From a557f2414e4abf606dcbeba12cf3187f9e625646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 21 Apr 2012 13:47:11 +0200 Subject: [PATCH] cssManager top is not used, so drop it --- src/static/js/ace2_inner.js | 8 -------- src/static/js/cssmanager.js | 11 ++++------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 0e15195c7..723d410f2 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -166,12 +166,10 @@ function Ace2Inner(){ } var dynamicCSS = null; - var dynamicCSSTop = null; function initDynamicCSS() { dynamicCSS = makeCSSManager("dynamicsyntax"); - dynamicCSSTop = makeCSSManager("dynamicsyntax", true); } var changesetTracker = makeChangesetTracker(scheduler, rep.apool, { @@ -214,7 +212,6 @@ function Ace2Inner(){ if (dynamicCSS) { dynamicCSS.removeSelectorStyle(getAuthorColorClassSelector(getAuthorClassName(author))); - dynamicCSSTop.removeSelectorStyle(getAuthorColorClassSelector(getAuthorClassName(author))); } } else @@ -232,23 +229,18 @@ function Ace2Inner(){ var authorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector( getAuthorClassName(author))); - var authorStyleTop = dynamicCSSTop.selectorStyle(getAuthorColorClassSelector( - getAuthorClassName(author))); var anchorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector( getAuthorClassName(author))+' > a') // author color authorStyle.backgroundColor = bgcolor; - authorStyleTop.backgroundColor = bgcolor; // text contrast if(colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.5) { authorStyle.color = '#ffffff'; - authorStyleTop.color = '#ffffff'; }else{ authorStyle.color = null; - authorStyleTop.color = null; } // anchor text contrast diff --git a/src/static/js/cssmanager.js b/src/static/js/cssmanager.js index 952388b7b..e20074498 100644 --- a/src/static/js/cssmanager.js +++ b/src/static/js/cssmanager.js @@ -20,15 +20,12 @@ * limitations under the License. */ -function makeCSSManager(emptyStylesheetTitle, top) +function makeCSSManager(emptyStylesheetTitle) { - function getSheetByTitle(title, top) + function getSheetByTitle(title) { - if(top) - var allSheets = window.parent.parent.document.styleSheets; - else - var allSheets = document.styleSheets; + var allSheets = document.styleSheets; for (var i = 0; i < allSheets.length; i++) { @@ -41,7 +38,7 @@ function makeCSSManager(emptyStylesheetTitle, top) return null; } - var browserSheet = getSheetByTitle(emptyStylesheetTitle, top); + var browserSheet = getSheetByTitle(emptyStylesheetTitle); function browserRules() {