diff --git a/lib/ice-coder.js b/lib/ice-coder.js index ec7720b..4c6971f 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1041,7 +1041,7 @@ var ICEcoder = { // Find & replace text according to user selections findReplace: function(findString,resultsOnly,buttonClick) { - var find, replace, results, cM, content, lineCount, numChars, charsToCursor, charCount, cursor, replaceQS, targetQS; + var find, replace, results, cM, content, scrollBarVisible, cursor, avgBlockH, addPadding, rBlocks, blockColor, replaceQS, targetQS, filesQS; // Determine our find & replace strings and results display find = findString.toLowerCase(); @@ -1066,10 +1066,14 @@ var ICEcoder = { content = cM.getValue().toLowerCase(); if (!top.ICEcoder.findMode||find!=top.ICEcoder.lastsearch) { ICEcoder.results = []; + ICEcoder.resultsLines = []; for (var i=0;i0) { + // Detect if we have a scrollbar + scrollBarVisible = cM.getScrollInfo().height > cM.getScrollInfo().clientHeight; + // Show results only if (resultsOnly) { results.innerHTML = ICEcoder.results.length + " results"; // We need to take action instead } else { - // Get the no of chars to our cursor - numChars=-1; - for (var i=0;i-1 ? cM.getCursor().line+1 == i ? "#b00" : "#888" : "transparent" + rBlocks += '
'; + } + top.ICEcoder.content.contentWindow.document.getElementById('resultsBar').innerHTML = rBlocks; + top.ICEcoder.content.contentWindow.document.getElementById('resultsBar').style.display = "inline-block"; return true; + } else { results.innerHTML = "No results"; + top.ICEcoder.content.contentWindow.document.getElementById('resultsBar').innerHTML = ""; + top.ICEcoder.content.contentWindow.document.getElementById('resultsBar').style.display = "none"; return false; } } else { @@ -1139,6 +1156,11 @@ var ICEcoder = { find != encodeURIComponent(find) ? find = 'ICEcoder:'+encodeURIComponent(find) : find; top.ICEcoder.showHide('show',top.get('loadingMask')); top.get('mediaContainer').innerHTML = ''; + // We have nothing to search for, blank it all out + } else { + results.innerHTML = "No results"; + top.ICEcoder.content.contentWindow.document.getElementById('resultsBar').innerHTML = ""; + top.ICEcoder.content.contentWindow.document.getElementById('resultsBar').style.display = "none"; } } },