diff options
author | John McLear <john@mclear.co.uk> | 2015-12-02 11:53:54 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2015-12-02 11:53:54 +0000 |
commit | 69c1d04dd2a2189b359757f6513a58da7dd0a1fd (patch) | |
tree | 97da0f6cb0d360149fdc086102c11be45999d562 | |
parent | 0617f8168917ff6b7fe559bef386a225d0c75721 (diff) | |
parent | 1a303f06b6429a710fd6d58cdfa2c2e30731afec (diff) | |
download | etherpad-lite-69c1d04dd2a2189b359757f6513a58da7dd0a1fd.zip |
Merge branch 'develop' of github.com:ether/etherpad-lite into plugin-hook-for-settings-earlier
-rw-r--r-- | doc/api/hooks_client-side.md | 2 | ||||
-rw-r--r-- | src/static/js/ace.js | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/doc/api/hooks_client-side.md b/doc/api/hooks_client-side.md index 367e0688..1c9ca5af 100644 --- a/doc/api/hooks_client-side.md +++ b/doc/api/hooks_client-side.md @@ -111,7 +111,7 @@ Called from: src/static/js/ace.js Things in context: None -This hook is provided to allow custom CSS files to be loaded. The return value should be an array of paths relative to the plugins directory. +This hook is provided to allow custom CSS files to be loaded. The return value should be an array of resource urls or paths relative to the plugins directory. ## aceInitInnerdocbodyHead Called from: src/static/js/ace.js 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); |