+
+
diff --git a/applications/admin/static/codemirror/mode/javascript/javascript.js b/applications/admin/static/codemirror/mode/javascript/javascript.js
new file mode 100644
index 00000000..6ece1bef
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/javascript/javascript.js
@@ -0,0 +1,361 @@
+CodeMirror.defineMode("javascript", function(config, parserConfig) {
+ var indentUnit = config.indentUnit;
+ var jsonMode = parserConfig.json;
+
+ // Tokenizer
+
+ var keywords = function(){
+ function kw(type) {return {type: type, style: "keyword"};}
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"};
+ return {
+ "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
+ "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C,
+ "var": kw("var"), "const": kw("var"), "let": kw("var"),
+ "function": kw("function"), "catch": kw("catch"),
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
+ "in": operator, "typeof": operator, "instanceof": operator,
+ "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
+ };
+ }();
+
+ var isOperatorChar = /[+\-*&%=<>!?|]/;
+
+ function chain(stream, state, f) {
+ state.tokenize = f;
+ return f(stream, state);
+ }
+
+ function nextUntilUnescaped(stream, end) {
+ var escaped = false, next;
+ while ((next = stream.next()) != null) {
+ if (next == end && !escaped)
+ return false;
+ escaped = !escaped && next == "\\";
+ }
+ return escaped;
+ }
+
+ // Used as scratch variables to communicate multiple values without
+ // consing up tons of objects.
+ var type, content;
+ function ret(tp, style, cont) {
+ type = tp; content = cont;
+ return style;
+ }
+
+ function jsTokenBase(stream, state) {
+ var ch = stream.next();
+ if (ch == '"' || ch == "'")
+ return chain(stream, state, jsTokenString(ch));
+ else if (/[\[\]{}\(\),;\:\.]/.test(ch))
+ return ret(ch);
+ else if (ch == "0" && stream.eat(/x/i)) {
+ stream.eatWhile(/[\da-f]/i);
+ return ret("number", "number");
+ }
+ else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
+ stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
+ return ret("number", "number");
+ }
+ else if (ch == "/") {
+ if (stream.eat("*")) {
+ return chain(stream, state, jsTokenComment);
+ }
+ else if (stream.eat("/")) {
+ stream.skipToEnd();
+ return ret("comment", "comment");
+ }
+ else if (state.reAllowed) {
+ nextUntilUnescaped(stream, "/");
+ stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
+ return ret("regexp", "string-2");
+ }
+ else {
+ stream.eatWhile(isOperatorChar);
+ return ret("operator", null, stream.current());
+ }
+ }
+ else if (ch == "#") {
+ stream.skipToEnd();
+ return ret("error", "error");
+ }
+ else if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return ret("operator", null, stream.current());
+ }
+ else {
+ stream.eatWhile(/[\w\$_]/);
+ var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
+ return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
+ ret("variable", "variable", word);
+ }
+ }
+
+ function jsTokenString(quote) {
+ return function(stream, state) {
+ if (!nextUntilUnescaped(stream, quote))
+ state.tokenize = jsTokenBase;
+ return ret("string", "string");
+ };
+ }
+
+ function jsTokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "/" && maybeEnd) {
+ state.tokenize = jsTokenBase;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return ret("comment", "comment");
+ }
+
+ // Parser
+
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
+
+ function JSLexical(indented, column, type, align, prev, info) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.prev = prev;
+ this.info = info;
+ if (align != null) this.align = align;
+ }
+
+ function inScope(state, varname) {
+ for (var v = state.localVars; v; v = v.next)
+ if (v.name == varname) return true;
+ }
+
+ function parseJS(state, style, type, content, stream) {
+ var cc = state.cc;
+ // Communicate our context to the combinators.
+ // (Less wasteful than consing up a hundred closures on every call.)
+ cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
+
+ if (!state.lexical.hasOwnProperty("align"))
+ state.lexical.align = true;
+
+ while(true) {
+ var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
+ if (combinator(type, content)) {
+ while(cc.length && cc[cc.length - 1].lex)
+ cc.pop()();
+ if (cx.marked) return cx.marked;
+ if (type == "variable" && inScope(state, content)) return "variable-2";
+ return style;
+ }
+ }
+ }
+
+ // Combinator utils
+
+ var cx = {state: null, column: null, marked: null, cc: null};
+ function pass() {
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
+ }
+ function cont() {
+ pass.apply(null, arguments);
+ return true;
+ }
+ function register(varname) {
+ var state = cx.state;
+ if (state.context) {
+ cx.marked = "def";
+ for (var v = state.localVars; v; v = v.next)
+ if (v.name == varname) return;
+ state.localVars = {name: varname, next: state.localVars};
+ }
+ }
+
+ // Combinators
+
+ var defaultVars = {name: "this", next: {name: "arguments"}};
+ function pushcontext() {
+ if (!cx.state.context) cx.state.localVars = defaultVars;
+ cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
+ }
+ function popcontext() {
+ cx.state.localVars = cx.state.context.vars;
+ cx.state.context = cx.state.context.prev;
+ }
+ function pushlex(type, info) {
+ var result = function() {
+ var state = cx.state;
+ state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
+ };
+ result.lex = true;
+ return result;
+ }
+ function poplex() {
+ var state = cx.state;
+ if (state.lexical.prev) {
+ if (state.lexical.type == ")")
+ state.indented = state.lexical.indented;
+ state.lexical = state.lexical.prev;
+ }
+ }
+ poplex.lex = true;
+
+ function expect(wanted) {
+ return function expecting(type) {
+ if (type == wanted) return cont();
+ else if (wanted == ";") return pass();
+ else return cont(arguments.callee);
+ };
+ }
+
+ function statement(type) {
+ if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
+ if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
+ if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
+ if (type == "{") return cont(pushlex("}"), block, poplex);
+ if (type == ";") return cont();
+ if (type == "function") return cont(functiondef);
+ if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
+ poplex, statement, poplex);
+ if (type == "variable") return cont(pushlex("stat"), maybelabel);
+ if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
+ block, poplex, poplex);
+ if (type == "case") return cont(expression, expect(":"));
+ if (type == "default") return cont(expect(":"));
+ if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
+ statement, poplex, popcontext);
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
+ }
+ function expression(type) {
+ if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
+ if (type == "function") return cont(functiondef);
+ if (type == "keyword c") return cont(maybeexpression);
+ if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
+ if (type == "operator") return cont(expression);
+ if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
+ if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
+ return cont();
+ }
+ function maybeexpression(type) {
+ if (type.match(/[;\}\)\],]/)) return pass();
+ return pass(expression);
+ }
+
+ function maybeoperator(type, value) {
+ if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
+ if (type == "operator" && value == "?") return cont(expression, expect(":"), expression);
+ if (type == ";") return;
+ if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
+ if (type == ".") return cont(property, maybeoperator);
+ if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
+ }
+ function maybelabel(type) {
+ if (type == ":") return cont(poplex, statement);
+ return pass(maybeoperator, expect(";"), poplex);
+ }
+ function property(type) {
+ if (type == "variable") {cx.marked = "property"; return cont();}
+ }
+ function objprop(type) {
+ if (type == "variable") cx.marked = "property";
+ if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
+ }
+ function commasep(what, end) {
+ function proceed(type) {
+ if (type == ",") return cont(what, proceed);
+ if (type == end) return cont();
+ return cont(expect(end));
+ }
+ return function commaSeparated(type) {
+ if (type == end) return cont();
+ else return pass(what, proceed);
+ };
+ }
+ function block(type) {
+ if (type == "}") return cont();
+ return pass(statement, block);
+ }
+ function vardef1(type, value) {
+ if (type == "variable"){register(value); return cont(vardef2);}
+ return cont();
+ }
+ function vardef2(type, value) {
+ if (value == "=") return cont(expression, vardef2);
+ if (type == ",") return cont(vardef1);
+ }
+ function forspec1(type) {
+ if (type == "var") return cont(vardef1, forspec2);
+ if (type == ";") return pass(forspec2);
+ if (type == "variable") return cont(formaybein);
+ return pass(forspec2);
+ }
+ function formaybein(type, value) {
+ if (value == "in") return cont(expression);
+ return cont(maybeoperator, forspec2);
+ }
+ function forspec2(type, value) {
+ if (type == ";") return cont(forspec3);
+ if (value == "in") return cont(expression);
+ return cont(expression, expect(";"), forspec3);
+ }
+ function forspec3(type) {
+ if (type != ")") cont(expression);
+ }
+ function functiondef(type, value) {
+ if (type == "variable") {register(value); return cont(functiondef);}
+ if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext);
+ }
+ function funarg(type, value) {
+ if (type == "variable") {register(value); return cont();}
+ }
+
+ // Interface
+
+ return {
+ startState: function(basecolumn) {
+ return {
+ tokenize: jsTokenBase,
+ reAllowed: true,
+ kwAllowed: true,
+ cc: [],
+ lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
+ localVars: parserConfig.localVars,
+ context: parserConfig.localVars && {vars: parserConfig.localVars},
+ indented: 0
+ };
+ },
+
+ token: function(stream, state) {
+ if (stream.sol()) {
+ if (!state.lexical.hasOwnProperty("align"))
+ state.lexical.align = false;
+ state.indented = stream.indentation();
+ }
+ if (stream.eatSpace()) return null;
+ var style = state.tokenize(stream, state);
+ if (type == "comment") return style;
+ state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/));
+ state.kwAllowed = type != '.';
+ return parseJS(state, style, type, content, stream);
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize != jsTokenBase) return 0;
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
+ if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
+ var type = lexical.type, closing = firstChar == type;
+ if (type == "vardef") return lexical.indented + 4;
+ else if (type == "form" && firstChar == "{") return lexical.indented;
+ else if (type == "stat" || type == "form") return lexical.indented + indentUnit;
+ else if (lexical.info == "switch" && !closing)
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
+ else if (lexical.align) return lexical.column + (closing ? 0 : 1);
+ else return lexical.indented + (closing ? 0 : indentUnit);
+ },
+
+ electricChars: ":{}"
+ };
+});
+
+CodeMirror.defineMIME("text/javascript", "javascript");
+CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
diff --git a/applications/admin/static/codemirror/mode/less/index.html b/applications/admin/static/codemirror/mode/less/index.html
new file mode 100644
index 00000000..69467bbb
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/less/index.html
@@ -0,0 +1,740 @@
+
+
+
+
+ CodeMirror: LESS mode
+
+
+
+
+
+
+
+
+
CodeMirror: LESS mode
+
+
+
+
MIME types defined:text/x-less, text/css (if not previously defined).
+
+
diff --git a/applications/admin/static/codemirror/mode/less/less.js b/applications/admin/static/codemirror/mode/less/less.js
new file mode 100644
index 00000000..70cd5c93
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/less/less.js
@@ -0,0 +1,266 @@
+/*
+ LESS mode - http://www.lesscss.org/
+ Ported to CodeMirror by Peter Kroon
+ Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues GitHub: @peterkroon
+*/
+
+CodeMirror.defineMode("less", function(config) {
+ var indentUnit = config.indentUnit, type;
+ function ret(style, tp) {type = tp; return style;}
+ //html tags
+ var tags = "a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption cite code col colgroup command datalist dd del details dfn dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins keygen kbd label legend li link map mark menu meta meter nav noframes noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td textarea tfoot th thead time title tr track tt u ul var video wbr".split(' ');
+
+ function inTagsArray(val){
+ for(var i=0; i*\/]/.test(ch)) {
+ if(stream.peek() == "=" || type == "a")return ret("string", "string");
+ return ret(null, "select-op");
+ }
+ else if (/[;{}:\[\]()~\|]/.test(ch)) {
+ if(ch == ":"){
+ stream.eatWhile(/[a-z\\\-]/);
+ if( selectors.test(stream.current()) ){
+ return ret("tag", "tag");
+ }else if(stream.peek() == ":"){//::-webkit-search-decoration
+ stream.next();
+ stream.eatWhile(/[a-z\\\-]/);
+ if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret("string", "string");
+ if( selectors.test(stream.current().substring(1)) )return ret("tag", "tag");
+ return ret(null, ch);
+ }else{
+ return ret(null, ch);
+ }
+ }else if(ch == "~"){
+ if(type == "r")return ret("string", "string");
+ }else{
+ return ret(null, ch);
+ }
+ }
+ else if (ch == ".") {
+ if(type == "(" || type == "string")return ret("string", "string"); // allow url(../image.png)
+ stream.eatWhile(/[\a-zA-Z0-9\-_]/);
+ if(stream.peek() == " ")stream.eatSpace();
+ if(stream.peek() == ")")return ret("number", "unit");//rgba(0,0,0,.25);
+ return ret("tag", "tag");
+ }
+ else if (ch == "#") {
+ //we don't eat white-space, we want the hex color and or id only
+ stream.eatWhile(/[A-Za-z0-9]/);
+ //check if there is a proper hex color length e.g. #eee || #eeeEEE
+ if(stream.current().length == 4 || stream.current().length == 7){
+ if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream
+ //when not a valid hex value, parse as id
+ if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret("atom", "tag");
+ //eat white-space
+ stream.eatSpace();
+ //when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,]
+ if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) )return ret("atom", "tag");
+ //#time { color: #aaa }
+ else if(stream.peek() == "}" )return ret("number", "unit");
+ //we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa
+ else if( /[a-zA-Z\\]/.test(stream.peek()) )return ret("atom", "tag");
+ //when a hex value is on the end of a line, parse as id
+ else if(stream.eol())return ret("atom", "tag");
+ //default
+ else return ret("number", "unit");
+ }else{//when not a valid hexvalue in the current stream e.g. #footer
+ stream.eatWhile(/[\w\\\-]/);
+ return ret("atom", "tag");
+ }
+ }else{//when not a valid hexvalue length
+ stream.eatWhile(/[\w\\\-]/);
+ return ret("atom", "tag");
+ }
+ }
+ else if (ch == "&") {
+ stream.eatWhile(/[\w\-]/);
+ return ret(null, ch);
+ }
+ else {
+ stream.eatWhile(/[\w\\\-_%.{]/);
+ if(type == "string"){
+ return ret("string", "string");
+ }else if(stream.current().match(/(^http$|^https$)/) != null){
+ stream.eatWhile(/[\w\\\-_%.{:\/]/);
+ return ret("string", "string");
+ }else if(stream.peek() == "<" || stream.peek() == ">"){
+ return ret("tag", "tag");
+ }else if( /\(/.test(stream.peek()) ){
+ return ret(null, ch);
+ }else if (stream.peek() == "/" && state.stack[state.stack.length-1] != undefined){ // url(dir/center/image.png)
+ return ret("string", "string");
+ }else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign
+ //commment out these 2 comment if you want the minus sign to be parsed as null -500px
+ //stream.backUp(stream.current().length-1);
+ //return ret(null, ch); //console.log( stream.current() );
+ return ret("number", "unit");
+ }else if( inTagsArray(stream.current().toLowerCase()) ){ // match html tags
+ return ret("tag", "tag");
+ }else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){
+ if(stream.current().substring(stream.current().length-1,stream.current().length) == "{"){
+ stream.backUp(1);
+ return ret("tag", "tag");
+ }//end if
+ stream.eatSpace();
+ if( /[{<>.a-zA-Z\/]/.test(stream.peek()) || stream.eol() )return ret("tag", "tag"); // e.g. button.icon-plus
+ return ret("string", "string"); // let url(/images/logo.png) without quotes return as string
+ }else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){
+ if(stream.current().substring(stream.current().length-1,stream.current().length) == "{")stream.backUp(1);
+ return ret("tag", "tag");
+ }else if(type == "compare" || type == "a" || type == "("){
+ return ret("string", "string");
+ }else if(type == "|" || stream.current() == "-" || type == "["){
+ return ret(null, ch);
+ }else if(stream.peek() == ":") {
+ stream.next();
+ var t_v = stream.peek() == ":" ? true : false;
+ if(!t_v){
+ var old_pos = stream.pos;
+ var sc = stream.current().length;
+ stream.eatWhile(/[a-z\\\-]/);
+ var new_pos = stream.pos;
+ if(stream.current().substring(sc-1).match(selectors) != null){
+ stream.backUp(new_pos-(old_pos-1));
+ return ret("tag", "tag");
+ } else stream.backUp(new_pos-(old_pos-1));
+ }else{
+ stream.backUp(1);
+ }
+ if(t_v)return ret("tag", "tag"); else return ret("variable", "variable");
+ }else{
+ return ret("variable", "variable");
+ }
+ }
+ }
+
+ function tokenSComment(stream, state) { // SComment = Slash comment
+ stream.skipToEnd();
+ state.tokenize = tokenBase;
+ return ret("comment", "comment");
+ }
+
+ function tokenCComment(stream, state) {
+ var maybeEnd = false, ch;
+ while ((ch = stream.next()) != null) {
+ if (maybeEnd && ch == "/") {
+ state.tokenize = tokenBase;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return ret("comment", "comment");
+ }
+
+ function tokenSGMLComment(stream, state) {
+ var dashes = 0, ch;
+ while ((ch = stream.next()) != null) {
+ if (dashes >= 2 && ch == ">") {
+ state.tokenize = tokenBase;
+ break;
+ }
+ dashes = (ch == "-") ? dashes + 1 : 0;
+ }
+ return ret("comment", "comment");
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, ch;
+ while ((ch = stream.next()) != null) {
+ if (ch == quote && !escaped)
+ break;
+ escaped = !escaped && ch == "\\";
+ }
+ if (!escaped) state.tokenize = tokenBase;
+ return ret("string", "string");
+ };
+ }
+
+ return {
+ startState: function(base) {
+ return {tokenize: tokenBase,
+ baseIndent: base || 0,
+ stack: []};
+ },
+
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null;
+ var style = state.tokenize(stream, state);
+
+ var context = state.stack[state.stack.length-1];
+ if (type == "hash" && context == "rule") style = "atom";
+ else if (style == "variable") {
+ if (context == "rule") style = null; //"tag"
+ else if (!context || context == "@media{") {
+ style = stream.current() == "when" ? "variable" :
+ /[\s,|\s\)|\s]/.test(stream.peek()) ? "tag" : type;
+ }
+ }
+
+ if (context == "rule" && /^[\{\};]$/.test(type))
+ state.stack.pop();
+ if (type == "{") {
+ if (context == "@media") state.stack[state.stack.length-1] = "@media{";
+ else state.stack.push("{");
+ }
+ else if (type == "}") state.stack.pop();
+ else if (type == "@media") state.stack.push("@media");
+ else if (context == "{" && type != "comment") state.stack.push("rule");
+ return style;
+ },
+
+ indent: function(state, textAfter) {
+ var n = state.stack.length;
+ if (/^\}/.test(textAfter))
+ n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;
+ return state.baseIndent + n * indentUnit;
+ },
+
+ electricChars: "}"
+ };
+});
+
+CodeMirror.defineMIME("text/x-less", "less");
+if (!CodeMirror.mimeModes.hasOwnProperty("text/css"))
+ CodeMirror.defineMIME("text/css", "less");
\ No newline at end of file
diff --git a/applications/admin/static/codemirror/mode/python/LICENSE.txt b/applications/admin/static/codemirror/mode/python/LICENSE.txt
new file mode 100644
index 00000000..918866b4
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/python/LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2010 Timothy Farrell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/applications/admin/static/codemirror/mode/python/index.html b/applications/admin/static/codemirror/mode/python/index.html
new file mode 100644
index 00000000..9f1164e2
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/python/index.html
@@ -0,0 +1,123 @@
+
+
+
+
+ CodeMirror: Python mode
+
+
+
+
+
+
+
+
CodeMirror: Python mode
+
+
+
+
Configuration Options:
+
+
version - 2/3 - The version of Python to recognize. Default is 2.
+
singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
+
+
+
MIME types defined:text/x-python.
+
+
diff --git a/applications/admin/static/codemirror/mode/python/python.js b/applications/admin/static/codemirror/mode/python/python.js
new file mode 100644
index 00000000..fc5b9551
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/python/python.js
@@ -0,0 +1,338 @@
+CodeMirror.defineMode("python", function(conf, parserConf) {
+ var ERRORCLASS = 'error';
+
+ function wordRegexp(words) {
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
+ }
+
+ var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
+ var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]');
+ var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
+ var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
+ var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
+ var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
+
+ var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']);
+ var commonkeywords = ['as', 'assert', 'break', 'class', 'continue',
+ 'def', 'del', 'elif', 'else', 'except', 'finally',
+ 'for', 'from', 'global', 'if', 'import',
+ 'lambda', 'pass', 'raise', 'return',
+ 'try', 'while', 'with', 'yield'];
+ var commonBuiltins = ['abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'callable', 'chr',
+ 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod',
+ 'enumerate', 'eval', 'filter', 'float', 'format', 'frozenset',
+ 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id',
+ 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len',
+ 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next',
+ 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
+ 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
+ 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple',
+ 'type', 'vars', 'zip', '__import__', 'NotImplemented',
+ 'Ellipsis', '__debug__'];
+ var py2 = {'builtins': ['apply', 'basestring', 'buffer', 'cmp', 'coerce', 'execfile',
+ 'file', 'intern', 'long', 'raw_input', 'reduce', 'reload',
+ 'unichr', 'unicode', 'xrange', 'False', 'True', 'None'],
+ 'keywords': ['exec', 'print']};
+ var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'],
+ 'keywords': ['nonlocal', 'False', 'True', 'None']};
+
+ if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) {
+ commonkeywords = commonkeywords.concat(py3.keywords);
+ commonBuiltins = commonBuiltins.concat(py3.builtins);
+ var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i");
+ } else {
+ commonkeywords = commonkeywords.concat(py2.keywords);
+ commonBuiltins = commonBuiltins.concat(py2.builtins);
+ var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
+ }
+ var keywords = wordRegexp(commonkeywords);
+ var builtins = wordRegexp(commonBuiltins);
+
+ var indentInfo = null;
+
+ // tokenizers
+ function tokenBase(stream, state) {
+ // Handle scope changes
+ if (stream.sol()) {
+ var scopeOffset = state.scopes[0].offset;
+ if (stream.eatSpace()) {
+ var lineOffset = stream.indentation();
+ if (lineOffset > scopeOffset) {
+ indentInfo = 'indent';
+ } else if (lineOffset < scopeOffset) {
+ indentInfo = 'dedent';
+ }
+ return null;
+ } else {
+ if (scopeOffset > 0) {
+ dedent(stream, state);
+ }
+ }
+ }
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ var ch = stream.peek();
+
+ // Handle Comments
+ if (ch === '#') {
+ stream.skipToEnd();
+ return 'comment';
+ }
+
+ // Handle Number Literals
+ if (stream.match(/^[0-9\.]/, false)) {
+ var floatLiteral = false;
+ // Floats
+ if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; }
+ if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }
+ if (stream.match(/^\.\d+/)) { floatLiteral = true; }
+ if (floatLiteral) {
+ // Float literals may be "imaginary"
+ stream.eat(/J/i);
+ return 'number';
+ }
+ // Integers
+ var intLiteral = false;
+ // Hex
+ if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }
+ // Binary
+ if (stream.match(/^0b[01]+/i)) { intLiteral = true; }
+ // Octal
+ if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }
+ // Decimal
+ if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
+ // Decimal literals may be "imaginary"
+ stream.eat(/J/i);
+ // TODO - Can you have imaginary longs?
+ intLiteral = true;
+ }
+ // Zero by itself with no other piece of number.
+ if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
+ if (intLiteral) {
+ // Integer literals may be "long"
+ stream.eat(/L/i);
+ return 'number';
+ }
+ }
+
+ // Handle Strings
+ if (stream.match(stringPrefixes)) {
+ state.tokenize = tokenStringFactory(stream.current());
+ return state.tokenize(stream, state);
+ }
+
+ // Handle operators and Delimiters
+ if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) {
+ return null;
+ }
+ if (stream.match(doubleOperators)
+ || stream.match(singleOperators)
+ || stream.match(wordOperators)) {
+ return 'operator';
+ }
+ if (stream.match(singleDelimiters)) {
+ return null;
+ }
+
+ if (stream.match(keywords)) {
+ return 'keyword';
+ }
+
+ if (stream.match(builtins)) {
+ return 'builtin';
+ }
+
+ if (stream.match(identifiers)) {
+ return 'variable';
+ }
+
+ // Handle non-detected items
+ stream.next();
+ return ERRORCLASS;
+ }
+
+ function tokenStringFactory(delimiter) {
+ while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
+ delimiter = delimiter.substr(1);
+ }
+ var singleline = delimiter.length == 1;
+ var OUTCLASS = 'string';
+
+ return function tokenString(stream, state) {
+ while (!stream.eol()) {
+ stream.eatWhile(/[^'"\\]/);
+ if (stream.eat('\\')) {
+ stream.next();
+ if (singleline && stream.eol()) {
+ return OUTCLASS;
+ }
+ } else if (stream.match(delimiter)) {
+ state.tokenize = tokenBase;
+ return OUTCLASS;
+ } else {
+ stream.eat(/['"]/);
+ }
+ }
+ if (singleline) {
+ if (parserConf.singleLineStringErrors) {
+ return ERRORCLASS;
+ } else {
+ state.tokenize = tokenBase;
+ }
+ }
+ return OUTCLASS;
+ };
+ }
+
+ function indent(stream, state, type) {
+ type = type || 'py';
+ var indentUnit = 0;
+ if (type === 'py') {
+ if (state.scopes[0].type !== 'py') {
+ state.scopes[0].offset = stream.indentation();
+ return;
+ }
+ for (var i = 0; i < state.scopes.length; ++i) {
+ if (state.scopes[i].type === 'py') {
+ indentUnit = state.scopes[i].offset + conf.indentUnit;
+ break;
+ }
+ }
+ } else {
+ indentUnit = stream.column() + stream.current().length;
+ }
+ state.scopes.unshift({
+ offset: indentUnit,
+ type: type
+ });
+ }
+
+ function dedent(stream, state, type) {
+ type = type || 'py';
+ if (state.scopes.length == 1) return;
+ if (state.scopes[0].type === 'py') {
+ var _indent = stream.indentation();
+ var _indent_index = -1;
+ for (var i = 0; i < state.scopes.length; ++i) {
+ if (_indent === state.scopes[i].offset) {
+ _indent_index = i;
+ break;
+ }
+ }
+ if (_indent_index === -1) {
+ return true;
+ }
+ while (state.scopes[0].offset !== _indent) {
+ state.scopes.shift();
+ }
+ return false;
+ } else {
+ if (type === 'py') {
+ state.scopes[0].offset = stream.indentation();
+ return false;
+ } else {
+ if (state.scopes[0].type != type) {
+ return true;
+ }
+ state.scopes.shift();
+ return false;
+ }
+ }
+ }
+
+ function tokenLexer(stream, state) {
+ indentInfo = null;
+ var style = state.tokenize(stream, state);
+ var current = stream.current();
+
+ // Handle '.' connected identifiers
+ if (current === '.') {
+ style = stream.match(identifiers, false) ? null : ERRORCLASS;
+ if (style === null && state.lastToken === 'meta') {
+ // Apply 'meta' style to '.' connected identifiers when
+ // appropriate.
+ style = 'meta';
+ }
+ return style;
+ }
+
+ // Handle decorators
+ if (current === '@') {
+ return stream.match(identifiers, false) ? 'meta' : ERRORCLASS;
+ }
+
+ if ((style === 'variable' || style === 'builtin')
+ && state.lastToken === 'meta') {
+ style = 'meta';
+ }
+
+ // Handle scope changes.
+ if (current === 'pass' || current === 'return') {
+ state.dedent += 1;
+ }
+ if (current === 'lambda') state.lambda = true;
+ if ((current === ':' && !state.lambda && state.scopes[0].type == 'py')
+ || indentInfo === 'indent') {
+ indent(stream, state);
+ }
+ var delimiter_index = '[({'.indexOf(current);
+ if (delimiter_index !== -1) {
+ indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1));
+ }
+ if (indentInfo === 'dedent') {
+ if (dedent(stream, state)) {
+ return ERRORCLASS;
+ }
+ }
+ delimiter_index = '])}'.indexOf(current);
+ if (delimiter_index !== -1) {
+ if (dedent(stream, state, current)) {
+ return ERRORCLASS;
+ }
+ }
+ if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') {
+ if (state.scopes.length > 1) state.scopes.shift();
+ state.dedent -= 1;
+ }
+
+ return style;
+ }
+
+ var external = {
+ startState: function(basecolumn) {
+ return {
+ tokenize: tokenBase,
+ scopes: [{offset:basecolumn || 0, type:'py'}],
+ lastToken: null,
+ lambda: false,
+ dedent: 0
+ };
+ },
+
+ token: function(stream, state) {
+ var style = tokenLexer(stream, state);
+
+ state.lastToken = style;
+
+ if (stream.eol() && stream.lambda) {
+ state.lambda = false;
+ }
+
+ return style;
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize != tokenBase) {
+ return 0;
+ }
+
+ return state.scopes[0].offset;
+ }
+
+ };
+ return external;
+});
+
+CodeMirror.defineMIME("text/x-python", "python");
diff --git a/applications/admin/static/codemirror/mode/xml/index.html b/applications/admin/static/codemirror/mode/xml/index.html
new file mode 100644
index 00000000..9628d954
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/xml/index.html
@@ -0,0 +1,45 @@
+
+
+
+
+ CodeMirror: XML mode
+
+
+
+
+
+
+
+
CodeMirror: XML mode
+
+
+
The XML mode supports two configuration parameters:
+
+
htmlMode (boolean)
+
This switches the mode to parse HTML instead of XML. This
+ means attributes do not have to be quoted, and some elements
+ (such as br) do not require a closing tag.
+
alignCDATA (boolean)
+
Setting this to true will force the opening tag of CDATA
+ blocks to not be indented.
+
+
+
MIME types defined:application/xml, text/html.
+
+
diff --git a/applications/admin/static/codemirror/mode/xml/xml.js b/applications/admin/static/codemirror/mode/xml/xml.js
new file mode 100644
index 00000000..cd69f62f
--- /dev/null
+++ b/applications/admin/static/codemirror/mode/xml/xml.js
@@ -0,0 +1,326 @@
+CodeMirror.defineMode("xml", function(config, parserConfig) {
+ var indentUnit = config.indentUnit;
+ var Kludges = parserConfig.htmlMode ? {
+ autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
+ 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
+ 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
+ 'track': true, 'wbr': true},
+ implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
+ 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
+ 'th': true, 'tr': true},
+ contextGrabbers: {
+ 'dd': {'dd': true, 'dt': true},
+ 'dt': {'dd': true, 'dt': true},
+ 'li': {'li': true},
+ 'option': {'option': true, 'optgroup': true},
+ 'optgroup': {'optgroup': true},
+ 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
+ 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
+ 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
+ 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
+ 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
+ 'rp': {'rp': true, 'rt': true},
+ 'rt': {'rp': true, 'rt': true},
+ 'tbody': {'tbody': true, 'tfoot': true},
+ 'td': {'td': true, 'th': true},
+ 'tfoot': {'tbody': true},
+ 'th': {'td': true, 'th': true},
+ 'thead': {'tbody': true, 'tfoot': true},
+ 'tr': {'tr': true}
+ },
+ doNotIndent: {"pre": true},
+ allowUnquoted: true,
+ allowMissing: true
+ } : {
+ autoSelfClosers: {},
+ implicitlyClosed: {},
+ contextGrabbers: {},
+ doNotIndent: {},
+ allowUnquoted: false,
+ allowMissing: false
+ };
+ var alignCDATA = parserConfig.alignCDATA;
+
+ // Return variables for tokenizers
+ var tagName, type;
+
+ function inText(stream, state) {
+ function chain(parser) {
+ state.tokenize = parser;
+ return parser(stream, state);
+ }
+
+ var ch = stream.next();
+ if (ch == "<") {
+ if (stream.eat("!")) {
+ if (stream.eat("[")) {
+ if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
+ else return null;
+ }
+ else if (stream.match("--")) return chain(inBlock("comment", "-->"));
+ else if (stream.match("DOCTYPE", true, true)) {
+ stream.eatWhile(/[\w\._\-]/);
+ return chain(doctype(1));
+ }
+ else return null;
+ }
+ else if (stream.eat("?")) {
+ stream.eatWhile(/[\w\._\-]/);
+ state.tokenize = inBlock("meta", "?>");
+ return "meta";
+ }
+ else {
+ type = stream.eat("/") ? "closeTag" : "openTag";
+ stream.eatSpace();
+ tagName = "";
+ var c;
+ while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
+ state.tokenize = inTag;
+ return "tag";
+ }
+ }
+ else if (ch == "&") {
+ var ok;
+ if (stream.eat("#")) {
+ if (stream.eat("x")) {
+ ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
+ } else {
+ ok = stream.eatWhile(/[\d]/) && stream.eat(";");
+ }
+ } else {
+ ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
+ }
+ return ok ? "atom" : "error";
+ }
+ else {
+ stream.eatWhile(/[^&<]/);
+ return null;
+ }
+ }
+
+ function inTag(stream, state) {
+ var ch = stream.next();
+ if (ch == ">" || (ch == "/" && stream.eat(">"))) {
+ state.tokenize = inText;
+ type = ch == ">" ? "endTag" : "selfcloseTag";
+ return "tag";
+ }
+ else if (ch == "=") {
+ type = "equals";
+ return null;
+ }
+ else if (/[\'\"]/.test(ch)) {
+ state.tokenize = inAttribute(ch);
+ return state.tokenize(stream, state);
+ }
+ else {
+ stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);
+ return "word";
+ }
+ }
+
+ function inAttribute(quote) {
+ return function(stream, state) {
+ while (!stream.eol()) {
+ if (stream.next() == quote) {
+ state.tokenize = inTag;
+ break;
+ }
+ }
+ return "string";
+ };
+ }
+
+ function inBlock(style, terminator) {
+ return function(stream, state) {
+ while (!stream.eol()) {
+ if (stream.match(terminator)) {
+ state.tokenize = inText;
+ break;
+ }
+ stream.next();
+ }
+ return style;
+ };
+ }
+ function doctype(depth) {
+ return function(stream, state) {
+ var ch;
+ while ((ch = stream.next()) != null) {
+ if (ch == "<") {
+ state.tokenize = doctype(depth + 1);
+ return state.tokenize(stream, state);
+ } else if (ch == ">") {
+ if (depth == 1) {
+ state.tokenize = inText;
+ break;
+ } else {
+ state.tokenize = doctype(depth - 1);
+ return state.tokenize(stream, state);
+ }
+ }
+ }
+ return "meta";
+ };
+ }
+
+ var curState, setStyle;
+ function pass() {
+ for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
+ }
+ function cont() {
+ pass.apply(null, arguments);
+ return true;
+ }
+
+ function pushContext(tagName, startOfLine) {
+ var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
+ curState.context = {
+ prev: curState.context,
+ tagName: tagName,
+ indent: curState.indented,
+ startOfLine: startOfLine,
+ noIndent: noIndent
+ };
+ }
+ function popContext() {
+ if (curState.context) curState.context = curState.context.prev;
+ }
+
+ function element(type) {
+ if (type == "openTag") {
+ curState.tagName = tagName;
+ return cont(attributes, endtag(curState.startOfLine));
+ } else if (type == "closeTag") {
+ var err = false;
+ if (curState.context) {
+ if (curState.context.tagName != tagName) {
+ if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
+ popContext();
+ }
+ err = !curState.context || curState.context.tagName != tagName;
+ }
+ } else {
+ err = true;
+ }
+ if (err) setStyle = "error";
+ return cont(endclosetag(err));
+ }
+ return cont();
+ }
+ function endtag(startOfLine) {
+ return function(type) {
+ if (type == "selfcloseTag" ||
+ (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) {
+ maybePopContext(curState.tagName.toLowerCase());
+ return cont();
+ }
+ if (type == "endTag") {
+ maybePopContext(curState.tagName.toLowerCase());
+ pushContext(curState.tagName, startOfLine);
+ return cont();
+ }
+ return cont();
+ };
+ }
+ function endclosetag(err) {
+ return function(type) {
+ if (err) setStyle = "error";
+ if (type == "endTag") { popContext(); return cont(); }
+ setStyle = "error";
+ return cont(arguments.callee);
+ };
+ }
+ function maybePopContext(nextTagName) {
+ var parentTagName;
+ while (true) {
+ if (!curState.context) {
+ return;
+ }
+ parentTagName = curState.context.tagName.toLowerCase();
+ if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
+ !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
+ return;
+ }
+ popContext();
+ }
+ }
+
+ function attributes(type) {
+ if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
+ if (type == "endTag" || type == "selfcloseTag") return pass();
+ setStyle = "error";
+ return cont(attributes);
+ }
+ function attribute(type) {
+ if (type == "equals") return cont(attvalue, attributes);
+ if (!Kludges.allowMissing) setStyle = "error";
+ return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
+ }
+ function attvalue(type) {
+ if (type == "string") return cont(attvaluemaybe);
+ if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
+ setStyle = "error";
+ return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
+ }
+ function attvaluemaybe(type) {
+ if (type == "string") return cont(attvaluemaybe);
+ else return pass();
+ }
+
+ return {
+ startState: function() {
+ return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
+ },
+
+ token: function(stream, state) {
+ if (stream.sol()) {
+ state.startOfLine = true;
+ state.indented = stream.indentation();
+ }
+ if (stream.eatSpace()) return null;
+
+ setStyle = type = tagName = null;
+ var style = state.tokenize(stream, state);
+ state.type = type;
+ if ((style || type) && style != "comment") {
+ curState = state;
+ while (true) {
+ var comb = state.cc.pop() || element;
+ if (comb(type || style)) break;
+ }
+ }
+ state.startOfLine = false;
+ return setStyle || style;
+ },
+
+ indent: function(state, textAfter, fullLine) {
+ var context = state.context;
+ if ((state.tokenize != inTag && state.tokenize != inText) ||
+ context && context.noIndent)
+ return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
+ if (alignCDATA && /
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+.cm-s-xq-dark { background: #0a001f; color: #f8f8f8; }
+.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }
+.cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
+.cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; }
+.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
+
+.cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
+.cm-s-xq-dark span.cm-atom {color: #6C8CD5;}
+.cm-s-xq-dark span.cm-number {color: #164;}
+.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}
+.cm-s-xq-dark span.cm-variable {color: #FFF;}
+.cm-s-xq-dark span.cm-variable-2 {color: #EEE;}
+.cm-s-xq-dark span.cm-variable-3 {color: #DDD;}
+.cm-s-xq-dark span.cm-property {}
+.cm-s-xq-dark span.cm-operator {}
+.cm-s-xq-dark span.cm-comment {color: gray;}
+.cm-s-xq-dark span.cm-string {color: #9FEE00;}
+.cm-s-xq-dark span.cm-meta {color: yellow;}
+.cm-s-xq-dark span.cm-error {color: #f00;}
+.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
+.cm-s-xq-dark span.cm-builtin {color: #30a;}
+.cm-s-xq-dark span.cm-bracket {color: #cc7;}
+.cm-s-xq-dark span.cm-tag {color: #FFBD40;}
+.cm-s-xq-dark span.cm-attribute {color: #FFF700;}
diff --git a/applications/admin/views/default/edit.html b/applications/admin/views/default/edit.html
index 2456aa22..1977b683 100644
--- a/applications/admin/views/default/edit.html
+++ b/applications/admin/views/default/edit.html
@@ -4,9 +4,23 @@
def shortcut(combo, description):
return XML('
From 22fbf70aaefa11ce5b3203aeb2fccff7f873ddfa Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Sat, 8 Sep 2012 22:22:06 -0500
Subject: [PATCH 20/37] auth.wiki(render='html')
---
VERSION | 2 +-
gluon/contrib/markmin/markmin2html.py | 43 ++++++++++++++++-----------
gluon/tools.py | 12 ++++++++
3 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/VERSION b/VERSION
index e64a7abe..5ff93dea 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-08 21:59:44) stable
+Version 2.0.8 (2012-09-08 22:22:02) stable
diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py
index ab75aeb5..bde911fb 100755
--- a/gluon/contrib/markmin/markmin2html.py
+++ b/gluon/contrib/markmin/markmin2html.py
@@ -559,6 +559,29 @@ def markmin_escape(text):
return regex_markmin_escape.sub(
lambda m: '\\'+m.group(0).replace('\\','\\\\'), text)
+def replace_autolinks(text,autolinks):
+ return regex_auto.sub(lambda m: autolinks(m.group('k')), text)
+
+def replace_at_urls(text,url):
+ # this is experimental @{function/args}
+ # turns into a digitally signed URL
+ def u1(match,url=url):
+ a,c,f,args = match.group('a','c','f','args')
+ return url(a=a or None,c=c or None,f = f or None,
+ args=args.split('/'), scheme=True, host=True)
+ return regex_URL.sub(u1,text)
+
+def replace_components(text,env):
+ def u2(match, env=env):
+ f = env.get(match.group('a'), match.group(0))
+ if callable(f):
+ try:
+ f = f(match.group('b'))
+ except Exception, e:
+ f = 'ERROR: %s' % e
+ return str(f)
+ return regex_env.sub(u2, text)
+
def autolinks_simple(url):
"""
it automatically converts the url to link,
@@ -829,13 +852,7 @@ def render(text,
text = regex_backslash.sub(lambda m: m.group(1).translate(ttab_in), text)
if URL is not None:
- # this is experimental @{function/args}
- # turns into a digitally signed URL
- def u1(match,URL=URL):
- a,c,f,args = match.group('a','c','f','args')
- return URL(a=a or None,c=c or None,f = f or None,
- args=args.split('/'), scheme=True, host=True)
- text = regex_URL.sub(u1,text)
+ text = replace_at_urls(text,URL)
if latex == 'google':
text = regex_dd.sub('``\g``:latex ', text)
@@ -878,7 +895,7 @@ def render(text,
text = regex_proto.sub(lambda m: protolinks(*m.group('p','k')), text)
if autolinks:
- text = regex_auto.sub(lambda m: autolinks(m.group('k')), text)
+ text = replace_autolinks(text,lambda m: autolinks(m.group('k')))
#############################################################
# normalize spaces
@@ -1304,15 +1321,7 @@ def render(text,
text = regex_expand_meta.sub(expand_meta, text)
if environment:
- def u2(match, environment=environment):
- f = environment.get(match.group('a'), match.group(0))
- if callable(f):
- try:
- f = f(match.group('b'))
- except Exception, e:
- f = 'ERROR: %s' % e
- return str(f)
- text = regex_env.sub(u2, text)
+ text = replace_components(text,environment)
return text.translate(ttab_out)
diff --git a/gluon/tools.py b/gluon/tools.py
index 75873cf5..8ae9fe9e 100644
--- a/gluon/tools.py
+++ b/gluon/tools.py
@@ -31,6 +31,8 @@ from utils import web2py_uuid
from fileutils import read_file, check_credentials
from gluon import *
from gluon.contrib.autolinks import expand_one
+from gluon.contrib.markmin.markmin2html import \
+ replace_at_urls, replace_autolinks, replace_components
from gluon.dal import Row
import serializers
@@ -4486,6 +4488,15 @@ class Wiki(object):
*[A(t.strip(),_href=URL(args='_search',vars=dict(q=t)))
for t in page.tags or [] if t.strip()]).xml()
return html
+ def html_render(self,page):
+ html = page.body
+ # @///function -> http://..../function
+ html = replace_at_urls(html,URL)
+ # http://...jpg ->
Date: Sat, 8 Sep 2012 23:22:42 -0500
Subject: [PATCH 21/37] codemirror seems to work with admin
---
VERSION | 2 +-
applications/admin/models/0.py | 2 +-
applications/admin/static/js/ajax_editor.js | 184 +++++++++++---------
applications/admin/views/default/edit.html | 15 +-
4 files changed, 110 insertions(+), 93 deletions(-)
diff --git a/VERSION b/VERSION
index 5ff93dea..128b466d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-08 22:22:02) stable
+Version 2.0.8 (2012-09-08 23:22:37) stable
diff --git a/applications/admin/models/0.py b/applications/admin/models/0.py
index 160118cf..4ac46f71 100644
--- a/applications/admin/models/0.py
+++ b/applications/admin/models/0.py
@@ -9,7 +9,7 @@ WEB2PY_VERSION_URL = WEB2PY_URL+'/examples/default/version'
# browser.
## Default editor
-TEXT_EDITOR = 'ace' or 'edit_area' or 'amy'
+TEXT_EDITOR = 'ace' or 'edit_area' or 'amy' or 'codemirror'
## Editor Color scheme (only for ace)
TEXT_EDITOR_THEME = (
"chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn",
diff --git a/applications/admin/static/js/ajax_editor.js b/applications/admin/static/js/ajax_editor.js
index 4edbfd24..cd7923eb 100644
--- a/applications/admin/static/js/ajax_editor.js
+++ b/applications/admin/static/js/ajax_editor.js
@@ -10,14 +10,14 @@ function prepareMultiPartPOST(data) {
var boundary = '' + Math.floor(Math.random()*10000);
var reqdata = '--' + boundary + '\r\n';
//console.log(data.length);
- for (var i=0;i < data.length;i++)
- {
- reqdata += 'content-disposition: form-data; name="' + data[i].Name + '"';
- reqdata += "\r\n\r\n" ;
- reqdata += data[i].Data;
- reqdata += "\r\n" ;
- reqdata += '--' + boundary + '\r\n';
- }
+ for (var i=0;i < data.length;i++) {
+ reqdata += 'content-disposition: form-data; name="';
+ reqdata += data[i].Name + '"';
+ reqdata += "\r\n\r\n" ;
+ reqdata += data[i].Data;
+ reqdata += "\r\n" ;
+ reqdata += '--' + boundary + '\r\n';
+ }
return new Array(reqdata,boundary);
}
@@ -27,101 +27,120 @@ function on_error() {
}
function getData() {
- try {
+ if (window.ace_editor) {
var data = window.ace_editor.getSession().getValue();
- } catch(e) {
- try {
- var data = eamy.instances[0].getText();
- } catch(e) {
- var data = area.textarea.value;
- }
+ } else if (window.mirror) {
+ var data = window.mirror.getValue();
+ } else if (window.eamy) {
+ var data = window.eamy.instances[0].getText();
+ } else if (window.textarea) {
+ var data = textarea.value;
}
return data;
}
function doHighlight(highlight) {
- try {
- window.ace_editor.gotoLine(highlight.lineno);
- } catch(e) {
- editAreaLoader.setSelectionRange('body', highlight.start, highlight.end);
- }
+ if (window.ace_editor) {
+ window.ace_editor.gotoLine(highlight.lineno);
+ } else if (window.mirror) {
+ window.mirror.setSelection({line:highlight.lineno,ch:0},
+ {line:highlight.end,ch:0});
+ } else if (window.eamy) {
+ // not implemented
+ } else if (window.textarea) {
+ editAreaLoader.setSelectionRange('body', highlight.start, highlight.end);
+ }
}
function doClickSave() {
var data = getData();
var dataForPost = prepareMultiPartPOST(new Array(
prepareDataForSave('data', data),
- prepareDataForSave('file_hash', jQuery("input[name='file_hash']").val()),
- prepareDataForSave('saved_on', jQuery("input[name='saved_on']").val()),
- prepareDataForSave('saved_on', jQuery("input[name='saved_on']").val()),
+ prepareDataForSave('file_hash',
+ jQuery("input[name='file_hash']").val()),
+ prepareDataForSave('saved_on',
+ jQuery("input[name='saved_on']").val()),
+ prepareDataForSave('saved_on',
+ jQuery("input[name='saved_on']").val()),
prepareDataForSave('from_ajax','true')));
// console.info(area.textarea.value);
- jQuery("input[name='saved_on']").attr('style','background-color:yellow');
+ jQuery("input[name='saved_on']").attr('style',
+ 'background-color:yellow');
jQuery("input[name='saved_on']").val('saving now...')
jQuery.ajax({
type: "POST",
- contentType: 'multipart/form-data;boundary="' + dataForPost[1] + '"',
+ contentType: 'multipart/form-data;boundary="'
+ + dataForPost[1] + '"',
url: self.location.href,
dataType: "json",
data: dataForPost[0],
timeout: 5000,
beforeSend: function(xhr) {
- xhr.setRequestHeader('web2py-component-location',document.location);
- xhr.setRequestHeader('web2py-component-element','doClickSave');},
+ xhr.setRequestHeader('web2py-component-location',
+ document.location);
+ xhr.setRequestHeader('web2py-component-element',
+ 'doClickSave');
+ },
success: function(json,text,xhr){
// show flash message (if any)
var flash=xhr.getResponseHeader('web2py-component-flash');
- if (flash) jQuery('.flash').html(decodeURIComponent(flash)).slideDown();
- else jQuery('.flash').hide();
+ if (flash) {
+ var flashhtml = decodeURIComponent(flash);
+ jQuery('.flash').html(flashhtml).slideDown();
+ } else jQuery('.flash').hide();
// reenable disabled submit button
var t=jQuery("input[name='save']");
t.attr('class','');
t.attr('disabled','');
-
- try {
- if (json.error) {
- window.location.href=json.redirect;
- } else {
- // console.info( json.file_hash );
- jQuery("input[name='file_hash']").val(json.file_hash);
- jQuery("input[name='saved_on']").val(json.saved_on);
- if (json.highlight) {
- doHighlight(json.highlight);
- } else {
- jQuery("input[name='saved_on']").attr('style','background-color:#99FF99');
- jQuery(".flash").delay(1000).fadeOut('slow');
- }
- // console.info(jQuery("input[name='file_hash']").val());
-
- var output = 'exposes: ';
- for ( var i in json.functions) {
- output += ' ' + json.functions[i] + ',';
- }
- if(output!='exposes: ') {
- jQuery("#exposed").html( output.substring(0, output.length-1));
- }
- }
- } catch(e) {
- on_error();
+ try {
+ if (json.error) {
+ window.location.href=json.redirect;
+ } else {
+ // console.info( json.file_hash );
+ jQuery("input[name='file_hash']").val(json.file_hash);
+ jQuery("input[name='saved_on']").val(json.saved_on);
+ if (json.highlight) {
+ doHighlight(json.highlight);
+ } else {
+ jQuery("input[name='saved_on']").attr('style','background-color:#99FF99');
+ jQuery(".flash").delay(1000).fadeOut('slow');
}
+ // console.info(jQuery("input[name='file_hash']").val());
+ var output = 'exposes: ';
+ for ( var i in json.functions) {
+ output += ' ' + json.functions[i] + ',';
+ }
+ if(output!='exposes: ') {
+ jQuery("#exposed").html( output.substring(0, output.length-1));
+ }
+ }
+ } catch(e) { on_error();}
},
- error: function(json) { on_error(); }
- });
+ error: function(json) { on_error(); }
+ });
return false;
}
function getSelectionRange() {
var sel;
- try {
- sel = {};
+ if (window.ace_editor) {
+ sel = {};
range = window.ace_editor.getSelectionRange();
// passing the line number directly, no need to read the text
sel['start'] = range.start.row;
sel['end'] = range.end.row;
sel['data'] = '';
- } catch(e) {
+ } else if (window.mirror) {
+ sel = {};
+ sel['start'] = window.mirror.getCursor(true).line;
+ sel['end'] = window.mirror.getCursor(false).line;
+ sel['data'] = '';
+ } else if (window.eamy) {
+ sel = {};
+ // not implemented
+ } else if (window.textarea) {
// passing offset, needs the text to calculate the line:
sel = editAreaLoader.getSelectionRange('body');
sel['data'] = getData();
@@ -130,7 +149,7 @@ function getSelectionRange() {
}
function doToggleBreakpoint(filename, url) {
- var sel = getSelectionRange();
+ var sel = getSelectionRange();
var dataForPost = prepareMultiPartPOST(new Array(
prepareDataForSave('filename', filename),
prepareDataForSave('sel_start', sel["start"]),
@@ -138,35 +157,34 @@ function doToggleBreakpoint(filename, url) {
prepareDataForSave('data', sel['data'])));
jQuery.ajax({
type: "POST",
- contentType: 'multipart/form-data;boundary="' + dataForPost[1] + '"',
+ contentType: 'multipart/form-data;boundary="'+dataForPost[1]+'"',
url: url,
dataType: "json",
data: dataForPost[0],
timeout: 5000,
beforeSend: function(xhr) {
- xhr.setRequestHeader('web2py-component-location',document.location);
- xhr.setRequestHeader('web2py-component-element','doSetBreakpoint');},
+ xhr.setRequestHeader('web2py-component-location',
+ document.location);
+ xhr.setRequestHeader('web2py-component-element',
+ 'doSetBreakpoint');},
success: function(json,text,xhr){
-
- // show flash message (if any)
- var flash=xhr.getResponseHeader('web2py-component-flash');
- if (flash) jQuery('.flash').html(decodeURIComponent(flash)).slideDown();
- else jQuery('.flash').hide();
- try {
- if (json.error) {
- window.location.href=json.redirect;
- } else {
- // mark the breakpoint if ok=True, remove mark if ok=False
- // do nothing if ok = null
- // alert(json.ok + json.lineno);
- }
- } catch(e) {
- on_error();
- }
-
+ // show flash message (if any)
+ var flash=xhr.getResponseHeader('web2py-component-flash');
+ if (flash) jQuery('.flash').html(decodeURIComponent(flash)).slideDown();
+ else jQuery('.flash').hide();
+ try {
+ if (json.error) {
+ window.location.href=json.redirect;
+ } else {
+ // mark the breakpoint if ok=True
+ // remove mark if ok=False
+ // do nothing if ok = null
+ // alert(json.ok + json.lineno);
+ }
+ } catch(e) { on_error(); }
},
- error: function(json) { on_error(); }
- });
+ error: function(json) { on_error(); }
+ });
return false;
}
diff --git a/applications/admin/views/default/edit.html b/applications/admin/views/default/edit.html
index 1977b683..ee9426b5 100644
--- a/applications/admin/views/default/edit.html
+++ b/applications/admin/views/default/edit.html
@@ -17,10 +17,7 @@
-
+
{{elif TEXT_EDITOR == 'ace':}}
@@ -127,9 +124,10 @@ jQuery(document).ready(function(){
{{=T('Last saved on:')}}
{{if TEXT_EDITOR == 'amy':}}
-
- {{elif TEXT_EDITOR == 'codemirror':}}
+
+ {{elif TEXT_EDITOR == 'codemirror':}}
+
{{cm_mode = {'html':'htmlmixed'}.get(filetype,filetype)}}
{{elif TEXT_EDITOR == 'ace':}}
{{=data}}
@@ -166,9 +165,9 @@ window.onload = function() {
window.ace_editor = editor;
};
-
{{else:}}
+
{{pass}}
{{=T('currently saved or')}}
{{=T('to previous version.')}}
From d82f91c0ec3deae254273f0f958b84456af0bf8a Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Sun, 9 Sep 2012 09:14:50 -0500
Subject: [PATCH 22/37] fixed a bug and replace div anchor with span anchor, as
suggested by Vladyslav
---
VERSION | 2 +-
gluon/contrib/markmin/markmin2html.py | 29 ++++++++++++++-------------
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/VERSION b/VERSION
index 128b466d..ad0bb575 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-08 23:22:37) stable
+Version 2.0.8 (2012-09-09 09:14:46) stable
diff --git a/gluon/contrib/markmin/markmin2html.py b/gluon/contrib/markmin/markmin2html.py
index bde911fb..1820c620 100755
--- a/gluon/contrib/markmin/markmin2html.py
+++ b/gluon/contrib/markmin/markmin2html.py
@@ -643,7 +643,7 @@ def render(text,
- class_prefix is a prefix for ALL classes in markmin text. E.g. if class_prefix='my_'
then for ``test``:cls class will be changed to "my_cls" (default value is '')
- id_prefix is prefix for ALL ids in markmin text (default value is 'markmin_'). E.g.:
- -- [[id]] will be converted to
+ -- [[id]] will be converted to
-- [[link #id]] will be converted to link
-- ``test``:cls[id] will be converted to test
@@ -774,19 +774,19 @@ def render(text,
'
holachau
# returnde value: {'p': {'a':1,'b':2}, `'c':[{'d':'hola'},{'d':'chau'}]}
d = {}
for node in self():
name = str(node.get_local_name())
+ ref_name_type = None
+ # handle multirefs: href="#id0"
+ if 'href' in node.attributes().keys():
+ href = node['href'][1:]
+ for ref_node in self(root=True)("multiRef"):
+ if ref_node['id'] == href:
+ node = ref_node
+ ref_name_type = ref_node['xsi:type'].split(":")[1]
+ break
try:
fn = types[name]
except (KeyError, ), e:
- raise TypeError("Tag: %s invalid" % (name,))
- if isinstance(fn,list):
+ if node.get_namespace_uri("soapenc"):
+ fn = None # ignore multirefs!
+ elif 'xsi:type' in node.attributes().keys():
+ xsd_type = node['xsi:type'].split(":")[1]
+ fn = REVERSE_TYPE_MAP[xsd_type]
+ elif strict:
+ raise TypeError(u"Tag: %s invalid (type not found)" % (name,))
+ else:
+ # if not strict, use default type conversion
+ fn = unicode
+
+ if isinstance(fn, list):
+ # append to existing list (if any) - unnested dict arrays -
+ value = d.setdefault(name, [])
+ children = node.children()
+ for child in (children and children() or []): # Readability counts
+ value.append(child.unmarshall(fn[0], strict))
+
+ elif isinstance(fn, tuple):
value = []
+ _d = {}
children = node.children()
- for child in children and children() or []:
- value.append(child.unmarshall(fn[0]))
- elif isinstance(fn,dict):
+ as_dict = len(fn) == 1 and isinstance(fn[0], dict)
+
+ for child in (children and children() or []): # Readability counts
+ if as_dict:
+ _d.update(child.unmarshall(fn[0], strict)) # Merging pairs
+ else:
+ value.append(child.unmarshall(fn[0], strict))
+ if as_dict:
+ value.append(_d)
+
+ if name in d:
+ _tmp = list(d[name])
+ _tmp.extend(value)
+ value = tuple(_tmp)
+ else:
+ value = tuple(value)
+
+ elif isinstance(fn, dict):
+ ##if ref_name_type is not None:
+ ## fn = fn[ref_name_type]
children = node.children()
- value = children and children.unmarshall(fn)
+ value = children and children.unmarshall(fn, strict)
else:
if fn is None: # xsd:anyType not unmarshalled
value = node
elif str(node) or fn == str:
try:
- # get special desserialization function (if any)
- fn = TYPE_UNMARSHAL_FN.get(fn,fn)
- value = fn(unicode(node))
+ # get special deserialization function (if any)
+ fn = TYPE_UNMARSHAL_FN.get(fn,fn)
+ if fn == str:
+ # always return an unicode object:
+ value = unicode(node)
+ else:
+ value = fn(unicode(node))
except (ValueError, TypeError), e:
- raise ValueError("Tag: %s: %s" % (name, unicode(e)))
+ raise ValueError(u"Tag: %s: %s" % (name, unicode(e)))
else:
value = None
d[name] = value
return d
-
- def marshall(self, name, value, add_child=True, add_comments=False, ns=False):
+
+
+ def _update_ns(self, name):
+ """Replace the defined namespace alias with tohse used by the client."""
+ pref = self.__ns_rx.search(name)
+ if pref:
+ pref = pref.groups()[0]
+ try:
+ name = name.replace(pref, self.__namespaces_map[pref])
+ except KeyError:
+ log.warning('Unknown namespace alias %s' % name)
+ return name
+
+
+ def marshall(self, name, value, add_child=True, add_comments=False,
+ ns=False, add_children_ns=True):
"Analize python value and add the serialized XML element using tag name"
+ # Change node name to that used by a client
+ name = self._update_ns(name)
+
if isinstance(value, dict): # serialize dict (value)
- child = add_child and self.add_child(name,ns=ns) or self
+ child = add_child and self.add_child(name, ns=ns) or self
for k,v in value.items():
+ if not add_children_ns:
+ ns = False
child.marshall(k, v, add_comments=add_comments, ns=ns)
elif isinstance(value, tuple): # serialize tuple (value)
- child = add_child and self.add_child(name,ns=ns) or self
+ child = add_child and self.add_child(name, ns=ns) or self
+ if not add_children_ns:
+ ns = False
for k,v in value:
- getattr(self,name).marshall(k, v, add_comments=add_comments, ns=ns)
+ getattr(self, name).marshall(k, v, add_comments=add_comments, ns=ns)
elif isinstance(value, list): # serialize lists
- child=self.add_child(name,ns=ns)
+ child=self.add_child(name, ns=ns)
+ if not add_children_ns:
+ ns = False
if add_comments:
child.add_comment("Repetitive array of:")
for t in value:
- child.marshall(name,t, False, add_comments=add_comments, ns=ns)
+ child.marshall(name, t, False, add_comments=add_comments, ns=ns)
elif isinstance(value, basestring): # do not convert strings or unicodes
- self.add_child(name,value,ns=ns)
+ self.add_child(name, value,ns=ns)
elif value is None: # sent a empty tag?
- self.add_child(name,ns=ns)
+ self.add_child(name, ns=ns)
elif value in TYPE_MAP.keys():
# add commented placeholders for simple tipes (for examples/help only)
- child = self.add_child(name,ns=ns)
+ child = self.add_child(name, ns=ns)
child.add_comment(TYPE_MAP[value])
- else: # the rest of object types are converted to string
+ else: # the rest of object types are converted to string
# get special serialization function (if any)
- fn = TYPE_MARSHAL_FN.get(type(value),str)
- self.add_child(name,fn(value),ns=ns)
+ fn = TYPE_MARSHAL_FN.get(type(value), str)
+ self.add_child(name, fn(value), ns=ns)
def import_node(self, other):
x = self.__document.importNode(other._element, True) # deep copy
self._element.appendChild(x)
-
-
-if __name__ == "__main__":
- span = SimpleXMLElement('pyar11.5')
- assert str(span.a)==str(span('a'))==str(span.a(0))=="pyar"
- assert span.a['href']=="python.org.ar"
- assert int(span.prueba.i)==1 and float(span.prueba.float)==1.5
- span1 = SimpleXMLElement('googleyahoohotmail')
- assert [str(a) for a in span1.a()] == ['google', 'yahoo', 'hotmail']
- span1.add_child('a','altavista')
- span1.b = "ex msn"
- d = {'href':'http://www.bing.com/', 'alt': 'Bing'}
- span1.b[:] = d
- assert sorted([(k,v) for k,v in span1.b[:]]) == sorted(d.items())
- print span1.as_xml()
- assert 'b' in span1
- span.import_node(span1)
- print span.as_xml()
-
diff --git a/gluon/contrib/pysimplesoap/transport.py b/gluon/contrib/pysimplesoap/transport.py
new file mode 100644
index 00000000..a1491334
--- /dev/null
+++ b/gluon/contrib/pysimplesoap/transport.py
@@ -0,0 +1,241 @@
+#!/usr/bin/python
+# -*- coding: latin-1 -*-
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by the
+# Free Software Foundation; either version 3, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+
+"Pythonic simple SOAP Client implementation"
+
+__author__ = "Mariano Reingart (reingart@gmail.com)"
+__copyright__ = "Copyright (C) 2008 Mariano Reingart"
+__license__ = "LGPL 3.0"
+
+TIMEOUT = 60
+
+import os
+import cPickle as pickle
+import urllib2
+from urlparse import urlparse
+import tempfile
+from simplexml import SimpleXMLElement, TYPE_MAP, OrderedDict
+import logging
+
+log = logging.getLogger(__name__)
+logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.WARNING)
+
+#
+# We store metadata about what available transport mechanisms we have available.
+#
+_http_connectors = {} # libname: classimpl mapping
+_http_facilities = {} # functionalitylabel: [sequence of libname] mapping
+
+class TransportBase:
+ @classmethod
+ def supports_feature(cls, feature_name):
+ return cls._wrapper_name in _http_facilities[feature_name]
+
+#
+# httplib2 support.
+#
+try:
+ import httplib2
+except ImportError:
+ TIMEOUT = None # timeout not supported by urllib2
+ pass
+else:
+ class Httplib2Transport(httplib2.Http, TransportBase):
+ _wrapper_version = "httplib2 %s" % httplib2.__version__
+ _wrapper_name = 'httplib2'
+ def __init__(self, timeout, proxy=None, cacert=None, sessions=False):
+ ##httplib2.debuglevel=4
+ kwargs = {}
+ if proxy:
+ import socks
+ kwargs['proxy_info'] = httplib2.ProxyInfo(proxy_type=socks.PROXY_TYPE_HTTP, **proxy)
+ print "using proxy", proxy
+
+ # set optional parameters according supported httplib2 version
+ if httplib2.__version__ >= '0.3.0':
+ kwargs['timeout'] = timeout
+ if httplib2.__version__ >= '0.7.0':
+ kwargs['disable_ssl_certificate_validation'] = cacert is None
+ kwargs['ca_certs'] = cacert
+ httplib2.Http.__init__(self, **kwargs)
+
+ _http_connectors['httplib2'] = Httplib2Transport
+ _http_facilities.setdefault('proxy', []).append('httplib2')
+ _http_facilities.setdefault('cacert', []).append('httplib2')
+
+ import inspect
+ if 'timeout' in inspect.getargspec(httplib2.Http.__init__)[0]:
+ _http_facilities.setdefault('timeout', []).append('httplib2')
+
+#
+# urllib2 support.
+#
+import urllib2
+class urllib2Transport(TransportBase):
+ _wrapper_version = "urllib2 %s" % urllib2.__version__
+ _wrapper_name = 'urllib2'
+ def __init__(self, timeout=None, proxy=None, cacert=None, sessions=False):
+ import sys
+ if (timeout is not None) and not self.supports_feature('timeout'):
+ raise RuntimeError('timeout is not supported with urllib2 transport')
+ if proxy:
+ raise RuntimeError('proxy is not supported with urllib2 transport')
+ if cacert:
+ raise RuntimeError('cacert is not support with urllib2 transport')
+
+ self.request_opener = urllib2.urlopen
+ if sessions:
+ from cookielib import CookieJar
+ opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(CookieJar()))
+ self.request_opener = opener.open
+
+ self._timeout = timeout
+
+ def request(self, url, method="GET", body=None, headers={}):
+ req = urllib2.Request(url, body, headers)
+ try:
+ f = self.request_opener(req, timeout=self._timeout)
+ except urllib2.HTTPError, f:
+ if f.code != 500:
+ raise
+ return f.info(), f.read()
+
+_http_connectors['urllib2'] = urllib2Transport
+_http_facilities.setdefault('sessions', []).append('urllib2')
+
+import sys
+if sys.version_info >= (2,6):
+ _http_facilities.setdefault('timeout', []).append('urllib2')
+del sys
+
+#
+# pycurl support.
+# experimental: pycurl seems faster + better proxy support (NTLM) + ssl features
+#
+try:
+ import pycurl
+except ImportError:
+ pass
+else:
+ try:
+ from cStringIO import StringIO
+ except ImportError:
+ from StringIO import StringIO
+
+ class pycurlTransport(TransportBase):
+ _wrapper_version = pycurl.version
+ _wrapper_name = 'pycurl'
+ def __init__(self, timeout, proxy=None, cacert=None, sessions=False):
+ self.timeout = timeout
+ self.proxy = proxy or {}
+ self.cacert = cacert
+
+ def request(self, url, method, body, headers):
+ c = pycurl.Curl()
+ c.setopt(pycurl.URL, str(url))
+ if 'proxy_host' in self.proxy:
+ c.setopt(pycurl.PROXY, self.proxy['proxy_host'])
+ if 'proxy_port' in self.proxy:
+ c.setopt(pycurl.PROXYPORT, self.proxy['proxy_port'])
+ if 'proxy_user' in self.proxy:
+ c.setopt(pycurl.PROXYUSERPWD, "%(proxy_user)s:%(proxy_pass)s" % self.proxy)
+ self.buf = StringIO()
+ c.setopt(pycurl.WRITEFUNCTION, self.buf.write)
+ #c.setopt(pycurl.READFUNCTION, self.read)
+ #self.body = StringIO(body)
+ #c.setopt(pycurl.HEADERFUNCTION, self.header)
+ if self.cacert:
+ c.setopt(c.CAINFO, str(self.cacert))
+ c.setopt(pycurl.SSL_VERIFYPEER, self.cacert and 1 or 0)
+ c.setopt(pycurl.SSL_VERIFYHOST, self.cacert and 2 or 0)
+ c.setopt(pycurl.CONNECTTIMEOUT, self.timeout/6)
+ c.setopt(pycurl.TIMEOUT, self.timeout)
+ if method=='POST':
+ c.setopt(pycurl.POST, 1)
+ c.setopt(pycurl.POSTFIELDS, body)
+ if headers:
+ hdrs = ['%s: %s' % (str(k), str(v)) for k, v in headers.items()]
+ ##print hdrs
+ c.setopt(pycurl.HTTPHEADER, hdrs)
+ c.perform()
+ ##print "pycurl perform..."
+ c.close()
+ return {}, self.buf.getvalue()
+
+ _http_connectors['pycurl'] = pycurlTransport
+ _http_facilities.setdefault('proxy', []).append('pycurl')
+ _http_facilities.setdefault('cacert', []).append('pycurl')
+ _http_facilities.setdefault('timeout', []).append('pycurl')
+
+
+class DummyTransport:
+ "Testing class to load a xml response"
+
+ def __init__(self, xml_response):
+ self.xml_response = xml_response
+
+ def request(self, location, method, body, headers):
+ print method, location
+ print headers
+ print body
+ return {}, self.xml_response
+
+
+def get_http_wrapper(library=None, features=[]):
+ # If we are asked for a specific library, return it.
+ if library is not None:
+ try:
+ return _http_connectors[library]
+ except KeyError:
+ raise RuntimeError('%s transport is not available' % (library,))
+
+ # If we haven't been asked for a specific feature either, then just return our favourite
+ # implementation.
+ if not features:
+ return _http_connectors.get('httplib2', _http_connectors['urllib2'])
+
+ # If we are asked for a connector which supports the given features, then we will
+ # try that.
+ current_candidates = _http_connectors.keys()
+ new_candidates = []
+ for feature in features:
+ for candidate in current_candidates:
+ if candidate in _http_facilities.get(feature, []):
+ new_candidates.append(candidate)
+ current_candidates = new_candidates
+ new_candidates = []
+
+ # Return the first candidate in the list.
+ try:
+ candidate_name = current_candidates[0]
+ except IndexError:
+ raise RuntimeError("no transport available which supports these features: %s" % (features,))
+ else:
+ return _http_connectors[candidate_name]
+
+def set_http_wrapper(library=None, features=[]):
+ "Set a suitable HTTP connection wrapper."
+ global Http
+ Http = get_http_wrapper(library, features)
+ return Http
+
+
+def get_Http():
+ "Return current transport class"
+ global Http
+ return Http
+
+
+# define the default HTTP connection class (it can be changed at runtime!):
+set_http_wrapper()
+
+
From 87a127c42b05317af28597b86491c4c6a2386f89 Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Mon, 10 Sep 2012 07:40:33 -0500
Subject: [PATCH 32/37] fixed bug in wiki can_manage
---
VERSION | 2 +-
gluon/tools.py | 31 ++++++++++++++++++-------------
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/VERSION b/VERSION
index aaea711b..285ae916 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-09 21:39:52) stable
+Version 2.0.8 (2012-09-10 07:40:29) stable
diff --git a/gluon/tools.py b/gluon/tools.py
index 8ae9fe9e..29edb6d2 100644
--- a/gluon/tools.py
+++ b/gluon/tools.py
@@ -4480,7 +4480,6 @@ class Expose(object):
class Wiki(object):
everybody = 'everybody'
rows_page = 25
- regex_redirect = re.compile('redirect\s+(\w+\://\S+)\s*')
def markmin_render(self,page):
html = MARKMIN(page.body,url=True,environment=self.env,
autolinks=lambda link: expand_one(link,{})).xml()
@@ -4582,14 +4581,15 @@ class Wiki(object):
# WIKI ACCESS POLICY
def not_authorized(self,page=None):
raise HTTP(401)
- def can_read(self,page):
+ def can_read(self,page):
if 'everybody' in page.can_read or not self.manage_permissions:
return True
elif self.auth.user:
groups = self.auth.user_groups.values()
if ('wiki_editor' in groups or
set(groups).intersection(set(page.can_read+page.can_edit)) or
- page.created_by==self.auth.user.id): return True
+ page.created_by==self.auth.user.id):
+ return True
return False
def can_edit(self,page=None):
if not self.auth.user: redirect(self.auth.settings.login_url)
@@ -4600,7 +4600,8 @@ class Wiki(object):
set(groups).intersection(set(page.can_edit)) or
page.created_by==self.auth.user.id))
def can_manage(self):
- if not self.auth.user: redirect(self.auth.settings.login_url)
+ if not self.auth.user:
+ return False
groups = self.auth.user_groups.values()
return 'wiki_editor' in groups
def can_search(self):
@@ -4610,11 +4611,11 @@ class Wiki(object):
request = current.request
automenu = self.menu(request.controller,request.function)
current.response.menu += automenu
- zero = request.args(0)
+ zero = request.args(0) or 'index'
if zero and zero.isdigit():
return self.media(int(zero))
elif not zero or not zero.startswith('_'):
- return self.read(zero or 'index')
+ return self.read(zero)
elif zero=='_edit':
return self.edit(request.args(1) or 'index')
elif zero=='_editmedia':
@@ -4648,19 +4649,20 @@ class Wiki(object):
return body.replace('://HOSTNAME','://%s' % self.host)
def read(self,slug):
- if slug in '_cloud': return self.cloud()
- elif slug in '_search': return self.search()
+ if slug in '_cloud':
+ return self.cloud()
+ elif slug in '_search':
+ return self.search()
page = self.auth.db.wiki_page(slug=slug)
if not page:
redirect(URL(args=('_create',slug)))
- if not self.can_read(page): return self.not_authorized(page)
+ if not self.can_read(page):
+ return self.not_authorized(page)
if current.request.extension == 'html':
if not page:
url = URL(args=('_edit',slug))
return dict(content=A('Create page "%s"' % slug,_href=url,_class="btn"))
else:
- match = self.regex_redirect.match(page.body)
- if match: redirect(match.group(1))
return dict(content=XML(self.fix_hostname(page.html)))
elif current.request.extension == 'load':
return self.fix_hostname(page.html) if page else ''
@@ -4689,7 +4691,8 @@ class Wiki(object):
if not self.can_edit(page): return self.not_authorized(page)
title_guess = ' '.join(c.capitalize() for c in slug.split('-'))
if not page:
- if not (self.can_manage() or slug.startswith(self.force_prefix)):
+ if not (self.can_manage() or
+ slug.startswith(self.force_prefix)):
current.session.flash='slug must have "%s" prefix' \
% self.force_prefix
redirect(URL(args=('_edit',self.force_prefix+slug)))
@@ -4743,7 +4746,8 @@ class Wiki(object):
redirect(URL(args=('_edit',form.vars.slug)))
return dict(content=form)
def pages(self):
- if not self.can_manage(): return self.not_authorized()
+ if not self.can_manage():
+ return self.not_authorized()
self.auth.db.wiki_page.id.represent = lambda id,row:SPAN('@////%s' % row.slug)
self.auth.db.wiki_page.title.represent = lambda title,row: \
A(title,_href=URL(args=row.slug))
@@ -4826,6 +4830,7 @@ class Wiki(object):
submenu.append((current.T('Search Pages'),None,
URL(controller,function,args=('_search'))))
return menu
+
def search(self,tags=None,query=None,cloud=True,preview=True,
limitby=(0,100),orderby=None):
if not self.can_search(): return self.not_authorized()
From 1d825fda760389af159119aa19de407df6240f4c Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Mon, 10 Sep 2012 07:47:52 -0500
Subject: [PATCH 33/37] fixed issue 974
---
VERSION | 2 +-
gluon/http.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 285ae916..85ace5fc 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-10 07:40:29) stable
+Version 2.0.8 (2012-09-10 07:47:49) stable
diff --git a/gluon/http.py b/gluon/http.py
index 50134959..05330a22 100644
--- a/gluon/http.py
+++ b/gluon/http.py
@@ -88,7 +88,7 @@ class HTTP(BaseException):
else:
status = str(status)
if not regex_status.match(status):
- status = "500 UNKNOWN ERROR"
+ status = '500 %s' % (defined_status[500])
if not 'Content-Type' in headers:
headers['Content-Type'] = 'text/html; charset=UTF-8'
body = self.body
From 359d6c957992eac42f8f0d500d4df9811304f40f Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Mon, 10 Sep 2012 07:51:45 -0500
Subject: [PATCH 34/37] fixed issue 989, thanks Dominic
---
VERSION | 2 +-
gluon/dal.py | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 85ace5fc..c910c778 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-10 07:47:49) stable
+Version 2.0.8 (2012-09-10 07:51:42) stable
diff --git a/gluon/dal.py b/gluon/dal.py
index 00e4e91e..20e8eb8c 100644
--- a/gluon/dal.py
+++ b/gluon/dal.py
@@ -8197,7 +8197,10 @@ class Expression(object):
db = self.db
if isinstance(value,(list, tuple)):
subqueries = [self.contains(str(v).strip()) for v in value if str(v).strip()]
- return reduce(all and AND or OR, subqueries,self.contains(''))
+ if not subqueries:
+ return self.contains('')
+ else:
+ return reduce(all and AND or OR,subqueries)
if not self.type in ('string', 'text') and not self.type.startswith('list:'):
raise SyntaxError, "contains used with incompatible field type"
return Query(db, db._adapter.CONTAINS, self, value)
From 385e5c0693ad99400c71fce2545853df3c36607a Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Mon, 10 Sep 2012 09:56:36 -0500
Subject: [PATCH 35/37] fixed GAE default problem, thanks Jan-Karen and Alan
---
VERSION | 2 +-
app.example.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index c910c778..c638fe8d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-10 07:51:42) stable
+Version 2.0.8 (2012-09-10 09:56:32) stable
diff --git a/app.example.yaml b/app.example.yaml
index 538bfdeb..d058361b 100644
--- a/app.example.yaml
+++ b/app.example.yaml
@@ -80,7 +80,7 @@ skip_files: |
builtins:
- remote_api: on
-- datastore_admin: on
+# - datastore_admin: on
- appstats: on
- admin_redirect: on
- deferred: on
From d10cdbb44f47d5fa7e24d542953aac7590b03783 Mon Sep 17 00:00:00 2001
From: mdipierro
Date: Mon, 10 Sep 2012 10:59:28 -0500
Subject: [PATCH 36/37] removed editarea, amy, ace; included zencoding support
for codemirror
---
VERSION | 2 +-
applications/admin/languages/default.py | 8 +
applications/admin/models/0.py | 3 +-
applications/admin/static/ace/ChangeLog.txt | 116 -
applications/admin/static/ace/LICENSE | 476 -
applications/admin/static/ace/Readme.md | 199 -
.../admin/static/ace/src/ace-compat.js | 1 -
applications/admin/static/ace/src/ace.js | 10 -
.../admin/static/ace/src/keybinding-emacs.js | 1 -
.../admin/static/ace/src/keybinding-vim.js | 1 -
applications/admin/static/ace/src/mode-css.js | 1 -
.../admin/static/ace/src/mode-html.js | 1 -
.../admin/static/ace/src/mode-javascript.js | 1 -
.../admin/static/ace/src/mode-json.js | 1 -
.../admin/static/ace/src/mode-python.js | 1 -
.../admin/static/ace/src/mode-text.js | 0
applications/admin/static/ace/src/mode-xml.js | 1 -
.../admin/static/ace/src/theme-chrome.js | 1 -
.../admin/static/ace/src/theme-clouds.js | 1 -
.../static/ace/src/theme-clouds_midnight.js | 1 -
.../admin/static/ace/src/theme-cobalt.js | 1 -
.../static/ace/src/theme-crimson_editor.js | 1 -
.../admin/static/ace/src/theme-dawn.js | 1 -
.../admin/static/ace/src/theme-dreamweaver.js | 1 -
.../admin/static/ace/src/theme-eclipse.js | 1 -
.../static/ace/src/theme-idle_fingers.js | 1 -
.../admin/static/ace/src/theme-kr_theme.js | 1 -
.../admin/static/ace/src/theme-merbivore.js | 1 -
.../static/ace/src/theme-merbivore_soft.js | 1 -
.../static/ace/src/theme-mono_industrial.js | 1 -
.../admin/static/ace/src/theme-monokai.js | 1 -
.../static/ace/src/theme-pastel_on_dark.js | 1 -
.../static/ace/src/theme-solarized_dark.js | 1 -
.../static/ace/src/theme-solarized_light.js | 1 -
.../admin/static/ace/src/theme-textmate.js | 0
.../admin/static/ace/src/theme-tomorrow.js | 1 -
.../static/ace/src/theme-tomorrow_night.js | 1 -
.../ace/src/theme-tomorrow_night_blue.js | 1 -
.../ace/src/theme-tomorrow_night_bright.js | 1 -
.../ace/src/theme-tomorrow_night_eighties.js | 1 -
.../admin/static/ace/src/theme-twilight.js | 1 -
.../admin/static/ace/src/theme-vibrant_ink.js | 1 -
.../admin/static/codemirror/emmet.min.js | 284 +
.../static/codemirror/zen_codemirror.min.js | 13 +
.../admin/static/eamy/bundle_markup.js | 390 -
.../admin/static/eamy/bundle_python.js | 297 -
.../admin/static/eamy/chap-bg-sidebar.gif | Bin 300 -> 0 bytes
.../static/eamy/chap-bookmark-default.gif | Bin 186 -> 0 bytes
.../static/eamy/chap-folding-expand-inner.gif | Bin 119 -> 0 bytes
.../admin/static/eamy/chap-folding-expand.gif | Bin 319 -> 0 bytes
.../admin/static/eamy/chap-folding-start.gif | Bin 204 -> 0 bytes
.../admin/static/eamy/chap-folding-stop.gif | Bin 204 -> 0 bytes
.../admin/static/eamy/chap-wrapped-row.gif | Bin 92 -> 0 bytes
applications/admin/static/eamy/eamy.js | 8144 -----------------
applications/admin/static/eamy/style.css | 56 -
applications/admin/static/eamy/void.gif | Bin 55 -> 0 bytes
.../admin/static/edit_area/autocompletion.js | 491 -
.../admin/static/edit_area/edit_area.css | 530 --
.../admin/static/edit_area/edit_area.js | 528 --
.../static/edit_area/edit_area_compressor.php | 428 -
.../admin/static/edit_area/edit_area_full.gz | Bin 29377 -> 0 bytes
.../admin/static/edit_area/edit_area_full.js | 39 -
.../edit_area/edit_area_full_with_plugins.js | 40 -
.../static/edit_area/edit_area_functions.js | 1202 ---
.../static/edit_area/edit_area_loader.js | 1082 ---
.../static/edit_area/elements_functions.js | 337 -
.../admin/static/edit_area/highlight.js | 408 -
.../edit_area/images/autocompletion.gif | Bin 359 -> 0 bytes
.../admin/static/edit_area/images/close.gif | Bin 102 -> 0 bytes
.../static/edit_area/images/fullscreen.gif | Bin 198 -> 0 bytes
.../static/edit_area/images/go_to_line.gif | Bin 1053 -> 0 bytes
.../admin/static/edit_area/images/help.gif | Bin 295 -> 0 bytes
.../static/edit_area/images/highlight.gif | Bin 256 -> 0 bytes
.../admin/static/edit_area/images/load.gif | Bin 1041 -> 0 bytes
.../admin/static/edit_area/images/move.gif | Bin 257 -> 0 bytes
.../static/edit_area/images/newdocument.gif | Bin 170 -> 0 bytes
.../admin/static/edit_area/images/opacity.png | Bin 147 -> 0 bytes
.../static/edit_area/images/processing.gif | Bin 825 -> 0 bytes
.../admin/static/edit_area/images/redo.gif | Bin 169 -> 0 bytes
.../edit_area/images/reset_highlight.gif | Bin 168 -> 0 bytes
.../admin/static/edit_area/images/save.gif | Bin 285 -> 0 bytes
.../admin/static/edit_area/images/search.gif | Bin 191 -> 0 bytes
.../edit_area/images/smooth_selection.gif | Bin 174 -> 0 bytes
.../admin/static/edit_area/images/spacer.gif | Bin 43 -> 0 bytes
.../edit_area/images/statusbar_resize.gif | Bin 79 -> 0 bytes
.../admin/static/edit_area/images/undo.gif | Bin 175 -> 0 bytes
.../static/edit_area/images/word_wrap.gif | Bin 951 -> 0 bytes
.../admin/static/edit_area/keyboard.js | 146 -
.../admin/static/edit_area/langs/bg.js | 54 -
.../admin/static/edit_area/langs/cs.js | 48 -
.../admin/static/edit_area/langs/de.js | 48 -
.../admin/static/edit_area/langs/dk.js | 48 -
.../admin/static/edit_area/langs/en.js | 48 -
.../admin/static/edit_area/langs/eo.js | 48 -
.../admin/static/edit_area/langs/es.js | 48 -
.../admin/static/edit_area/langs/fi.js | 48 -
.../admin/static/edit_area/langs/fr.js | 48 -
.../admin/static/edit_area/langs/hr.js | 48 -
.../admin/static/edit_area/langs/it.js | 48 -
.../admin/static/edit_area/langs/ja.js | 48 -
.../admin/static/edit_area/langs/mk.js | 48 -
.../admin/static/edit_area/langs/nl.js | 48 -
.../admin/static/edit_area/langs/pl.js | 48 -
.../admin/static/edit_area/langs/pt.js | 48 -
.../admin/static/edit_area/langs/ru.js | 48 -
.../admin/static/edit_area/langs/sk.js | 48 -
.../admin/static/edit_area/langs/zh.js | 48 -
.../admin/static/edit_area/license.txt | 0
.../admin/static/edit_area/license_apache.txt | 7 -
.../admin/static/edit_area/license_bsd.txt | 10 -
.../admin/static/edit_area/license_lgpl.txt | 458 -
.../admin/static/edit_area/manage_area.js | 623 --
.../edit_area/plugins/charmap/charmap.js | 90 -
.../edit_area/plugins/charmap/css/charmap.css | 64 -
.../plugins/charmap/images/charmap.gif | Bin 245 -> 0 bytes
.../edit_area/plugins/charmap/jscripts/map.js | 373 -
.../edit_area/plugins/charmap/langs/bg.js | 12 -
.../edit_area/plugins/charmap/langs/cs.js | 6 -
.../edit_area/plugins/charmap/langs/de.js | 6 -
.../edit_area/plugins/charmap/langs/dk.js | 6 -
.../edit_area/plugins/charmap/langs/en.js | 6 -
.../edit_area/plugins/charmap/langs/eo.js | 6 -
.../edit_area/plugins/charmap/langs/es.js | 6 -
.../edit_area/plugins/charmap/langs/fr.js | 6 -
.../edit_area/plugins/charmap/langs/hr.js | 6 -
.../edit_area/plugins/charmap/langs/it.js | 6 -
.../edit_area/plugins/charmap/langs/ja.js | 6 -
.../edit_area/plugins/charmap/langs/mk.js | 6 -
.../edit_area/plugins/charmap/langs/nl.js | 6 -
.../edit_area/plugins/charmap/langs/pl.js | 6 -
.../edit_area/plugins/charmap/langs/pt.js | 6 -
.../edit_area/plugins/charmap/langs/ru.js | 6 -
.../edit_area/plugins/charmap/langs/sk.js | 6 -
.../edit_area/plugins/charmap/langs/zh.js | 6 -
.../edit_area/plugins/charmap/popup.html | 24 -
.../edit_area/plugins/test/css/test.css | 3 -
.../edit_area/plugins/test/images/test.gif | Bin 87 -> 0 bytes
.../static/edit_area/plugins/test/langs/bg.js | 10 -
.../static/edit_area/plugins/test/langs/cs.js | 4 -
.../static/edit_area/plugins/test/langs/de.js | 4 -
.../static/edit_area/plugins/test/langs/dk.js | 4 -
.../static/edit_area/plugins/test/langs/en.js | 4 -
.../static/edit_area/plugins/test/langs/eo.js | 4 -
.../static/edit_area/plugins/test/langs/es.js | 4 -
.../static/edit_area/plugins/test/langs/fr.js | 4 -
.../static/edit_area/plugins/test/langs/hr.js | 4 -
.../static/edit_area/plugins/test/langs/it.js | 4 -
.../static/edit_area/plugins/test/langs/ja.js | 4 -
.../static/edit_area/plugins/test/langs/mk.js | 4 -
.../static/edit_area/plugins/test/langs/nl.js | 4 -
.../static/edit_area/plugins/test/langs/pl.js | 4 -
.../static/edit_area/plugins/test/langs/pt.js | 4 -
.../static/edit_area/plugins/test/langs/ru.js | 4 -
.../static/edit_area/plugins/test/langs/sk.js | 4 -
.../static/edit_area/plugins/test/langs/zh.js | 4 -
.../static/edit_area/plugins/test/test.js | 110 -
.../static/edit_area/plugins/test/test2.js | 1 -
.../edit_area/plugins/zencoding/core.js | 4 -
.../edit_area/plugins/zencoding/langs/en.js | 4 -
.../edit_area/plugins/zencoding/zencoding.js | 420 -
.../admin/static/edit_area/reg_syntax.js | 167 -
.../static/edit_area/reg_syntax/basic.js | 70 -
.../static/edit_area/reg_syntax/brainfuck.js | 45 -
.../admin/static/edit_area/reg_syntax/c.js | 63 -
.../static/edit_area/reg_syntax/coldfusion.js | 120 -
.../admin/static/edit_area/reg_syntax/cpp.js | 66 -
.../admin/static/edit_area/reg_syntax/css.js | 85 -
.../admin/static/edit_area/reg_syntax/html.js | 51 -
.../admin/static/edit_area/reg_syntax/java.js | 57 -
.../admin/static/edit_area/reg_syntax/js.js | 94 -
.../admin/static/edit_area/reg_syntax/pas.js | 83 -
.../admin/static/edit_area/reg_syntax/perl.js | 88 -
.../admin/static/edit_area/reg_syntax/php.js | 157 -
.../static/edit_area/reg_syntax/python.js | 145 -
.../static/edit_area/reg_syntax/robotstxt.js | 25 -
.../admin/static/edit_area/reg_syntax/ruby.js | 68 -
.../admin/static/edit_area/reg_syntax/sql.js | 56 -
.../admin/static/edit_area/reg_syntax/tsql.js | 88 -
.../admin/static/edit_area/reg_syntax/vb.js | 53 -
.../admin/static/edit_area/reg_syntax/xml.js | 57 -
applications/admin/static/edit_area/regexp.js | 140 -
.../admin/static/edit_area/resize_area.js | 74 -
.../admin/static/edit_area/search_replace.js | 175 -
.../admin/static/edit_area/template.html | 101 -
applications/admin/views/default/edit.html | 51 +-
185 files changed, 343 insertions(+), 20399 deletions(-)
delete mode 100644 applications/admin/static/ace/ChangeLog.txt
delete mode 100644 applications/admin/static/ace/LICENSE
delete mode 100644 applications/admin/static/ace/Readme.md
delete mode 100644 applications/admin/static/ace/src/ace-compat.js
delete mode 100644 applications/admin/static/ace/src/ace.js
delete mode 100644 applications/admin/static/ace/src/keybinding-emacs.js
delete mode 100644 applications/admin/static/ace/src/keybinding-vim.js
delete mode 100644 applications/admin/static/ace/src/mode-css.js
delete mode 100644 applications/admin/static/ace/src/mode-html.js
delete mode 100644 applications/admin/static/ace/src/mode-javascript.js
delete mode 100644 applications/admin/static/ace/src/mode-json.js
delete mode 100644 applications/admin/static/ace/src/mode-python.js
delete mode 100644 applications/admin/static/ace/src/mode-text.js
delete mode 100644 applications/admin/static/ace/src/mode-xml.js
delete mode 100644 applications/admin/static/ace/src/theme-chrome.js
delete mode 100644 applications/admin/static/ace/src/theme-clouds.js
delete mode 100644 applications/admin/static/ace/src/theme-clouds_midnight.js
delete mode 100644 applications/admin/static/ace/src/theme-cobalt.js
delete mode 100644 applications/admin/static/ace/src/theme-crimson_editor.js
delete mode 100644 applications/admin/static/ace/src/theme-dawn.js
delete mode 100644 applications/admin/static/ace/src/theme-dreamweaver.js
delete mode 100644 applications/admin/static/ace/src/theme-eclipse.js
delete mode 100644 applications/admin/static/ace/src/theme-idle_fingers.js
delete mode 100644 applications/admin/static/ace/src/theme-kr_theme.js
delete mode 100644 applications/admin/static/ace/src/theme-merbivore.js
delete mode 100644 applications/admin/static/ace/src/theme-merbivore_soft.js
delete mode 100644 applications/admin/static/ace/src/theme-mono_industrial.js
delete mode 100644 applications/admin/static/ace/src/theme-monokai.js
delete mode 100644 applications/admin/static/ace/src/theme-pastel_on_dark.js
delete mode 100644 applications/admin/static/ace/src/theme-solarized_dark.js
delete mode 100644 applications/admin/static/ace/src/theme-solarized_light.js
delete mode 100644 applications/admin/static/ace/src/theme-textmate.js
delete mode 100644 applications/admin/static/ace/src/theme-tomorrow.js
delete mode 100644 applications/admin/static/ace/src/theme-tomorrow_night.js
delete mode 100644 applications/admin/static/ace/src/theme-tomorrow_night_blue.js
delete mode 100644 applications/admin/static/ace/src/theme-tomorrow_night_bright.js
delete mode 100644 applications/admin/static/ace/src/theme-tomorrow_night_eighties.js
delete mode 100644 applications/admin/static/ace/src/theme-twilight.js
delete mode 100644 applications/admin/static/ace/src/theme-vibrant_ink.js
create mode 100644 applications/admin/static/codemirror/emmet.min.js
create mode 100644 applications/admin/static/codemirror/zen_codemirror.min.js
delete mode 100644 applications/admin/static/eamy/bundle_markup.js
delete mode 100644 applications/admin/static/eamy/bundle_python.js
delete mode 100755 applications/admin/static/eamy/chap-bg-sidebar.gif
delete mode 100755 applications/admin/static/eamy/chap-bookmark-default.gif
delete mode 100755 applications/admin/static/eamy/chap-folding-expand-inner.gif
delete mode 100755 applications/admin/static/eamy/chap-folding-expand.gif
delete mode 100755 applications/admin/static/eamy/chap-folding-start.gif
delete mode 100755 applications/admin/static/eamy/chap-folding-stop.gif
delete mode 100755 applications/admin/static/eamy/chap-wrapped-row.gif
delete mode 100644 applications/admin/static/eamy/eamy.js
delete mode 100644 applications/admin/static/eamy/style.css
delete mode 100755 applications/admin/static/eamy/void.gif
delete mode 100755 applications/admin/static/edit_area/autocompletion.js
delete mode 100755 applications/admin/static/edit_area/edit_area.css
delete mode 100755 applications/admin/static/edit_area/edit_area.js
delete mode 100755 applications/admin/static/edit_area/edit_area_compressor.php
delete mode 100755 applications/admin/static/edit_area/edit_area_full.gz
delete mode 100755 applications/admin/static/edit_area/edit_area_full.js
delete mode 100755 applications/admin/static/edit_area/edit_area_full_with_plugins.js
delete mode 100755 applications/admin/static/edit_area/edit_area_functions.js
delete mode 100755 applications/admin/static/edit_area/edit_area_loader.js
delete mode 100755 applications/admin/static/edit_area/elements_functions.js
delete mode 100755 applications/admin/static/edit_area/highlight.js
delete mode 100755 applications/admin/static/edit_area/images/autocompletion.gif
delete mode 100755 applications/admin/static/edit_area/images/close.gif
delete mode 100755 applications/admin/static/edit_area/images/fullscreen.gif
delete mode 100755 applications/admin/static/edit_area/images/go_to_line.gif
delete mode 100755 applications/admin/static/edit_area/images/help.gif
delete mode 100755 applications/admin/static/edit_area/images/highlight.gif
delete mode 100755 applications/admin/static/edit_area/images/load.gif
delete mode 100755 applications/admin/static/edit_area/images/move.gif
delete mode 100755 applications/admin/static/edit_area/images/newdocument.gif
delete mode 100755 applications/admin/static/edit_area/images/opacity.png
delete mode 100755 applications/admin/static/edit_area/images/processing.gif
delete mode 100755 applications/admin/static/edit_area/images/redo.gif
delete mode 100755 applications/admin/static/edit_area/images/reset_highlight.gif
delete mode 100755 applications/admin/static/edit_area/images/save.gif
delete mode 100755 applications/admin/static/edit_area/images/search.gif
delete mode 100755 applications/admin/static/edit_area/images/smooth_selection.gif
delete mode 100755 applications/admin/static/edit_area/images/spacer.gif
delete mode 100755 applications/admin/static/edit_area/images/statusbar_resize.gif
delete mode 100755 applications/admin/static/edit_area/images/undo.gif
delete mode 100755 applications/admin/static/edit_area/images/word_wrap.gif
delete mode 100755 applications/admin/static/edit_area/keyboard.js
delete mode 100755 applications/admin/static/edit_area/langs/bg.js
delete mode 100755 applications/admin/static/edit_area/langs/cs.js
delete mode 100755 applications/admin/static/edit_area/langs/de.js
delete mode 100755 applications/admin/static/edit_area/langs/dk.js
delete mode 100755 applications/admin/static/edit_area/langs/en.js
delete mode 100755 applications/admin/static/edit_area/langs/eo.js
delete mode 100755 applications/admin/static/edit_area/langs/es.js
delete mode 100755 applications/admin/static/edit_area/langs/fi.js
delete mode 100755 applications/admin/static/edit_area/langs/fr.js
delete mode 100755 applications/admin/static/edit_area/langs/hr.js
delete mode 100755 applications/admin/static/edit_area/langs/it.js
delete mode 100755 applications/admin/static/edit_area/langs/ja.js
delete mode 100755 applications/admin/static/edit_area/langs/mk.js
delete mode 100755 applications/admin/static/edit_area/langs/nl.js
delete mode 100755 applications/admin/static/edit_area/langs/pl.js
delete mode 100755 applications/admin/static/edit_area/langs/pt.js
delete mode 100755 applications/admin/static/edit_area/langs/ru.js
delete mode 100755 applications/admin/static/edit_area/langs/sk.js
delete mode 100755 applications/admin/static/edit_area/langs/zh.js
delete mode 100755 applications/admin/static/edit_area/license.txt
delete mode 100755 applications/admin/static/edit_area/license_apache.txt
delete mode 100755 applications/admin/static/edit_area/license_bsd.txt
delete mode 100755 applications/admin/static/edit_area/license_lgpl.txt
delete mode 100755 applications/admin/static/edit_area/manage_area.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/charmap.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/css/charmap.css
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/images/charmap.gif
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/jscripts/map.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/bg.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/cs.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/de.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/dk.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/en.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/eo.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/es.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/fr.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/hr.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/it.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/ja.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/mk.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/nl.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/pl.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/pt.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/ru.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/sk.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/langs/zh.js
delete mode 100755 applications/admin/static/edit_area/plugins/charmap/popup.html
delete mode 100755 applications/admin/static/edit_area/plugins/test/css/test.css
delete mode 100755 applications/admin/static/edit_area/plugins/test/images/test.gif
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/bg.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/cs.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/de.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/dk.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/en.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/eo.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/es.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/fr.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/hr.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/it.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/ja.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/mk.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/nl.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/pl.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/pt.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/ru.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/sk.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/langs/zh.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/test.js
delete mode 100755 applications/admin/static/edit_area/plugins/test/test2.js
delete mode 100644 applications/admin/static/edit_area/plugins/zencoding/core.js
delete mode 100644 applications/admin/static/edit_area/plugins/zencoding/langs/en.js
delete mode 100644 applications/admin/static/edit_area/plugins/zencoding/zencoding.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/basic.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/brainfuck.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/c.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/coldfusion.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/cpp.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/css.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/html.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/java.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/js.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/pas.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/perl.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/php.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/python.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/robotstxt.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/ruby.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/sql.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/tsql.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/vb.js
delete mode 100755 applications/admin/static/edit_area/reg_syntax/xml.js
delete mode 100755 applications/admin/static/edit_area/regexp.js
delete mode 100755 applications/admin/static/edit_area/resize_area.js
delete mode 100755 applications/admin/static/edit_area/search_replace.js
delete mode 100755 applications/admin/static/edit_area/template.html
diff --git a/VERSION b/VERSION
index c638fe8d..3b03afc7 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-Version 2.0.8 (2012-09-10 09:56:32) stable
+Version 2.0.8 (2012-09-10 10:59:24) stable
diff --git a/applications/admin/languages/default.py b/applications/admin/languages/default.py
index 2e65d5d2..1369b2fd 100644
--- a/applications/admin/languages/default.py
+++ b/applications/admin/languages/default.py
@@ -64,6 +64,7 @@
'Error ticket': 'Error ticket',
'Errors': 'Errors',
'Exception instance attributes': 'Exception instance attributes',
+'Expand Abbreviation': 'Expand Abbreviation',
'exposes': 'exposes',
'exposes:': 'exposes:',
'extends': 'extends',
@@ -76,6 +77,7 @@
'Get from URL:': 'Get from URL:',
'Git Pull': 'Git Pull',
'Git Push': 'Git Push',
+'Go to Matching Pair': 'Go to Matching Pair',
'go!': 'go!',
'Help': 'Help',
'Hide/Show Translated strings': 'Hide/Show Translated strings',
@@ -85,6 +87,7 @@
'Installed applications': 'Installed applications',
'invalid password.': 'invalid password.',
'Key bindings': 'Key bindings',
+'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin',
'Language files (static strings) updated': 'Language files (static strings) updated',
'languages': 'languages',
'Languages': 'Languages',
@@ -94,6 +97,8 @@
'Login': 'Login',
'Login to the Administrative Interface': 'Login to the Administrative Interface',
'Logout': 'Logout',
+'Match Pair': 'Match Pair',
+'Merge Lines': 'Merge Lines',
'models': 'models',
'Models': 'Models',
'Modules': 'Modules',
@@ -101,6 +106,7 @@
'New Application Wizard': 'New Application Wizard',
'New application wizard': 'New application wizard',
'New simple application': 'New simple application',
+'Next Edit Point': 'Next Edit Point',
'online designer': 'online designer',
'Original/Translation': 'Original/Translation',
'Overwrite installed app': 'Overwrite installed app',
@@ -110,6 +116,7 @@
'plugins': 'plugins',
'Plural-Forms:': 'Plural-Forms:',
'Powered by': 'Powered by',
+'Previous Edit Point': 'Previous Edit Point',
'Private files': 'Private files',
'private files': 'private files',
'Reload routes': 'Reload routes',
@@ -173,4 +180,5 @@
'Web Framework': 'Web Framework',
'web2py is up to date': 'web2py is up to date',
'web2py Recent Tweets': 'web2py Recent Tweets',
+'Wrap with Abbreviation': 'Wrap with Abbreviation',
}
diff --git a/applications/admin/models/0.py b/applications/admin/models/0.py
index 961ada45..ec92f27a 100644
--- a/applications/admin/models/0.py
+++ b/applications/admin/models/0.py
@@ -8,8 +8,9 @@ WEB2PY_VERSION_URL = WEB2PY_URL+'/examples/default/version'
# the user-interface feature that allows you to edit files in your web
# browser.
-## Default editor
+## Default editor (to change editor you need web2py.admin.editors.zip)
TEXT_EDITOR = 'codemirror' or 'ace' or 'edit_area' or 'amy'
+
## Editor Color scheme (only for ace)
TEXT_EDITOR_THEME = (
"chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn",
diff --git a/applications/admin/static/ace/ChangeLog.txt b/applications/admin/static/ace/ChangeLog.txt
deleted file mode 100644
index 76b2313b..00000000
--- a/applications/admin/static/ace/ChangeLog.txt
+++ /dev/null
@@ -1,116 +0,0 @@
-2011.08.02, Version 0.2.0
-
-* Split view (Julian Viereck)
- - split editor area horizontally or vertivally to show two files at the same
- time
-
-* Code Folding (Julian Viereck)
- - Unstructured code folding
- - Will be the basis for language aware folding
-
-* Mode behaviours (Chris Spencer)
- - Adds mode specific hooks which allow transformations of entered text
- - Autoclosing of braces, paranthesis and quotation marks in C style modes
- - Autoclosing of angular brackets in XML style modes
-
-* New language modes
- - Clojure (Carin Meier)
- - C# (Rob Conery)
- - Groovy (Ben Tilford)
- - Scala (Ben Tilford)
- - JSON
- - OCaml (Sergi Mansilla)
- - Perl (Panagiotis Astithas)
- - SCSS/SASS (Andreas Madsen)
- - SVG
- - Textile (Kelley van Evert)
- - SCAD (Jacob Hansson)
-
-* Live syntax checks
- - Lint for Css using CSS Lint
- - CoffeeScript
-
-* New Themes
- - Crimson Editor (iebuggy)
- - Merbivore (Michael Schwartz)
- - Merbivore soft (Michael Schwartz)
- - Solarized dark/light (David Alan
- Hjelle)
- - Vibrant Ink (Michael Schwartz)
-
-* Small Features/Enhancements
- - Lots of render performance optimizations (Harutyun Amirjanyan)
- - Improved Ruby highlighting (Chris Wanstrath, Trent Ogren)
- - Improved PHP highlighting (Thomas Hruska)
- - Improved CSS highlighting (Sean Kellogg)
- - Clicks which cause the editor to be focused don't reset the selection
- - Make padding text layer specific so that print margin and active line
- highlight are not affected (Irakli Gozalishvili)
- - Added setFontSize method
- - Improved vi keybindings (Trent Ogren)
- - When unfocused make cursor transparent instead of removing it (Harutyun
- Amirjanyan)
- - Support for matching groups in tokenizer with arrays of tokens (Chris
- Spencer)
-
-* Bug fixes
- - Add support for the new OSX scroll bars
- - Properly highlight JavaScript regexp literals
- - Proper handling of unicode characters in JavaScript identifiers
- - Fix remove lines command on last line (Harutyun Amirjanyan)
- - Fix scroll wheel sluggishness in Safari
- - Make keyboard infrastructure route keys like []^$ the right way (Julian
- Viereck)
-
-2011.02.14, Version 0.1.6
-
-* Floating Anchors
- - An Anchor is a floating pointer in the document.
- - Whenever text is inserted or deleted before the cursor, the position of
- the cursor is updated
- - Usesd for the cursor and selection
- - Basis for bookmarks, multiple cursors and snippets in the future
-* Extensive support for Cocoa style keybindings on the Mac
-* New commands:
- - center selection in viewport
- - remove to end/start of line
- - split line
- - transpose letters
-* Refator markers
- - Custom code can be used to render markers
- - Markers can be in front or behind the text
- - Markers are now stored in the session (was in the renderer)
-* Lots of IE8 fixes including copy, cut and selections
-* Unit tests can also be run in the browser
-
-* Soft wrap can adapt to the width of the editor (Mike Ratcliffe, Joe Cheng)
-* Add minimal node server server.js to run the Ace demo in Chrome
-* The top level editor.html demo has been renamed to index.html
-* Bug fixes
- - Fixed gotoLine to consider wrapped lines when calculating where to scroll to (James Allen)
- - Fixed isues when the editor was scrolled in the web page (Eric Allam)
- - Highlighting of Python string literals
- - Syntax rule for PHP comments
-
-2011.02.08, Version 0.1.5
-
-* Add Coffeescript Mode (Satoshi Murakami)
-* Fix word wrap bug (Julian Viereck)
-* Fix packaged version of the Eclipse mode
-* Loading of workers is more robust
-* Fix "click selection"
-* Allow tokizing empty lines (Daniel Krech)
-* Make PageUp/Down behavior more consistent with native OS (Joe Cheng)
-
-2011.02.04, Version 0.1.4
-
-* Add C/C++ mode contributed by Gastón Kleiman
-* Fix exception in key input
-
-2011.02.04, Version 0.1.3
-
-* Let the packaged version play nice with requireJS
-* Add Ruby mode contributed by Shlomo Zalman Heigh
-* Add Java mode contributed by Tom Tasche
-* Fix annotation bug
-* Changing a document added a new empty line at the end
\ No newline at end of file
diff --git a/applications/admin/static/ace/LICENSE b/applications/admin/static/ace/LICENSE
deleted file mode 100644
index 853e4fd5..00000000
--- a/applications/admin/static/ace/LICENSE
+++ /dev/null
@@ -1,476 +0,0 @@
-Licensed under the tri-license MPL/LGPL/GPL.
-
- MOZILLA PUBLIC LICENSE
- Version 1.1
-
- ---------------
-
-1. Definitions.
-
- 1.0.1. "Commercial Use" means distribution or otherwise making the
- Covered Code available to a third party.
-
- 1.1. "Contributor" means each entity that creates or contributes to
- the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the Original
- Code, prior Modifications used by a Contributor, and the Modifications
- made by that particular Contributor.
-
- 1.3. "Covered Code" means the Original Code or Modifications or the
- combination of the Original Code and Modifications, in each case
- including portions thereof.
-
- 1.4. "Electronic Distribution Mechanism" means a mechanism generally
- accepted in the software development community for the electronic
- transfer of data.
-
- 1.5. "Executable" means Covered Code in any form other than Source
- Code.
-
- 1.6. "Initial Developer" means the individual or entity identified
- as the Initial Developer in the Source Code notice required by Exhibit
- A.
-
- 1.7. "Larger Work" means a work which combines Covered Code or
- portions thereof with code not governed by the terms of this License.
-
- 1.8. "License" means this document.
-
- 1.8.1. "Licensable" means having the right to grant, to the maximum
- extent possible, whether at the time of the initial grant or
- subsequently acquired, any and all of the rights conveyed herein.
-
- 1.9. "Modifications" means any addition to or deletion from the
- substance or structure of either the Original Code or any previous
- Modifications. When Covered Code is released as a series of files, a
- Modification is:
- A. Any addition to or deletion from the contents of a file
- containing Original Code or previous Modifications.
-
- B. Any new file that contains any part of the Original Code or
- previous Modifications.
-
- 1.10. "Original Code" means Source Code of computer software code
- which is described in the Source Code notice required by Exhibit A as
- Original Code, and which, at the time of its release under this
- License is not already Covered Code governed by this License.
-
- 1.10.1. "Patent Claims" means any patent claim(s), now owned or
- hereafter acquired, including without limitation, method, process,
- and apparatus claims, in any patent Licensable by grantor.
-
- 1.11. "Source Code" means the preferred form of the Covered Code for
- making modifications to it, including all modules it contains, plus
- any associated interface definition files, scripts used to control
- compilation and installation of an Executable, or source code
- differential comparisons against either the Original Code or another
- well known, available Covered Code of the Contributor's choice. The
- Source Code can be in a compressed or archival form, provided the
- appropriate decompression or de-archiving software is widely available
- for no charge.
-
- 1.12. "You" (or "Your") means an individual or a legal entity
- exercising rights under, and complying with all of the terms of, this
- License or a future version of this License issued under Section 6.1.
- For legal entities, "You" includes any entity which controls, is
- controlled by, or is under common control with You. For purposes of
- this definition, "control" means (a) the power, direct or indirect,
- to cause the direction or management of such entity, whether by
- contract or otherwise, or (b) ownership of more than fifty percent
- (50%) of the outstanding shares or beneficial ownership of such
- entity.
-
-2. Source Code License.
-
- 2.1. The Initial Developer Grant.
- The Initial Developer hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Initial Developer to use, reproduce,
- modify, display, perform, sublicense and distribute the Original
- Code (or portions thereof) with or without Modifications, and/or
- as part of a Larger Work; and
-
- (b) under Patents Claims infringed by the making, using or
- selling of Original Code, to make, have made, use, practice,
- sell, and offer for sale, and/or otherwise dispose of the
- Original Code (or portions thereof).
-
- (c) the licenses granted in this Section 2.1(a) and (b) are
- effective on the date Initial Developer first distributes
- Original Code under the terms of this License.
-
- (d) Notwithstanding Section 2.1(b) above, no patent license is
- granted: 1) for code that You delete from the Original Code; 2)
- separate from the Original Code; or 3) for infringements caused
- by: i) the modification of the Original Code or ii) the
- combination of the Original Code with other software or devices.
-
- 2.2. Contributor Grant.
- Subject to third party intellectual property claims, each Contributor
- hereby grants You a world-wide, royalty-free, non-exclusive license
-
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Contributor, to use, reproduce, modify,
- display, perform, sublicense and distribute the Modifications
- created by such Contributor (or portions thereof) either on an
- unmodified basis, with other Modifications, as Covered Code
- and/or as part of a Larger Work; and
-
- (b) under Patent Claims infringed by the making, using, or
- selling of Modifications made by that Contributor either alone
- and/or in combination with its Contributor Version (or portions
- of such combination), to make, use, sell, offer for sale, have
- made, and/or otherwise dispose of: 1) Modifications made by that
- Contributor (or portions thereof); and 2) the combination of
- Modifications made by that Contributor with its Contributor
- Version (or portions of such combination).
-
- (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
- effective on the date Contributor first makes Commercial Use of
- the Covered Code.
-
- (d) Notwithstanding Section 2.2(b) above, no patent license is
- granted: 1) for any code that Contributor has deleted from the
- Contributor Version; 2) separate from the Contributor Version;
- 3) for infringements caused by: i) third party modifications of
- Contributor Version or ii) the combination of Modifications made
- by that Contributor with other software (except as part of the
- Contributor Version) or other devices; or 4) under Patent Claims
- infringed by Covered Code in the absence of Modifications made by
- that Contributor.
-
-3. Distribution Obligations.
-
- 3.1. Application of License.
- The Modifications which You create or to which You contribute are
- governed by the terms of this License, including without limitation
- Section 2.2. The Source Code version of Covered Code may be
- distributed only under the terms of this License or a future version
- of this License released under Section 6.1, and You must include a
- copy of this License with every copy of the Source Code You
- distribute. You may not offer or impose any terms on any Source Code
- version that alters or restricts the applicable version of this
- License or the recipients' rights hereunder. However, You may include
- an additional document offering the additional rights described in
- Section 3.5.
-
- 3.2. Availability of Source Code.
- Any Modification which You create or to which You contribute must be
- made available in Source Code form under the terms of this License
- either on the same media as an Executable version or via an accepted
- Electronic Distribution Mechanism to anyone to whom you made an
- Executable version available; and if made available via Electronic
- Distribution Mechanism, must remain available for at least twelve (12)
- months after the date it initially became available, or at least six
- (6) months after a subsequent version of that particular Modification
- has been made available to such recipients. You are responsible for
- ensuring that the Source Code version remains available even if the
- Electronic Distribution Mechanism is maintained by a third party.
-
- 3.3. Description of Modifications.
- You must cause all Covered Code to which You contribute to contain a
- file documenting the changes You made to create that Covered Code and
- the date of any change. You must include a prominent statement that
- the Modification is derived, directly or indirectly, from Original
- Code provided by the Initial Developer and including the name of the
- Initial Developer in (a) the Source Code, and (b) in any notice in an
- Executable version or related documentation in which You describe the
- origin or ownership of the Covered Code.
-
- 3.4. Intellectual Property Matters
- (a) Third Party Claims.
- If Contributor has knowledge that a license under a third party's
- intellectual property rights is required to exercise the rights
- granted by such Contributor under Sections 2.1 or 2.2,
- Contributor must include a text file with the Source Code
- distribution titled "LEGAL" which describes the claim and the
- party making the claim in sufficient detail that a recipient will
- know whom to contact. If Contributor obtains such knowledge after
- the Modification is made available as described in Section 3.2,
- Contributor shall promptly modify the LEGAL file in all copies
- Contributor makes available thereafter and shall take other steps
- (such as notifying appropriate mailing lists or newsgroups)
- reasonably calculated to inform those who received the Covered
- Code that new knowledge has been obtained.
-
- (b) Contributor APIs.
- If Contributor's Modifications include an application programming
- interface and Contributor has knowledge of patent licenses which
- are reasonably necessary to implement that API, Contributor must
- also include this information in the LEGAL file.
-
- (c) Representations.
- Contributor represents that, except as disclosed pursuant to
- Section 3.4(a) above, Contributor believes that Contributor's
- Modifications are Contributor's original creation(s) and/or
- Contributor has sufficient rights to grant the rights conveyed by
- this License.
-
- 3.5. Required Notices.
- You must duplicate the notice in Exhibit A in each file of the Source
- Code. If it is not possible to put such notice in a particular Source
- Code file due to its structure, then You must include such notice in a
- location (such as a relevant directory) where a user would be likely
- to look for such a notice. If You created one or more Modification(s)
- You may add your name as a Contributor to the notice described in
- Exhibit A. You must also duplicate this License in any documentation
- for the Source Code where You describe recipients' rights or ownership
- rights relating to Covered Code. You may choose to offer, and to
- charge a fee for, warranty, support, indemnity or liability
- obligations to one or more recipients of Covered Code. However, You
- may do so only on Your own behalf, and not on behalf of the Initial
- Developer or any Contributor. You must make it absolutely clear than
- any such warranty, support, indemnity or liability obligation is
- offered by You alone, and You hereby agree to indemnify the Initial
- Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of warranty,
- support, indemnity or liability terms You offer.
-
- 3.6. Distribution of Executable Versions.
- You may distribute Covered Code in Executable form only if the
- requirements of Section 3.1-3.5 have been met for that Covered Code,
- and if You include a notice stating that the Source Code version of
- the Covered Code is available under the terms of this License,
- including a description of how and where You have fulfilled the
- obligations of Section 3.2. The notice must be conspicuously included
- in any notice in an Executable version, related documentation or
- collateral in which You describe recipients' rights relating to the
- Covered Code. You may distribute the Executable version of Covered
- Code or ownership rights under a license of Your choice, which may
- contain terms different from this License, provided that You are in
- compliance with the terms of this License and that the license for the
- Executable version does not attempt to limit or alter the recipient's
- rights in the Source Code version from the rights set forth in this
- License. If You distribute the Executable version under a different
- license You must make it absolutely clear that any terms which differ
- from this License are offered by You alone, not by the Initial
- Developer or any Contributor. You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by
- the Initial Developer or such Contributor as a result of any such
- terms You offer.
-
- 3.7. Larger Works.
- You may create a Larger Work by combining Covered Code with other code
- not governed by the terms of this License and distribute the Larger
- Work as a single product. In such a case, You must make sure the
- requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
- If it is impossible for You to comply with any of the terms of this
- License with respect to some or all of the Covered Code due to
- statute, judicial order, or regulation then You must: (a) comply with
- the terms of this License to the maximum extent possible; and (b)
- describe the limitations and the code they affect. Such description
- must be included in the LEGAL file described in Section 3.4 and must
- be included with all distributions of the Source Code. Except to the
- extent prohibited by statute or regulation, such description must be
- sufficiently detailed for a recipient of ordinary skill to be able to
- understand it.
-
-5. Application of this License.
-
- This License applies to code to which the Initial Developer has
- attached the notice in Exhibit A and to related Covered Code.
-
-6. Versions of the License.
-
- 6.1. New Versions.
- Netscape Communications Corporation ("Netscape") may publish revised
- and/or new versions of the License from time to time. Each version
- will be given a distinguishing version number.
-
- 6.2. Effect of New Versions.
- Once Covered Code has been published under a particular version of the
- License, You may always continue to use it under the terms of that
- version. You may also choose to use such Covered Code under the terms
- of any subsequent version of the License published by Netscape. No one
- other than Netscape has the right to modify the terms applicable to
- Covered Code created under this License.
-
- 6.3. Derivative Works.
- If You create or use a modified version of this License (which you may
- only do in order to apply it to code which is not already Covered Code
- governed by this License), You must (a) rename Your license so that
- the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
- "MPL", "NPL" or any confusingly similar phrase do not appear in your
- license (except to note that your license differs from this License)
- and (b) otherwise make it clear that Your version of the license
- contains terms which differ from the Mozilla Public License and
- Netscape Public License. (Filling in the name of the Initial
- Developer, Original Code or Contributor in the notice described in
- Exhibit A shall not of themselves be deemed to be modifications of
- this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
- COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
- DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
- THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
- IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
- YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
- COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
- OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
- ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
- 8.1. This License and the rights granted hereunder will terminate
- automatically if You fail to comply with terms herein and fail to cure
- such breach within 30 days of becoming aware of the breach. All
- sublicenses to the Covered Code which are properly granted shall
- survive any termination of this License. Provisions which, by their
- nature, must remain in effect beyond the termination of this License
- shall survive.
-
- 8.2. If You initiate litigation by asserting a patent infringement
- claim (excluding declatory judgment actions) against Initial Developer
- or a Contributor (the Initial Developer or Contributor against whom
- You file such action is referred to as "Participant") alleging that:
-
- (a) such Participant's Contributor Version directly or indirectly
- infringes any patent, then any and all rights granted by such
- Participant to You under Sections 2.1 and/or 2.2 of this License
- shall, upon 60 days notice from Participant terminate prospectively,
- unless if within 60 days after receipt of notice You either: (i)
- agree in writing to pay Participant a mutually agreeable reasonable
- royalty for Your past and future use of Modifications made by such
- Participant, or (ii) withdraw Your litigation claim with respect to
- the Contributor Version against such Participant. If within 60 days
- of notice, a reasonable royalty and payment arrangement are not
- mutually agreed upon in writing by the parties or the litigation claim
- is not withdrawn, the rights granted by Participant to You under
- Sections 2.1 and/or 2.2 automatically terminate at the expiration of
- the 60 day notice period specified above.
-
- (b) any software, hardware, or device, other than such Participant's
- Contributor Version, directly or indirectly infringes any patent, then
- any rights granted to You by such Participant under Sections 2.1(b)
- and 2.2(b) are revoked effective as of the date You first made, used,
- sold, distributed, or had made, Modifications made by that
- Participant.
-
- 8.3. If You assert a patent infringement claim against Participant
- alleging that such Participant's Contributor Version directly or
- indirectly infringes any patent where such claim is resolved (such as
- by license or settlement) prior to the initiation of patent
- infringement litigation, then the reasonable value of the licenses
- granted by such Participant under Sections 2.1 or 2.2 shall be taken
- into account in determining the amount or value of any payment or
- license.
-
- 8.4. In the event of termination under Sections 8.1 or 8.2 above,
- all end user license agreements (excluding distributors and resellers)
- which have been validly granted by You or any distributor hereunder
- prior to termination shall survive termination.
-
-9. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
- DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
- OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
- ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
- CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
- WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
- RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
- PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
- EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
- THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
- The Covered Code is a "commercial item," as that term is defined in
- 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
- software" and "commercial computer software documentation," as such
- terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
- C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
- all U.S. Government End Users acquire Covered Code with only those
- rights set forth herein.
-
-11. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the extent
- necessary to make it enforceable. This License shall be governed by
- California law provisions (except to the extent applicable law, if
- any, provides otherwise), excluding its conflict-of-law provisions.
- With respect to disputes in which at least one party is a citizen of,
- or an entity chartered or registered to do business in the United
- States of America, any litigation relating to this License shall be
- subject to the jurisdiction of the Federal Courts of the Northern
- District of California, with venue lying in Santa Clara County,
- California, with the losing party responsible for costs, including
- without limitation, court costs and reasonable attorneys' fees and
- expenses. The application of the United Nations Convention on
- Contracts for the International Sale of Goods is expressly excluded.
- Any law or regulation which provides that the language of a contract
- shall be construed against the drafter shall not apply to this
- License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
- As between Initial Developer and the Contributors, each party is
- responsible for claims and damages arising, directly or indirectly,
- out of its utilization of rights under this License and You agree to
- work with Initial Developer and Contributors to distribute such
- responsibility on an equitable basis. Nothing herein is intended or
- shall be deemed to constitute any admission of liability.
-
-13. MULTIPLE-LICENSED CODE.
-
- Initial Developer may designate portions of the Covered Code as
- "Multiple-Licensed". "Multiple-Licensed" means that the Initial
- Developer permits you to utilize portions of the Covered Code under
- Your choice of the NPL or the alternative licenses, if any, specified
- by the Initial Developer in the file described in Exhibit A.
-
-EXHIBIT A -Mozilla Public License.
-
- ``The contents of this file are subject to the Mozilla Public License
- Version 1.1 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations
- under the License.
-
- The Original Code is ______________________________________.
-
- The Initial Developer of the Original Code is ________________________.
- Portions created by ______________________ are Copyright (C) ______
- _______________________. All Rights Reserved.
-
- Contributor(s): ______________________________________.
-
- Alternatively, the contents of this file may be used under the terms
- of the _____ license (the "[___] License"), in which case the
- provisions of [______] License are applicable instead of those
- above. If you wish to allow use of your version of this file only
- under the terms of the [____] License and not to allow others to use
- your version of this file under the MPL, indicate your decision by
- deleting the provisions above and replace them with the notice and
- other provisions required by the [___] License. If you do not delete
- the provisions above, a recipient may use your version of this file
- under either the MPL or the [___] License."
-
- [NOTE: The text of this Exhibit A may differ slightly from the text of
- the notices in the Source Code files of the Original Code. You should
- use the text of this Exhibit A rather than the text found in the
- Original Code Source Code for Your Modifications.]
-
-
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
\ No newline at end of file
diff --git a/applications/admin/static/ace/Readme.md b/applications/admin/static/ace/Readme.md
deleted file mode 100644
index 68edb3d0..00000000
--- a/applications/admin/static/ace/Readme.md
+++ /dev/null
@@ -1,199 +0,0 @@
-Ace (Ajax.org Cloud9 Editor)
-============================
-
-Ace is a standalone code editor written in JavaScript. Our goal is to create a browser based editor that matches and extends the features, usability and performance of existing native editors such as TextMate, Vim or Eclipse. It can be easily embedded in any web page or JavaScript application. Ace is developed as the primary editor for [Cloud9 IDE](http://www.cloud9ide.com/) and the successor of the Mozilla Skywriter (Bespin) Project.
-
-Features
---------
-
-* Syntax highlighting
-* Automatic indent and outdent
-* An optional command line
-* Handles huge documents (100,000 lines and more are no problem)
-* Fully customizable key bindings including VI and Emacs modes
-* Themes (TextMate themes can be imported)
-* Search and replace with regular expressions
-* Highlight matching parentheses
-* Toggle between soft tabs and real tabs
-* Displays hidden characters
-* Drag and drop text using the mouse
-* Line wrapping
-* Unstructured / user code folding
-* Live syntax checker (currently JavaScript/CoffeeScript)
-
-Take Ace for a spin!
---------------------
-
-Check out the Ace live [demo](http://ajaxorg.github.com/ace/) or get a [Cloud9 IDE account](http://run.cloud9ide.com) to experience Ace while editing one of your own GitHub projects.
-
-If you want, you can use Ace as a textarea replacement thanks to the [Ace Bookmarklet](http://ajaxorg.github.com/ace/build/textarea/editor.html).
-
-History
--------
-
-Previously known as “Bespin” and “Skywriter” it’s now known as Ace (Ajax.org Cloud9 Editor)! Bespin and Ace started as two independent projects, both aiming to build a no-compromise code editor component for the web. Bespin started as part of Mozilla Labs and was based on the canvas tag, while Ace is the Editor component of the Cloud9 IDE and is using the DOM for rendering. After the release of Ace at JSConf.eu 2010 in Berlin the Skywriter team decided to merge Ace with a simplified version of Skywriter's plugin system and some of Skywriter's extensibility points. All these changes have been merged back to Ace. Both Ajax.org and Mozilla are actively developing and maintaining Ace.
-
-Getting the code
-----------------
-
-Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the Mozilla tri-license (MPL/GPL/LGPL), the same license used by Firefox. This license is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!
-
-```bash
- git clone git://github.com/ajaxorg/ace.git
- cd ace
- git submodule update --init --recursive
-```
-
-Embedding Ace
--------------
-
-Ace can be easily embedded into any existing web page. The Ace git repository ships with a pre-packaged version of Ace inside of the `build` directory. The same packaged files are also available as a separate [download](https://github.com/ajaxorg/ace/downloads). Simply copy the contents of the `src` subdirectory somewhere into your project and take a look at the included demos of how to use Ace.
-
-The easiest version is simply:
-
-```html
-
some text
-
-
-```
-
-With "editor" being the id of the DOM element, which should be converted to an editor. Note that this element must be explicitly sized and positioned `absolute` or `relative` for Ace to work. e.g.
-
-```css
- #editor {
- position: absolute;
- width: 500px;
- height: 400px;
- }
-```
-
-To change the theme simply include the Theme's JavaScript file
-
-```html
-
-```
-
-and configure the editor to use the theme:
-
-```javascript
- editor.setTheme("ace/theme/twilight");
-```
-
-By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:
-
-```html
-
-```
-
-Then the mode can be used like this:
-
-```javascript
- var JavaScriptMode = require("ace/mode/javascript").Mode;
- editor.getSession().setMode(new JavaScriptMode());
-```
-
-Documentation
--------------
-
-You find a lot more sample code in the [demo app](https://github.com/ajaxorg/ace/blob/master/demo/demo.js).
-
-There is also some documentation on the [wiki page](https://github.com/ajaxorg/ace/wiki).
-
-If you still need help, feel free to drop a mail on the [ace mailing list](http://groups.google.com/group/ace-discuss).
-
-Running Ace
------------
-
-After the checkout Ace works out of the box. No build step is required. Open 'editor.html' in any browser except Google Chrome. Google Chrome doesn't allow XMLHTTPRequests from files loaded from disc (i.e. with a file:/// URL). To open Ace in Chrome simply start the bundled mini HTTP server:
-
-```bash
- ./static.py
-```
-
-Or using Node.JS
-
-```bash
- npm install mime
- ./static.js
-```
-
-The editor can then be opened at http://localhost:8888/index.html.
-
-Package Ace
------------
-
-To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. Before you can build you need to make sure that the submodules are up to date.
-
-```bash
- git submodule update --init --recursive
-```
-
-Make sure you at least version 0.3.0 of dryice
-
-```bash
- npm install dryice
-```
-
-Afterwards Ace can be built by calling
-
-```bash
- ./Makefile.dryice.js normal
-```
-
-The packaged Ace will be put in the 'build' folder.
-
-To build the bookmarklet version execute
-
-```bash
- ./Makefile.dryice.js bm
-```
-
-Running the Unit Tests
-----------------------
-
-The Ace unit tests run on node.js. Before the first run a couple of node modules have to be installed. The easiest way to do this is by using the node package manager (npm). In the Ace base directory simply call
-
-```bash
- npm link .
-```
-
-To run the tests call:
-
-```bash
- node lib/ace/test/all.js
-```
-
-You can also run the tests in your browser by serving:
-
- http://localhost:8888/lib/ace/test/tests.html
-
-This makes debugging failing tests way more easier.
-
-Continuous Integration status
------------------------------
-
-This project is tested with [Travis CI](http://travis-ci.org)
-[](http://travis-ci.org/ajaxorg/ace)
-
-Contributing
-------------
-
-Ace wouldn't be what it is without contributions! Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once. There are two versions of the agreement:
-
-1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
-2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects
-
-If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email.
-
-Email: fabian.jakobs@web.de
-
-Fax: +31 (0) 206388953
-
-Address: Ajax.org B.V.
- Keizersgracht 241
- 1016 EA, Amsterdam
- the Netherlands
\ No newline at end of file
diff --git a/applications/admin/static/ace/src/ace-compat.js b/applications/admin/static/ace/src/ace-compat.js
deleted file mode 100644
index 18d2ed78..00000000
--- a/applications/admin/static/ace/src/ace-compat.js
+++ /dev/null
@@ -1 +0,0 @@
-define("pilot/index",["require","exports","module","pilot/browser_focus","pilot/dom","pilot/event","pilot/event_emitter","pilot/fixoldbrowsers","pilot/keys","pilot/lang","pilot/oop","pilot/useragent","pilot/canon"],function(a,b,c){a("pilot/browser_focus"),a("pilot/dom"),a("pilot/event"),a("pilot/event_emitter"),a("pilot/fixoldbrowsers"),a("pilot/keys"),a("pilot/lang"),a("pilot/oop"),a("pilot/useragent"),a("pilot/canon")}),define("pilot/browser_focus",["require","exports","module","ace/lib/browser_focus"],function(a,b,c){console.warn("DEPRECATED: 'pilot/browser_focus' is deprecated. Use 'ace/lib/browser_focus' instead"),c.exports=a("ace/lib/browser_focus")}),define("pilot/dom",["require","exports","module","ace/lib/dom"],function(a,b,c){console.warn("DEPRECATED: 'pilot/dom' is deprecated. Use 'ace/lib/dom' instead"),c.exports=a("ace/lib/dom")}),define("pilot/event",["require","exports","module","ace/lib/event"],function(a,b,c){console.warn("DEPRECATED: 'pilot/event' is deprecated. Use 'ace/lib/event' instead"),c.exports=a("ace/lib/event")}),define("pilot/event_emitter",["require","exports","module","ace/lib/event_emitter"],function(a,b,c){console.warn("DEPRECATED: 'pilot/event_emitter' is deprecated. Use 'ace/lib/event_emitter' instead"),c.exports=a("ace/lib/event_emitter")}),define("pilot/fixoldbrowsers",["require","exports","module","ace/lib/fixoldbrowsers"],function(a,b,c){console.warn("DEPRECATED: 'pilot/fixoldbrowsers' is deprecated. Use 'ace/lib/fixoldbrowsers' instead"),c.exports=a("ace/lib/fixoldbrowsers")}),define("pilot/keys",["require","exports","module","ace/lib/keys"],function(a,b,c){console.warn("DEPRECATED: 'pilot/keys' is deprecated. Use 'ace/lib/keys' instead"),c.exports=a("ace/lib/keys")}),define("pilot/lang",["require","exports","module","ace/lib/lang"],function(a,b,c){console.warn("DEPRECATED: 'pilot/lang' is deprecated. Use 'ace/lib/lang' instead"),c.exports=a("ace/lib/lang")}),define("pilot/oop",["require","exports","module","ace/lib/oop"],function(a,b,c){console.warn("DEPRECATED: 'pilot/oop' is deprecated. Use 'ace/lib/oop' instead"),c.exports=a("ace/lib/oop")}),define("pilot/useragent",["require","exports","module","ace/lib/useragent"],function(a,b,c){console.warn("DEPRECATED: 'pilot/useragent' is deprecated. Use 'ace/lib/useragent' instead"),c.exports=a("ace/lib/useragent")}),define("pilot/canon",["require","exports","module"],function(a,b,c){console.warn("DEPRECATED: 'pilot/canon' is deprecated."),b.addCommand=function(){console.warn("DEPRECATED: 'canon.addCommand()' is deprecated. Use 'editor.commands.addCommand(command)' instead."),console.trace()},b.removeCommand=function(){console.warn("DEPRECATED: 'canon.removeCommand()' is deprecated. Use 'editor.commands.removeCommand(command)' instead."),console.trace()}})
\ No newline at end of file
diff --git a/applications/admin/static/ace/src/ace.js b/applications/admin/static/ace/src/ace.js
deleted file mode 100644
index 8fa4f627..00000000
--- a/applications/admin/static/ace/src/ace.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function(){function g(a){if(typeof requirejs!="undefined"){var e=b.define;b.define=function(a,b,c){return typeof c!="function"?e.apply(this,arguments):e(a,b,function(a,d,e){return b[2]=="module"&&(e.packaged=!0),c.apply(this,arguments)})},b.define.packaged=!0;return}var f=function(a,b){return d("",a,b)};f.packaged=!0;var g=b;a&&(b[a]||(b[a]={}),g=b[a]),g.define&&(c.original=g.define),g.define=c,g.require&&(d.original=g.require),g.require=f}var a="",b=function(){return this}(),c=function(a,b,d){if(typeof a!="string"){c.original?c.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(d=b),c.modules||(c.modules={}),c.modules[a]=d},d=function(a,b,c){if(Object.prototype.toString.call(b)==="[object Array]"){var e=[];for(var g=0,h=b.length;g1&&h(b,"")>-1&&(i=RegExp(this.source,d.replace.call(g(this),"g","")),d.replace.call(a.slice(b.index),i,function(){for(var a=1;ab.index&&this.lastIndex--}return b},f||(RegExp.prototype.test=function(a){var b=d.exec.call(this,a);return b&&this.global&&!b[0].length&&this.lastIndex>b.index&&this.lastIndex--,!!b})}),define("ace/lib/es5-shim",["require","exports","module"],function(a,b,c){function p(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=g.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,h=c.apply(f,d.concat(g.call(arguments)));return h!==null&&Object(h)===h?h:f}return c.apply(b,d.concat(g.call(arguments)))};return e});var d=Function.prototype.call,e=Array.prototype,f=Object.prototype,g=e.slice,h=d.bind(f.toString),i=d.bind(f.hasOwnProperty),j,k,l,m,n;if(n=i(f,"__defineGetter__"))j=d.bind(f.__defineGetter__),k=d.bind(f.__defineSetter__),l=d.bind(f.__lookupGetter__),m=d.bind(f.__lookupSetter__);Array.isArray||(Array.isArray=function(b){return h(b)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(b){var c=G(this),d=arguments[1],e=0,f=c.length>>>0;if(h(b)!="[object Function]")throw new TypeError;while(e>>0,e=Array(d),f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=[],f=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var g=0;g>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0,e=arguments[1];if(h(b)!="[object Function]")throw new TypeError;for(var f=0;f>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e=0,f;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);for(;e>>0;if(h(b)!="[object Function]")throw new TypeError;if(!d&&arguments.length==1)throw new TypeError;var e,f=d-1;if(arguments.length>=2)e=arguments[1];else do{if(f in c){e=c[f--];break}if(--f<0)throw new TypeError}while(!0);do f in this&&(e=b.call(void 0,e,c[f],f,c));while(f--);return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(b){var c=G(this),d=c.length>>>0;if(!d)return-1;var e=0;arguments.length>1&&(e=E(arguments[1])),e=e>=0?e:Math.max(0,d+e);for(;e>>0;if(!d)return-1;var e=d-1;arguments.length>1&&(e=Math.min(e,E(arguments[1]))),e=e>=0?e:d-Math.abs(e);for(;e>=0;e--)if(e in c&&b===c[e])return e;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(b){return b.__proto__||(b.constructor?b.constructor.prototype:f)});if(!Object.getOwnPropertyDescriptor){var o="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(b,c){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(o+b);if(!i(b,c))return;var d,e,g;d={enumerable:!0,configurable:!0};if(n){var h=b.__proto__;b.__proto__=f;var e=l(b,c),g=m(b,c);b.__proto__=h;if(e||g)return e&&(d.get=e),g&&(d.set=g),d}return d.value=b[c],d}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(b){return Object.keys(b)}),Object.create||(Object.create=function(b,c){var d;if(b===null)d={"__proto__":null};else{if(typeof b!="object")throw new TypeError("typeof prototype["+typeof b+"] != 'object'");var e=function(){};e.prototype=b,d=new e,d.__proto__=b}return c!==void 0&&Object.defineProperties(d,c),d});if(Object.defineProperty){var q=p({}),r=typeof document=="undefined"||p(document.createElement("div"));if(!q||!r)var s=Object.defineProperty}if(!Object.defineProperty||s){var t="Property description must be an object: ",u="Object.defineProperty called on non-object: ",v="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(b,c,d){if(typeof b!="object"&&typeof b!="function"||b===null)throw new TypeError(u+b);if(typeof d!="object"&&typeof d!="function"||d===null)throw new TypeError(t+d);if(s)try{return s.call(Object,b,c,d)}catch(e){}if(i(d,"value"))if(n&&(l(b,c)||m(b,c))){var g=b.__proto__;b.__proto__=f,delete b[c],b[c]=d.value,b.__proto__=g}else b[c]=d.value;else{if(!n)throw new TypeError(v);i(d,"get")&&j(b,c,d.get),i(d,"set")&&k(b,c,d.set)}return b}}Object.defineProperties||(Object.defineProperties=function(b,c){for(var d in c)i(c,d)&&Object.defineProperty(b,d,c[d]);return b}),Object.seal||(Object.seal=function(b){return b}),Object.freeze||(Object.freeze=function(b){return b});try{Object.freeze(function(){})}catch(w){Object.freeze=function(b){return function(c){return typeof c=="function"?c:b(c)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(b){return b}),Object.isSealed||(Object.isSealed=function(b){return!1}),Object.isFrozen||(Object.isFrozen=function(b){return!1}),Object.isExtensible||(Object.isExtensible=function(b){if(Object(b)===b)throw new TypeError;var c="";while(i(b,c))c+="?";b[c]=!0;var d=i(b,c);return delete b[c],d});if(!Object.keys){var x=!0,y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],z=y.length;for(var A in{toString:null})x=!1;Object.keys=function H(a){if(typeof a!="object"&&typeof a!="function"||a===null)throw new TypeError("Object.keys called on a non-object");var H=[];for(var b in a)i(a,b)&&H.push(b);if(x)for(var c=0,d=z;c9999?"+":"")+("00000"+Math.abs(e)).slice(0<=e&&e<=9999?-4:-6),c=b.length;while(c--)d=b[c],d<10&&(b[c]="0"+d);return e+"-"+b.slice(0,2).join("-")+"T"+b.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};Date.now||(Date.now=function(){return(new Date).getTime()}),Date.prototype.toJSON||(Date.prototype.toJSON=function(b){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),Date.parse("+275760-09-13T00:00:00.000Z")!==864e13&&(Date=function(a){var b=function e(b,c,d,f,g,h,i){var j=arguments.length;if(this instanceof a){var k=j==1&&String(b)===b?new a(e.parse(b)):j>=7?new a(b,c,d,f,g,h,i):j>=6?new a(b,c,d,f,g,h):j>=5?new a(b,c,d,f,g):j>=4?new a(b,c,d,f):j>=3?new a(b,c,d):j>=2?new a(b,c):j>=1?new a(b):new a;return k.constructor=e,k}return a.apply(this,arguments)},c=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");for(var d in a)b[d]=a[d];return b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(d){var e=c.exec(d);if(e){e.shift();for(var f=1;f<7;f++)e[f]=+(e[f]||(f<3?1:0)),f==1&&e[f]--;var g=+e.pop(),h=+e.pop(),i=e.pop(),j=0;if(i){if(h>23||g>59)return NaN;j=(h*60+g)*6e4*(i=="+"?-1:1)}var k=+e[0];return 0<=k&&k<=99?(e[0]=k+400,a.UTC.apply(this,e)+j-126227808e5):a.UTC.apply(this,e)+j}return a.parse.apply(this,arguments)},b}(Date));var B="\t\n\f\r \u2028\u2029";if(!String.prototype.trim||B.trim()){B="["+B+"]";var C=new RegExp("^"+B+B+"*"),D=new RegExp(B+B+"*$");String.prototype.trim=function(){return String(this).replace(C,"").replace(D,"")}}var E=function(a){return a=+a,a!==a?a=0:a!==0&&a!==1/0&&a!==-Infinity&&(a=(a>0||-1)*Math.floor(Math.abs(a))),a},F="a"[0]!="a",G=function(a){if(a==null)throw new TypeError;return F&&typeof a=="string"&&a?a.split(""):Object(a)}}),define("ace/lib/dom",["require","exports","module"],function(a,b,c){"use strict";var d="http://www.w3.org/1999/xhtml";b.createElement=function(a,b){return document.createElementNS?document.createElementNS(b||d,a):document.createElement(a)},b.setText=function(a,b){a.innerText!==undefined&&(a.innerText=b),a.textContent!==undefined&&(a.textContent=b)},b.hasCssClass=function(a,b){var c=a.className.split(/\s+/g);return c.indexOf(b)!==-1},b.addCssClass=function(a,c){b.hasCssClass(a,c)||(a.className+=" "+c)},b.removeCssClass=function(a,b){var c=a.className.split(/\s+/g);for(;;){var d=c.indexOf(b);if(d==-1)break;c.splice(d,1)}a.className=c.join(" ")},b.toggleCssClass=function(a,b){var c=a.className.split(/\s+/g),d=!0;for(;;){var e=c.indexOf(b);if(e==-1)break;d=!1,c.splice(e,1)}return d&&c.push(b),a.className=c.join(" "),d},b.setCssClass=function(a,c,d){d?b.addCssClass(a,c):b.removeCssClass(a,c)},b.hasCssString=function(a,b){var c=0,d;b=b||document;if(b.createStyleSheet&&(d=b.styleSheets)){while(c5||Math.abs(a.clientY-j)>5)h=0;h==d&&(h=0,g(a));if(e)return b.preventDefault(a)};b.addListener(a,"mousedown",k),e.isOldIE&&b.addListener(a,"dblclick",k)},b.addCommandKeyListener=function(a,c){var d=b.addListener;if(e.isOldGecko||e.isOpera){var f=null;d(a,"keydown",function(a){f=a.keyCode}),d(a,"keypress",function(a){return g(c,a,f)})}else{var h=null;d(a,"keydown",function(a){return h=a.keyIdentifier||a.keyCode,g(c,a,a.keyCode)})}};if(window.postMessage){var h=1;b.nextTick=function(a,c){c=c||window;var d="zero-timeout-message-"+h;b.addListener(c,"message",function e(f){f.data==d&&(b.stopPropagation(f),b.removeListener(c,"message",e),a())}),c.postMessage(d,"*")}}else b.nextTick=function(a,b){b=b||window,window.setTimeout(a,0)}}),define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(a,b,c){"use strict";var d=a("./oop"),e=function(){var a={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:'"'}};for(var b in a.FUNCTION_KEYS){var c=a.FUNCTION_KEYS[b].toUpperCase();a[c]=parseInt(b,10)}return d.mixin(a,a.MODIFIER_KEYS),d.mixin(a,a.PRINTABLE_KEYS),d.mixin(a,a.FUNCTION_KEYS),a}();d.mixin(b,e),b.keyCodeToString=function(a){return(e[a]||String.fromCharCode(a)).toLowerCase()}}),define("ace/lib/oop",["require","exports","module"],function(a,b,c){"use strict",b.inherits=function(){var a=function(){};return function(b,c){a.prototype=c.prototype,b.super_=c.prototype,b.prototype=new a,b.prototype.constructor=b}}(),b.mixin=function(a,b){for(var c in b)a[c]=b[c]},b.implement=function(a,c){b.mixin(a,c)}}),define("ace/lib/useragent",["require","exports","module"],function(a,b,c){"use strict";var d=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),e=navigator.userAgent;b.isWin=d=="win",b.isMac=d=="mac",b.isLinux=d=="linux",b.isIE=navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),b.isOldIE=b.isIE&&b.isIE<9,b.isGecko=b.isMozilla=window.controllers&&window.navigator.product==="Gecko",b.isOldGecko=b.isGecko&&parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1],10)<4,b.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",b.isWebKit=parseFloat(e.split("WebKit/")[1])||undefined,b.isChrome=parseFloat(e.split(" Chrome/")[1])||undefined,b.isAIR=e.indexOf("AdobeAIR")>=0,b.isIPad=e.indexOf("iPad")>=0,b.isTouchPad=e.indexOf("TouchPad")>=0,b.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},b.getOS=function(){return b.isMac?b.OS.MAC:b.isLinux?b.OS.LINUX:b.OS.WINDOWS}}),define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands"],function(a,b,c){"use strict",a("./lib/fixoldbrowsers");var d=a("./lib/oop"),e=a("./lib/lang"),f=a("./lib/useragent"),g=a("./keyboard/textinput").TextInput,h=a("./mouse/mouse_handler").MouseHandler,i=a("./mouse/fold_handler").FoldHandler,j=a("./keyboard/keybinding").KeyBinding,k=a("./edit_session").EditSession,l=a("./search").Search,m=a("./range").Range,n=a("./lib/event_emitter").EventEmitter,o=a("./commands/command_manager").CommandManager,p=a("./commands/default_commands").commands,q=function(a,b){var c=a.getContainerElement();this.container=c,this.renderer=a,this.textInput=new g(a.getTextAreaContainer(),this),this.keyBinding=new j(this),f.isIPad||(this.$mouseHandler=new h(this),new i(this)),this.$blockScrolling=0,this.$search=(new l).set({wrap:!0}),this.commands=new o(f.isMac?"mac":"win",p),this.setSession(b||new k(""))};((function(){d.implement(this,n),this.setKeyboardHandler=function(a){this.keyBinding.setKeyboardHandler(a)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(a){if(this.session==a)return;if(this.session){var b=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeLeftTop",this.$onScrollLeftChange);var c=this.session.getSelection();c.removeEventListener("changeCursor",this.$onCursorChange),c.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=a,this.$onDocumentChange=this.onDocumentChange.bind(this),a.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(a),this.$onChangeMode=this.onChangeMode.bind(this),a.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),a.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.updateText.bind(this.renderer),a.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),a.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),a.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),a.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=a.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull(),this._emit("changeSession",{session:a,oldSession:b})},this.getSession=function(){return this.session},this.getSelection=function(){return this.selection},this.resize=function(){this.renderer.onResize()},this.setTheme=function(a){this.renderer.setTheme(a)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(a){this.renderer.setStyle(a)},this.unsetStyle=function(a){this.renderer.unsetStyle(a)},this.setFontSize=function(a){this.container.style.fontSize=a,this.renderer.updateFontSize()},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var a=this;this.$highlightPending=!0,setTimeout(function(){a.$highlightPending=!1;var b=a.session.findMatchingBracket(a.getCursorPosition());if(b){var c=new m(b.row,b.column,b.row,b.column+1);a.session.$bracketHighlight=a.session.addMarker(c,"ace_bracket","text")}},10)},this.focus=function(){var a=this;setTimeout(function(){a.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus")},this.onBlur=function(){this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur")},this.onDocumentChange=function(a){var b=a.data,c=b.range,d;c.start.row==c.end.row&&b.action!="insertLines"&&b.action!="removeLines"?d=c.end.row:d=Infinity,this.renderer.updateLines(c.start.row,d),this._emit("change",a),this.onCursorChange()},this.onTokenizerUpdate=function(a){var b=a.data;this.renderer.updateLines(b.first,b.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.renderer.updateCursor(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.renderer.moveTextAreaToCursor(this.textInput.getElement()),this.$highlightBrackets(),this.$updateHighlightActiveLine()},this.$updateHighlightActiveLine=function(){var a=this.getSession();a.$highlightLineMarker&&a.removeMarker(a.$highlightLineMarker),a.$highlightLineMarker=null;if(this.getHighlightActiveLine()&&(this.getSelectionStyle()!="line"||!this.selection.isMultiLine())){var b=this.getCursorPosition(),c=this.session.getFoldLine(b.row),d;c?d=new m(c.start.row,0,c.end.row+1,0):d=new m(b.row,0,b.row+1,0),a.$highlightLineMarker=a.addMarker(d,"ace_active_line","background")}},this.onSelectionChange=function(a){var b=this.getSession();b.$selectionMarker&&b.removeMarker(b.$selectionMarker),b.$selectionMarker=null;if(!this.selection.isEmpty()){var c=this.selection.getRange(),d=this.getSelectionStyle();b.$selectionMarker=b.addMarker(c,"ace_selection",d)}else this.$updateHighlightActiveLine();this.$highlightSelectedWord&&this.session.getMode().highlightSelection(this)},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.setBreakpoints(this.session.getBreakpoints())},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(){this.renderer.updateText()},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getCopyText=function(){var a="";return this.selection.isEmpty()||(a=this.session.getTextRange(this.getSelectionRange())),this._emit("copy",a),a},this.onCut=function(){if(this.$readOnly)return;var a=this.getSelectionRange();this._emit("cut",a),this.selection.isEmpty()||(this.session.remove(a),this.clearSelection())},this.insert=function(a){var b=this.session,c=b.getMode(),d=this.getCursorPosition();if(this.getBehavioursEnabled()){var e=c.transformAction(b.getState(d.row),"insertion",this,b,a);e&&(a=e.text)}a=a.replace("\t",this.session.getTabString());if(!this.selection.isEmpty())d=this.session.remove(this.getSelectionRange()),this.clearSelection();else if(this.session.getOverwrite()){var f=new m.fromPoints(d,d);f.end.column+=a.length,this.session.remove(f)}this.clearSelection();var g=d.column,h=b.getState(d.row),i=c.checkOutdent(h,b.getLine(d.row),a),j=b.getLine(d.row),k=c.getNextLineIndent(h,j.slice(0,d.column),b.getTabString()),l=b.insert(d,a);e&&e.selection&&(e.selection.length==2?this.selection.setSelectionRange(new m(d.row,g+e.selection[0],d.row,g+e.selection[1])):this.selection.setSelectionRange(new m(d.row+e.selection[0],e.selection[1],d.row+e.selection[2],e.selection[3])));var h=b.getState(d.row);if(b.getDocument().isNewLine(a)){this.moveCursorTo(d.row+1,0);var n=b.getTabSize(),o=Number.MAX_VALUE;for(var p=d.row+1;p<=l.row;++p){var q=0;j=b.getLine(p);for(var r=0;r0;++r)j.charAt(r)=="\t"?s-=n:j.charAt(r)==" "&&(s-=1);b.remove(new m(p,0,p,r))}b.indentRows(d.row+1,l.row,k)}i&&c.autoOutdent(h,b,d.row)},this.onTextInput=function(a,b){b&&this._emit("paste",a),this.keyBinding.onTextInput(a,b)},this.onCommandKey=function(a,b,c){this.keyBinding.onCommandKey(a,b,c)},this.setOverwrite=function(a){this.session.setOverwrite(a)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(a){this.$mouseHandler.setScrollSpeed(a)},this.getScrollSpeed=function(){return this.$mouseHandler.getScrollSpeed()},this.setDragDelay=function(a){this.$mouseHandler.setDragDelay(a)},this.getDragDelay=function(){return this.$mouseHandler.getDragDelay()},this.$selectionStyle="line",this.setSelectionStyle=function(a){if(this.$selectionStyle==a)return;this.$selectionStyle=a,this.onSelectionChange(),this._emit("changeSelectionStyle",{data:a})},this.getSelectionStyle=function(){return this.$selectionStyle},this.$highlightActiveLine=!0,this.setHighlightActiveLine=function(a){if(this.$highlightActiveLine==a)return;this.$highlightActiveLine=a,this.$updateHighlightActiveLine()},this.getHighlightActiveLine=function(){return this.$highlightActiveLine},this.$highlightSelectedWord=!0,this.setHighlightSelectedWord=function(a){if(this.$highlightSelectedWord==a)return;this.$highlightSelectedWord=a,a?this.session.getMode().highlightSelection(this):this.session.getMode().clearSelectionHighlight(this)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setShowInvisibles=function(a){if(this.getShowInvisibles()==a)return;this.renderer.setShowInvisibles(a)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setShowPrintMargin=function(a){this.renderer.setShowPrintMargin(a)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(a){this.renderer.setPrintMarginColumn(a)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.$readOnly=!1,this.setReadOnly=function(a){this.$readOnly=a},this.getReadOnly=function(){return this.$readOnly},this.$modeBehaviours=!0,this.setBehavioursEnabled=function(a){this.$modeBehaviours=a},this.getBehavioursEnabled=function(){return this.$modeBehaviours},this.setShowFoldWidgets=function(a){var b=this.renderer.$gutterLayer;if(b.getShowFoldWidgets()==a)return;this.renderer.$gutterLayer.setShowFoldWidgets(a),this.$showFoldWidgets=a,this.renderer.updateFull()},this.getShowFoldWidgets=function(){return this.renderer.$gutterLayer.getShowFoldWidgets()},this.remove=function(a){this.selection.isEmpty()&&(a=="left"?this.selection.selectLeft():this.selection.selectRight());var b=this.getSelectionRange();if(this.getBehavioursEnabled()){var c=this.session,d=c.getState(b.start.row),e=c.getMode().transformAction(d,"deletion",this,c,b);e&&(b=e)}this.session.remove(b),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var a=this.getSelectionRange();a.start.column==a.end.column&&a.start.row==a.end.row&&(a.end.column=0,a.end.row++),this.session.remove(a),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var a=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(a)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var a=this.getCursorPosition(),b=a.column;if(b===0)return;var c=this.session.getLine(a.row),d,e;b=this.getFirstVisibleRow()&&a<=this.getLastVisibleRow()},this.isRowFullyVisible=function(a){return a>=this.renderer.getFirstFullyVisibleRow()&&a<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$getPageDownRow=function(){return this.renderer.getScrollBottomRow()},this.$getPageUpRow=function(){var a=this.renderer.getScrollTopRow(),b=this.renderer.getScrollBottomRow();return a-(b-a)},this.selectPageDown=function(){var a=this.$getPageDownRow()+Math.floor(this.$getVisibleRowCount()/2);this.scrollPageDown();var b=this.getSelection(),c=this.session.documentToScreenPosition(b.getSelectionLead()),d=this.session.screenToDocumentPosition(a,c.column);b.selectTo(d.row,d.column)},this.selectPageUp=function(){var a=this.renderer.getScrollTopRow()-this.renderer.getScrollBottomRow(),b=this.$getPageUpRow()+Math.round(a/2);this.scrollPageUp();var c=this.getSelection(),d=this.session.documentToScreenPosition(c.getSelectionLead()),e=this.session.screenToDocumentPosition(b,d.column);c.selectTo(e.row,e.column)},this.gotoPageDown=function(){var a=this.$getPageDownRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.gotoPageUp=function(){var a=this.$getPageUpRow(),b=this.getCursorPositionScreen().column;this.scrollToRow(a),this.getSelection().moveCursorToScreen(a,b)},this.scrollPageDown=function(){this.scrollToRow(this.$getPageDownRow())},this.scrollPageUp=function(){this.renderer.scrollToRow(this.$getPageUpRow())},this.scrollToRow=function(a){this.renderer.scrollToRow(a)},this.scrollToLine=function(a,b){this.renderer.scrollToLine(a,b)},this.centerSelection=function(){var a=this.getSelectionRange(),b=Math.floor(a.start.row+(a.end.row-a.start.row)/2);this.renderer.scrollToLine(b,!0)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(a,b){this.selection.moveCursorTo(a,b)},this.moveCursorToPosition=function(a){this.selection.moveCursorToPosition(a)},this.jumpToMatching=function(){var a=this.getCursorPosition(),b=this.session.findMatchingBracket(a);b||(a.column+=1,b=this.session.findMatchingBracket(a)),b||(a.column-=2,b=this.session.findMatchingBracket(a)),b&&(this.clearSelection(),this.moveCursorTo(b.row,b.column))},this.gotoLine=function(a,b){this.selection.clearSelection(),this.session.unfold({row:a-1,column:b||0}),this.$blockScrolling+=1,this.moveCursorTo(a-1,b||0),this.$blockScrolling-=1,this.isRowFullyVisible(this.getCursorPosition().row)||this.scrollToLine(a,!0)},this.navigateTo=function(a,b){this.clearSelection(),this.moveCursorTo(a,b)},this.navigateUp=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(-a,0)},this.navigateDown=function(a){this.selection.clearSelection(),a=a||1,this.selection.moveCursorBy(a,0)},this.navigateLeft=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().start;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorLeft()}this.clearSelection()},this.navigateRight=function(a){if(!this.selection.isEmpty()){var b=this.getSelectionRange().end;this.moveCursorToPosition(b)}else{a=a||1;while(a--)this.selection.moveCursorRight()}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,b){b&&this.$search.set(b);var c=this.$search.find(this.session);if(!c)return;this.$tryReplace(c,a),c!==null&&this.selection.setSelectionRange(c)},this.replaceAll=function(a,b){b&&this.$search.set(b);var c=this.$search.findAll(this.session);if(!c.length)return;var d=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0),this.$blockScrolling+=1;for(var e=c.length-1;e>=0;--e)this.$tryReplace(c[e],a);this.selection.setSelectionRange(d),this.$blockScrolling-=1},this.$tryReplace=function(a,b){var c=this.session.getTextRange(a);return b=this.$search.replace(c,b),b!==null?(a.end=this.session.replace(a,b),a):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,b){this.clearSelection(),b=b||{},b.needle=a,this.$search.set(b),this.$find()},this.findNext=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!1),this.$search.set(a),this.$find()},this.findPrevious=function(a){a=a||{},typeof a.backwards=="undefined"&&(a.backwards=!0),this.$search.set(a),this.$find()},this.$find=function(a){this.selection.isEmpty()||this.$search.set({needle:this.session.getTextRange(this.getSelectionRange())}),typeof a!="undefined"&&this.$search.set({backwards:a});var b=this.$search.find(this.session);b&&(this.session.unfold(b),this.selection.setSelectionRange(b))},this.undo=function(){this.session.getUndoManager().undo()},this.redo=function(){this.session.getUndoManager().redo()},this.destroy=function(){this.renderer.destroy()}})).call(q.prototype),b.Editor=q}),define("ace/lib/lang",["require","exports","module"],function(a,b,c){"use strict",b.stringReverse=function(a){return a.split("").reverse().join("")},b.stringRepeat=function(a,b){return(new Array(b+1)).join(a)};var d=/^\s\s*/,e=/\s\s*$/;b.stringTrimLeft=function(a){return a.replace(d,"")},b.stringTrimRight=function(a){return a.replace(e,"")},b.copyObject=function(a){var b={};for(var c in a)b[c]=a[c];return b},b.copyArray=function(a){var b=[];for(var c=0,d=a.length;c128)return;setTimeout(function(){h||m()},0)},p=function(a){h=!0,b.onCompositionStart(),e.isGecko||setTimeout(q,0)},q=function(){if(!h)return;b.onCompositionUpdate(c.value)},r=function(a){h=!1,b.onCompositionEnd()},s=function(a){i=!0;var d=b.getCopyText();d?c.value=d:a.preventDefault(),l(),setTimeout(function(){m()},0)},t=function(a){i=!0;var d=b.getCopyText();d?(c.value=d,b.onCut()):a.preventDefault(),l(),setTimeout(function(){m()},0)};d.addCommandKeyListener(c,b.onCommandKey.bind(b));if(e.isOldIE){var u={13:1,27:1};d.addListener(c,"keyup",function(a){h&&(!c.value||u[a.keyCode])&&setTimeout(r,0);if((c.value.charCodeAt(0)|0)<129)return;h?q():p()})}"onpropertychange"in c&&!("oninput"in c)?d.addListener(c,"propertychange",o):d.addListener(c,"input",n),d.addListener(c,"paste",function(a){j=!0,a.clipboardData&&a.clipboardData.getData?(m(a.clipboardData.getData("text/plain")),a.preventDefault()):o()}),"onbeforecopy"in c&&typeof clipboardData!="undefined"?(d.addListener(c,"beforecopy",function(a){var c=b.getCopyText();c?clipboardData.setData("Text",c):a.preventDefault()}),d.addListener(a,"keydown",function(a){if(a.ctrlKey&&a.keyCode==88){var c=b.getCopyText();c&&(clipboardData.setData("Text",c),b.onCut()),d.preventDefault(a)}})):(d.addListener(c,"copy",s),d.addListener(c,"cut",t)),d.addListener(c,"compositionstart",p),e.isGecko&&d.addListener(c,"text",q),e.isWebKit&&d.addListener(c,"keyup",q),d.addListener(c,"compositionend",r),d.addListener(c,"blur",function(){b.onBlur()}),d.addListener(c,"focus",function(){b.onFocus(),l()}),this.focus=function(){b.onFocus(),l(),c.focus()},this.blur=function(){c.blur()},this.isFocused=v,this.getElement=function(){return c},this.onContextMenu=function(a,b){a&&(k||(k=c.style.cssText),c.style.cssText="position:fixed; z-index:1000;left:"+(a.x-2)+"px; top:"+(a.y-2)+"px;"),b&&(c.value="")},this.onContextMenuClose=function(){setTimeout(function(){k&&(c.style.cssText=k,k=""),m()},0)}};b.TextInput=g}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event"],function(a,b,c){"use strict";var d=a("../lib/event"),e=a("./default_handlers").DefaultHandlers,f=a("./default_gutter_handler").GutterHandler,g=a("./mouse_event").MouseEvent,h=function(a){this.editor=a,new e(a),new f(a),d.addListener(a.container,"mousedown",function(b){return a.focus(),d.preventDefault(b)}),d.addListener(a.container,"selectstart",function(a){return d.preventDefault(a)});var b=a.renderer.getMouseEventTarget();d.addListener(b,"mousedown",this.onMouseEvent.bind(this,"mousedown")),d.addListener(b,"click",this.onMouseEvent.bind(this,"click")),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove")),d.addMultiMouseDownListener(b,0,2,500,this.onMouseEvent.bind(this,"dblclick")),d.addMultiMouseDownListener(b,0,3,600,this.onMouseEvent.bind(this,"tripleclick")),d.addMultiMouseDownListener(b,0,4,600,this.onMouseEvent.bind(this,"quadclick")),d.addMouseWheelListener(a.container,this.onMouseWheel.bind(this,"mousewheel"));var c=a.renderer.$gutter;d.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),d.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),d.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),d.addListener(c,"mousemove",this.onMouseMove.bind(this,"gutter"))};((function(){this.$scrollSpeed=1,this.setScrollSpeed=function(a){this.$scrollSpeed=a},this.getScrollSpeed=function(){return this.$scrollSpeed},this.onMouseEvent=function(a,b){this.editor._emit(a,new g(b,this.editor))},this.$dragDelay=250,this.setDragDelay=function(a){this.$dragDelay=a},this.getDragDelay=function(){return this.$dragDelay},this.onMouseMove=function(a,b){var c=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!c||!c.length)return;this.editor._emit(a,new g(b,this.editor))},this.onMouseWheel=function(a,b){var c=new g(b,this.editor);c.speed=this.$scrollSpeed*2,c.wheelX=b.wheelX,c.wheelY=b.wheelY,this.editor._emit(a,c)}})).call(h.prototype),b.MouseHandler=h}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/event","ace/lib/dom","ace/lib/browser_focus"],function(a,b,c){function k(a){this.editor=a,this.$clickSelection=null,this.browserFocus=new f,a.setDefaultHandler("mousedown",this.onMouseDown.bind(this)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(this)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(this)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(this)),a.setDefaultHandler("mousewheel",this.onScroll.bind(this))}function l(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))}"use strict";var d=a("../lib/event"),e=a("../lib/dom"),f=a("../lib/browser_focus").BrowserFocus,g=0,h=1,i=2,j=5;((function(){this.onMouseDown=function(a){function C(b){a.getShiftKey()?m.selection.selectToPosition(b):n.$clickSelection||(m.moveCursorToPosition(b),m.selection.clearSelection(b.row,b.column)),q=h}var b=a.inSelection(),c=a.pageX,f=a.pageY,k=a.getDocumentPosition(),m=this.editor,n=this,o=m.getSelectionRange(),p=o.isEmpty(),q=g;if(b&&(!this.browserFocus.isFocused()||(new Date).getTime()-this.browserFocus.lastFocus<20||!m.isFocused())){m.focus();return}var r=a.getButton();if(r!==0){p&&m.moveCursorToPosition(k),r==2&&(m.textInput.onContextMenu({x:a.clientX,y:a.clientY},p),d.capture(m.container,function(){},m.textInput.onContextMenuClose));return}b||C(k);var s=c,t=f,u=(new Date).getTime(),v,w,x,y=function(a){s=d.getDocumentX(a),t=d.getDocumentY(a)},z=function(a){clearInterval(F),q==g?C(k):q==i&&A(a),n.$clickSelection=null,q=g},A=function(a){e.removeCssClass(m.container,"ace_dragging"),m.session.removeMarker(x),m.$mouseHandler.$clickSelection||v||(m.moveCursorToPosition(k),m.selection.clearSelection(k.row,k.column));if(!v)return;if(w.contains(v.row,v.column)){v=null;return}m.clearSelection();if(a&&(a.ctrlKey||a.altKey))var b=m.session,c=b.insert(v,b.getTextRange(w));else var c=m.moveText(w,v);if(!c){v=null;return}m.selection.setSelectionRange(c)},B=function(){if(q==g){var a=l(c,f,s,t),b=(new Date).getTime();if(a>j){q=h;var d=m.renderer.screenToTextCoordinates(s,t);d.row=Math.max(0,Math.min(d.row,m.session.getLength()-1)),C(d)}else if(b-u>m.getDragDelay()){q=i,w=m.getSelectionRange();var k=m.getSelectionStyle();x=m.session.addMarker(w,"ace_selection",k),m.clearSelection(),e.addCssClass(m.container,"ace_dragging")}}q==i?E():q==h&&D()},D=function(){var a,b=m.renderer.screenToTextCoordinates(s,t);b.row=Math.max(0,Math.min(b.row,m.session.getLength()-1)),n.$clickSelection?n.$clickSelection.contains(b.row,b.column)?m.selection.setSelectionRange(n.$clickSelection):(n.$clickSelection.compare(b.row,b.column)==-1?a=n.$clickSelection.end:a=n.$clickSelection.start,m.selection.setSelectionAnchor(a.row,a.column),m.selection.selectToPosition(b)):m.selection.selectToPosition(b),m.renderer.scrollCursorIntoView()},E=function(){v=m.renderer.screenToTextCoordinates(s,t),v.row=Math.max(0,Math.min(v.row,m.session.getLength()-1)),m.moveCursorToPosition(v)};d.capture(m.container,y,z);var F=setInterval(B,20);return a.preventDefault()},this.onDoubleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectWord(),this.$clickSelection=c.getSelectionRange()},this.onTripleClick=function(a){var b=a.getDocumentPosition(),c=this.editor;c.moveCursorToPosition(b),c.selection.selectLine(),this.$clickSelection=c.getSelectionRange()},this.onQuadClick=function(a){var b=this.editor;b.selectAll(),this.$clickSelection=b.getSelectionRange()},this.onScroll=function(a){var b=this.editor;b.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed);if(b.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed))return a.preventDefault()}})).call(k.prototype),b.DefaultHandlers=k}),define("ace/lib/browser_focus",["require","exports","module","ace/lib/oop","ace/lib/event","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./oop"),e=a("./event"),f=a("./event_emitter").EventEmitter,g=function(a){a=a||window,this.lastFocus=(new Date).getTime(),this._isFocused=!0;var b=this;"onfocusin"in a.document?(e.addListener(a.document,"focusin",function(a){b._setFocused(!0)}),e.addListener(a.document,"focusout",function(a){b._setFocused(!!a.toElement)})):(e.addListener(a,"blur",function(a){b._setFocused(!1)}),e.addListener(a,"focus",function(a){b._setFocused(!0)}))};((function(){d.implement(this,f),this.isFocused=function(){return this._isFocused},this._setFocused=function(a){if(this._isFocused==a)return;a&&(this.lastFocus=(new Date).getTime()),this._isFocused=a,this._emit("changeFocus")}})).call(g.prototype),b.BrowserFocus=g}),define("ace/lib/event_emitter",["require","exports","module"],function(a,b,c){"use strict";var d={};d._emit=d._dispatchEvent=function(a,b){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var c=this._eventRegistry[a]||[],d=this._defaultHandlers[a];if(!c.length&&!d)return;b=b||{},b.type=a,b.stopPropagation||(b.stopPropagation=function(){this.propagationStopped=!0}),b.preventDefault||(b.preventDefault=function(){this.defaultPrevented=!0});for(var e=0;e=4352&&a<=4447||a>=4515&&a<=4519||a>=4602&&a<=4607||a>=9001&&a<=9002||a>=11904&&a<=11929||a>=11931&&a<=12019||a>=12032&&a<=12245||a>=12272&&a<=12283||a>=12288&&a<=12350||a>=12353&&a<=12438||a>=12441&&a<=12543||a>=12549&&a<=12589||a>=12593&&a<=12686||a>=12688&&a<=12730||a>=12736&&a<=12771||a>=12784&&a<=12830||a>=12832&&a<=12871||a>=12880&&a<=13054||a>=13056&&a<=19903||a>=19968&&a<=42124||a>=42128&&a<=42182||a>=43360&&a<=43388||a>=44032&&a<=55203||a>=55216&&a<=55238||a>=55243&&a<=55291||a>=63744&&a<=64255||a>=65040&&a<=65049||a>=65072&&a<=65106||a>=65108&&a<=65126||a>=65128&&a<=65131||a>=65281&&a<=65376||a>=65504&&a<=65510}d.implement(this,f),this.setDocument=function(a){if(this.doc)throw new Error("Document is already set");this.doc=a,a.on("change",this.onChange.bind(this)),this.on("changeFold",this.onChangeFold.bind(this)),this.bgTokenizer&&(this.bgTokenizer.setDocument(this.getDocument()),this.bgTokenizer.start(0))},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(a==0){this.$rowCache=[];return}var b=this.$rowCache;for(var c=0;c=a){b.splice(c,b.length);return}},this.onChangeFold=function(a){var b=a.data;this.$resetRowCache(b.start.row)},this.onChange=function(a){var b=a.data;this.$modified=!0,this.$resetRowCache(b.range.start.row);var c=this.$updateInternalDataOnChange(a);!this.$fromUndo&&this.$undoManager&&!b.ignore&&(this.$deltasDoc.push(b),c&&c.length!=0&&this.$deltasFold.push({action:"removeFolds",folds:c}),this.$informUndoManager.schedule()),this.bgTokenizer.start(b.range.start.row),this._emit("change",a)},this.setValue=function(a){this.doc.setValue(a),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(a){return this.bgTokenizer.getState(a)},this.getTokens=function(a,b){return this.bgTokenizer.getTokens(a,b)},this.getTokenAt=function(a,b){var c=this.bgTokenizer.getTokens(a,a)[0].tokens,d,e=0;if(b==null)f=c.length-1,e=this.getLine(a).length;else for(var f=0;f=b)break}return d=c[f],d?(d.index=f,d.start=e-d.value.length,d):null},this.setUndoManager=function(a){this.$undoManager=a,this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(a){var b=this;this.$syncInformUndoManager=function(){b.$informUndoManager.cancel(),b.$deltasFold.length&&(b.$deltas.push({group:"fold",deltas:b.$deltasFold}),b.$deltasFold=[]),b.$deltasDoc.length&&(b.$deltas.push({group:"doc",deltas:b.$deltasDoc}),b.$deltasDoc=[]),b.$deltas.length>0&&a.execute({action:"aceupdate",args:[b.$deltas,b]}),b.$deltas=[]},this.$informUndoManager=e.deferredCall(this.$syncInformUndoManager)}},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?e.stringRepeat(" ",this.getTabSize()):"\t"},this.$useSoftTabs=!0,this.setUseSoftTabs=function(a){if(this.$useSoftTabs===a)return;this.$useSoftTabs=a},this.getUseSoftTabs=function(){return this.$useSoftTabs},this.$tabSize=4,this.setTabSize=function(a){if(isNaN(a)||this.$tabSize===a)return;this.$modified=!0,this.$tabSize=a,this._emit("changeTabSize")},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(a){if(this.$overwrite==a)return;this.$overwrite=a,this._emit("changeOverwrite")},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(a){this.$breakpoints=[];for(var b=0;b0&&(d=!!c.charAt(b-1).match(this.tokenRe)),d||(d=!!c.charAt(b).match(this.tokenRe));var e=d?this.tokenRe:this.nonTokenRe,f=b;if(f>0){do f--;while(f>=0&&c.charAt(f).match(e));f++}var g=b;while(g=this.doc.getLength()-1)return 0;var c=this.doc.removeLines(a,b);return this.doc.insertLines(a+1,c),1},this.duplicateLines=function(a,b){var a=this.$clipRowToDocument(a),b=this.$clipRowToDocument(b),c=this.getLines(a,b);this.doc.insertLines(a,c);var d=b-a+1;return d},this.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.doc.getLength()-1))},this.$clipColumnToRow=function(a,b){return b<0?0:Math.min(this.doc.getLine(a).length,b)},this.$clipPositionToDocument=function(a,b){b=Math.max(0,b);if(a<0)a=0,b=0;else{var c=this.doc.getLength();a>=c?(a=c-1,b=this.doc.getLine(c-1).length):b=Math.min(this.doc.getLine(a).length,b)}return{row:a,column:b}},this.$clipRangeToDocument=function(a){a.start.row<0?(a.start.row=0,a.start.column=0):a.start.column=this.$clipColumnToRow(a.start.row,a.start.column);var b=this.doc.getLength()-1;return a.end.row>b?(a.end.row=b,a.end.column=this.doc.getLine(b).length):a.end.column=this.$clipColumnToRow(a.end.row,a.end.column),a},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(a){if(a!=this.$useWrapMode){this.$useWrapMode=a,this.$modified=!0,this.$resetRowCache(0);if(a){var b=this.getLength();this.$wrapData=[];for(var c=0;c0?(this.$wrapLimit=b,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(a){var b=this.$wrapLimitRange.min;b&&(a=Math.max(b,a));var c=this.$wrapLimitRange.max;return c&&(a=Math.min(c,a)),Math.max(1,a)},this.getWrapLimit=function(){return this.$wrapLimit},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(a){var b=this.$useWrapMode,c,d=a.data.action,e=a.data.range.start.row,f=a.data.range.end.row,g=a.data.range.start,h=a.data.range.end,i=null;d.indexOf("Lines")!=-1?(d=="insertLines"?f=e+a.data.lines.length:f=e,c=a.data.lines?a.data.lines.length:f-e):c=f-e;if(c!=0)if(d.indexOf("remove")!=-1){b&&this.$wrapData.splice(e,c);var j=this.$foldData;i=this.getFoldsInRange(a.data.range),this.removeFolds(i);var k=this.getFoldLine(h.row),l=0;if(k){k.addRemoveChars(h.row,h.column,g.column-h.column),k.shiftRow(-c);var m=this.getFoldLine(e);m&&m!==k&&(m.merge(k),k=m),l=j.indexOf(k)+1}for(l;l=h.row&&k.shiftRow(-c)}f=e}else{var n;if(b){n=[e,0];for(var o=0;o=e&&k.shiftRow(c)}}else{c=Math.abs(a.data.range.start.column-a.data.range.end.column),d.indexOf("remove")!=-1&&(i=this.getFoldsInRange(a.data.range),this.removeFolds(i),c=-c);var k=this.getFoldLine(e);k&&k.addRemoveChars(e,g.column,c)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),b&&this.$updateWrapData(e,f),i},this.$updateWrapData=function(a,b){var c=this.doc.getAllLines(),d=this.getTabSize(),f=this.$wrapData,i=this.$wrapLimit,j,k,m=a;b=Math.min(b,c.length-1);while(m<=b){k=this.getFoldLine(m,k);if(!k)j=this.$getDisplayTokens(e.stringTrimRight(c[m])),f[m]=this.$computeWrapSplits(j,i,d),m++;else{j=[],k.walk(function(a,b,d,e){var f;if(a){f=this.$getDisplayTokens(a,j.length),f[0]=g;for(var i=1;i=l)j.pop();f[k.start.row]=this.$computeWrapSplits(j,i,d),m=k.end.row+1}}};var b=1,c=2,g=3,h=4,j=9,l=10,m=11,n=12;this.$computeWrapSplits=function(a,b){function i(b){var d=a.slice(e,b),g=d.length;d.join("").replace(/12/g,function(){g-=1}).replace(/2/g,function(){g-=1}),f+=g,c.push(f),e=b}if(a.length==0)return[];var c=[],d=a.length,e=0,f=0;while(d-e>b){var k=e+b;if(a[k]>=l){while(a[k]>=l)k++;i(k);continue}if(a[k]==g||a[k]==h){for(k;k!=e-1;k--)if(a[k]==g)break;if(k>e){i(k);continue}k=e+b;for(k;km&&a[k]m&&a[k]==j)k--;if(k>m){i(++k);continue}k=e+b,i(k)}return c},this.$getDisplayTokens=function(a,d){var e=[],f;d=d||0;for(var g=0;g39&&h<48||h>57&&h<64?e.push(j):h>=4352&&o(h)?e.push(b,c):e.push(b)}return e},this.$getStringScreenWidth=function(a,b,c){if(b==0)return[0,0];b==null&&(b=c+a.length*Math.max(this.getTabSize(),2)),c=c||0;var d,e;for(e=0;e=4352&&o(d)?c+=2:c+=1;if(c>b)break}return[c,e]},this.getRowLength=function(a){return!this.$useWrapMode||!this.$wrapData[a]?1:this.$wrapData[a].length+1},this.getRowHeight=function(a,b){return this.getRowLength(b)*a.lineHeight},this.getScreenLastRowColumn=function(a){return this.documentToScreenColumn(a,this.doc.getLine(a).length)},this.getDocumentLastRowColumn=function(a,b){var c=this.documentToScreenRow(a,b);return this.getScreenLastRowColumn(c)},this.getDocumentLastRowColumnPosition=function(a,b){var c=this.documentToScreenRow(a,b);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},this.getRowSplitData=function(a){return this.$useWrapMode?this.$wrapData[a]:undefined},this.getScreenTabSize=function(a){return this.$tabSize-a%this.$tabSize},this.screenToDocumentRow=function(a,b){return this.screenToDocumentPosition(a,b).row},this.screenToDocumentColumn=function(a,b){return this.screenToDocumentPosition(a,b).column},this.screenToDocumentPosition=function(a,b){if(a<0)return{row:0,column:0};var c,d=0,e=0,f,g=0,h=0,i=this.$rowCache;for(var j=0;j=a||d>=l)break;g+=h,d++,d>n&&(d=m.end.row+1,m=this.getNextFoldLine(d,m),n=m?m.start.row:Infinity),k&&i.push({docRow:d,screenRow:g})}if(m&&m.start.row<=d)c=this.getFoldDisplayLine(m),d=m.start.row;else{if(g+h<=a||d>l)return{row:l,column:this.getLine(l).length};c=this.getLine(d),m=null}if(this.$useWrapMode){var o=this.$wrapData[d];o&&(f=o[a-g],a>g&&o.length&&(e=o[a-g-1]||o[o.length-1],c=c.substring(e)))}return e+=this.$getStringScreenWidth(c,b)[1],this.$useWrapMode?e>=f&&(e=f-1):e=Math.min(e,c.length),m?m.idxToPosition(e):{row:d,column:e}},this.documentToScreenPosition=function(a,b){if(typeof b=="undefined")var c=this.$clipPositionToDocument(a.row,a.column);else c=this.$clipPositionToDocument(a,b);a=c.row,b=c.column;var d;if(this.$useWrapMode){d=this.$wrapData;if(a>d.length-1)return{row:this.getScreenLength(),column:d.length==0?0:d[d.length-1].length-1}}var e=0,f=null,g=null;g=this.getFoldAt(a,b,1),g&&(a=g.start.row,b=g.start.column);var h,i=0,j=this.$rowCache;for(var k=0;k=n){h=m.end.row+1;if(h>a)break;m=this.getNextFoldLine(h,m),n=m?m.start.row:Infinity}else h=i+1;e+=this.getRowLength(i),i=h,l&&j.push({docRow:i,screenRow:e})}var o="";m&&i>=n?(o=this.getFoldDisplayLine(m,a,b),f=m.start.row):(o=this.getLine(a).substring(0,b),f=a);if(this.$useWrapMode){var p=d[f],q=0;while(o.length>=p[q])e++,q++;o=o.substring(p[q-1]||0,o.length)}return{row:e,column:this.$getStringScreenWidth(o)[0]}},this.documentToScreenColumn=function(a,b){return this.documentToScreenPosition(a,b).column},this.documentToScreenRow=function(a,b){return this.documentToScreenPosition(a,b).row},this.getScreenLength=function(){var a=0,b=null;if(!this.$useWrapMode){a=this.getLength();var c=this.$foldData;for(var d=0;dg&&(f=b.end.row+1,b=this.$foldData[d++],g=b?b.start.row:Infinity)}return a}})).call(l.prototype),a("./edit_session/folding").Folding.call(l.prototype),a("./edit_session/bracket_match").BracketMatch.call(l.prototype),b.EditSession=l}),define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/lang"),f=a("./lib/event_emitter").EventEmitter,g=a("./range").Range,h=function(a){this.session=a,this.doc=a.getDocument(),this.clearSelection(),this.selectionLead=this.doc.createAnchor(0,0),this.selectionAnchor=this.doc.createAnchor(0,0);var b=this;this.selectionLead.on("change",function(a){b._emit("changeCursor"),b.$isEmpty||b._emit("changeSelection"),!b.$preventUpdateDesiredColumnOnChange&&a.old.column!=a.value.column&&b.$updateDesiredColumn()}),this.selectionAnchor.on("change",function(){b.$isEmpty||b._emit("changeSelection")})};((function(){d.implement(this,f),this.isEmpty=function(){return this.$isEmpty||this.selectionAnchor.row==this.selectionLead.row&&this.selectionAnchor.column==this.selectionLead.column},this.isMultiLine=function(){return this.isEmpty()?!1:this.getRange().isMultiLine()},this.getCursor=function(){return this.selectionLead.getPosition()},this.setSelectionAnchor=function(a,b){this.selectionAnchor.setPosition(a,b),this.$isEmpty&&(this.$isEmpty=!1,this._emit("changeSelection"))},this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.selectionAnchor.getPosition()},this.getSelectionLead=function(){return this.selectionLead.getPosition()},this.shiftSelection=function(a){if(this.$isEmpty){this.moveCursorTo(this.selectionLead.row,this.selectionLead.column+a);return}var b=this.getSelectionAnchor(),c=this.getSelectionLead(),d=this.isBackwards();(!d||b.column!==0)&&this.setSelectionAnchor(b.row,b.column+a),(d||c.column!==0)&&this.$moveSelection(function(){this.moveCursorTo(c.row,c.column+a)})},this.isBackwards=function(){var a=this.selectionAnchor,b=this.selectionLead;return a.row>b.row||a.row==b.row&&a.column>b.column},this.getRange=function(){var a=this.selectionAnchor,b=this.selectionLead;return this.isEmpty()?g.fromPoints(b,b):this.isBackwards()?g.fromPoints(b,a):g.fromPoints(a,b)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var a=this.doc.getLength()-1;this.setSelectionAnchor(a,this.doc.getLine(a).length),this.moveCursorTo(0,0)},this.setSelectionRange=function(a,b){b?(this.setSelectionAnchor(a.end.row,a.end.column),this.selectTo(a.start.row,a.start.column)):(this.setSelectionAnchor(a.start.row,a.start.column),this.selectTo(a.end.row,a.end.column)),this.$updateDesiredColumn()},this.$updateDesiredColumn=function(){var a=this.getCursor();this.$desiredColumn=this.session.documentToScreenColumn(a.row,a.column)},this.$moveSelection=function(a){var b=this.selectionLead;this.$isEmpty&&this.setSelectionAnchor(b.row,b.column),a.call(this)},this.selectTo=function(a,b){this.$moveSelection(function(){this.moveCursorTo(a,b)})},this.selectToPosition=function(a){this.$moveSelection(function(){this.moveCursorToPosition(a)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.selectWord=function(){var a=this.getCursor(),b=this.session.getWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectAWord=function(){var a=this.getCursor(),b=this.session.getAWordRange(a.row,a.column);this.setSelectionRange(b)},this.selectLine=function(){var a=this.selectionLead.row,b,c=this.session.getFoldLine(a);c?(a=c.start.row,b=c.end.row):b=a,this.setSelectionAnchor(a,0),this.$moveSelection(function(){this.moveCursorTo(b+1,0)})},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(b.start.row,b.start.column);else if(a.column==0)a.row>0&&this.moveCursorTo(a.row-1,this.doc.getLine(a.row-1).length);else{var c=this.session.getTabSize();this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(a.column-c,a.column).split(" ").length-1==c?this.moveCursorBy(0,-c):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var a=this.selectionLead.getPosition(),b;if(b=this.session.getFoldAt(a.row,a.column,1))this.moveCursorTo(b.end.row,b.end.column);else if(this.selectionLead.column==this.doc.getLine(this.selectionLead.row).length)this.selectionLead.row=c.length){this.moveCursorTo(a,c.length),this.moveCursorRight(),a0&&this.moveCursorWordLeft();return}if(g=this.session.tokenRe.exec(f))b-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(a,b)},this.moveCursorBy=function(a,b){var c=this.session.documentToScreenPosition(this.selectionLead.row,this.selectionLead.column),d=b===0&&this.$desiredColumn||c.column,e=this.session.screenToDocumentPosition(c.row+a,d);this.moveCursorTo(e.row,e.column+b,b===0)},this.moveCursorToPosition=function(a){this.moveCursorTo(a.row,a.column)},this.moveCursorTo=function(a,b,c){var d=this.session.getFoldAt(a,b,1);d&&(a=d.start.row,b=d.start.column),this.$preventUpdateDesiredColumnOnChange=!0,this.selectionLead.setPosition(a,b),this.$preventUpdateDesiredColumnOnChange=!1,c||this.$updateDesiredColumn(this.selectionLead.column)},this.moveCursorToScreen=function(a,b,c){var d=this.session.screenToDocumentPosition(a,b);a=d.row,b=d.column,this.moveCursorTo(a,b,c)}})).call(h.prototype),b.Selection=h}),define("ace/range",["require","exports","module"],function(a,b,c){"use strict";var d=function(a,b,c,d){this.start={row:a,column:b},this.end={row:c,column:d}};((function(){this.isEequal=function(a){return this.start.row==a.start.row&&this.end.row==a.end.row&&this.start.column==a.start.column&&this.end.column==a.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(a,b){return this.compare(a,b)==0},this.compareRange=function(a){var b,c=a.end,d=a.start;return b=this.compare(c.row,c.column),b==1?(b=this.compare(d.row,d.column),b==1?2:b==0?1:0):b==-1?-2:(b=this.compare(d.row,d.column),b==-1?-1:b==1?42:0)},this.comparePoint=function(a){return this.compare(a.row,a.column)},this.containsRange=function(a){return this.comparePoint(a.start)==0&&this.comparePoint(a.end)==0},this.isEnd=function(a,b){return this.end.row==a&&this.end.column==b},this.isStart=function(a,b){return this.start.row==a&&this.start.column==b},this.setStart=function(a,b){typeof a=="object"?(this.start.column=a.column,this.start.row=a.row):(this.start.row=a,this.start.column=b)},this.setEnd=function(a,b){typeof a=="object"?(this.end.column=a.column,this.end.row=a.row):(this.end.row=a,this.end.column=b)},this.inside=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)||this.isStart(a,b)?!1:!0:!1},this.insideStart=function(a,b){return this.compare(a,b)==0?this.isEnd(a,b)?!1:!0:!1},this.insideEnd=function(a,b){return this.compare(a,b)==0?this.isStart(a,b)?!1:!0:!1},this.compare=function(a,b){return!this.isMultiLine()&&a===this.start.row?bthis.end.column?1:0:athis.end.row?1:this.start.row===a?b>=this.start.column?0:-1:this.end.row===a?b<=this.end.column?0:1:0},this.compareStart=function(a,b){return this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.compareEnd=function(a,b){return this.end.row==a&&this.end.column==b?1:this.compare(a,b)},this.compareInside=function(a,b){return this.end.row==a&&this.end.column==b?1:this.start.row==a&&this.start.column==b?-1:this.compare(a,b)},this.clipRows=function(a,b){if(this.end.row>b)var c={row:b+1,column:0};if(this.start.row>b)var e={row:b+1,column:0};if(this.start.row=0&&/^[\w\d]/.test(h)||e<=g&&/[\w\d]$/.test(h))return;h=f.substring(c.start.column,c.end.column);if(!/^[\w\d]+$/.test(h))return;var i=a.getCursorPosition(),j={wrap:!0,wholeWord:!0,caseSensitive:!0,needle:h},k=a.$search.getOptions();a.$search.set(j);var l=a.$search.findAll(b);l.forEach(function(a){if(!a.contains(i.row,i.column)){var c=b.addMarker(a,"ace_selected_word","text");b.$selectionOccurrences.push(c)}}),a.$search.set(k)},this.clearSelectionHighlight=function(a){if(!a.session.$selectionOccurrences)return;a.session.$selectionOccurrences.forEach(function(b){a.session.removeMarker(b)}),a.session.$selectionOccurrences=[]},this.createModeDelegates=function(a){if(!this.$embeds)return;this.$modes={};for(var b=0;b1&&(m=g.slice(n+2,n+1+e[n].len)),typeof l.token=="function"?k=l.token.apply(this,m):k=l.token;var o=l.next;o&&o!==c&&(c=o,d=this.rules[c],e=this.matchMappings[c],i=f.lastIndex,f=this.regExps[c],f.lastIndex=i);break}if(m[0]){typeof k=="string"&&(m=[m.join("")],k=[k]);for(var n=0;n=b&&(a.row=Math.max(0,b-1),a.column=this.getLine(b-1).length),a},this.insert=function(a,b){if(b.length==0)return a;a=this.$clipPosition(a),this.getLength()<=1&&this.$detectNewLine(b);var c=this.$split(b),d=c.splice(0,1)[0],e=c.length==0?null:c.splice(c.length-1,1)[0];return a=this.insertInLine(a,d),e!==null&&(a=this.insertNewLine(a),a=this.insertLines(a.row,c),a=this.insertInLine(a,e||"")),a},this.insertLines=function(a,b){if(b.length==0)return{row:a,column:0};var c=[a,0];c.push.apply(c,b),this.$lines.splice.apply(this.$lines,c);var d=new f(a,0,a+b.length,0),e={action:"insertLines",range:d,lines:b};return this._emit("change",{data:e}),d.end},this.insertNewLine=function(a){a=this.$clipPosition(a);var b=this.$lines[a.row]||"";this.$lines[a.row]=b.substring(0,a.column),this.$lines.splice(a.row+1,0,b.substring(a.column,b.length));var c={row:a.row+1,column:0},d={action:"insertText",range:f.fromPoints(a,c),text:this.getNewLineCharacter()};return this._emit("change",{data:d}),c},this.insertInLine=function(a,b){if(b.length==0)return a;var c=this.$lines[a.row]||"";this.$lines[a.row]=c.substring(0,a.column)+b+c.substring(a.column);var d={row:a.row,column:a.column+b.length},e={action:"insertText",range:f.fromPoints(a,d),text:b};return this._emit("change",{data:e}),d},this.remove=function(a){a.start=this.$clipPosition(a.start),a.end=this.$clipPosition(a.end);if(a.isEmpty())return a.start;var b=a.start.row,c=a.end.row;if(a.isMultiLine()){var d=a.start.column==0?b:b+1,e=c-1;a.end.column>0&&this.removeInLine(c,0,a.end.column),e>=d&&this.removeLines(d,e),d!=b&&(this.removeInLine(b,a.start.column,this.getLine(b).length),this.removeNewLine(a.start.row))}else this.removeInLine(b,a.start.column,a.end.column);return a.start},this.removeInLine=function(a,b,c){if(b==c)return;var d=new f(a,b,a,c),e=this.getLine(a),g=e.substring(b,c),h=e.substring(0,b)+e.substring(c,e.length);this.$lines.splice(a,1,h);var i={action:"removeText",range:d,text:g};return this._emit("change",{data:i}),d.start},this.removeLines=function(a,b){var c=new f(a,0,b+1,0),d=this.$lines.splice(a,b-a+1),e={action:"removeLines",range:c,nl:this.getNewLineCharacter(),lines:d};return this._emit("change",{data:e}),d},this.removeNewLine=function(a){var b=this.getLine(a),c=this.getLine(a+1),d=new f(a,b.length,a+1,0),e=b+c;this.$lines.splice(a,2,e);var g={action:"removeText",range:d,text:this.getNewLineCharacter()};this._emit("change",{data:g})},this.replace=function(a,b){if(b.length==0&&a.isEmpty())return a.start;if(b==this.getTextRange(a))return a.end;this.remove(a);if(b)var c=this.insert(a.start,b);else c=a.start;return c},this.applyDeltas=function(a){for(var b=0;b=0;b--){var c=a[b],d=f.fromPoints(c.range.start,c.range.end);c.action=="insertLines"?this.removeLines(d.start.row,d.end.row-1):c.action=="insertText"?this.remove(d):c.action=="removeLines"?this.insertLines(d.start.row,c.lines):c.action=="removeText"&&this.insert(d.start,c.text)}}})).call(h.prototype),b.Document=h}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=b.Anchor=function(a,b,c){this.document=a,typeof c=="undefined"?this.setPosition(b.row,b.column):this.setPosition(b,c),this.$onChange=this.onChange.bind(this),a.on("change",this.$onChange)};((function(){d.implement(this,e),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.onChange=function(a){var b=a.data,c=b.range;if(c.start.row==c.end.row&&c.start.row!=this.row)return;if(c.start.row>this.row)return;if(c.start.row==this.row&&c.start.column>this.column)return;var d=this.row,e=this.column;b.action==="insertText"?c.start.row===d&&c.start.column<=e?c.start.row===c.end.row?e+=c.end.column-c.start.column:(e-=c.start.column,d+=c.end.row-c.start.row):c.start.row!==c.end.row&&c.start.row=e?e=c.start.column:e=Math.max(0,e-(c.end.column-c.start.column)):c.start.row!==c.end.row&&c.start.row=this.document.getLength()?(c.row=Math.max(0,this.document.getLength()-1),c.column=this.document.getLine(c.row).length):a<0?(c.row=0,c.column=0):(c.row=a,c.column=Math.min(this.document.getLine(c.row).length,Math.max(0,b))),b<0&&(c.column=0),c}})).call(f.prototype)}),define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/event_emitter").EventEmitter,f=function(a,b){this.running=!1,this.lines=[],this.currentLine=0,this.tokenizer=a;var c=this;this.$worker=function(){if(!c.running)return;var a=new Date,b=c.currentLine,d=c.doc,e=0,f=d.getLength();while(c.currentLine20){c.fireUpdateEvent(b,c.currentLine-1),c.running=setTimeout(c.$worker,20);return}}c.running=!1,c.fireUpdateEvent(b,f-1)}};((function(){d.implement(this,e),this.setTokenizer=function(a){this.tokenizer=a,this.lines=[],this.start(0)},this.setDocument=function(a){this.doc=a,this.lines=[],this.stop()},this.fireUpdateEvent=function(a,b){var c={first:a,last:b};this._emit("update",{data:c})},this.start=function(a){this.currentLine=Math.min(a||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(a,b){return this.$tokenizeRows(a,b)},this.getState=function(a){return this.$tokenizeRows(a,a)[0].state},this.$tokenizeRows=function(a,b){if(!this.doc||isNaN(a)||isNaN(b))return[{state:"start",tokens:[]}];var c=[],d="start",e=!1;a>0&&this.lines[a-1]?(d=this.lines[a-1].state,e=!0):a==0?(d="start",e=!0):this.lines.length>0&&(d=this.lines[this.lines.length-1].state);var f=this.doc.getLines(a,b);for(var g=a;g<=b;g++)if(!this.lines[g]){var h=this.tokenizer.getLineTokens(f[g-a]||"",d),d=h.state;c.push(h),e&&(this.lines[g]=h)}else{var h=this.lines[g];d=h.state,c.push(h)}return c}})).call(f.prototype),b.BackgroundTokenizer=f}),define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(a,b,c){function h(){this.getFoldAt=function(a,b,c){var d=this.getFoldLine(a);if(!d)return null;var e=d.folds;for(var f=0;f=a)return e;if(e.end.row>a)return null}return null},this.getNextFoldLine=function(a,b){var c=this.$foldData,d=0;b&&(d=c.indexOf(b)),d==-1&&(d=0);for(d;d=a)return e}return null},this.getFoldedRowCount=function(a,b){var c=this.$foldData,d=b-a+1;for(var e=0;e=b){h=a?d-=b-h:d=0);break}g>=a&&(h>=a?d-=g-h:d-=g-a+1)}return d},this.$addFoldLine=function(a){return this.$foldData.push(a),this.$foldData.sort(function(a,b){return a.start.row-b.start.row}),a},this.addFold=function(a,b){var c=this.$foldData,d=!1,g;a instanceof f?g=a:g=new f(b,a),this.$clipRangeToDocument(g.range);var h=g.start.row,i=g.start.column,j=g.end.row,k=g.end.column;if(g.placeholder.length<2)throw"Placeholder has to be at least 2 characters";if(h==j&&k-i<2)throw"The range has to be at least 2 characters width";var l=this.getFoldAt(h,i,1),m=this.getFoldAt(j,k,-1);if(l&&m==l)return l.addSubFold(g);if(l&&!l.range.isStart(h,i)||m&&!m.range.isEnd(j,k))throw"A fold can't intersect already existing fold"+g.range+l.range;var n=this.getFoldsInRange(g.range);n.length>0&&(this.removeFolds(n),g.subFolds=n);for(var o=0;othis.endRow)throw"Can't add a fold to this FoldLine as it has no connection";this.folds.push(a),this.folds.sort(function(a,b){return-a.range.compareEnd(b.start.row,b.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else{if(a.end.row!=this.start.row)throw"Trying to add fold to FoldRow that doesn't have a matching row";this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column}a.foldLine=this},this.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},this.walk=function(a,b,c){var d=0,e=this.folds,f,g,h,i=!0;b==null&&(b=this.end.row,c=this.end.column);for(var j=0;j=this.$rowTokens.length){this.$row+=1;if(this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row,this.$row)[0].tokens,this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,b=this.$tokenIndex,c=a[b].start;if(c!==undefined)return c;c=0;while(b>0)b-=1,c+=a[b].value.length;return c}})).call(d.prototype),b.TokenIterator=d}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator"],function(a,b,c){function e(){this.findMatchingBracket=function(a){if(a.column==0)return null;var b=this.getLine(a.row).charAt(a.column-1);if(b=="")return null;var c=b.match(/([\(\[\{])|([\)\]\}])/);return c?c[1]?this.$findClosingBracket(c[1],a):this.$findOpeningBracket(c[2],a):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("rparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn()-2,j=g.value;for(;;){while(i>=0){var k=j.charAt(i);if(k==c){e-=1;if(e==0)return{row:f.getCurrentTokenRow(),column:i+f.getCurrentTokenColumn()}}else k==a&&(e+=1);i-=1}do g=f.stepBackward();while(g&&!h.test(g.type));if(g==null)break;j=g.value,i=j.length-1}return null},this.$findClosingBracket=function(a,b){var c=this.$brackets[a],e=1,f=new d(this,b.row,b.column),g=f.getCurrentToken();if(!g)return null;var h=new RegExp("(\\.?"+g.type.replace(".","|").replace("lparen","lparen|rparen")+")+"),i=b.column-f.getCurrentTokenColumn();for(;;){var j=g.value,k=j.length;while(i=0;h--){var i=g[h],j=c.$rangeFromMatch(f,i.offset,i.str.length);if(d(j))return!0}})}}},this.$rangeFromMatch=function(a,b,c){return new f(a,b,a,b+c)},this.$assembleRegExp=function(){if(this.$options.regExp)var a=this.$options.needle;else a=d.escapeRegExp(this.$options.needle);this.$options.wholeWord&&(a="\\b"+a+"\\b");var b="g";this.$options.caseSensitive||(b+="i");var c=new RegExp(a,b);return c},this.$forwardLineIterator=function(a){function k(e){var f=a.getLine(e);return b&&e==c.end.row&&(f=f.substring(0,c.end.column)),j&&e==d.row&&(f=f.substring(0,d.column)),f}var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"start":"end"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap,j=!1;return{forEach:function(a){var b=d.row,c=k(b),g=d.column,l=!1;j=!1;while(!a(c,g,b)){if(l)return;b++,g=0;if(b>h){if(!i)return;b=e,g=f,j=!0}b==d.row&&(l=!0),c=k(b)}}}},this.$backwardLineIterator=function(a){var b=this.$options.scope==g.SELECTION,c=this.$options.range||a.getSelection().getRange(),d=this.$options.start||c[b?"end":"start"],e=b?c.start.row:0,f=b?c.start.column:0,h=b?c.end.row:a.getLength()-1,i=this.$options.wrap;return{forEach:function(g){var j=d.row,k=a.getLine(j).substring(0,d.column),l=0,m=!1,n=!1;while(!g(k,l,j)){if(m)return;j--,l=0;if(j0},this.hasRedo=function(){return this.$redoStack.length>0}})).call(d.prototype),b.UndoManager=d}),define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/useragent","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/renderloop","ace/lib/event_emitter","text!ace/css/editor.css"],function(a,b,c){"use strict";var d=a("./lib/oop"),e=a("./lib/dom"),f=a("./lib/event"),g=a("./lib/useragent"),h=a("./layer/gutter").Gutter,i=a("./layer/marker").Marker,j=a("./layer/text").Text,k=a("./layer/cursor").Cursor,l=a("./scrollbar").ScrollBar,m=a("./renderloop").RenderLoop,n=a("./lib/event_emitter").EventEmitter,o=a("text!./css/editor.css");e.importCssString(o,"ace_editor");var p=function(a,b){var c=this;this.container=a,e.addCssClass(a,"ace_editor"),this.setTheme(b),this.$gutter=e.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=e.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=e.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new h(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onResize.bind(this,!0)),this.$markerBack=new i(this.content);var d=this.$textLayer=new j(this.content);this.canvas=d.element,this.$markerFront=new i(this.content),this.characterWidth=d.getCharacterWidth(),this.lineHeight=d.getLineHeight(),this.$cursorLayer=new k(this.content),this.$cursorPadding=8,this.$horizScroll=!0,this.$horizScrollAlwaysVisible=!0,this.scrollBar=new l(a),this.scrollBar.addEventListener("scroll",function(a){c.session.setScrollTop(a.data)}),this.scrollTop=0,this.scrollLeft=0,f.addListener(this.scroller,"scroll",function(){var a=c.scroller.scrollLeft;c.scrollLeft=a,c.session.setScrollLeft(a)}),this.cursorPos={row:0,column:0},this.$textLayer.addEventListener("changeCharacterSize",function(){c.characterWidth=d.getCharacterWidth(),c.lineHeight=d.getLineHeight(),c.$updatePrintMargin(),c.onResize(!0),c.$loop.schedule(c.CHANGE_FULL)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:1,characterWidth:1,minHeight:1,maxHeight:1,offset:0,height:1},this.$loop=new m(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.setPadding(4),this.$updatePrintMargin()};((function(){this.showGutter=!0,this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,d.implement(this,n),this.setSession=function(a){this.session=a,this.$cursorLayer.setSession(a),this.$markerBack.setSession(a),this.$markerFront.setSession(a),this.$gutterLayer.setSession(a),this.$textLayer.setSession(a),this.$loop.schedule(this.CHANGE_FULL)},this.updateLines=function(a,b){b===undefined&&(b=Infinity),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowc.lastRow+1)return;if(bc&&this.session.setScrollTop(c),this.scrollTop+this.$size.scrollerHeightb&&(b0)return!0;if(b>0&&this.session.getScrollTop()+this.$size.scrollerHeighth&&(e=g.end.row+1,g=this.session.getNextFoldLine(e,g),h=g?g.start.row:Infinity);if(e>f)break;var j=this.$annotations[e]||b;c.push("