diff options
Diffstat (limited to 'infrastructure')
-rw-r--r-- | infrastructure/ace/www/ace2_outer.js | 14 | ||||
-rw-r--r-- | infrastructure/ace/www/domline.js | 9 | ||||
-rw-r--r-- | infrastructure/ace/www/linestylefilter.js | 9 | ||||
-rw-r--r-- | infrastructure/com.etherpad/licensing.scala | 2 | ||||
-rw-r--r-- | infrastructure/framework-src/modules/ejs.js | 16 |
5 files changed, 41 insertions, 9 deletions
diff --git a/infrastructure/ace/www/ace2_outer.js b/infrastructure/ace/www/ace2_outer.js index e6d430d..f947534 100644 --- a/infrastructure/ace/www/ace2_outer.js +++ b/infrastructure/ace/www/ace2_outer.js @@ -168,7 +168,7 @@ function Ace2Editor() { var iframeHTML = ["'"+doctype+"<html><head>'"]; - top.plugins.callHook( + plugins.callHook( "aceInitInnerdocbodyHead", {iframeHTML:iframeHTML}); // these lines must conform to a specific format because they are passed by the build script: @@ -203,6 +203,18 @@ function Ace2Editor() { '\x3cscript>', outerScript, '\x3c/script>', '</head><body id="outerdocbody"><div id="sidediv"><!-- --></div><div id="linemetricsdiv">x</div><div id="overlaysdiv"><!-- --></div></body></html>']; + + if (!Array.prototype.map) Array.prototype.map = function(fun) { //needed for IE + if (typeof fun != "function") throw new TypeError(); + var len = this.length; + var res = new Array(len); + var thisp = arguments[1]; + for (var i = 0; i < len; i++) { + if (i in this) res[i] = fun.call(thisp, this[i], i, this); + } + return res; + }; + var outerFrame = document.createElement("IFRAME"); outerFrame.frameBorder = 0; // for IE info.frame = outerFrame; diff --git a/infrastructure/ace/www/domline.js b/infrastructure/ace/www/domline.js index 90e9943..f1d19e4 100644 --- a/infrastructure/ace/www/domline.js +++ b/infrastructure/ace/www/domline.js @@ -101,7 +101,14 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { var extraOpenTags = ""; var extraCloseTags = ""; - (function () { try { return top.plugins; } catch (e) { return plugins; }; })().callHook( + var plugins_; + if (typeof(plugins)!='undefined') { + plugins_ = plugins; + } else { + plugins_ = parent.parent.plugins; + } + + plugins_.callHook( "aceCreateDomLine", {domline:domline, cls:cls} ).map(function (modifier) { cls = modifier.cls; diff --git a/infrastructure/ace/www/linestylefilter.js b/infrastructure/ace/www/linestylefilter.js index c163120..196cb63 100644 --- a/infrastructure/ace/www/linestylefilter.js +++ b/infrastructure/ace/www/linestylefilter.js @@ -238,7 +238,14 @@ linestylefilter.textAndClassFuncSplitter = function(func, splitPointsOpt) { linestylefilter.getFilterStack = function(lineText, textAndClassFunc, browser) { var func = linestylefilter.getURLFilter(lineText, textAndClassFunc); - var hookFilters = (function () { try { return top.plugins; } catch (e) { return plugins; }; })().callHook( + var plugins_; + if (typeof(plugins)!='undefined') { + plugins_ = plugins; + } else { + plugins_ = parent.parent.plugins; + } + + var hookFilters = plugins_.callHook( "aceGetFilterStack", {linestylefilter:linestylefilter, browser:browser}); hookFilters.map(function (hookFilter) { func = hookFilter(lineText, func); diff --git a/infrastructure/com.etherpad/licensing.scala b/infrastructure/com.etherpad/licensing.scala index 9318f78..68019f5 100644 --- a/infrastructure/com.etherpad/licensing.scala +++ b/infrastructure/com.etherpad/licensing.scala @@ -134,7 +134,7 @@ object Licensing { println("Done."); } case "genmainkey" => { - println("Generating key for etherpad.com..."); + println("Generating main key..."); config.values("licenseGeneratorKey") = args(1); val out = new PrintWriter(new FileOutputStream(args(2))); out.print(generateKey("etherpad", "AppJet", -1, 0, -1, 0, 0, 0)) diff --git a/infrastructure/framework-src/modules/ejs.js b/infrastructure/framework-src/modules/ejs.js index bf14ed3..58c67bc 100644 --- a/infrastructure/framework-src/modules/ejs.js +++ b/infrastructure/framework-src/modules/ejs.js @@ -33,6 +33,7 @@ import("jsutils.*"); import("funhtml"); +import("etherpad.log"); jimport("java.lang.System.out.println"); jimport("net.appjet.ajstdlib.execution.executeCodeInNewScope"); @@ -75,12 +76,13 @@ var EjsScanner = function(source, left, right) { this.double_left = left+'%%'; this.double_right = '%%'+right; this.left_equal = left+'%='; + this.left_colon = left+'%:'; this.left_comment = left+'%#'; if(left=='[') { - this.SplitRegexp = /(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/; + this.SplitRegexp = /(\[%%)|(%%\])|(\[%:)|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/; } else { - this.SplitRegexp = new RegExp('('+this.double_left+')|(%%'+this.double_right+')|('+this.left_equal+')|('+this.left_comment+')|('+this.left_delimiter+')|('+this.right_delimiter+'\n)|('+this.right_delimiter+')|(\n)') + this.SplitRegexp = new RegExp('('+this.double_left+')|(%%'+this.double_right+')|('+this.left_equal+')|('+this.left_colon+')|('+this.left_equal+')|('+this.left_comment+')|('+this.left_delimiter+')|('+this.right_delimiter+'\n)|('+this.right_delimiter+')|(\n)') } this.source = source; @@ -178,7 +180,7 @@ EjsBuffer.prototype = { /* Adaptation from the Compiler of erb.rb */ EjsCompiler = function(source, left) { - this.pre_cmd = ['var ___ejsO = "";']; + this.pre_cmd = ['var ejs_data = "";']; this.post_cmd = new Array(); this.source = ' '; if (source != null) @@ -217,7 +219,7 @@ EjsCompiler.prototype = { compile: function(options) { options = options || {}; this.out = ''; - var put_cmd = "___ejsO += "; + var put_cmd = "ejs_data += "; var insert_cmd = put_cmd; var buff = new EjsBuffer(this.pre_cmd, this.post_cmd); var content = ''; @@ -241,6 +243,7 @@ EjsCompiler.prototype = { break; case scanner.left_delimiter: case scanner.left_equal: + case scanner.left_colon: case scanner.left_comment: scanner.stag = token; if (content.length > 0) @@ -277,6 +280,9 @@ EjsCompiler.prototype = { case scanner.left_equal: buff.push(insert_cmd + "(EjsScanner.to_text(" + content + "))"); break; + case scanner.left_colon: + buff.push(insert_cmd + content); + break; } scanner.stag = null; content = ''; @@ -302,7 +308,7 @@ EjsCompiler.prototype = { ' with(_VIEW) {', ' with (_CONTEXT) {', this.out, - ' return ___ejsO;', + ' return ejs_data;', ' }', ' }', '};' |