From 5778d501667d04b702682cc4aa3de1d89db9f6ea Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 26 Feb 2021 01:47:44 -0500 Subject: [PATCH] ace: Delete unused `$$INCLUDE_CSS` logic Nothing "compiles" the file by replacing `$$INCLUDE_CSS()` calls anymore so it is safe to simplify the code. --- src/static/js/ace.js | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index e550a902b..ba1429a9d 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -162,22 +162,17 @@ const Ace2Editor = function () { doneFunc(); }; - // 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: - const includedCSS = []; - const $$INCLUDE_CSS = (filename) => { includedCSS.push(filename); }; - $$INCLUDE_CSS('../static/css/iframe_editor.css'); - $$INCLUDE_CSS(`../static/css/pad.css?v=${clientVars.randomVersionString}`); - includedCSS.push(...hooks.callAll('aceEditorCSS').map((path) => { - if (path.match(/\/\//)) { // Allow urls to external CSS - http(s):// and //some/path.css - return path; - } - return `../static/plugins/${path}`; - })); - $$INCLUDE_CSS( - `../static/skins/${clientVars.skinName}/pad.css?v=${clientVars.randomVersionString}`); + const includedCSS = [ + '../static/css/iframe_editor.css', + `../static/css/pad.css?v=${clientVars.randomVersionString}`, + ...hooks.callAll('aceEditorCSS').map((path) => { + if (path.match(/\/\//)) { // Allow urls to external CSS - http(s):// and //some/path.css + return path; + } + return `../static/plugins/${path}`; + }), + `../static/skins/${clientVars.skinName}/pad.css?v=${clientVars.randomVersionString}`, + ]; const doctype = '';