From f3ba353d5877a54a4c4c4809238d8555f40da4c1 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Wed, 29 Feb 2012 13:07:43 -0800 Subject: [PATCH] Don't inline styles or scripts in Ace. --- static/js/ace.js | 91 ++++++++---------------------------------------- 1 file changed, 15 insertions(+), 76 deletions(-) diff --git a/static/js/ace.js b/static/js/ace.js index f974744c2..4793feb73 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -133,62 +133,6 @@ function Ace2Editor() return info.ace_getUnhandledErrors(); }; - - - function sortFilesByEmbeded(files) { - var embededFiles = []; - var remoteFiles = []; - - if (Ace2Editor.EMBEDED) { - for (var i = 0, ii = files.length; i < ii; i++) { - var file = files[i]; - if (Object.prototype.hasOwnProperty.call(Ace2Editor.EMBEDED, file)) { - embededFiles.push(file); - } else { - remoteFiles.push(file); - } - } - } else { - remoteFiles = files; - } - - return {embeded: embededFiles, remote: remoteFiles}; - } - function pushScriptsTo(buffer) { - /* Folling is for packaging regular expression. */ - /* $$INCLUDE_JS("../minified/ace2_inner.js?callback=require.define"); */ - var ACE_SOURCE = '../minified/ace2_inner.js?callback=require.define'; - if (Ace2Editor.EMBEDED && Ace2Editor.EMBEDED[ACE_SOURCE]) { - buffer.push('\ +\n\ +\ '); - pushScriptsTo(iframeHTML); iframeHTML.push(''); iframeHTML.push(' '); @@ -264,12 +208,7 @@ function Ace2Editor() var outerHTML = [doctype, ''] - 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"); - pushStyleTagsFor(outerHTML, includedCSS); + outerHTML.push(styleTags); // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing)