diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 83ad9447b..db0d596b8 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -1,5 +1,5 @@ /** - * This code is mostly from the old Etherpad. Please help us to comment this code. + * This code is mostly from the old Etherpad. Please help us to comment this code. * This helps other people to understand this code better and helps them to improve it. * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED */ @@ -86,7 +86,7 @@ function Ace2Editor() }); actionsPendingInit = []; } - + ace2.registry[info.id] = info; // The following functions (prefixed by 'ace_') are exposed by editor, but @@ -97,7 +97,7 @@ function Ace2Editor() 'applyChangesToBase', 'applyPreparedChangesetToBase', 'setUserChangeNotificationCallback', 'setAuthorInfo', 'setAuthorSelectionRange', 'callWithAce', 'execCommand', 'replaceRange']; - + _.each(aceFunctionsPendingInit, function(fnName,i){ var prefix = 'ace_'; var name = prefix + fnName; @@ -105,18 +105,18 @@ function Ace2Editor() info[prefix + fnName].apply(this, arguments); }); }); - + editor.exportText = function() { if (!loaded) return "(awaiting init)\n"; return info.ace_exportText(); }; - + editor.getFrame = function() { return info.frame || null; }; - + editor.getDebugProperty = function(prop) { return info.ace_getDebugProperty(prop); @@ -221,16 +221,16 @@ function Ace2Editor() // calls to these functions ($$INCLUDE_...) are replaced when this file is processed // and compressed, putting the compressed code from the named file directly into the // source here. - // these lines must conform to a specific format because they are passed by the build script: + // these lines must conform to a specific format because they are passed by the build script: var includedCSS = []; var $$INCLUDE_CSS = function(filename) {includedCSS.push(filename)}; $$INCLUDE_CSS("../static/css/iframe_editor.css"); $$INCLUDE_CSS("../static/css/pad.css"); $$INCLUDE_CSS("../static/custom/pad.css"); - + var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ return '../static/plugins/' + path }); includedCSS = includedCSS.concat(additionalCSS); - + pushStyleTagsFor(iframeHTML, includedCSS); if (!Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[KERNEL_SOURCE]) { @@ -304,16 +304,16 @@ window.onload = function () {\n\ $$INCLUDE_CSS("../static/css/iframe_editor.css"); $$INCLUDE_CSS("../static/css/pad.css"); $$INCLUDE_CSS("../static/custom/pad.css"); - - + + var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ return '../static/plugins/' + path }); includedCSS = includedCSS.concat(additionalCSS); - + pushStyleTagsFor(outerHTML, includedCSS); // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) - outerHTML.push('', scriptTag(outerScript), '