From c734bde7dd1eb656214393d05c4f6045b55bb58a Mon Sep 17 00:00:00 2001 From: Sofian Benaissa Date: Tue, 13 Mar 2012 11:54:49 -0300 Subject: [PATCH 1/4] Fix the nocolor embed parameter --- static/js/pad_editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/pad_editor.js b/static/js/pad_editor.js index 3dd67544d..23c549146 100644 --- a/static/js/pad_editor.js +++ b/static/js/pad_editor.js @@ -87,8 +87,6 @@ var padeditor = (function() return defaultValue; } - self.ace.setProperty("showsauthorcolors", !settings.noColors); - self.ace.setProperty("rtlIsTrue", settings.rtlIsTrue); var v; @@ -100,6 +98,8 @@ var padeditor = (function() v = getOption('showAuthorColors', true); self.ace.setProperty("showsauthorcolors", v); padutils.setCheckbox($("#options-colorscheck"), v); + // Override from parameters + self.ace.setProperty("showsauthorcolors", !settings.noColors); v = getOption('useMonospaceFont', false); self.ace.setProperty("textface", (v ? "monospace" : "Arial, sans-serif")); From cc06a6365494c2be0aae9acb399659e59956d9fc Mon Sep 17 00:00:00 2001 From: Sofian Benaissa Date: Tue, 20 Mar 2012 22:02:53 -0400 Subject: [PATCH 2/4] Added inner.js and inner.css for custom theming and scripting of innermost iframe --- bin/installDeps.sh | 2 +- static/js/ace.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index 270ec98cd..b72d8a370 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -96,7 +96,7 @@ rm -f var/minified* echo "ensure custom css/js files are created..." -for f in "index" "pad" "timeslider" +for f in "index" "pad" "timeslider" "inner" do if [ ! -f "static/custom/$f.js" ]; then cp -v "static/custom/js.template" "static/custom/$f.js" || exit 1 diff --git a/static/js/ace.js b/static/js/ace.js index 22d4eaa6e..d2fcfd10c 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -265,6 +265,8 @@ function Ace2Editor() pushScriptsTo(iframeHTML); iframeHTML.push(''); + iframeHTML.push(''); + iframeHTML.push(''); iframeHTML.push(' '); // Expose myself to global for my child frame. From 5d7a1734a47e48d0adf3cacdbe895501c21b30cd Mon Sep 17 00:00:00 2001 From: Sofian Benaissa Date: Tue, 20 Mar 2012 22:12:42 -0400 Subject: [PATCH 3/4] Added outer.js and outer.css for custom theming and scripting of middle iframe --- bin/installDeps.sh | 2 +- static/js/ace.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index b72d8a370..a8bfd5fcd 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -96,7 +96,7 @@ rm -f var/minified* echo "ensure custom css/js files are created..." -for f in "index" "pad" "timeslider" "inner" +for f in "index" "pad" "timeslider" "inner" "outer" do if [ ! -f "static/custom/$f.js" ]; then cp -v "static/custom/js.template" "static/custom/$f.js" || exit 1 diff --git a/static/js/ace.js b/static/js/ace.js index d2fcfd10c..a77906024 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -287,7 +287,7 @@ function Ace2Editor() // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) - outerHTML.push('', '\x3cscript>\n', outerScript.replace(/<\//g, '<\\/'), '\n\x3c/script>', '
x
'); + outerHTML.push('', '\x3cscript>\n', outerScript.replace(/<\//g, '<\\/'), '\n\x3c/script>', '
x
'); var outerFrame = document.createElement("IFRAME"); outerFrame.frameBorder = 0; // for IE From 80c9d9c948ebf9fff19281a49f9a24b08a9f6bc5 Mon Sep 17 00:00:00 2001 From: Sofian Benaissa Date: Tue, 20 Mar 2012 22:16:01 -0400 Subject: [PATCH 4/4] use relative paths for custom/inner.* and outer.* --- static/js/ace.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/ace.js b/static/js/ace.js index a77906024..188ef8e42 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -265,8 +265,8 @@ function Ace2Editor() pushScriptsTo(iframeHTML); iframeHTML.push(''); - iframeHTML.push(''); - iframeHTML.push(''); + iframeHTML.push(''); + iframeHTML.push(''); iframeHTML.push(' '); // Expose myself to global for my child frame. @@ -287,7 +287,7 @@ function Ace2Editor() // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) - outerHTML.push('', '\x3cscript>\n', outerScript.replace(/<\//g, '<\\/'), '\n\x3c/script>', '
x
'); + outerHTML.push('', '\x3cscript>\n', outerScript.replace(/<\//g, '<\\/'), '\n\x3c/script>', '
x
'); var outerFrame = document.createElement("IFRAME"); outerFrame.frameBorder = 0; // for IE