Fix: redeclare getdb

This commit is contained in:
dignajar 2015-07-06 19:22:03 -03:00
parent 7d624ab20f
commit d8cb3f1145
27 changed files with 710 additions and 36 deletions

View File

@ -66,3 +66,5 @@ if(!$dbPosts->postExists($layout['parameters'])) {
}
$_Post = buildPost($layout['parameters']);
$layout['title'] .= ' - '.$Language->g('Edit post').' - '.$_Post->title();

View File

@ -1,5 +1,15 @@
Error, enable rewrite module.
Documentation:
- http://docs.bludit.com/en/getting-started/requirements
- http://docs.bludit.com/en/troubleshooting/browser-returns-not-found
<!DOCTYPE html>
<html>
<head>
<title>Bludit - Test rewrite module</title>
</head>
<body>
<p>Error, enable rewrite module.</p>
<p>
<b>Documentation:</b><br>
<a href="http://docs.bludit.com/en/getting-started/requirements">http://docs.bludit.com/en/getting-started/requirements</a> <br>
<a href="http://docs.bludit.com/en/troubleshooting/browser-returns-not-found">http://docs.bludit.com/en/troubleshooting/browser-returns-not-found</a><br>
</p>
</p>
</body>
</html>

View File

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bludit</title>
<title><?php echo $layout['title'] ?></title>
<link rel="stylesheet" href="./css/kube.min.css">
<link rel="stylesheet" href="./css/default.css">
@ -18,9 +18,7 @@
<?php
Theme::plugins('onAdminHead');
?>
</head>
<body>
<!-- ALERT -->

View File

@ -33,7 +33,7 @@
<?php
if(Alert::defined()) {
echo '<div class="tools-alert">'.Alert::get().'</div>';
echo '<div class="tools-alert tools-alert-red">'.Alert::get().'</div>';
}
// Load view

View File

@ -76,7 +76,7 @@ class dbJSON
return $this->save();
}
public function getDb()
public function get()
{
return $this->db;
}

View File

@ -5,7 +5,8 @@ $layout = array(
'view'=>null,
'template'=>'index.php',
'slug'=>null,
'parameters'=>null
'parameters'=>null,
'title'=>'Bludit'
);
// Get the view, controller, and the parameters from the URL.

View File

@ -54,19 +54,19 @@ function build_plugins()
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().'language'.DS.$Site->locale().'.json';
if( Sanitize::pathFile($languageFilename) )
{
$data = new dbJSON($languageFilename, false);
$database = new dbJSON($languageFilename, false);
}
else
{
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().'language'.DS.'en_US.json';
$data = new dbJSON($languageFilename, false);
$database = new dbJSON($languageFilename, false);
}
$data = $data->getDb();
$databaseArray = $database->get();
$Plugin->setData( $data['plugin-data'] );
// Add words to language dictionary.
unset($data['plugin-data']);
$Language->add($data);
unset($databaseArray['plugin-data']);
$Language->add($databaseArray);
// Push Plugin to array all plugins installed and not installed.
array_push($plugins['all'], $Plugin);

View File

