From 7d1dbae5e59e67fc32625c1a79f0175f68752e15 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 15 Aug 2011 11:59:09 +0100 Subject: [PATCH] Add pad.css and custom/pad.css availability into the iFrame as a fix for issue 83 --- static/js/ace.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/ace.js b/static/js/ace.js index bb2e68330..27899aaab 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -248,6 +248,8 @@ function Ace2Editor() // these lines must conform to a specific format because they are passed by the build script: iframeHTML.push($$INCLUDE_CSS_Q("../static/css/iframe_editor.css")); + iframeHTML.push($$INCLUDE_CSS_Q("../static/css/pad.css")); + iframeHTML.push($$INCLUDE_CSS_Q("../static/custom/pad.css")); iframeHTML.push($$INCLUDE_JS_Q("../static/js/ace2_common.js")); iframeHTML.push($$INCLUDE_JS_Q("../static/js/skiplist.js")); iframeHTML.push($$INCLUDE_JS_Q("../static/js/virtual_lines.js")); @@ -267,7 +269,7 @@ function Ace2Editor() var outerScript = 'editorId = "' + info.id + '"; editorInfo = parent.' + thisFunctionsName + '.registry[editorId]; ' + 'window.onload = function() ' + '{ window.onload = null; setTimeout' + '(function() ' + '{ var iframe = document.createElement("IFRAME"); ' + 'iframe.scrolling = "no"; var outerdocbody = document.getElementById("outerdocbody"); ' + 'iframe.frameBorder = 0; iframe.allowTransparency = true; ' + // for IE 'outerdocbody.insertBefore(iframe, outerdocbody.firstChild); ' + 'iframe.ace_outerWin = window; ' + 'readyFunc = function() { editorInfo.onEditorReady(); readyFunc = null; editorInfo = null; }; ' + 'var doc = iframe.contentWindow.document; doc.open(); var text = (' + iframeHTML.join('+') + ').replace(/\\\\x3c/g, \'<\');doc.write(text); doc.close(); ' + '}, 0); }'; - var outerHTML = [doctype, '', $$INCLUDE_CSS("../static/css/iframe_editor.css"), + var outerHTML = [doctype, '', $$INCLUDE_CSS("../static/css/iframe_editor.css"), $$INCLUDE_CSS("../static/css/pad.css"), $$INCLUDE_CSS("../static/custom/pad.css"), // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) '', '\x3cscript>\n', outerScript, '\n\x3c/script>', '
x
'];