utopia-project 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utopia/project/version.rb +1 -1
- data/lib/utopia/project.rb +2 -10
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash-script.css +0 -2
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.bash.css +0 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.bash.js +1 -1
- data/public/_components/jquery-syntax/jquery.syntax.brush.basic.js +1 -1
- data/public/_components/jquery-syntax/jquery.syntax.brush.css.js +3 -3
- data/public/_components/jquery-syntax/jquery.syntax.brush.html.js +2 -2
- data/public/_components/jquery-syntax/jquery.syntax.brush.python.js +1 -1
- data/public/_components/jquery-syntax/jquery.syntax.brush.ruby.js +1 -1
- data/public/_components/jquery-syntax/jquery.syntax.core.js +30 -30
- data/public/_components/jquery-syntax/jquery.syntax.editor.js +10 -10
- data/public/_components/jquery-syntax/jquery.syntax.js +3 -3
- data/public/_components/jquery-syntax/jquery.syntax.min.js +3 -3
- data/public/_static/site.css +0 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ce07def02d374cd501a236559942010ed5e7ca858180821f92324697e10bfc0
|
4
|
+
data.tar.gz: ebbfa1ac8fb13afb5b5b727659e8d76c0e828c971fefacea24248e5821a04dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6a8d3c286386986108bbd47bb7556e0f8ec0513f8718dd6be1fafce35f7f5baf5691e0e2297411a241fdee0338569a04656d207d3d1a147eb8ad7326703d09d
|
7
|
+
data.tar.gz: 6976d253c5387207fd120dbe6421b1ee7ac4787b8cfba23438badd5cb6c82faa5970328b74f077c7a5b6cce8cd337d17666f931f162e547666f6cb3cf56f1933
|
data/lib/utopia/project.rb
CHANGED
@@ -41,16 +41,8 @@ module Utopia
|
|
41
41
|
|
42
42
|
# Appends a project application to the rack builder.
|
43
43
|
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
# require 'utopia/setup'
|
48
|
-
# UTOPIA ||= Utopia.setup
|
49
|
-
#
|
50
|
-
# require 'utopia/project'
|
51
|
-
# Utopia::Project.call(self)
|
52
|
-
# ~~~
|
53
|
-
#
|
44
|
+
# @param builder [Rack::Builder]
|
45
|
+
# @param root [String] The file-system root path of the project/gem.
|
54
46
|
# @param locales [Array(String)] an array of locales to support, e.g. `['en', 'ja']`.
|
55
47
|
def self.call(builder, root = Dir.pwd, locales: nil)
|
56
48
|
if UTOPIA.production?
|
@@ -1,2 +1,2 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
-
Syntax.brushes.dependency("bash","bash-script");Syntax.register("bash",function(a){a.push({pattern:/^([\w@:~ ]*?[
|
2
|
+
Syntax.brushes.dependency("bash","bash-script");Syntax.register("bash",function(a){a.push({pattern:/^([\w@:~ ]*?[\$|#])\s+(.*?)$/gm,matches:Syntax.extractMatches({klass:"prompt"},{brush:"bash-script"})});a.push({pattern:/^\-\- .*$/gm,klass:"comment",allow:["href"]});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.webLink);a.push({klass:"stderr",allow:["string","comment","constant","href"]})});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
2
|
Syntax.lib.vbStyleComment={pattern:/' .*$/gm,klass:"comment",allow:["href"]};
|
3
|
-
Syntax.register("basic",function(a){var b="- & &= * *= / /= \\ = ^ ^= + += = -=".split(" ")
|
3
|
+
Syntax.register("basic",function(a){var b="- & &= * *= / /= \\ = ^ ^= + += = -=".split(" ");b="+ - * / += -= *= /= = := == != ! % ? > < >= <= && || & | ^ . ~ .. >> << >>> <<< >>= <<= >>>= <<<= %= ^= @".split(" ");a.push("CBool CByte CChar CDate CDec CDbl Char CInt CLng CObj Const CShort CSng CStr CType Date Decimal Variant String Short Long Single Double Object Integer Boolean Byte Char".split(" "),{klass:"type"});a.push("AddHandler AddressOf Alias And AndAlso Ansi As Assembly Auto ByRef ByVal Call Case Catch Declare Default Delegate Dim DirectCast Do Each Else ElseIf End Enum Erase Error Event Exit Finally For Function Get GetType GoSub GoTo Handles If Implements Imports In Inherits Interface Is Let Lib Like Loop Mod Module MustOverride Namespace New Next Not On Option Optional Or OrElse Overloads Overridable Overrides ParamArray Preserve Property RaiseEvent ReadOnly ReDim REM RemoveHandler Resume Return Select Set Static Step Stop Structure Sub SyncLock Then Throw To Try TypeOf Unicode Until When While With WithEvents WriteOnly Xor ExternalSource Region Print Class".split(" "),{klass:"keyword",
|
4
4
|
options:"gi"});a.push(b,{klass:"operator"});a.push("Public Protected Private Shared Friend Shadows MustInherit NotInheritable NotOverridable".split(" "),{klass:"access"});a.push(["Me","MyClass","MyBase","super","True","False","Nothing",/[A-Z][A-Z0-9_]+/g],{klass:"constant"});a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.vbStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.postprocess=function(a,b,c){jQuery(".function",
|
5
5
|
b).each(function(){var a=jQuery(this).text();jQuery(this).replaceWith(jQuery("<a>").attr("href","http://social.msdn.microsoft.com/Search/en-us?query="+encodeURIComponent(a)).text(a))});return b}});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
-
Syntax.register("css",function(a){var
|
3
|
-
function(a){return"("+Syntax.Brush.convertStringToTokenPattern(a,!0)+")"}),jQuery.map(["#[0-9a-f]{3,6}","rgba?\\(.+?\\)","hsla?\\(.+?\\)"],function(a){return"("+Syntax.Brush.convertStringToTokenPattern(a,!1)+")"}));a.push({pattern:/\(.*?\)/g,allow:"*",disallow:["property"]});a.push({pattern:/\s*([
|
4
|
-
c=document.createElement("span");c.className="colour-box";var b=document.createElement("span");b.className="sample";b.style.backgroundColor=
|
2
|
+
Syntax.register("css",function(a){var e=[].concat(jQuery.map("AliceBlue AntiqueWhite Aqua Aquamarine Azure Beige Bisque Black BlanchedAlmond Blue BlueViolet Brown BurlyWood CadetBlue Chartreuse Chocolate Coral CornflowerBlue Cornsilk Crimson Cyan DarkBlue DarkCyan DarkGoldenRod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen Darkorange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DimGray DodgerBlue FireBrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite Gold GoldenRod Gray Green GreenYellow HoneyDew HotPink IndianRed Indigo Ivory Khaki Lavender LavenderBlush LawnGreen LemonChiffon LightBlue LightCoral LightCyan LightGoldenRodYellow LightGrey LightGreen LightPink LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue LightYellow Lime LimeGreen Linen Magenta Maroon MediumAquaMarine MediumBlue MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen MediumTurquoise MediumVioletRed MidnightBlue MintCream MistyRose Moccasin NavajoWhite Navy OldLace Olive OliveDrab Orange OrangeRed Orchid PaleGoldenRod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip PeachPuff Peru Pink Plum PowderBlue Purple Red RosyBrown RoyalBlue SaddleBrown Salmon SandyBrown SeaGreen SeaShell Sienna Silver SkyBlue SlateBlue SlateGray Snow SpringGreen SteelBlue Tan Teal Thistle Tomato Turquoise Violet Wheat White WhiteSmoke Yellow YellowGreen".split(" "),
|
3
|
+
function(a){return"("+Syntax.Brush.convertStringToTokenPattern(a,!0)+")"}),jQuery.map(["#[0-9a-f]{3,6}","rgba?\\(.+?\\)","hsla?\\(.+?\\)"],function(a){return"("+Syntax.Brush.convertStringToTokenPattern(a,!1)+")"}));a.push({pattern:/\(.*?\)/g,allow:"*",disallow:["property"]});a.push({pattern:/\s*([:\.\[\]"'=\s\w#\.\-,]+)\s+\{/gm,matches:Syntax.extractMatches({klass:"selector",allow:["string"]})});a.push({pattern:new RegExp(e.join("|"),"gi"),klass:"color",process:function(a,d){d=Syntax.innerText(a);
|
4
|
+
var c=document.createElement("span");c.className="colour-box";var b=document.createElement("span");b.className="sample";b.style.backgroundColor=d;b.appendChild(document.createTextNode(" "));c.appendChild(b);a.appendChild(c);return a}});a.push(Syntax.lib.cStyleComment);a.push(Syntax.lib.webLink);a.push({pattern:/\{(.|\n)*?\}/g,klass:"properties",allow:"*"});a.push({pattern:/:(.*?(?=\})|(.|\n)*?(?=(\}|;)))/g,matches:Syntax.extractMatches({klass:"value",allow:["color"],only:["properties"]})});a.push({pattern:/([\-\w]+):/g,
|
5
5
|
matches:Syntax.extractMatches({klass:"property",process:Syntax.lib.webLinkProcess("http://cssdocs.org/")})});a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.cStyleFunction)});
|
@@ -1,4 +1,4 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
2
|
Syntax.brushes.dependency("html","xml");Syntax.brushes.dependency("html","javascript");Syntax.brushes.dependency("html","css");Syntax.brushes.dependency("html","php-script");Syntax.brushes.dependency("html","ruby");
|
3
|
-
Syntax.register("html",function(a){a.push({pattern:/<script.*?type
|
4
|
-
matches:Syntax.extractMatches({klass:"ruby-tag",allow:["keyword","ruby"]},{klass:"keyword"},{brush:"ruby"},{klass:"keyword"})});a.push({pattern:/<%=?(.*?)(%>)/g,klass:"instruction",allow:["string"]});a.push({pattern
|
3
|
+
Syntax.register("html",function(a){a.push({pattern:/<script.*?type=.?text\/javascript.*?>((.|\n)*?)<\/script>/gmi,matches:Syntax.extractMatches({brush:"javascript"})});a.push({pattern:/<style.*?type=.?text\/css.*?>((.|\n)*?)<\/style>/gmi,matches:Syntax.extractMatches({brush:"css"})});a.push({pattern:/((<\?php)([\s\S]*?)(\?>))/gm,matches:Syntax.extractMatches({klass:"php-tag",allow:["keyword","php-script"]},{klass:"keyword"},{brush:"php-script"},{klass:"keyword"})});a.push({pattern:/((<\?rb?)([\s\S]*?)(\?>))/gm,
|
4
|
+
matches:Syntax.extractMatches({klass:"ruby-tag",allow:["keyword","ruby"]},{klass:"keyword"},{brush:"ruby"},{klass:"keyword"})});a.push({pattern:/<%=?(.*?)(%>)/g,klass:"instruction",allow:["string"]});a.push({pattern:/<!(DOCTYPE(.*?))>/g,matches:Syntax.extractMatches({klass:"doctype"})});a.push({pattern:/(%[0-9a-f]{2})/gi,klass:"percent-escape",only:["html"]});a.derives("xml")});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
2
|
Syntax.register("python",function(a){a.push({pattern:/^\s*@\w+/gm,klass:"decorator"});a.push(["self","True","False","None"],{klass:"constant"});a.push("and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield".split(" "),{klass:"keyword"});a.push("!= % %= & &= ( ) * ** **= *= + += , - -= . / // //= /= : ; < << <<= <= <> = == > >= >> >>= @ [ ] ^ ^= ` ` { | |= } ~".split(" "),{klass:"operator"});
|
3
3
|
a.push("abs all any basestring bin bool callable chr classmethod cmp compile complex delattr dict dir divmod enumerate eval execfile file filter float format frozenset getattr globals hasattr hash help hex id input int isinstance issubclass iter len list locals long map max min next object oct open ord pow print property range raw_input reduce reload repr reversed round set setattr slice sorted staticmethod str sum super tuple type type unichr unicode vars xrange zip __import__ apply buffer coerce intern".split(" "),
|
4
|
-
{klass:"builtin"});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleFunction);a.push(Syntax.lib.perlStyleComment);a.push({pattern:/(['
|
4
|
+
{klass:"builtin"});a.push(Syntax.lib.camelCaseType);a.push(Syntax.lib.cStyleFunction);a.push(Syntax.lib.perlStyleComment);a.push({pattern:/(['"]{3})([^\1])*?\1/gm,klass:"comment"});a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.processes["function"]=Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=");a.processes.type=Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=");
|
5
5
|
a.processes.builtin=Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=")});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
2
|
Syntax.lib.rubyStyleFunction={pattern:/(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi,matches:Syntax.extractMatches({klass:"function"})};Syntax.lib.rubyStyleSymbol={pattern:/([:]?):\w+/g,klass:"constant",matches:function(a,b){return""!=a[1]?[]:[new Syntax.Match(a.index,a[0].length,b,a[0])]}};
|
3
|
-
Syntax.register("ruby",function(a){a.push(["private","protected","public"],{klass:"access"});a.push(["self","super","true","false","nil"],{klass:"constant"});a.push({pattern:/(
|
3
|
+
Syntax.register("ruby",function(a){a.push(["private","protected","public"],{klass:"access"});a.push(["self","super","true","false","nil"],{klass:"constant"});a.push({pattern:/(%[\S])(\{[\s\S]*?\})/g,matches:Syntax.extractMatches({klass:"function"},{klass:"constant"})});a.push({pattern:/`[^`]+`/g,klass:"string"});a.push({pattern:/#\{([^\}]*)\}/g,matches:Syntax.extractMatches({brush:"ruby",only:["string"]})});a.push(Syntax.lib.rubyStyleRegularExpression);a.push({pattern:/(@+|\$)[\w]+/g,klass:"variable"});
|
4
4
|
a.push(Syntax.lib.camelCaseType);a.push("alias and begin break case class def define_method defined? do else elsif end ensure false for if in module next not or raise redo rescue retry return then throw undef unless until when while yield block_given?".split(" "),{klass:"keyword"});a.push("+*/-&|~!%<=>".split(""),{klass:"operator"});a.push(Syntax.lib.rubyStyleSymbol);a.push(Syntax.lib.perlStyleComment);a.push(Syntax.lib.webLink);a.push(Syntax.lib.singleQuotedString);a.push(Syntax.lib.doubleQuotedString);
|
5
5
|
a.push(Syntax.lib.stringEscape);a.push(Syntax.lib.decimalNumber);a.push(Syntax.lib.hexNumber);a.push(Syntax.lib.rubyStyleFunction);a.push(Syntax.lib.cStyleFunction)});
|
@@ -1,34 +1,34 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
-
RegExp.prototype.indexOf||(RegExp.indexOf=function(a
|
3
|
-
Syntax.extractTextFromSelection=function(
|
4
|
-
Syntax.extractElementMatches=function(a
|
5
|
-
Syntax.extractMatches=function(){var
|
6
|
-
Syntax.lib.webLinkProcess=function(a
|
2
|
+
RegExp.prototype.indexOf||(RegExp.indexOf=function(b,a){return b[0].indexOf(b[a])+b.index});RegExp.prototype.escape||(RegExp.escape=function(b){return b.replace(/[\-\[\]{}()*+?.\\\^$|,#\s]/g,"\\$&")});String.prototype.repeat||(String.prototype.repeat=function(b){return Array(b+1).join(this)});Syntax.innerText=function(b){if(!b)return"";if("BR"==b.nodeName)return"\n";if(b.textContent)var a=b.textContent;else document.body.innerText&&(a=b.innerText);return a.replace(/\r\n?/g,"\n")};
|
3
|
+
Syntax.extractTextFromSelection=function(b){for(var a="",c=0;c<b.rangeCount;c+=1){var d=b.getRangeAt(c).toString();a+=d}return a};Syntax.copyCode=function(b){var a=window.getSelection();a=Syntax.extractTextFromSelection(a);b.clipboardData.setData("text/plain",a);return!1};
|
4
|
+
Syntax.extractElementMatches=function(b,a){var c=[];a=a||0;(function(b){for(var d=0;b[d];d++){var f=b[d];if(3===f.nodeType||4===f.nodeType)a+=f.nodeValue.length;else if(1===f.nodeType){var g=Syntax.innerText(f);c.push(new Syntax.Match(a,g.length,{klass:f.className,force:!0,element:f,allow:"*"},g))}8!==f.nodeType&&f.children&&arguments.callee(f.childNodes,a)}})(b);c.shift();return c};
|
5
|
+
Syntax.extractMatches=function(){var b=arguments;return function(a,c){for(var d=[],e=0;e<b.length;e+=1){var f=b[e],g=e+1;null!=f&&("undefined"!=typeof f.index&&(g=f.index),f.debug&&console.log("extractMatches",f,g,a[g],a),0<a[g].length&&(f.brush?d.push(Syntax.Brush.buildTree(f,a[g],RegExp.indexOf(a,g))):(f=jQuery.extend({owner:c.owner},f),d.push(new Syntax.Match(RegExp.indexOf(a,g),a[g].length,f,a[g])))))}return d}};
|
6
|
+
Syntax.lib.webLinkProcess=function(b,a){a&&(b="http://www.google.com/search?btnI=I&q="+encodeURIComponent(b+" "));return function(a,d,e){if(!1===e.linkify)return a;d=document.createElement("a");d.href=b+encodeURIComponent(Syntax.innerText(a));for(d.className=a.className;0<a.childNodes.length;)d.appendChild(a.childNodes[0]);return d}};Syntax.register=function(b,a){var c=Syntax.brushes[b]=new Syntax.Brush;c.klass=b;a(c)};Syntax.lib.cStyleComment={pattern:/\/\*[\s\S]*?\*\//gm,klass:"comment",allow:["href"]};
|
7
7
|
Syntax.lib.cppStyleComment={pattern:/\/\/.*$/gm,klass:"comment",allow:["href"]};Syntax.lib.perlStyleComment={pattern:/#.*$/gm,klass:"comment",allow:["href"]};Syntax.lib.perlStyleRegularExpression={pattern:/\B\/([^\\\/]|\\.)*\/[a-z]*(?=\s*($|[^\w\s'"\(]))/gm,klass:"constant",incremental:!0};Syntax.lib.rubyStyleRegularExpression={pattern:/\B\/([^\\\/]|\\.)*\/[a-z]*(?=\s*($|[^\w\s'"\(]|do))/gm,klass:"constant",incremental:!0};Syntax.lib.cStyleFunction={pattern:/([a-z_][a-z0-9_]*)\s*\(/gi,matches:Syntax.extractMatches({klass:"function"})};
|
8
8
|
Syntax.lib.camelCaseType={pattern:/\b_*[A-Z][\w]*\b/g,klass:"type"};Syntax.lib.cStyleType={pattern:/\b[_a-z][_\w]*_t\b/gi,klass:"type"};Syntax.lib.xmlComment={pattern:/(<|<)!--[\s\S]*?--(>|>)/gm,klass:"comment"};Syntax.lib.webLink={pattern:/\w+:\/\/[\w\-.\/?%&=@:;#]*/g,klass:"href"};Syntax.lib.hexNumber={pattern:/\b0x[0-9a-fA-F]+/g,klass:"constant"};Syntax.lib.decimalNumber={pattern:/\b[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/g,klass:"constant"};
|
9
9
|
Syntax.lib.doubleQuotedString={pattern:/"([^\\"\n]|\\.)*"/g,klass:"string"};Syntax.lib.singleQuotedString={pattern:/'([^\\'\n]|\\.)*'/g,klass:"string"};Syntax.lib.multiLineDoubleQuotedString={pattern:/"([^\\"]|\\.)*"/g,klass:"string"};Syntax.lib.multiLineSingleQuotedString={pattern:/'([^\\']|\\.)*'/g,klass:"string"};Syntax.lib.stringEscape={pattern:/\\./g,klass:"escape",only:["string"]};
|
10
|
-
Syntax.Match=function(a,
|
11
|
-
Syntax.Match.sort=function(a
|
12
|
-
Syntax.Match.prototype.reduce=function(a
|
13
|
-
this.offset,g-c);
|
14
|
-
Syntax.Match.prototype.canContain=function(
|
15
|
-
Syntax.Match.prototype.canHaveChild=function(
|
16
|
-
Syntax.Match.prototype.insert=function(a
|
17
|
-
Syntax.Match.prototype._insertWhole=function(
|
18
|
-
return this};Syntax.Match.prototype.insertAtEnd=function(
|
19
|
-
Syntax.Match.prototype._insert=function(
|
20
|
-
Syntax.Match.prototype.bisectAtOffsets=function(
|
21
|
-
|
22
|
-
Syntax.Match.prototype.split=function(
|
23
|
-
Syntax.Match.prototype.splitLines=function(){for(var
|
24
|
-
Syntax.Brush.prototype.derives=function(
|
25
|
-
Syntax.Brush.MatchPattern=function(a
|
26
|
-
Syntax.Brush.prototype.push=function(a
|
27
|
-
Syntax.Brush.MatchPattern,
|
28
|
-
Syntax.Brush.prototype.getMatches=function(
|
29
|
-
Syntax.Brush.prototype.buildTree=function(a,
|
30
|
-
Syntax.Brush.prototype.process=function(a,
|
31
|
-
Syntax.highlightText=function(a,
|
32
|
-
Syntax.extractBrushName=function(
|
33
|
-
Syntax.highlight=function(a,
|
34
|
-
|
10
|
+
Syntax.Match=function(b,a,c,d){this.offset=b;this.endOffset=b+a;this.length=a;this.expression=c;this.value=d;this.children=[];this.next=this.parent=null};Syntax.Match.prototype.shift=function(b,a){this.adjust(b,null,a);for(var c=0;c<this.children.length;c++)this.children[c].shift(b,a)};Syntax.Match.prototype.adjust=function(b,a,c){this.offset+=b;this.endOffset+=b;a&&(this.length=a,this.endOffset=this.offset+a);c&&(this.value=c.substr(this.offset,this.length))};
|
11
|
+
Syntax.Match.sort=function(b,a){return b.offset-a.offset||a.length-b.length};Syntax.Match.prototype.contains=function(b){return b.offset>=this.offset&&b.endOffset<=this.endOffset};Syntax.Match.defaultReduceCallback=function(b,a){"string"===typeof b&&(b=document.createTextNode(b));a.appendChild(b)};
|
12
|
+
Syntax.Match.prototype.reduce=function(b,a){var c=this.offset,d=document.createElement("span");b=b||Syntax.Match.defaultReduceCallback;this.expression&&this.expression.klass&&(0<d.className.length&&(d.className+=" "),d.className+=this.expression.klass);this.className&&(d.className+=" ",d.className+=this.className);for(var e=0;e<this.children.length;e+=1){var f=this.children[e],g=f.offset;f.offset<this.offset&&console.log("Syntax Warning: Offset of child",f,"is before offset of parent",this);c=this.value.substr(c-
|
13
|
+
this.offset,g-c);b(c,d);b(f.reduce(b,a),d);c=f.endOffset}c===this.offset?b(this.value,d):c<this.endOffset?b(this.value.substr(c-this.offset,this.endOffset-c),d):c>this.endOffset&&console.log("Syntax Warning: Start position "+c+" exceeds end of value "+this.endOffset);a&&(d=a(d,this));return d};
|
14
|
+
Syntax.Match.prototype.canContain=function(b){return b.expression.force?!0:this.complete?!1:b.expression.only?!0:"undefined"===typeof this.expression.allow||jQuery.isArray(this.expression.disallow)&&-1!==jQuery.inArray(b.expression.klass,this.expression.disallow)?!1:"*"===this.expression.allow||jQuery.isArray(this.expression.allow)&&-1!==jQuery.inArray(b.expression.klass,this.expression.allow)?!0:!1};
|
15
|
+
Syntax.Match.prototype.canHaveChild=function(b){if(b=b.expression.only){for(var a=this;null!==a;){if(-1!==jQuery.inArray(a.expression.klass,b))return!0;if((a=a.parent)&&a.complete)break}return!1}return!0};Syntax.Match.prototype._splice=function(b,a){return this.canHaveChild(a)?(this.children.splice(b,0,a),a.parent=this,a.expression.owner||(a.expression.owner=this.expression.owner),this):null};
|
16
|
+
Syntax.Match.prototype.insert=function(b,a){if(!this.contains(b))return null;if(a){a=this;for(var c=0;c<a.children.length;)a.children[c].contains(b)?(a=a.children[c],c=0):c+=1;return a._insertWhole(b)}return this._insert(b)};
|
17
|
+
Syntax.Match.prototype._insertWhole=function(b){var a=this.bisectAtOffsets([b.offset,b.endOffset]);this.children=[];a[0]&&(this.children=this.children.concat(a[0].children));if(a[1]){b.children=[];this.expression&&this.expression.owner&&(b.expression=this.expression.owner.getRuleForKlass(b.expression.klass)||b.expression);for(var c=0;c<a[1].children.length;c+=1){var d=a[1].children[c];b.canContain(d)&&b.children.push(d)}this.children.push(b)}a[2]&&(this.children=this.children.concat(a[2].children));
|
18
|
+
return this};Syntax.Match.prototype.insertAtEnd=function(b){if(!this.contains(b))return console.log("Syntax Error: Child is not contained in parent node!"),null;if(!this.canContain(b))return null;if(0<this.children.length){var a=this.children.length-1,c=this.children[a];return b.offset<c.offset?b.force?this._insert(b):null:b.offset<c.endOffset?b.endOffset<=c.endOffset?c.insertAtEnd(b):b.force?this._insert(b):null:this._splice(a+1,b)}return this._splice(0,b)};
|
19
|
+
Syntax.Match.prototype._insert=function(b){if(0==this.children.length)return this._splice(0,b);for(var a=0;a<this.children.length;a+=1){var c=this.children[a];if(b.endOffset<=c.offset)return this._splice(a,b);if(!(b.offset>=c.endOffset)){if(c.contains(b))return c._insert(b);b=b.bisectAtOffsets([c.offset,c.endOffset]);b[0]&&this._splice(a,b[0]);b[1]&&c.insert(b[1]);if(b[2])b=b[2];else return this}}this._splice(this.children.length,b)};
|
20
|
+
Syntax.Match.prototype.bisectAtOffsets=function(b){var a=[],c=this.offset,d=null,e=jQuery.merge([],this.children);b=b.slice(0);b.push(this.endOffset);b.sort(function(a,b){return a-b});for(var f=0;f<b.length;f+=1){var g=b[f];if(g>this.endOffset)break;g<this.offset||0==g-c?(a.push(null),c=g):(c<this.offset&&(c=this.offset),g=new Syntax.Match(c,g-c,this.expression),g.value=this.value.substr(c-this.offset,g.length),d&&(d.next=g),d=g,c=g.endOffset,a.push(g))}b.length=a.length;for(f=0;f<a.length;f+=1)if(null!=
|
21
|
+
a[f]){for(g=b[0];0<e.length;)if(e[0].endOffset<=a[f].endOffset)a[f].children.push(e.shift());else break;if(e.length&&e[0].offset<a[f].endOffset){c=e.shift().bisectAtOffsets(b);for(d=0;d<c.length;d+=1)null!=c[d]&&a[f+d].children.push(c[d]);f+=c.length-2;b.splice(0,c.length-2)}b.shift()}e.length&&console.log("Syntax Error: Children nodes not consumed",e.length," remaining!");return a};
|
22
|
+
Syntax.Match.prototype.split=function(b){for(var a=[];null!==b.exec(this.value);)a.push(b.lastIndex);b=this.bisectAtOffsets(a);return jQuery.grep(b,function(a,b){return a})};
|
23
|
+
Syntax.Match.prototype.splitLines=function(){for(var b=this.split(/\n/g),a=0;a<b.length;a+=1){var c=b[a],d=c.value.search(/\S/),e=new Syntax.Match(c.offset,c.length,c.expression,c.value);0<d?(c=c.bisectAtOffsets([c.offset+d]),e.children=c,c[0].expression={klass:"indent"},c[1].expression={klass:"text"}):(c.expression={klass:"text"},e.children=[c]);b[a]=e}return b};Syntax.Brush=function(){this.klass=null;this.rules=[];this.parents=[];this.processes={}};
|
24
|
+
Syntax.Brush.prototype.derives=function(b){this.parents.push(b);this.rules.push({apply:function(a,c){return Syntax.brushes[b].getMatches(a)}})};Syntax.Brush.prototype.allKlasses=function(){for(var b=[this.klass],a=0;a<this.parents.length;a+=1)b=b.concat(Syntax.brushes[this.parents[a]].allKlasses());return b};Syntax.Brush.convertStringToTokenPattern=function(b,a){var c="\\b",d="\\b";b.match(/^\w/)?b.match(/\w$/)||(d="\\B"):c=b.match(/\w$/)?"\\B":d="";a&&(b=RegExp.escape(b));return c+b+d};
|
25
|
+
Syntax.Brush.MatchPattern=function(b,a){if(!a.pattern)return[];var c=[],d=RegExp();for(d.compile(a.pattern);null!==(match=d.exec(b));)a.matches?c=c.concat(a.matches(match,a)):a.brush?c.push(Syntax.Brush.buildTree(a,match[0],match.index)):c.push(new Syntax.Match(match.index,match[0].length,a,match[0])),a.incremental&&(d.lastIndex=match.index+1);return c};
|
26
|
+
Syntax.Brush.prototype.push=function(b,a){if(jQuery.isArray(b)){for(var c="(",d=0;d<b.length;d+=1){0<d&&(c+="|");var e=b[d];c=e instanceof RegExp?c+e.source:c+Syntax.Brush.convertStringToTokenPattern(e,!0)}this.push(jQuery.extend({pattern:new RegExp(c+")",a.options||"g")},a))}else a=b,"string"===typeof a.pattern&&(a.string=a.pattern,a.pattern=new RegExp(Syntax.Brush.convertStringToTokenPattern(a.string,!0),a.options||"g")),"undefined"!==typeof XRegExp&&(a.pattern=new XRegExp(a.pattern)),a.apply=a.apply||
|
27
|
+
Syntax.Brush.MatchPattern,a.pattern&&a.pattern.global||"undefined"==typeof a.pattern?this.rules.push(jQuery.extend({owner:this},a)):console.log("Syntax Error: Malformed rule: ",a)};Syntax.Brush.prototype.getMatchesForRule=function(b,a){var c=[];"undefined"!=typeof a.apply&&(c=a.apply(b,a));a.debug&&console.log("Syntax matches:",a,b,c);return c};Syntax.Brush.prototype.getRuleForKlass=function(b){for(var a=0;a<this.rules.length;a+=1)if(this.rules[a].klass==b)return this.rules[a];return null};
|
28
|
+
Syntax.Brush.prototype.getMatches=function(b){for(var a=[],c=0;c<this.rules.length;c+=1)a=a.concat(this.getMatchesForRule(b,this.rules[c]));return a};Syntax.Brush.buildTree=function(b,a,c,d){a=Syntax.brushes[b.brush].buildTree(a,c,d);jQuery.extend(a.expression,b);return a};
|
29
|
+
Syntax.Brush.prototype.buildTree=function(b,a,c){a=a||0;b=b.replace(/\r/g,"");var d=this.getMatches(b);if(a&&0<a)for(var e=0;e<d.length;e+=1)d[e].shift(a);b=new Syntax.Match(a,b.length,{klass:this.allKlasses().join(" "),allow:"*",owner:this},b);d.sort(Syntax.Match.sort);for(e=0;e<d.length;e+=1)b.insertAtEnd(d[e]);if(c)for(e=0;e<c.length;e+=1)b.insert(c[e],!0);b.complete=!0;return b};
|
30
|
+
Syntax.Brush.prototype.process=function(b,a,c){b=this.buildTree(b,0,a).splitLines();a=document.createElement("code");a.className="syntax highlighted";for(var d=0;d<b.length;d+=1){var e=b[d].reduce(null,function(a,b){if(b.expression&&(b.expression.process&&(a=b.expression.process(a,b,c)),b.expression.owner)){var d=b.expression.owner.processes[b.expression.klass];d&&(a=d(a,b,c))}return a});a.appendChild(e)}return a};
|
31
|
+
Syntax.highlightText=function(b,a,c,d,e){a=(a||"plain").toLowerCase();a=Syntax.aliases[a]||a;Syntax.brushes.get(a,function(a){var f=a.process(b,c,d);d.linkify&&jQuery("span.href",f).each(function(){jQuery(this).replaceWith(jQuery("<a>").attr("href",this.innerHTML).text(this.innerHTML))});e(f,a,b,d)})};
|
32
|
+
Syntax.extractBrushName=function(b){b=b.toLowerCase();var a=b.match(/(brush|language)-([\S]+)/);if(a)return a[2];b=b.split(/ /);if(-1!==jQuery.inArray("syntax",b))for(a=0;a<b.length;a+=1){var c=Syntax.aliases[b[a]];if(c)return c}return null};
|
33
|
+
Syntax.highlight=function(b,a,c){b.each(function(){var b=jQuery(this),e=a.brush||Syntax.extractBrushName(this.className),f=Syntax.innerText(this),g=Syntax.extractElementMatches(b);a.matches&&Array.prototype.push(g,a.matches);Syntax.highlightText(f,e,g,a,function(d,e){d.oncopy=Syntax.copyCode;d=jQuery(d);if(a.theme){for(var f=Syntax.themes[a.theme],g=0;g<f.length;g+=1)d.addClass("syntax-theme-"+f[g]);d.addClass("syntax-theme-"+a.theme)}e.postprocess&&(d=e.postprocess(a,d,b));c&&(d=c(a,d,b));d&&!0===
|
34
|
+
a.replace&&b.replaceWith(d)})})};Syntax.loader.core=!0;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
|
2
|
-
Syntax.Editor=function(a,
|
3
|
-
Syntax.Editor.prototype.updateChangedLines=function(){for(var a={},
|
4
|
-
|
5
|
-
Syntax.Editor.prototype.updateLines=function(a,
|
6
|
-
Syntax.Editor.getCharacterOffset=function(a){var
|
7
|
-
Syntax.Editor.getNodesForCharacterOffsets=function(a,
|
8
|
-
Syntax.Editor.prototype.getClientState=function(){var a={},
|
9
|
-
Syntax.Editor.prototype.setClientState=function(a){if(a.startOffset){var
|
10
|
-
Syntax.layouts.editor=function(a,
|
11
|
-
|
2
|
+
Syntax.Editor=function(a,b){this.container=a;this.current=this.getLines()};Syntax.Editor.prototype.getLines=function(){for(var a=this.container.childNodes,b=[],c=[],d="",f=0,e=0;e<a.length;e+=1){var g=Syntax.innerText([a[e]]).split("\n");if(1<g.length){g[0]=d+g[0];d=g.pop();for(var h=0;h<g.length;h+=1)c.push(f-b.length),b.push(g[h]);f=e+1}else d+=g[0]}""!=d?(c.push(f-b.length),b.push(d)):--f;c.push(f);console.log("getLines",c,b,a);return{lines:b,offsets:c}};
|
3
|
+
Syntax.Editor.prototype.updateChangedLines=function(){for(var a={},b=this.getLines(),c=0,d=0;c<this.current.lines.length&&d<b.lines.length;)if(this.current.lines[c]==b.lines[d])c+=1,d+=1;else break;a.start=d;c=this.current.lines.length;for(d=b.lines.length;c>a.start&&d>a.start;)if(this.current.lines[c-1]==b.lines[d-1])--c,--d;else break;a.end=d;a.originalEnd=c;for(a.difference=b.lines.length-this.current.lines.length;0<a.start&&b.offsets[a.start]!=b.offsets[a.start-1];)--a.start;if(0<a.difference)for(;a.end<
|
4
|
+
b.lines.length-1&&b.offsets[a.end-1]!=b.offsets[a.end];)a.end+=1,a.originalEnd+=1;this.current=b;return this.changed=a};Syntax.Editor.prototype.textForLines=function(a,b){return this.current.lines.slice(a,b).join("\n")+"\n"};
|
5
|
+
Syntax.Editor.prototype.updateLines=function(a,b){if(a.start!=a.end){var c=a.start;a=a.end;c+=this.current.offsets[c];a+=this.current.offsets[a];c=Array.prototype.slice.call(this.container.childNodes,c,a);$(c).replaceWith(b)}else 0==a.start?$(this.container).prepend(b):(c=a.start,c+=this.current.offsets[c],$(this.container.childNodes[c]).after(b))};
|
6
|
+
Syntax.Editor.getCharacterOffset=function(a){var b=0;if("undefined"!=typeof window.getSelection){b=window.getSelection().getRangeAt(0);var c=b.cloneRange();c.selectNodeContents(a);c.setEnd(b.endContainer,b.endOffset);b=c.toString().length}else"undefined"!=typeof document.selection&&"Control"!=document.selection.type&&(b=document.selection.createRange(),c=document.body.createTextRange(),c.moveToElementText(a),c.setEndPoint("EndToEnd",b),b=c.text.length);return b};
|
7
|
+
Syntax.Editor.getNodesForCharacterOffsets=function(a,b){b=document.createTreeWalker(b,NodeFilter.SHOW_TEXT,function(a){return NodeFilter.FILTER_ACCEPT},!1);for(var c=[],d=0,f=0;f<a.length&&b.nextNode();){for(var e=d+b.currentNode.length;f<a.length&&a[f]<e;)c.push([b.currentNode,d,e]),f+=1;d=e}return c};
|
8
|
+
Syntax.Editor.prototype.getClientState=function(){var a={},b=window.getSelection();0<b.rangeCount&&(a.range=b.getRangeAt(0));a.range&&(a.startOffset=Syntax.Editor.getCharacterOffset(this.container));return a};
|
9
|
+
Syntax.Editor.prototype.setClientState=function(a){if(a.startOffset){var b=Syntax.Editor.getNodesForCharacterOffsets([a.startOffset],this.container),c=document.createRange();c.setStart(b[0][0],a.startOffset-b[0][1]);c.setEnd(b[0][0],a.startOffset-b[0][1]);a=window.getSelection();a.removeAllRanges();a.addRange(c)}};
|
10
|
+
Syntax.layouts.editor=function(a,b){var c=jQuery('<div class="editor syntax highlighted" contentEditable="true">');c.append(b.children());var d=new Syntax.Editor(c.get(0)),f=function(b){var c=d.getClientState(),e=d.updateChangedLines();0>e.difference&&0<e.start&&--e.start;b=d.textForLines(e.start,e.end);e.start==e.end?d.updateLines(e,[]):Syntax.highlightText(b,a,function(a){d.updateLines(e,a.children().get());d.setClientState(c)})};c.bind("keyup",function(){f()});c.bind("paste",function(a){f()});
|
11
|
+
c.bind("keydown",function(a){9==a.keyCode?(a.preventDefault(),document.execCommand("insertHTML",!1," ")):13==a.keyCode&&(a.preventDefault(),document.execCommand("insertHTML",!1,"\n"))});return jQuery('<div class="syntax-container">').append(c)};
|
@@ -3,6 +3,6 @@ Function.prototype.bind||(Function.prototype.bind=function(a){var b=Array.protot
|
|
3
3
|
ResourceLoader.prototype._loaded=function(a){var b=this[a],c=this.loading[a];this.loading[a]=null;if(b)for(a=0;a<c.length;a+=1)c[a](b);else alert("ResourceLoader: Could not load resource named "+a)};ResourceLoader.prototype.dependency=function(a,b){if(!this[b]||this.loading[name])this.dependencies[a]?this.dependencies[a].push(b):this.dependencies[a]=[b]};
|
4
4
|
ResourceLoader.prototype.get=function(a,b){void 0==a?b():this.loading[a]?this.loading[a].push(b):this[a]?b(this[a]):(this.loading[a]=[b],this.loader(a,this._finish.bind(this,a)))};
|
5
5
|
var Syntax={root:null,aliases:{},styles:{},themes:{},lib:{},cacheScripts:!0,cacheStyleSheets:!0,codeSelector:"code:not(.highlighted)",defaultOptions:{theme:"base",replace:!0,linkify:!0},brushes:new ResourceLoader(function(a,b){a=Syntax.aliases[a]||a;Syntax.getResource("jquery.syntax.brush",a,b)}),loader:new ResourceLoader(function(a,b){Syntax.getResource("jquery.syntax",a,b)}),getStyles:function(a){var b=jQuery("<link>");jQuery("head").append(b);Syntax.cacheStyleSheets||(a=a+"?"+Math.random());b.attr({rel:"stylesheet",
|
6
|
-
type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onreadystatechange=function(){
|
7
|
-
b[d]);Syntax.getScript(this.root+a+".js",c)},alias:function(a,b){Syntax.aliases[a]=a;for(var c=0;c<b.length;c+=1)Syntax.aliases[b[c]]=a},brushAliases:function(a){var b=[],c;for(c in Syntax.aliases)Syntax.aliases[c]===a&&b.push(c);return b},brushNames:function(){var a=[],b;for(b in Syntax.aliases)b===Syntax.aliases[b]&&a.push(b);return a},detectRoot:function(){if(null==Syntax.root){var a=jQuery("script").filter(function(){return this.src.match(/jquery\.syntax/)}).get(0);
|
8
|
-
a[0]}}};jQuery.fn.syntax=function(a,b){0!=this.length&&(a=jQuery.extend(Syntax.defaultOptions,a),Syntax.loader.get("core",function(c){Syntax.highlight(this,a,b)}.bind(this)))};jQuery.syntax=function(a,b){jQuery(Syntax.codeSelector,a?a.context:null).syntax(a,b)};
|
6
|
+
type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onreadystatechange=function(){!this.onload||"loaded"!=this.readyState&&"complete"!=this.readyState||(this.onload(),this.onload=null)};c.onload=b;c.type="text/javascript";Syntax.cacheScripts||(a=a+"?"+Math.random());c.src=a;document.getElementsByTagName("head")[0].appendChild(c)},getResource:function(a,b,c){Syntax.detectRoot();a=a+"."+b;if(b=this.styles[a])for(var d=0;d<b.length;d+=1)this.getStyles(this.root+
|
7
|
+
b[d]);Syntax.getScript(this.root+a+".js",c)},alias:function(a,b){Syntax.aliases[a]=a;for(var c=0;c<b.length;c+=1)Syntax.aliases[b[c]]=a},brushAliases:function(a){var b=[],c;for(c in Syntax.aliases)Syntax.aliases[c]===a&&b.push(c);return b},brushNames:function(){var a=[],b;for(b in Syntax.aliases)b===Syntax.aliases[b]&&a.push(b);return a},detectRoot:function(){if(null==Syntax.root){var a=jQuery("script").filter(function(){return this.src.match(/jquery\.syntax/)}).get(0);a&&(a=a.src.match(/.*\//))&&
|
8
|
+
(Syntax.root=a[0])}}};jQuery.fn.syntax=function(a,b){0!=this.length&&(a=jQuery.extend(Syntax.defaultOptions,a),Syntax.loader.get("core",function(c){Syntax.highlight(this,a,b)}.bind(this)))};jQuery.syntax=function(a,b){jQuery(Syntax.codeSelector,a?a.context:null).syntax(a,b)};
|
@@ -3,9 +3,9 @@ Function.prototype.bind||(Function.prototype.bind=function(a){var b=Array.protot
|
|
3
3
|
ResourceLoader.prototype._loaded=function(a){var b=this[a],c=this.loading[a];this.loading[a]=null;if(b)for(a=0;a<c.length;a+=1)c[a](b);else alert("ResourceLoader: Could not load resource named "+a)};ResourceLoader.prototype.dependency=function(a,b){if(!this[b]||this.loading[name])this.dependencies[a]?this.dependencies[a].push(b):this.dependencies[a]=[b]};
|
4
4
|
ResourceLoader.prototype.get=function(a,b){void 0==a?b():this.loading[a]?this.loading[a].push(b):this[a]?b(this[a]):(this.loading[a]=[b],this.loader(a,this._finish.bind(this,a)))};
|
5
5
|
var Syntax={root:null,aliases:{},styles:{},themes:{},lib:{},cacheScripts:!0,cacheStyleSheets:!0,codeSelector:"code:not(.highlighted)",defaultOptions:{theme:"base",replace:!0,linkify:!0},brushes:new ResourceLoader(function(a,b){a=Syntax.aliases[a]||a;Syntax.getResource("jquery.syntax.brush",a,b)}),loader:new ResourceLoader(function(a,b){Syntax.getResource("jquery.syntax",a,b)}),getStyles:function(a){var b=jQuery("<link>");jQuery("head").append(b);Syntax.cacheStyleSheets||(a=a+"?"+Math.random());b.attr({rel:"stylesheet",
|
6
|
-
type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onreadystatechange=function(){
|
7
|
-
b[d]);Syntax.getScript(this.root+a+".js",c)},alias:function(a,b){Syntax.aliases[a]=a;for(var c=0;c<b.length;c+=1)Syntax.aliases[b[c]]=a},brushAliases:function(a){var b=[],c;for(c in Syntax.aliases)Syntax.aliases[c]===a&&b.push(c);return b},brushNames:function(){var a=[],b;for(b in Syntax.aliases)b===Syntax.aliases[b]&&a.push(b);return a},detectRoot:function(){if(null==Syntax.root){var a=jQuery("script").filter(function(){return this.src.match(/jquery\.syntax/)}).get(0);
|
8
|
-
a[0]}}};jQuery.fn.syntax=function(a,b){0!=this.length&&(a=jQuery.extend(Syntax.defaultOptions,a),Syntax.loader.get("core",function(c){Syntax.highlight(this,a,b)}.bind(this)))};jQuery.syntax=function(a,b){jQuery(Syntax.codeSelector,a?a.context:null).syntax(a,b)};Syntax.alias("apache",[]);Syntax.alias("applescript",[]);Syntax.alias("assembly",["asm"]);Syntax.alias("bash-script",[]);Syntax.alias("bash",[]);Syntax.alias("basic",["vb"]);Syntax.alias("clang",["cpp","c++","c","objective-c"]);
|
6
|
+
type:"text/css",href:a})},getScript:function(a,b){var c=document.createElement("script");c.onreadystatechange=function(){!this.onload||"loaded"!=this.readyState&&"complete"!=this.readyState||(this.onload(),this.onload=null)};c.onload=b;c.type="text/javascript";Syntax.cacheScripts||(a=a+"?"+Math.random());c.src=a;document.getElementsByTagName("head")[0].appendChild(c)},getResource:function(a,b,c){Syntax.detectRoot();a=a+"."+b;if(b=this.styles[a])for(var d=0;d<b.length;d+=1)this.getStyles(this.root+
|
7
|
+
b[d]);Syntax.getScript(this.root+a+".js",c)},alias:function(a,b){Syntax.aliases[a]=a;for(var c=0;c<b.length;c+=1)Syntax.aliases[b[c]]=a},brushAliases:function(a){var b=[],c;for(c in Syntax.aliases)Syntax.aliases[c]===a&&b.push(c);return b},brushNames:function(){var a=[],b;for(b in Syntax.aliases)b===Syntax.aliases[b]&&a.push(b);return a},detectRoot:function(){if(null==Syntax.root){var a=jQuery("script").filter(function(){return this.src.match(/jquery\.syntax/)}).get(0);a&&(a=a.src.match(/.*\//))&&
|
8
|
+
(Syntax.root=a[0])}}};jQuery.fn.syntax=function(a,b){0!=this.length&&(a=jQuery.extend(Syntax.defaultOptions,a),Syntax.loader.get("core",function(c){Syntax.highlight(this,a,b)}.bind(this)))};jQuery.syntax=function(a,b){jQuery(Syntax.codeSelector,a?a.context:null).syntax(a,b)};Syntax.alias("apache",[]);Syntax.alias("applescript",[]);Syntax.alias("assembly",["asm"]);Syntax.alias("bash-script",[]);Syntax.alias("bash",[]);Syntax.alias("basic",["vb"]);Syntax.alias("clang",["cpp","c++","c","objective-c"]);
|
9
9
|
Syntax.alias("csharp",["c-sharp","c#"]);Syntax.alias("css",[]);Syntax.alias("diff",["patch"]);Syntax.alias("go",[]);Syntax.alias("haskell",[]);Syntax.alias("html",[]);Syntax.alias("io",[]);Syntax.alias("java",[]);Syntax.alias("javascript",["js","actionscript"]);Syntax.alias("kai",[]);Syntax.alias("lisp",["scheme","clojure"]);Syntax.alias("lua",[]);Syntax.alias("nginx",[]);Syntax.alias("ocaml",["ml","sml","fsharp"]);Syntax.alias("ooc",[]);Syntax.alias("pascal",["delphi"]);Syntax.alias("perl5",[]);
|
10
10
|
Syntax.alias("php-script",[]);Syntax.alias("php",[]);Syntax.alias("plain",["text"]);Syntax.alias("protobuf",[]);Syntax.alias("python",[]);Syntax.alias("ruby",[]);Syntax.alias("scala",[]);Syntax.alias("smalltalk",[]);Syntax.alias("sql",[]);Syntax.alias("super-collider",["sc"]);Syntax.alias("swift",[]);Syntax.alias("html",[]);Syntax.alias("xml",[]);Syntax.alias("yaml",[]);Syntax.styles["jquery.syntax.brush.apache"]=["base/jquery.syntax.brush.apache.css"];
|
11
11
|
Syntax.styles["jquery.syntax.brush.applescript"]=["base/jquery.syntax.brush.applescript.css"];Syntax.styles["jquery.syntax.brush.assembly"]=["base/jquery.syntax.brush.assembly.css"];Syntax.styles["jquery.syntax.brush.bash-script"]=["base/jquery.syntax.brush.bash-script.css"];Syntax.styles["jquery.syntax.brush.bash"]=["base/jquery.syntax.brush.bash.css"];Syntax.styles["jquery.syntax.brush.clang"]=["base/jquery.syntax.brush.clang.css"];Syntax.styles["jquery.syntax.brush.css"]=["base/jquery.syntax.brush.css.css"];
|
data/public/_static/site.css
CHANGED