@ -19,10 +19,20 @@ class dbPosts extends dbJSON
parent::__construct(PATH_DATABASES.'posts.php');
}
// Return an array with the database for a post.
public function getDb($slug)
// Return an array with the database for a page, FALSE otherwise.
public function getDb($key)
{
return $this->db[$slug];
if($this->postExists($key)) {
return $this->db[$key];
}
return false;
}
// Return TRUE if the post exists, FALSE otherwise.
public function postExists($key)
{
return isset($this->db[$key]);
}
// Generate a valid Key/Slug.
@ -170,12 +180,6 @@ class dbPosts extends dbJSON
return true;
}
// Return TRUE if the post exists, FALSE otherwise.
public function postExists($key)
{
return isset($this->db[$key]);
}
public function regenerate()
{
$db = $this->db;

View File

@ -62,6 +62,21 @@ class Theme {
return $tmp;
}
public static function keywords($keywords, $echo=true)
{
if(is_array($keywords)) {
$keywords = implode(',', $keywords);
}
$tmp = '<meta name="keywords" content="'.$keywords.'">'.PHP_EOL;
if($echo) {
echo $tmp;
}
return $tmp;
}
public static function viewport($content='width=device-width, initial-scale=1.0', $echo=true)
{
$tmp = '<meta name="viewport" content="'.$content.'">'.PHP_EOL;

View File

@ -0,0 +1,297 @@
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.subhead {
text-transform: uppercase;
color: #aaa;
border-bottom: 1px solid #eee;
padding: 0.4em 0;
font-size: 80%;
font-weight: 500;
letter-spacing: 0.1em;
}
#layout {
padding: 0;
}
/* PAGE and POST */
.page,
.post
{
padding-bottom: 50px;
}
.page-title,
.post-title
{
font-size: 2.4em;
margin: 0;
}
.page-title a,
.post-title a
{
color: #555;
}
.page-content,
.post-content {
color: #444;
line-height: 1.7em;
margin-top: 22px;
}
.page-content hr,
.post-content hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 30px 0;
padding: 0;
}
.page-content h2,
.post-content h2
{
color: #555;
margin: 30px 0 30px 0;
font-size: 2em;
font-weight: normal;
}
.page-content h3,
.post-content h3
{
color: #555;
margin: 35px 0 25px 0;
font-size: 1.5em;
font-weight: normal;
}
.page-content h4,
.post-content h4
{
color: #555;
margin: 25px 0 15px 0;
font-size: 1.2em;
font-weight: lighter;
}
.post-meta {
color: #999;
font-size: 90%;
margin: 0;
}
.post-images {
margin: 1em 0;
}
.post-image-meta {
margin-top: -3.5em;
margin-left: 1em;
color: #fff;
text-shadow: 0 1px 1px #333;
}
/* -------------------------------------------------------- OLD */
a {
text-decoration: none;
color: #2672ec;
}
a:hover,
a:focus {
text-decoration: none;
}
p {
margin: 10px 0 0 0;
}
img {
display: block;
max-width: 100%;
}
table {
empty-cells: show;
border: 1px solid #cbcbcb;
}
thead {
background-color: #e0e0e0;
color: #000;
text-align: left;
vertical-align: bottom;
}
tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
}
th, td {
padding: 0.5em 1em;
}
pre, code {
white-space: pre-wrap !important;
}
code {
font-size: 13px !important;
}
.header {
margin: 60px 30px;
text-align: left;
}
.sidebar {
background-color: #fff;
}
.sidebar ul {
display: block;
list-style-type: none;
margin: 5px 0 30px;
padding: 0 0 0 10px;
}
.sidebar h1 {
font-weight: lighter;
margin: 0;
padding: 0;
font-size: 3.2em;
}
.sidebar h2 {
font-weight: lighter;
margin: -15px 0 5px;
padding: 0;
font-size: 2.2em;
}
.sidebar div.links {
margin-bottom: 50px;
}
.sidebar p.about {
margin: 10px 0 40px 0;
color: #555;
}
.sidebar a.homelink {
margin: 15px 0;
display: block-inline;
}
.sidebar a.parent {
display: block;
color: #333;
margin-bottom: 0;
padding-bottom: 0;
}
.sidebar a.children {
color: #888;
}
.content {
padding: 2em 1em 0;
}
/* LAYOUT CSS */
.pure-img-responsive {
max-width: 100%;
height: auto;
}
.brand-title,
.brand-tagline {
margin: 0;
}
.brand-title {
text-transform: uppercase;
}
.brand-tagline {
font-weight: 300;
color: #fff;
}
.nav-list {
margin: 0;
padding: 0;
list-style: none;
}
.nav-item {
display: inline-block;
*display: inline;
zoom: 1;
}
.nav-item a {
background: transparent;
border: 2px solid rgb(176, 202, 219);
color: #fff;
margin-top: 1em;
letter-spacing: 0.05em;
text-transform: uppercase;
font-size: 85%;
}
.nav-item a:hover,
.nav-item a:focus {
border: 2px solid rgb(61, 146, 201);
text-decoration: none;
}
.content-subhead {
text-transform: uppercase;
color: #aaa;
border-bottom: 1px solid #eee;
padding: 0.4em 0;
font-size: 80%;
font-weight: 500;
letter-spacing: 0.1em;
}
.footer {
text-align: center;
padding: 1em 0;
}
.footer a {
color: #ccc;
font-size: 80%;
}
.footer .pure-menu a:hover,
.footer .pure-menu a:focus {
background: none;
}
@media (min-width: 48em) {
.content {
padding: 1em 3em 0;
margin-left: 25%;
}
.sidebar {
position: fixed;
top: 0;
bottom: 0;
overflow: scroll;
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

11
themes/pure-clean/css/pure-min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,88 @@
/**
* GitHub theme
*
* @author Craig Campbell
* @version 1.0.4
*/
pre {
border: 1px solid #ccc;
word-wrap: break-word;
padding: 6px 10px;
line-height: 19px;
margin-bottom: 20px;
}
code {
border: 1px solid #eaeaea;
margin: 0px 2px;
padding: 0px 5px;
font-size: 12px;
}
pre code {
border: 0px;
padding: 0px;
margin: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
}
pre, code {
font-family: Consolas, 'Liberation Mono', Courier, monospace;
color: #333;
background: #f8f8f8;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
pre, pre code {
font-size: 13px;
}
pre .comment {
color: #998;
}
pre .support {
color: #0086B3;
}
pre .tag, pre .tag-name {
color: navy;
}
pre .keyword, pre .css-property, pre .vendor-prefix, pre .sass, pre .class, pre .id, pre .css-value, pre .entity.function, pre .storage.function {
font-weight: bold;
}
pre .css-property, pre .css-value, pre .vendor-prefix, pre .support.namespace {
color: #333;
}
pre .constant.numeric, pre .keyword.unit, pre .hex-color {
font-weight: normal;
color: #099;
}
pre .entity.class {
color: #458;
}
pre .entity.id, pre .entity.function {
color: #900;
}
pre .attribute, pre .variable {
color: teal;
}
pre .string, pre .support.value {
font-weight: normal;
color: #d14;
}
pre .regexp {
color: #009926;
}

View File

@ -0,0 +1,51 @@
<!doctype html>
<html lang="<?php echo $Site->language() ?>">
<head>
<!-- Meta tags -->
<?php include('php/head.php') ?>
</head>
<body>
<!-- Plugins -->
<?php Theme::plugins('onSiteBody') ?>
<!-- Layout -->
<div id="layout" class="pure-g">
<!-- Sidebar -->
<div class="sidebar pure-u-1 pure-u-md-1-4">
<?php include('php/sidebar.php') ?>
</div>
<!-- Main -->
<div class="content pure-u-1 pure-u-md-3-4">
<!-- Content -->
<?php
if($Url->whereAmI()=='home')
{
include('php/home.php');
}
elseif($Url->whereAmI()=='post')
{
include('php/post.php');
}
elseif($Url->whereAmI()=='page')
{
include('php/page.php');
}
?>
<!-- Footer -->
<div class="footer">
<p><?php echo $Site->footer(); ?></p>
</div>
</div>
</div>
</body>
</html>

44
themes/pure-clean/js/rainbow.min.js vendored Normal file
View File

@ -0,0 +1,44 @@
/* Rainbow v1.2 rainbowco.de | included languages: c, shell, java, d, coffeescript, generic, scheme, javascript, r, haskell, python, html, smalltalk, csharp, go, php, ruby, lua, css */
var k=!0;
window.Rainbow=function(){function r(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b<a.length;++b)if("data-language"===a[b].nodeName)return a[b].nodeValue}return c}function C(a){var b=r(a)||r(a.parentNode);if(!b){var c=/\blang(?:uage)?-(\w+)/;(a=a.className.match(c)||a.parentNode.className.match(c))&&(b=a[1])}return b}function D(a,b){for(var c in f[d]){c=parseInt(c,10);if(a==c&&b==f[d][c]?0:a<=c&&b>=f[d][c])delete f[d][c],delete j[d][c];if(a>=c&&a<f[d][c]||
b>c&&b<f[d][c])return k}return!1}function s(a,b){return'<span class="'+a.replace(/\./g," ")+(m?" "+m:"")+'">'+b+"</span>"}function t(a,b,c,i){if("undefined"===typeof a||null===a)i();else{var e=a.exec(c);if(e){++u;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var l=e[0],g=e.index,v=e[0].length+g,h=function(){function e(){t(a,b,c,i)}u%100>0?e():setTimeout(e,0)};if(D(g,v))h();else{var n=w(b.matches),m=function(a,c,i){if(a>=c.length)i(l);else{var d=e[c[a]];if(d){var g=
b.matches[c[a]],f=g.language,h=g.name&&g.matches?g.matches:g,j=function(b,d,g){var f;f=0;var h;for(h=1;h<c[a];++h)e[h]&&(f=f+e[h].length);d=g?s(g,d):d;l=l.substr(0,f)+l.substr(f).replace(b,d);m(++a,c,i)};f?o(d,f,function(a){j(d,a)}):typeof g==="string"?j(d,d,g):x(d,h.length?h:[h],function(a){j(d,a,g.matches?g.name:0)})}else m(++a,c,i)}};m(0,n,function(a){b.name&&(a=s(b.name,a));if(!j[d]){j[d]={};f[d]={}}j[d][g]={replace:e[0],"with":a};f[d][g]=v;h()})}}else i()}}function w(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&
b.push(c);return b.sort(function(a,b){return b-a})}function x(a,b,c){function i(b,l){l<b.length?t(b[l].pattern,b[l],a,function(){i(b,++l)}):E(a,function(a){delete j[d];delete f[d];--d;c(a)})}++d;i(b,0)}function E(a,b){function c(a,b,i,f){if(i<b.length){++y;var h=b[i],m=j[d][h],a=a.substr(0,h)+a.substr(h).replace(m.replace,m["with"]),h=function(){c(a,b,++i,f)};0<y%250?h():setTimeout(h,0)}else f(a)}var i=w(j[d]);c(a,i,0,b)}function o(a,b,c){var d=n[b]||[],e=n[z]||[],b=A[b]?d:d.concat(e);x(a.replace(/</g,
"&lt;").replace(/>/g,"&gt;").replace(/&(?![\w\#]+;)/g,"&amp;"),b,c)}function p(a,b,c){if(b<a.length){var d=a[b],e=C(d);return!(-1<(" "+d.className+" ").indexOf(" rainbow "))&&e?(e=e.toLowerCase(),d.className+=d.className?" rainbow":"rainbow",o(d.innerHTML,e,function(l){d.innerHTML=l;j={};f={};q&&q(d,e);setTimeout(function(){p(a,++b,c)},0)})):p(a,++b,c)}c&&c()}function B(a,b){var a=a&&"function"==typeof a.getElementsByTagName?a:document,c=a.getElementsByTagName("pre"),d=a.getElementsByTagName("code"),
e,f=[],g=[];for(e=0;e<c.length;++e)c[e].getElementsByTagName("code").length?c[e].innerHTML=c[e].innerHTML.replace(/^\s+/,"").replace(/\s+$/,""):f.push(c[e]);for(e=0;e<d.length;++e)g.push(d[e]);p(g.concat(f),0,b)}var j={},f={},n={},A={},d=0,z=0,u=0,y=0,m,q;return{extend:function(a,b,c){1==arguments.length&&(b=a,a=z);A[a]=c;n[a]=b.concat(n[a]||[])},c:function(a){q=a},a:function(a){m=a},color:function(a,b,c){if("string"==typeof a)return o(a,b,c);if("function"==typeof a)return B(0,a);B(a,b)}}}();
document.addEventListener?document.addEventListener("DOMContentLoaded",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.c;Rainbow.addClass=Rainbow.a;Rainbow.extend("c",[{name:"meta.preprocessor",matches:{1:[{matches:{1:"keyword.define",2:"entity.name"},pattern:/(\w+)\s(\w+)\b/g},{name:"keyword.define",pattern:/endif/g},{name:"constant.numeric",pattern:/\d+/g},{matches:{1:"keyword.include",2:"string"},pattern:/(include)\s(.*?)$/g}]},pattern:/\#([\S\s]*?)$/gm},{name:"keyword",pattern:/\b(do|goto|typedef)\b/g},{name:"entity.label",pattern:/\w+:/g},{matches:{1:"storage.type",3:"storage.type",4:"entity.name.function"},pattern:/\b((un)?signed|const)? ?(void|char|short|int|long|float|double)\*? +((\w+)(?= ?\())?/g},
{matches:{2:"entity.name.function"},pattern:/(\w|\*) +((\w+)(?= ?\())/g},{name:"storage.modifier",pattern:/\b(static|extern|auto|register|volatile|inline)\b/g},{name:"support.type",pattern:/\b(struct|union|enum)\b/g}]);Rainbow.extend("shell",[{name:"shell",matches:{1:{language:"shell"}},pattern:/\$\(([\s\S]*?)\)/gm},{matches:{2:"string"},pattern:/(\(|\s|\[|\=)(('|")[\s\S]*?(\3))/gm},{name:"keyword.operator",pattern:/&lt;|&gt;|&amp;/g},{name:"comment",pattern:/\#[\s\S]*?$/gm},{name:"storage.function",pattern:/(.+?)(?=\(\)\s{0,}\{)/g},{name:"support.command",pattern:/\b(echo|rm|ls|(mk|rm)dir|cd|find|cp|exit|pwd|exec|trap|source|shift|unset)/g},{matches:{1:"keyword"},pattern:/\b(break|case|continue|do|done|elif|else|esac|eval|export|fi|for|function|if|in|local|return|set|then|unset|until|while)(?=\(|\b)/g}],
k);Rainbow.extend("java",[{name:"constant",pattern:/\b(false|null|true|[A-Z_]+)\b/g},{b:{1:"keyword",2:"support.namespace"},pattern:/(import|package)\s(.+)/g},{name:"keyword",pattern:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/g},
{name:"string",pattern:/(".*?")/g},{name:"char",pattern:/(')(.|\\.|\\u[\dA-Fa-f]{4})\1/g},{name:"integer",pattern:/\b(0x[\da-f]+|\d+)L?\b/g},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/).*?$/gm},{name:"support.annotation",pattern:/@\w+/g},{b:{1:"entity.function"},pattern:/([^@\.\s]+)\(/g},{name:"entity.class",pattern:/\b([A-Z]\w*)\b/g},{name:"operator",pattern:/(\+{1,2}|-{1,2}|~|!|\*|\/|%|(?:&lt;){1,2}|(?:&gt;){1,3}|instanceof|(?:&amp;){1,2}|\^|\|{1,2}|\?|:|(?:=|!|\+|-|\*|\/|%|\^|\||(?:&lt;){1,2}|(?:&gt;){1,3})?=)/g}],
k);Rainbow.extend("d",[{name:"constant",pattern:/\b(false|null|true)\b/gm},{name:"keyword",pattern:/\b(abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|in|inout|int|interface|invariant|ireal|is|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|size_t|static|string|struct|super|switch|synchronized|template|this|throw|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__FILE__|__LINE__|__gshared|__traits|__vector|__parameters)\b/gm},
{matches:{1:"keyword",2:{name:"support.class",pattern:/\w+/gm}},pattern:/(typeof)\s([^\$].*?)(\)|;)/gm},{matches:{1:"keyword.namespace",2:{name:"support.namespace",pattern:/\w+/gm}},pattern:/\b(namespace)\s(.*?);/gm},{matches:{1:"storage.modifier",2:"storage.class",3:"entity.name.class",4:"storage.modifier.extends",5:"entity.other.inherited-class"},pattern:/\b(abstract|sealed)?\s?(class)\s(\w+)(\sextends\s)?([\w\\]*)?\s?\{?(\n|\})/gm},{name:"keyword.static",pattern:/\b(static)\b/gm},{matches:{1:"keyword.new",
2:{name:"support.class",pattern:/\w+/gm}},pattern:/\b(new)\s([^\$].*?)(?=\)|\(|;|&)/gm},{name:"string",pattern:/("|')(.*?)\1/gm},{name:"integer",pattern:/\b(0x[\da-f]+|\d+)\b/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|\/\+[\s\S]*?\+\/|(\/\/)[\s\S]*?$/gm},{name:"operator",pattern:/(\/|\/=|&amp;=|&amp;&amp;|&amp;|\|=|\|\|\||\-=|\-\-|\-|\+=|\+\+|\+|&lt;=|&lt;&lt;|&lt;|&lt;&lt;=|&lt;&gt;=|&lt;&gt;|&gt;|&gt;&gt;&gt;=|&gt;&gt;=|&gt;=|&gt;&gt;|&gt;&gt;&gt;|!=|!&lt;&gt;=|!&lt;&gt;|!&lt;=|!&lt;|!&gt;=|!&gt;|!|[|]|\$|==|=|\*=|\*|%=|%|\^\^=|\^=|\^\^|\^|~=|~|@|=&gt;|\:)/gm}],
k);Rainbow.extend("coffeescript",[{name:"comment.block",pattern:/(\#{3})[\s\S]*\1/gm},{name:"string.block",pattern:/('{3}|"{3})[\s\S]*\1/gm},{name:"string.regex",matches:{2:{name:"comment",pattern:/\#(.*?)\n/g}},pattern:/(\/{3})([\s\S]*)\1/gm},{matches:{1:"keyword"},pattern:/\b(in|when|is|isnt|of|not|unless|until|super)(?=\b)/gi},{name:"keyword.operator",pattern:/\?/g},{name:"constant.language",pattern:/\b(undefined|yes|on|no|off)\b/g},{name:"keyword.variable.coffee",pattern:/@(\w+)/gi},{name:"reset",
pattern:/object|class|print/gi},{matches:{1:"entity.name.function",2:"keyword.operator",3:{name:"function.argument.coffee",pattern:/([\@\w]+)/g},4:"keyword.function"},pattern:/(\w+)\s{0,}(=|:)\s{0,}\((.*?)((-|=)&gt;)/gi},{matches:{1:{name:"function.argument.coffee",pattern:/([\@\w]+)/g},2:"keyword.function"},pattern:/\s\((.*?)\)\s{0,}((-|=)&gt;)/gi},{matches:{1:"entity.name.function",2:"keyword.operator",3:"keyword.function"},pattern:/(\w+)\s{0,}(=|:)\s{0,}((-|=)&gt;)/gi},{matches:{1:"storage.class",
2:"entity.name.class",3:"storage.modifier.extends",4:"entity.other.inherited-class"},pattern:/\b(class)\s(\w+)(\sextends\s)?([\w\\]*)?\b/g},{matches:{1:"keyword.new",2:{name:"support.class",pattern:/\w+/g}},pattern:/\b(new)\s(.*?)(?=\s)/g}]);Rainbow.extend([{matches:{1:[{name:"keyword.operator",pattern:/\=|\+/g},{name:"keyword.dot",pattern:/\./g}],2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:|\+|\.)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(and|array|as|b(ool(ean)?|reak)|c(ase|atch|har|lass|on(st|tinue))|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi},
{name:"constant.language",pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s(.*?)(?=\()/g}]);Rainbow.extend("scheme",[{name:"plain",pattern:/&gt;|&lt;/g},{name:"comment",pattern:/;.*$/gm},{name:"constant.language",pattern:/#t|#f|'\(\)/g},{name:"constant.symbol",pattern:/'[^()\s#]+/g},{name:"constant.number",pattern:/\b\d+(?:\.\d*)?\b/g},{name:"string",pattern:/".+?"/g},{matches:{1:"storage.function",2:"variable"},pattern:/\(\s*(define)\s+\(?(\S+)/g},{matches:{1:"keyword"},pattern:/\(\s*(begin|define\-syntax|if|lambda|quasiquote|quote|set!|syntax\-rules|and|and\-let\*|case|cond|delay|do|else|or|let|let\*|let\-syntax|letrec|letrec\-syntax)(?=[\]()\s#])/g},
{matches:{1:"entity.function"},pattern:/\(\s*(eqv\?|eq\?|equal\?|number\?|complex\?|real\?|rational\?|integer\?|exact\?|inexact\?|=|<|>|<=|>=|zero\?|positive\?|negative\?|odd\?|even\?|max|min|\+|\-|\*|\/|abs|quotient|remainder|modulo|gcd|lcm|numerator|denominator|floor|ceiling|truncate|round|rationalize|exp|log|sin|cos|tan|asin|acos|atan|sqrt|expt|make\-rectangular|make\-polar|real\-part|imag\-part|magnitude|angle|exact\->inexact|inexact\->exact|number\->string|string\->number|not|boolean\?|pair\?|cons|car|cdr|set\-car!|set\-cdr!|caar|cadr|cdar|cddr|caaar|caadr|cadar|caddr|cdaar|cdadr|cddar|cdddr|caaaar|caaadr|caadar|caaddr|cadaar|cadadr|caddar|cadddr|cdaaar|cdaadr|cdadar|cdaddr|cddaar|cddadr|cdddar|cddddr|null\?|list\?|list|length|append|reverse|list\-tail|list\-ref|memq|memv|member|assq|assv|assoc|symbol\?|symbol\->string|string\->symbol|char\?|char=\?|char<\?|char>\?|char<=\?|char>=\?|char\-ci=\?|char\-ci<\?|char\-ci>\?|char\-ci<=\?|char\-ci>=\?|char\-alphabetic\?|char\-numeric\?|char\-whitespace\?|char\-upper\-case\?|char\-lower\-case\?|char\->integer|integer\->char|char\-upcase|char\-downcase|string\?|make\-string|string|string\-length|string\-ref|string\-set!|string=\?|string\-ci=\?|string<\?|string>\?|string<=\?|string>=\?|string\-ci<\?|string\-ci>\?|string\-ci<=\?|string\-ci>=\?|substring|string\-append|string\->list|list\->string|string\-copy|string\-fill!|vector\?|make\-vector|vector|vector\-length|vector\-ref|vector\-set!|vector\->list|list\->vector|vector\-fill!|procedure\?|apply|map|for\-each|force|call\-with\-current\-continuation|call\/cc|values|call\-with\-values|dynamic\-wind|eval|scheme\-report\-environment|null\-environment|interaction\-environment|call\-with\-input\-file|call\-with\-output\-file|input\-port\?|output\-port\?|current\-input\-port|current\-output\-port|with\-input\-from\-file|with\-output\-to\-file|open\-input\-file|open\-output\-file|close\-input\-port|close\-output\-port|read|read\-char|peek\-char|eof\-object\?|char\-ready\?|write|display|newline|write\-char|load|transcript\-on|transcript\-off)(?=[\]()\s#])/g}],
k);Rainbow.extend("javascript",[{name:"selector",pattern:/(\s|^)\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{name:"string.regexp",matches:{1:"string.regexp.open",2:{name:"constant.regexp.escape",pattern:/\\(.){1}/g},
3:"string.regexp.close",4:"string.regexp.modifier"},pattern:/(\/)(?!\*)(.+)(\/)([igm]{0,3})/g},{matches:{1:"storage",3:"entity.function"},pattern:/(var)?(\s|^)(\S*)(?=\s?=\s?function\()/g},{matches:{1:"keyword",2:"entity.function"},pattern:/(new)\s+(.*)(?=\()/g},{name:"entity.function",pattern:/(\w+)(?=:\s{0,}function)/g}]);Rainbow.extend("r",[{matches:{1:{name:"keyword.operator",pattern:/\=|<\-|&lt;-/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm},{matches:{1:"constant.language"},pattern:/\b(NULL|NA|TRUE|FALSE|T|F|NaN|Inf|NA_integer_|NA_real_|NA_complex_|NA_character_)\b/g},{matches:{1:"constant.symbol"},pattern:/[^0-9a-zA-Z\._](LETTERS|letters|month\.(abb|name)|pi)/g},{name:"keyword.operator",pattern:/&lt;-|<-|-|==|&lt;=|<=|&gt;>|>=|<|>|&amp;&amp;|&&|&amp;|&|!=|\|\|?|\*|\+|\^|\/|%%|%\/%|\=|%in%|%\*%|%o%|%x%|\$|:|~|\[{1,2}|\]{1,2}/g},
{matches:{1:"storage",3:"entity.function"},pattern:/(\s|^)(.*)(?=\s?=\s?function\s\()/g},{matches:{1:"storage.function"},pattern:/[^a-zA-Z0-9._](function)(?=\s*\()/g},{matches:{1:"namespace",2:"keyword.operator",3:"function.call"},pattern:/([a-zA-Z][a-zA-Z0-9._]+)([:]{2,3})([.a-zA-Z][a-zA-Z0-9._]*(?=\s*\())\b/g},{name:"support.function",pattern:/(^|[^0-9a-zA-Z\._])(array|character|complex|data\.frame|double|integer|list|logical|matrix|numeric|vector)(?=\s*\()/g}]);Rainbow.extend("haskell",[{name:"comment",pattern:/\{\-\-[\s\S(\w+)]+[\-\-][\}$]/gm},{name:"comment",pattern:/\-\-(.*)/g},{matches:{1:"keyword",2:"support.namespace"},pattern:/\b(module)\s(\w+)\s[\(]?(\w+)?[\)?]\swhere/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\/\=|\||\@|\:|\.|\+{2}|\:|\*|\=|#|\.{2}|(\\)[a-zA-Z_]/g},{name:"keyword",pattern:/\b(case|class|foreign|hiding|qualified|data|family|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|in|otherwise|module|newtype|of|then|type|where)\b/g},
{name:"keyword",pattern:/[\`][a-zA-Z_']*?[\`]/g},{matches:{1:"keyword",2:"keyword.operator"},pattern:/\b(infix|infixr|infixl)+\s\d+\s(\w+)*/g},{name:"entity.class",pattern:/\b([A-Z][A-Za-z0-9_']*)/g},{name:"meta.preprocessor",matches:{1:[{matches:{1:"keyword.define",2:"entity.name"},pattern:/(\w+)\s(\w+)\b/g},{name:"keyword.define",pattern:/endif/g},{name:"constant.numeric",pattern:/\d+/g},{matches:{1:"keyword.include",2:"string"},pattern:/(include)\s(.*?)$/g}]},pattern:/^\#([\S\s]*?)$/gm}]);Rainbow.extend("python",[{name:"variable.self",pattern:/self/g},{name:"constant.language",pattern:/None|True|False|NotImplemented|\.\.\./g},{name:"support.object",pattern:/object/g},{name:"support.function.python",pattern:/\b(bs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|bin|file|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern)(?=\()/g},
{matches:{1:"keyword"},pattern:/\b(pass|lambda|with|is|not|in|from|elif|raise|del)(?=\(|\b)/g},{matches:{1:"storage.class",2:"entity.name.class",3:"entity.other.inherited-class"},pattern:/(class)\s+(\w+)\((\w+?)\)/g},{matches:{1:"storage.function",2:"support.magic"},pattern:/(def)\s+(__\w+)(?=\()/g},{name:"support.magic",pattern:/__(name)__/g},{matches:{1:"keyword.control",2:"support.exception.type"},pattern:/(except) (\w+):/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(def)\s+(\w+)(?=\()/g},
{name:"entity.name.function.decorator",pattern:/@([\w\.]+)/g},{name:"comment.docstring",pattern:/('{3}|"{3})[\s\S]*?\1/gm}]);Rainbow.extend("html",[{name:"source.php.embedded",matches:{2:{language:"php"}},pattern:/&lt;\?=?(?!xml)(php)?([\s\S]*?)(\?&gt;)/gm},{name:"source.css.embedded",matches:{1:{matches:{1:"support.tag.style",2:[{name:"entity.tag.style",pattern:/^style/g},{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.style.attribute",pattern:/(\w+)/g}],3:"support.tag.style"},pattern:/(&lt;\/?)(style.*?)(&gt;)/g},2:{language:"css"},3:"support.tag.style",4:"entity.tag.style",5:"support.tag.style"},pattern:/(&lt;style.*?&gt;)([\s\S]*?)(&lt;\/)(style)(&gt;)/gm},
{name:"source.js.embedded",matches:{1:{matches:{1:"support.tag.script",2:[{name:"entity.tag.script",pattern:/^script/g},{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.script.attribute",pattern:/(\w+)/g}],3:"support.tag.script"},pattern:/(&lt;\/?)(script.*?)(&gt;)/g},2:{language:"javascript"},3:"support.tag.script",4:"entity.tag.script",5:"support.tag.script"},pattern:/(&lt;script(?! src).*?&gt;)([\s\S]*?)(&lt;\/)(script)(&gt;)/gm},{name:"comment.html",pattern:/&lt;\!--[\S\s]*?--&gt;/g},
{matches:{1:"support.tag.open",2:"support.tag.close"},pattern:/(&lt;)|(\/?\??&gt;)/g},{name:"support.tag",matches:{1:"support.tag",2:"support.tag.special",3:"support.tag-name"},pattern:/(&lt;\??)(\/|\!?)(\w+)/g},{matches:{1:"support.attribute"},pattern:/([a-z-]+)(?=\=)/gi},{matches:{1:"support.operator",2:"string.quote",3:"string.value",4:"string.quote"},pattern:/(=)('|")(.*?)(\2)/g},{matches:{1:"support.operator",2:"support.value"},pattern:/(=)([a-zA-Z\-0-9]*)\b/g},{matches:{1:"support.attribute"},
pattern:/\s(\w+)(?=\s|&gt;)(?![\s\S]*&lt;)/g}],k);Rainbow.extend("smalltalk",[{name:"keyword.pseudovariable",pattern:/self|thisContext/g},{name:"keyword.constant",pattern:/false|nil|true/g},{name:"string",pattern:/'([^']|'')*'/g},{name:"string.symbol",pattern:/#\w+|#'([^']|'')*'/g},{name:"string.character",pattern:/\$\w+/g},{name:"comment",pattern:/"([^"]|"")*"/g},{name:"constant.numeric",pattern:/-?\d+(\.\d+)?((r-?|s)[A-Za-z0-9]+|e-?[0-9]+)?/g},{name:"entity.name.class",pattern:/\b[A-Z]\w*/g},{name:"entity.name.function",pattern:/\b[a-z]\w*:?/g},
{name:"entity.name.binary",pattern:/(&lt;|&gt;|&amp;|[=~\|\\\/!@*\-_+])+/g},{name:"operator.delimiter",pattern:/;[\(\)\[\]\{\}]|#\[|#\(^\./g}],k);Rainbow.extend("csharp",[{name:"constant",pattern:/\b(false|null|true)\b/g},{name:"keyword",pattern:/\b(abstract|add|alias|ascending|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|descending|double|do|dynamic|else|enum|event|explicit|extern|false|finally|fixed|float|foreach|for|from|get|global|goto|group|if|implicit|int|interface|internal|into|in|is|join|let|lock|long|namespace|new|object|operator|orderby|out|override|params|partial|private|protected|public|readonly|ref|remove|return|sbyte|sealed|select|set|short|sizeof|stackalloc|static|string|struct|switch|this|throw|try|typeof|uint|unchecked|ulong|unsafe|ushort|using|value|var|virtual|void|volatile|where|while|yield)\b/g},
{matches:{1:"keyword",2:{name:"support.class",pattern:/\w+/g}},pattern:/(typeof)\s([^\$].*?)(\)|;)/g},{matches:{1:"keyword.namespace",2:{name:"support.namespace",pattern:/\w+/g}},pattern:/\b(namespace)\s(.*?);/g},{matches:{1:"storage.modifier",2:"storage.class",3:"entity.name.class",4:"storage.modifier.extends",5:"entity.other.inherited-class"},pattern:/\b(abstract|sealed)?\s?(class)\s(\w+)(\sextends\s)?([\w\\]*)?\s?\{?(\n|\})/g},{name:"keyword.static",pattern:/\b(static)\b/g},{matches:{1:"keyword.new",
2:{name:"support.class",pattern:/\w+/g}},pattern:/\b(new)\s([^\$].*?)(?=\)|\(|;|&)/g},{name:"string",pattern:/(")(.*?)\1/g},{name:"integer",pattern:/\b(0x[\da-f]+|\d+)\b/g},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/)[\s\S]*?$/gm},{name:"operator",pattern:/(\+\+|\+=|\+|--|-=|-|&lt;&lt;=|&lt;&lt;|&lt;=|=&gt;|&gt;&gt;=|&gt;&gt;|&gt;=|!=|!|~|\^|\|\||&amp;&amp;|&amp;=|&amp;|\?\?|::|:|\*=|\*|\/=|%=|\|=|==|=)/g},{name:"preprocessor",pattern:/(\#if|\#else|\#elif|\#endif|\#define|\#undef|\#warning|\#error|\#line|\#region|\#endregion|\#pragma)[\s\S]*?$/gm}],
k);Rainbow.extend("go",[{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\(`|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)((`|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(break|c(ase|onst|ontinue)|d(efault|efer)|else|fallthrough|for|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)(?=\(|\b)/gi},
{name:"constant.language",pattern:/true|false|null|string|byte|rune|u?int(8|16|32|64)?|float(32|64)|complex(64|128)/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\:?=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(func)\s(.*?)(?=\()/g}]);Rainbow.extend("php",[{name:"support",pattern:/\becho\b/g},{matches:{1:"variable.dollar-sign",2:"variable"},pattern:/(\$)(\w+)\b/g},{name:"constant.language",pattern:/true|false|null/ig},{name:"constant",pattern:/\b[A-Z0-9_]{2,}\b/g},{name:"keyword.dot",pattern:/\./g},{name:"keyword",pattern:/\b(die|end(for(each)?|switch|if)|case|require(_once)?|include(_once)?)(?=\(|\b)/g},{matches:{1:"keyword",2:{name:"support.class",pattern:/\w+/g}},pattern:/(instanceof)\s([^\$].*?)(\)|;)/g},{matches:{1:"support.function"},
pattern:/\b(array(_key_exists|_merge|_keys|_shift)?|isset|count|empty|unset|printf|is_(array|string|numeric|object)|sprintf|each|date|time|substr|pos|str(len|pos|tolower|_replace|totime)?|ord|trim|in_array|implode|end|preg_match|explode|fmod|define|link|list|get_class|serialize|file|sort|mail|dir|idate|log|intval|header|chr|function_exists|dirname|preg_replace|file_exists)(?=\()/g},{name:"variable.language.php-tag",pattern:/(&lt;\?(php)?|\?&gt;)/g},{matches:{1:"keyword.namespace",2:{name:"support.namespace",
pattern:/\w+/g}},pattern:/\b(namespace|use)\s(.*?);/g},{matches:{1:"storage.modifier",2:"storage.class",3:"entity.name.class",4:"storage.modifier.extends",5:"entity.other.inherited-class",6:"storage.modifier.extends",7:"entity.other.inherited-class"},pattern:/\b(abstract|final)?\s?(class|interface|trait)\s(\w+)(\sextends\s)?([\w\\]*)?(\simplements\s)?([\w\\]*)?\s?\{?(\n|\})/g},{name:"keyword.static",pattern:/self::|static::/g},{matches:{1:"storage.function",2:"support.magic"},pattern:/(function)\s(__.*?)(?=\()/g},
{matches:{1:"keyword.new",2:{name:"support.class",pattern:/\w+/g}},pattern:/\b(new)\s([^\$].*?)(?=\)|\(|;)/g},{matches:{1:{name:"support.class",pattern:/\w+/g},2:"keyword.static"},pattern:/([\w\\]*?)(::)(?=\b|\$)/g},{matches:{2:{name:"support.class",pattern:/\w+/g}},pattern:/(\(|,\s?)([\w\\]*?)(?=\s\$)/g}]);Rainbow.extend("ruby",[{matches:{1:"variable.language",2:{language:null}},pattern:/^(__END__)\n((?:.*\n)*)/gm},{name:"string",matches:{1:"string.open",2:[{name:"string.interpolation",matches:{1:"string.open",2:{language:"ruby"},3:"string.close"},pattern:/(\#\{)(.*?)(\})/g}],3:"string.close"},pattern:/("|`)(.*?[^\\\1])?(\1)/g},{name:"string",pattern:/('|"|`)([^\\\1\n]|\\.)*?\1/g},{name:"string",pattern:/%[qQ](?=(\(|\[|\{|&lt;|.)(.*?)(?:'|\)|\]|\}|&gt;|\1))(?:\(\2\)|\[\2\]|\{\2\}|\&lt;\2&gt;|\1\2\1)/g},
{matches:{1:"string",2:"string",3:"string"},pattern:/(&lt;&lt;)(\w+).*?$([\s\S]*?^\2)/gm},{matches:{1:"string",2:"string",3:"string"},pattern:/(&lt;&lt;\-)(\w+).*?$([\s\S]*?\2)/gm},{name:"string.regexp",matches:{1:"string.regexp",2:{name:"string.regexp",pattern:/\\(.){1}/g},3:"string.regexp",4:"string.regexp"},pattern:/(\/)(.*?)(\/)([a-z]*)/g},{name:"string.regexp",matches:{1:"string.regexp",2:{name:"string.regexp",pattern:/\\(.){1}/g},3:"string.regexp",4:"string.regexp"},pattern:/%r(?=(\(|\[|\{|&lt;|.)(.*?)('|\)|\]|\}|&gt;|\1))(?:\(\2\)|\[\2\]|\{\2\}|\&lt;\2&gt;|\1\2\1)([a-z]*)/g},
{name:"comment",pattern:/#.*$/gm},{name:"comment",pattern:/^\=begin[\s\S]*?\=end$/gm},{matches:{1:"constant"},pattern:/(\w+:)[^:]/g},{matches:{1:"constant.symbol"},pattern:/[^:](:(?:\w+|(?=['"](.*?)['"])(?:"\2"|'\2')))/g},{name:"constant.numeric",pattern:/\b(0x[\da-f]+|\d+)\b/g},{name:"support.class",pattern:/\b[A-Z]\w*(?=((\.|::)[A-Za-z]|\[))/g},{name:"constant",pattern:/\b[A-Z]\w*\b/g},{matches:{1:"storage.class",2:"entity.name.class",3:"entity.other.inherited-class"},pattern:/\s*(class)\s+((?:(?:::)?[A-Z]\w*)+)(?:\s+&lt;\s+((?:(?:::)?[A-Z]\w*)+))?/g},
{matches:{1:"storage.module",2:"entity.name.class"},pattern:/\s*(module)\s+((?:(?:::)?[A-Z]\w*)+)/g},{name:"variable.global",pattern:/\$([a-zA-Z_]\w*)\b/g},{name:"variable.class",pattern:/@@([a-zA-Z_]\w*)\b/g},{name:"variable.instance",pattern:/@([a-zA-Z_]\w*)\b/g},{matches:{1:"keyword.control"},pattern:/[^\.]\b(BEGIN|begin|case|class|do|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!])/g},{matches:{1:"keyword.control.pseudo-method"},pattern:/[^\.]\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\?/g},
{matches:{1:"constant.language"},pattern:/\b(nil|true|false)\b(?![?!])/g},{matches:{1:"variable.language"},pattern:/\b(__(FILE|LINE)__|self)\b(?![?!])/g},{matches:{1:"keyword.special-method"},pattern:/\b(require|gem|initialize|new|loop|include|extend|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\b(?![?!])/g},{name:"keyword.operator",pattern:/\s\?\s|=|&lt;&lt;|&lt;&lt;=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|&lt;&lt;|&lt;=&gt;|&lt;(?!&lt;|=)|&gt;(?!&lt;|=|&gt;)|&lt;=|&gt;=|===|==|=~|!=|!~|%|&amp;|\*\*|\*|\+|\-|\/|\||~|&gt;&gt;/g},
{matches:{1:"keyword.operator.logical"},pattern:/[^\.]\b(and|not|or)\b/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(def)\s(.*?)(?=(\s|\())/g}],k);Rainbow.extend("lua",[{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\-{2}\[{2}\-{2}[\s\S]*?\-{2}\]{2}\-{2}|(\-{2})[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b((a|e)nd|in|repeat|break|local|return|do|for|then|else(if)?|function|not|if|or|until|while)(?=\(|\b)/gi},
{name:"constant.language",pattern:/true|false|nil/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=|#|\.{2}/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s+(\w+[\:|\.]?\w+?)(?=\()/g},{matches:{1:"support.function"},pattern:/\b(print|require|module|\w+\.\w+)(?=\()/g}],k);Rainbow.extend("css",[{name:"comment",pattern:/\/\*[\s\S]*?\*\//gm},{name:"constant.hex-color",pattern:/#([a-f0-9]{3}|[a-f0-9]{6})(?=;|\s|,|\))/gi},{matches:{1:"constant.numeric",2:"keyword.unit"},pattern:/(\d+)(px|em|cm|s|%)?/g},{name:"string",pattern:/('|")(.*?)\1/g},{name:"support.css-property",matches:{1:"support.vendor-prefix"},pattern:/(-o-|-moz-|-webkit-|-ms-)?[\w-]+(?=\s?:)(?!.*\{)/g},{matches:{1:[{name:"entity.name.sass",pattern:/&amp;/g},{name:"direct-descendant",pattern:/&gt;/g},{name:"entity.name.class",
pattern:/\.[\w\-_]+/g},{name:"entity.name.id",pattern:/\#[\w\-_]+/g},{name:"entity.name.pseudo",pattern:/:[\w\-_]+/g},{name:"entity.name.tag",pattern:/\w+/g}]},pattern:/([\w\ ,\n:\.\#\&\;\-_]+)(?=.*\{)/g},{matches:{2:"support.vendor-prefix",3:"support.css-value"},pattern:/(:|,)\s*(-o-|-moz-|-webkit-|-ms-)?([a-zA-Z-]*)(?=\b)(?!.*\{)/g}],k);

View File

@ -0,0 +1,53 @@
<?php
Theme::charset('UTF-8');
Theme::viewport();
// <title>Site title</title>
Theme::title( $Site->title() );
// <meta name="description" content="Site description">
Theme::description( $Site->description() );
// <meta name="keywords" content="HTML,CSS,XML,JavaScript">
if( $Url->whereAmI()=='post' ) {
Theme::keywords( $Post->tags() );
}
elseif( $Url->whereAmI()=='page' ) {
Theme::keywords( $Page->tags() );
}
// <link rel="stylesheet" type="text/css" href="pure-min.css">
// <link rel="stylesheet" type="text/css" href="grids-responsive-min.css">
// <link rel="stylesheet" type="text/css" href="blog.css">
// <link rel="stylesheet" type="text/css" href="rainbow.github.css">
Theme::css(array(
'pure-min.css',
'grids-responsive-min.css',
'blog.css',
'rainbow.github.css'
));
Theme::css(array(
'http://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,cyrillic,latin-ext'
), '');
// <script src="rainbow.min.js"></script>
Theme::javascript(array(
'rainbow.min.js'
));
?>
<!-- Pure and Google Fonts -->
<style>
html, button, input, select, textarea,
.pure-g [class *= "pure-u"] {
font-family: 'Open Sans', sans-serif;
}
</style>
<!-- Plugins -->
<?php
Theme::plugins('onSiteHead');
?>

View File

@ -0,0 +1,22 @@
<h1 class="subhead">Recent Posts</h1>
<?php foreach ($posts as $Post): ?>
<section class="post">
<header class="post-header">
<h2 class="post-title">
<a href="<?php echo $Post->permalink() ?>"><?php echo $Post->title() ?></a>
</h2>
<p class="post-meta">
<span><?php echo $Language->get('Posted By').' '.$Post->author() ?></span>
<span>Date: <?php echo $Post->dateCreated() ?></span>
</p>
</header>
<div class="post-description">
<?php echo $Post->content() ?>
</div>
</section>
<?php endforeach; ?>

View File

@ -0,0 +1,11 @@
<section class="page">
<header class="page-head">
<h1 class="page-title">
# <?php echo $Page->title() ?>
</h1>
</header>
<div class="page-content">
<?php echo $Page->content() ?>
</div>
</section>

View File

@ -0,0 +1,18 @@
<h1 class="subhead">Posts</h1>
<section class="post">
<header class="post-header">
<h2 class="post-title">
<?php echo $Post->title() ?>
</h2>
<p class="post-meta">
<span>Posted by <?php echo $Post->author() ?></span>
<span>Date: <?php echo $Post->dateCreated() ?></span>
</p>
</header>
<div class="post-description">
<?php echo $Post->content() ?>
</div>
</section>

View File

@ -0,0 +1,40 @@
<div class="header">
<h1><?php echo $Site->title() ?></h1>
<h2><?php echo $Site->slogan() ?></h2>
<?php
// Links
echo '<div class="links">';
echo '<a class="homelink" href="'.HTML_PATH_ROOT.'">Home</a>';
echo '<span> - </span>';
echo '<a class="homelink" href="'.HTML_PATH_ROOT.'">Twitter</a>';
echo '</div>';
// Pages
$parents = $pagesParents[NO_PARENT_CHAR];
foreach($parents as $parent)
{
// Print the parent
echo '<a class="parent" href="'.$parent->permalink().'">'.$parent->title().'</a>';
// Check if the parent hash children
if(isset($pagesParents[$parent->key()]))
{
$children = $pagesParents[$parent->key()];
// Print the children
echo '<ul>';
foreach($children as $child)
{
echo '<li><a class="children" href="'.$child->permalink().'">— '.$child->title().'</a></li>';
}
echo '</ul>';
}
}
?>
</div>

View File

@ -40,10 +40,7 @@
<!-- Footer -->
<div class="footer">
<?php include('php/footer.php') ?>
<?php
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
?>
<p><?php echo $Site->footer(); ?></p>
</div>
</div>
@ -51,4 +48,4 @@ echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
</div>
</body>
</html>
</html>

View File

@ -1,3 +0,0 @@
<div class="pure-menu pure-menu-horizontal">
<p><?php echo $Site->footer(); ?></p>
</div>

View File

@ -9,6 +9,14 @@
// <meta name="description" content="Site description">
Theme::description( $Site->description() );
// <meta name="keywords" content="HTML,CSS,XML,JavaScript">
if( $Url->whereAmI()=='post' ) {
Theme::keywords( $Post->tags() );
}
elseif( $Url->whereAmI()=='page' ) {
Theme::keywords( $Page->tags() );
}
// <link rel="stylesheet" type="text/css" href="pure-min.css">
// <link rel="stylesheet" type="text/css" href="grids-responsive-min.css">
// <link rel="stylesheet" type="text/css" href="blog.css">
@ -42,4 +50,4 @@ html, button, input, select, textarea,
<!-- Plugins -->
<?php
Theme::plugins('onSiteHead');
?>
?>

View File

@ -8,4 +8,4 @@
<div class="page-content">
<?php echo $Page->content() ?>
</div>
</section>
</section>

View File

@ -15,4 +15,4 @@
<div class="post-description">
<?php echo $Post->content() ?>
</div>
</section>
</section>