From 934d35353724179810cb079473f4ecdd4e86f561 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Wed, 10 Jul 2013 17:29:58 +0100 Subject: [PATCH] codeAssist set from settings, fixes to updating codeAssist is now set along with other settings in index.php solarized and xq-light should have lighter active lines too If codeAssist isn't the same as out session setting, set it to the updated setting and toggle the switch Adjusts to CSS stylesheet targeting. New CSS file meant it's now position 4 in the array and child item 4 where we'll find the content style I also changed background to background-color on the activeLine style --- lib/ice-coder.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index db7bccf..9de2e8c 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -25,7 +25,6 @@ var ICEcoder = { findMode: false, // States if we're in find/replace mode lockedNav: true, // Nav is locked or not htmlTagArray: [], // Array storing the nest of tags - codeAssist: true, // Assist user with their coding mouseDown: false, // If the mouse is down or not draggingFilesW: false, // If we're dragging the file manager width or not draggingTab: false, // If we're dragging a tab @@ -1653,11 +1652,14 @@ var ICEcoder = { styleNode.setAttribute('type', 'text/css'); styleNode.setAttribute('href', themeURL); top.ICEcoder.content.contentWindow.document.getElementsByTagName('head')[0].appendChild(styleNode); - activeLineBG = ["eclipse","elegant","neat"].indexOf(top.ICEcoder.theme)>-1 ? "#ccc": "#000"; + activeLineBG = ["eclipse","elegant","neat","solarized","xq-light"].indexOf(top.ICEcoder.theme)>-1 ? "#ccc": "#000"; top.ICEcoder.switchTab(top.ICEcoder.selectedTab); // Check/uncheck Code Assist setting - top.get('codeAssist').checked = codeAssist; + if (codeAssist != top.ICEcoder.codeAssist) { + top.get('codeAssist').checked = codeAssist; + top.ICEcoder.codeAssistToggle(); + } // Unlock/lock the file manager if (lockedNav != top.ICEcoder.lockedNav) {top.ICEcoder.lockUnlockNav()}; @@ -1666,11 +1668,11 @@ var ICEcoder = { top.ICEcoder.hideFileMenu(); } - cMCSS = ICEcoder.content.contentWindow.document.styleSheets[3]; + cMCSS = ICEcoder.content.contentWindow.document.styleSheets[4]; strCSS = cMCSS.rules ? 'rules' : 'cssRules'; cMCSS[strCSS][0].style['fontSize'] = fontSize; - cMCSS[strCSS][5].style['content'] = visibleTabs ? '"\\21e5"' : '" "'; - cMCSS[strCSS][2].style.cssText = "background: " + activeLineBG + " !important"; + cMCSS[strCSS][4].style['content'] = visibleTabs ? '"\\21e5"' : '" "'; + cMCSS[strCSS][2].style.cssText = "background-color: " + activeLineBG + " !important"; top.ICEcoder.lineWrapping = lineWrapping; top.ICEcoder.indentWithTabs = indentWithTabs;