diff options
author | Mikk Andresen <mikk.andresen@gmail.com> | 2015-12-01 14:16:44 +0200 |
---|---|---|
committer | Mikk Andresen <mikk.andresen@gmail.com> | 2015-12-01 14:16:44 +0200 |
commit | ad2ea924b5c039ebb8df9dd97d1f5ecaeb02fb14 (patch) | |
tree | 775762ccdf2f9994703b0ae2ace1fa4ee61fcaaf | |
parent | 8a79ae6e0229075dcc4d153463e5e27233746b97 (diff) | |
download | etherpad-lite-ad2ea924b5c039ebb8df9dd97d1f5ecaeb02fb14.zip |
aceEditorCSS to allow absolute paths to resources to include external CSS
-rw-r--r-- | src/static/js/ace.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 455bfaa3..a5e365ce 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -229,7 +229,12 @@ function Ace2Editor() $$INCLUDE_CSS("../static/css/pad.css"); $$INCLUDE_CSS("../static/custom/pad.css"); - var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ return '../static/plugins/' + path }); + var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ + if (path.match(/\/\//)) { // Allow urls to external CSS - http(s):// and //some/path.css + return path; + } + return '../static/plugins/' + path; + }); includedCSS = includedCSS.concat(additionalCSS); pushStyleTagsFor(iframeHTML, includedCSS); @@ -308,7 +313,12 @@ window.onload = function () {\n\ $$INCLUDE_CSS("../static/custom/pad.css"); - var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ return '../static/plugins/' + path }); + var additionalCSS = _(hooks.callAll("aceEditorCSS")).map(function(path){ + if (path.match(/\/\//)) { // Allow urls to external CSS - http(s):// and //some/path.css + return path; + } + return '../static/plugins/' + path } + ); includedCSS = includedCSS.concat(additionalCSS); pushStyleTagsFor(outerHTML, includedCSS); |