diff --git a/lib/coder.js b/lib/coder.js index 22dc755..581214b 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -93,7 +93,6 @@ var ICEcoder = { if (fileName.indexOf(".js")<0&&fileName.indexOf(".rb")&&fileName.indexOf(".css")<0) { cM = ICEcoder.getcMInstance(); content = cM.getValue(); - if (top.ICEcoder.codeAssist) {content = content.replace(/ & /g,' & ');}; content = content.replace(//g,''); // Then set the content in the editor & clear the history @@ -178,12 +177,13 @@ var ICEcoder = { // Now we've built up our nest depth array, if we're due to show it in the display if (updateNestDisplay && !top.ICEcoder.dontUpdateNest) { - // Clear the display ICEcoder.nestDisplay.innerHTML = ""; if ("undefined" != typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]) { fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1]; - if (fileName.indexOf(".js")<0&&fileName.indexOf(".rb")<0&&fileName.indexOf(".css")<0) { + if (fileName.indexOf(".js")<0&&fileName.indexOf(".rb")<0&&fileName.indexOf(".css")<0&& + (nestCheck.indexOf("include(")==-1)&&(nestCheck.indexOf("include_once(")==-1)&& + (nestCheck.indexOf("-1||nestCheck.indexOf("-1)) { // Then for all the array items, output as the nest display for (var i=0;i0) { + // If we have something to find in currrent document + if (findLen>0 && document.findAndReplace.target.value=="this document") { cM = ICEcoder.getcMInstance(); - content = cM.getValue().toLowerCase(); + content = cM.getValue(); - // Find & replace the next instance? - if (document.findAndReplace.connector.value=="and" && cM.getSelection()==find) { - cM.replaceSelection(document.getElementById('replace').value); + // Find & replace the next instance, or all? + if (document.findAndReplace.connector.value=="and") { + if (document.findAndReplace.replaceAction.value=="replace" && cM.getSelection()==find) { + cM.replaceSelection(document.getElementById('replace').value); + } + if (document.findAndReplace.replaceAction.value=="replace all" && buttonClick) { + var rExp = new RegExp(find,"g"); + cM.setValue(cM.getValue().replace(rExp,document.getElementById('replace').value)); + } } + // Get the content again, as it might of changed + content = cM.getValue(); if (!top.ICEcoder.findMode||parent.parent.document.getElementById('find').value!=ICEcoder.lastsearch) { ICEcoder.results = []; + for (var i=0;i'; + } } }, @@ -1447,5 +1471,11 @@ var ICEcoder = { // Finally, refresh the file manager if we need to if (refreshFM) {top.ICEcoder.refreshFileManager()}; + }, + + // Update and show/hide found results display? + updateResultsDisplay: function(showHide) { + ICEcoder.findReplace('find',true,false); + document.getElementById('results').style.display = showHide == "show" ? 'inline-block' : 'none'; } }; \ No newline at end of file