diff --git a/lib/ice-coder.js b/lib/ice-coder.js
index 7bc4891..ecea7ed 100644
--- a/lib/ice-coder.js
+++ b/lib/ice-coder.js
@@ -248,16 +248,16 @@ var ICEcoder = {
// Move lines in turn up
if (dir=="up") {
for (var i=lineStart.line; i<=lineEnd.line; i++) {
- cM.setLine(i-1,cM.getLine(i));
+ cM.replaceRange(cM.getLine(i),{line:i-1,ch:0},{line:i-1,ch:1000000});
}
// ...or down
} else {
for (var i=lineEnd.line; i>=lineStart.line; i--) {
- cM.setLine(i+1,cM.getLine(i));
+ cM.replaceRange(cM.getLine(i),{line:i+1,ch:0},{line:i+1,ch:1000000});
}
}
// Now swap our final line with the swap line to complete the move
- cM.setLine(dir=="up" ? lineEnd.line : lineStart.line,swapLine);
+ cM.replaceRange(swapLine,{line: dir=="up" ? lineEnd.line : lineStart.line, ch: 0},{line: dir=="up" ? lineEnd.line : lineStart.line, ch:1000000});
// Finally set the moved selection
cM.setSelection(
{line: lineStart.line+(dir=="up" ? -1 : 1), ch: lineStart.ch},
@@ -356,7 +356,7 @@ var ICEcoder = {
top.ICEcoder.startPosCh = startPos.ch = cursor.from().ch;
// Now set an end position object that matches this start tag
endPos = new Object();
- endPos.line = top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(cM,startPos) || startPos.line;
+ endPos.line = top.ICEcoder.content.contentWindow.CodeMirror.fold.xml(cM,startPos) || startPos.line;
endPos.line = endPos.line.to ? endPos.line.to.line : endPos.line;
endPos.ch = cM.getLine(endPos.line).indexOf(""+top.ICEcoder.htmlTagArray[nestPos]+">")+top.ICEcoder.htmlTagArray[nestPos].length+3;
// Set the selection or escape out of not selecting
@@ -395,7 +395,7 @@ var ICEcoder = {
startLine = cM.getCursor('start').line;
endLine = cM.getCursor().line;
cM.operation(function() {
- cM.replaceSelection("
\n"+cM.getSelection()+"\n
");
+ cM.replaceSelection("\n"+cM.getSelection()+"\n
","around");
for (var i=startLine+1; i<=endLine+1; i++) {
cM.indentLine(i);
}
@@ -407,11 +407,11 @@ var ICEcoder = {
cM.getSelection().substr(0,tag.length+1) == "<"+tagStart &&
cM.getSelection().substr(-(tag.length+3)) == ""+tagEnd+">") {
// Undo wrapper
- cM.replaceSelection(cM.getSelection().substr(cM.getSelection().indexOf(">")+1,cM.getSelection().length-cM.getSelection().indexOf(">")-1-tag.length-3));
+ cM.replaceSelection(cM.getSelection().substr(cM.getSelection().indexOf(">")+1,cM.getSelection().length-cM.getSelection().indexOf(">")-1-tag.length-3),"around");
} else {
if (tag=='a') {tagStart='a href=""';}
// Do wrapper
- cM.replaceSelection("<"+tagStart+">"+cM.getSelection()+""+tagEnd+">");
+ cM.replaceSelection("<"+tagStart+">"+cM.getSelection()+""+tagEnd+">","around");
if (tag=='a') {cM.setCursor({line:cM.getCursor('start').line,ch:cM.getCursor('start').ch+9})}
}
}
@@ -423,7 +423,7 @@ var ICEcoder = {
cM = ICEcoder.getcMInstance();
if (!line) {line = cM.getCursor().line};
- cM.setLine(line,cM.getLine(line)+"
");
+ cM.replaceRange(cM.getLine(line)+"
",{line:line,ch:0},{line:line,ch:1000000});
},
// Duplicate line
@@ -440,7 +440,7 @@ var ICEcoder = {
} else {
if (!line) {line = cM.getCursor().line};
ch = cM.getCursor().ch;
- cM.setLine(line,cM.getLine(line)+"\n"+cM.getLine(line));
+ cM.replaceRange(cM.getLine(line)+"\n"+cM.getLine(line),{line:line,ch:0},{line:line,ch:1000000});
cM.setCursor(line+1,ch);
}
},
@@ -455,7 +455,7 @@ var ICEcoder = {
} else {
if (!line) {line = cM.getCursor().line};
ch = cM.getCursor().ch;
- cM.removeLine(line);
+ cM.execCommand('deleteLine');
cM.setCursor(line-1,ch);
}
},
@@ -505,7 +505,7 @@ var ICEcoder = {
if(top.ICEcoder.draggingWithKey == "CTRL") {
url = window.location.protocol + "//" + window.location.hostname + url;
}
- cM.replaceSelection(url);
+ cM.replaceSelection(url,"around");
},
// Search for selected text online
@@ -1150,7 +1150,7 @@ var ICEcoder = {
// Find & replace the next instance, or all?
if (document.findAndReplace.connector.value=="and" && buttonClick) {
if (document.findAndReplace.replaceAction.value=="replace" && cM.getSelection().toLowerCase()==find) {
- cM.replaceSelection(replace);
+ cM.replaceSelection(replace,"around");
} else if (document.findAndReplace.replaceAction.value=="replace all") {
var rExp = new RegExp(find,"gi");
cM.setValue(cM.getValue().replace(rExp,replace));
@@ -1538,7 +1538,7 @@ var ICEcoder = {
cM = ICEcoder.getcMInstance();
cursor = cM.getTokenAt(cM.getCursor());
- cM.replaceRange(color,{line:cM.getCursor().line,ch:cursor.start},{line:cM.getCursor().line,ch:cursor.end});
+ cM.replaceRange(color,{line:cM.getCursor().line,ch:cursor.start},{line:cM.getCursor().line,ch:1000000});
},
// Change opacity of the file manager icons
@@ -2651,7 +2651,7 @@ var ICEcoder = {
}
}
// Clear the cursor string and set the cursor there
- cM.setLine(lineNo, replacedLine.replace("CURSOR",""));
+ cM.replaceRange(replacedLine.replace("CURSOR",""),{line:lineNo,ch:0},{line:lineNo,ch:1000000});
cM.setCursor(lineNoCount,curPos);
// Finally, focus on the editor
top.ICEcoder.focus();
diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js
index 249b9ed..16612c2 100644
--- a/lib/ice-coder.min.js
+++ b/lib/ice-coder.min.js
@@ -6,28 +6,28 @@ top.ICEcoder.openFiles.length;a++)top.ICEcoder.content.contentWindow["cM"+ICEcod
ICEcoder.filesW)/2):ICEcoder.filesW=ICEcoder.maxFilesW:ICEcoder.filesW>ICEcoder.minFilesW+1?ICEcoder.filesW-=Math.ceil((ICEcoder.filesW-ICEcoder.minFilesW)/2):ICEcoder.filesW=ICEcoder.minFilesW;("expand"==a&&ICEcoder.filesW==ICEcoder.maxFilesW||"contract"==a&&ICEcoder.filesW==ICEcoder.minFilesW)&&clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){top.ICEcoder.ready&&"w-resize"==top.document.body.style.cursor?top.ICEcoder.mouseDown&&(top.ICEcoder.filesW=top.ICEcoder.maxFilesW=
250<=top.ICEcoder.mouseX&&400>=top.ICEcoder.mouseX?top.ICEcoder.mouseX:250>top.ICEcoder.mouseX?250:400,top.ICEcoder.files.style.width=top.ICEcoder.filesFrame.style.width=top.ICEcoder.filesW+"px",top.ICEcoder.setLayout(),top.ICEcoder.draggingFilesW=!0):top.ICEcoder.draggingFilesW=!1},lockUnlockNav:function(){var a;a=top.filesFrame.contentWindow.document.getElementById("fmLock");ICEcoder.lockedNav=!ICEcoder.lockedNav;a.style.backgroundPosition=ICEcoder.lockedNav?"0 0":"-16px 0"},showHidePlugins:function(a){get("plugins").style.width=
"show"==a?"55px":"3px";get("plugins").style.background="show"==a?"#333":"transparent";"show"==a&&ICEcoder.changeFilesW("expand")},contentCleanUp:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getValue();b=b.replace(//g,"");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration()},undo:function(){ICEcoder.getcMInstance().undo()},redo:function(){ICEcoder.getcMInstance().redo()},indent:function(a){var b;b=ICEcoder.getcMInstance();
-"more"==a?top.ICEcoder.content.contentWindow.CodeMirror.commands.indentMore(b):top.ICEcoder.content.contentWindow.CodeMirror.commands.indentLess(b)},moveLines:function(a){var b,c,d,e,f;b=top.ICEcoder.getcMInstance();c=b.getCursor("start");d=b.getCursor("end");"up"==a&&0=c.line;e--)b.setLine(e+
-1,b.getLine(e));b.setLine("up"==a?d.line:c.line,f);b.setSelection({line:c.line+("up"==a?-1:1),ch:c.ch},{line:d.line+("up"==a?-1:1),ch:d.ch})}))},highlightLine:function(a){var b;b=top.ICEcoder.getcMInstance();b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},focus:function(){var a;/iPhone|iPad|iPod/i.test(navigator.userAgent)||(a=top.ICEcoder.getcMInstance())&&a.focus()},goToLine:function(a){ICEcoder.getcMInstance().setCursor(a?a-1:top.get("goToLineNo").value-1);top.ICEcoder.focus();
-return!1},lineCommentToggle:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);ICEcoder.lineCommentToggleSub(a,b,c,d,d.length,2)},highlightBlock:function(a,b){var c,d,e,f;c=top.ICEcoder.getcMInstance();if(b)top.ICEcoder.dontUpdateNest?c.setCursor(top.ICEcoder.cursorOrigLine,top.ICEcoder.cursorOrigCh):top.ICEcoder.getNestLocation("updateNestDisplay"),top.ICEcoder.dontUpdateNest=!1;else{top.ICEcoder.cursorOrigCh=c.getCursor().ch;top.ICEcoder.cursorOrigLine=
-c.getCursor().line;top.ICEcoder.dontUpdateNest=!0;d={};d.ch=c.getCursor().ch;d.line=c.getCursor().line;for(var g=top.ICEcoder.htmlTagArray.length-1;g>=a;g--)e=c.getSearchCursor("<"+top.ICEcoder.htmlTagArray[g],d),e.findPrevious(),d.ch=e.from().ch,d.line=e.from().line,g==a&&(f=c.getSearchCursor(">",d),f.findNext(),c.setCursor(f.from().line,f.from().ch+1),top.ICEcoder.getNestLocation(),ICEcoder.htmlTagArray.length-1!=a&&g++);e.from()&&(d={},top.ICEcoder.startPosLine=d.line=e.from().line,top.ICEcoder.startPosCh=
-d.ch=e.from().ch,e={},e.line=top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(c,d)||d.line,e.line=e.line.to?e.line.to.line:e.line,e.ch=c.getLine(e.line).indexOf(""+top.ICEcoder.htmlTagArray[a]+">")+top.ICEcoder.htmlTagArray[a].length+3,top.ICEcoder.dontSelect?top.ICEcoder.dontSelect=!1:c.setSelection(d,e),c.scrollIntoView(d))}},setPosition:function(a,b,c){var d;d=ICEcoder.getcMInstance();c=d.getLine(b).indexOf(">",d.getLine(b).indexOf("<"+c))+1;d.setCursor(b,c);top.ICEcoder.focus();
-for(d=b=0;d<=a;d++)b=ICEcoder.nestDisplay.innerHTML.indexOf(">",b+1);ICEcoder.nestDisplay.innerHTML=ICEcoder.nestDisplay.innerHTML.substr(0,b).replace(/<(?:.|\n)*?>/gm,"");top.ICEcoder.dontUpdateNest=!1;top.ICEcoder.dontSelect=!0},tagWrapper:function(a){var b,c,d,e;b=ICEcoder.getcMInstance();c=a;"div"==a?(d=b.getCursor("start").line,e=b.getCursor().line,b.operation(function(){b.replaceSelection("\n"+b.getSelection()+"\n
");for(var a=d+1;a<=e+1;a++)b.indentLine(a);b.indentLine(e+2,"prev");
-b.indentLine(e+2,"subtract")})):-1<"p a b i strong em h1 h2 h3 h4 h5 h6".split(" ").indexOf(a)&&b.getSelection().substr(0,a.length+1)=="<"+c&&b.getSelection().substr(-(a.length+3))==""+a+">"?b.replaceSelection(b.getSelection().substr(b.getSelection().indexOf(">")+1,b.getSelection().length-b.getSelection().indexOf(">")-1-a.length-3)):("a"==a&&(c='a href=""'),b.replaceSelection("<"+c+">"+b.getSelection()+""+a+">"),"a"==a&&b.setCursor({line:b.getCursor("start").line,ch:b.getCursor("start").ch+9}))},
-addLineBreakAtEnd:function(a){var b;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);b.setLine(a,b.getLine(a)+"
")},duplicateLines:function(a){var b,c,d;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"start"),b.setSelection(c,d)):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.setLine(a,b.getLine(a)+"\n"+b.getLine(a)),b.setCursor(a+
-1,c))},removeLines:function(a){var b,c;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?b.replaceSelection(""):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.removeLine(a),b.setCursor(a-1,c))},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);else for(top.ICEcoder.origCurorPos=a.getCursor(),a=["var "+b,"function "+b,b+"=function",b+"= function",b+" =function",
-b+" = function",b+"=new function",b+"= new function",b+" =new function",b+" = new function","window['"+b+"']",'window["'+b+'"]',"this['"+b+"']",'this["'+b+'"]',b+":",b+" :","def "+b,"class "+b],b=0;be.replace(/\d+/g,g)?c:e;if(0c&&("LI"!=d.childNodes[c].nodeName&&c++,b=d.childNodes[c].childNodes[0].childNodes[1],
-b.id==f&&(a=!0),!0==a&&-1==top.ICEcoder.selectedFiles.indexOf(b.id)&&(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(b.id)),b.id!=e);c+=2);else ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c);document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?"selected files":"all files";document.findAndReplace.target[3].innerHTML=
-top.ICEcoder.selectedFiles[0]?"selected filenames":"all filenames";top.ICEcoder.hideFileMenu()},deselectAllFiles:function(){for(var a,b=0;bCreating Folder
"+b)},openFile:function(a){var b;a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType="file");"/[NEW]"!=top.ICEcoder.thisFileFolderLink&&!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+
-1):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),b=!0,100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message("Sorry, you can only have 100 files open at a time!"),b=!1),b&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink+"&csrf="+top.ICEcoder.csrf),
-top.ICEcoder.serverMessage("Opening File
"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab(),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;bGetting
"+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0Saving
"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
+"more"==a?top.ICEcoder.content.contentWindow.CodeMirror.commands.indentMore(b):top.ICEcoder.content.contentWindow.CodeMirror.commands.indentLess(b)},moveLines:function(a){var b,c,d,e,f;b=top.ICEcoder.getcMInstance();c=b.getCursor("start");d=b.getCursor("end");"up"==a&&0=c.line;e--)b.replaceRange(b.getLine(e),{line:e+1,ch:0},{line:e+1,ch:1E6});b.replaceRange(f,{line:"up"==a?d.line:c.line,ch:0},{line:"up"==a?d.line:c.line,ch:1E6});b.setSelection({line:c.line+("up"==a?-1:1),ch:c.ch},{line:d.line+("up"==a?-1:1),ch:d.ch})}))},highlightLine:function(a){var b;b=top.ICEcoder.getcMInstance();b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},focus:function(){var a;/iPhone|iPad|iPod/i.test(navigator.userAgent)||(a=top.ICEcoder.getcMInstance())&&
+a.focus()},goToLine:function(a){ICEcoder.getcMInstance().setCursor(a?a-1:top.get("goToLineNo").value-1);top.ICEcoder.focus();return!1},lineCommentToggle:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);ICEcoder.lineCommentToggleSub(a,b,c,d,d.length,2)},highlightBlock:function(a,b){var c,d,e,f;c=top.ICEcoder.getcMInstance();if(b)top.ICEcoder.dontUpdateNest?c.setCursor(top.ICEcoder.cursorOrigLine,top.ICEcoder.cursorOrigCh):top.ICEcoder.getNestLocation("updateNestDisplay"),
+top.ICEcoder.dontUpdateNest=!1;else{top.ICEcoder.cursorOrigCh=c.getCursor().ch;top.ICEcoder.cursorOrigLine=c.getCursor().line;top.ICEcoder.dontUpdateNest=!0;d={};d.ch=c.getCursor().ch;d.line=c.getCursor().line;for(var g=top.ICEcoder.htmlTagArray.length-1;g>=a;g--)e=c.getSearchCursor("<"+top.ICEcoder.htmlTagArray[g],d),e.findPrevious(),d.ch=e.from().ch,d.line=e.from().line,g==a&&(f=c.getSearchCursor(">",d),f.findNext(),c.setCursor(f.from().line,f.from().ch+1),top.ICEcoder.getNestLocation(),ICEcoder.htmlTagArray.length-
+1!=a&&g++);e.from()&&(d={},top.ICEcoder.startPosLine=d.line=e.from().line,top.ICEcoder.startPosCh=d.ch=e.from().ch,e={},e.line=top.ICEcoder.content.contentWindow.CodeMirror.fold.xml(c,d)||d.line,e.line=e.line.to?e.line.to.line:e.line,e.ch=c.getLine(e.line).indexOf(""+top.ICEcoder.htmlTagArray[a]+">")+top.ICEcoder.htmlTagArray[a].length+3,top.ICEcoder.dontSelect?top.ICEcoder.dontSelect=!1:c.setSelection(d,e),c.scrollIntoView(d))}},setPosition:function(a,b,c){var d;d=ICEcoder.getcMInstance();c=d.getLine(b).indexOf(">",
+d.getLine(b).indexOf("<"+c))+1;d.setCursor(b,c);top.ICEcoder.focus();for(d=b=0;d<=a;d++)b=ICEcoder.nestDisplay.innerHTML.indexOf(">",b+1);ICEcoder.nestDisplay.innerHTML=ICEcoder.nestDisplay.innerHTML.substr(0,b).replace(/<(?:.|\n)*?>/gm,"");top.ICEcoder.dontUpdateNest=!1;top.ICEcoder.dontSelect=!0},tagWrapper:function(a){var b,c,d,e;b=ICEcoder.getcMInstance();c=a;"div"==a?(d=b.getCursor("start").line,e=b.getCursor().line,b.operation(function(){b.replaceSelection("\n"+b.getSelection()+"\n
",
+"around");for(var a=d+1;a<=e+1;a++)b.indentLine(a);b.indentLine(e+2,"prev");b.indentLine(e+2,"subtract")})):-1<"p a b i strong em h1 h2 h3 h4 h5 h6".split(" ").indexOf(a)&&b.getSelection().substr(0,a.length+1)=="<"+c&&b.getSelection().substr(-(a.length+3))==""+a+">"?b.replaceSelection(b.getSelection().substr(b.getSelection().indexOf(">")+1,b.getSelection().length-b.getSelection().indexOf(">")-1-a.length-3),"around"):("a"==a&&(c='a href=""'),b.replaceSelection("<"+c+">"+b.getSelection()+""+a+">",
+"around"),"a"==a&&b.setCursor({line:b.getCursor("start").line,ch:b.getCursor("start").ch+9}))},addLineBreakAtEnd:function(a){var b;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);b.replaceRange(b.getLine(a)+"
",{line:a,ch:0},{line:a,ch:1E6})},duplicateLines:function(a){var b,c,d;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"start"),
+b.setSelection(c,d)):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.replaceRange(b.getLine(a)+"\n"+b.getLine(a),{line:a,ch:0},{line:a,ch:1E6}),b.setCursor(a+1,c))},removeLines:function(a){var b,c;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?b.replaceSelection(""):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.execCommand("deleteLine"),b.setCursor(a-1,c))},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);
+else for(top.ICEcoder.origCurorPos=a.getCursor(),a=["var "+b,"function "+b,b+"=function",b+"= function",b+" =function",b+" = function",b+"=new function",b+"= new function",b+" =new function",b+" = new function","window['"+b+"']",'window["'+b+'"]',"this['"+b+"']",'this["'+b+'"]',b+":",b+" :","def "+b,"class "+b],b=0;be.replace(/\d+/g,g)?c:e;if(0c&&("LI"!=d.childNodes[c].nodeName&&
+c++,b=d.childNodes[c].childNodes[0].childNodes[1],b.id==f&&(a=!0),!0==a&&-1==top.ICEcoder.selectedFiles.indexOf(b.id)&&(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(b.id)),b.id!=e);c+=2);else ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c);document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?"selected files":"all files";
+document.findAndReplace.target[3].innerHTML=top.ICEcoder.selectedFiles[0]?"selected filenames":"all filenames";top.ICEcoder.hideFileMenu()},deselectAllFiles:function(){for(var a,b=0;bCreating Folder
"+b)},openFile:function(a){var b;a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType="file");"/[NEW]"!=top.ICEcoder.thisFileFolderLink&&!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?
+top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),b=!0,100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message("Sorry, you can only have 100 files open at a time!"),b=!1),b&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+
+top.ICEcoder.thisFileFolderLink+"&csrf="+top.ICEcoder.csrf),top.ICEcoder.serverMessage("Opening File
"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab(),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;bGetting
"+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0Saving
"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput("Please enter the new name for",c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1
',
c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+b+"&oldFileName="+a.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf),top.ICEcoder.serverMessage("Renaming to
"+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&(d=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/")),-1
',c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=
@@ -47,7 +47,7 @@ b.replace(/\//g,"|")+"|"+c+"_perms");"move"==a&&(top.ICEcoder.updateFileManagerL
"|"):"")+"|"+c).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.src="files.php";top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;
if(224==b||91==b||93==b)top.ICEcoder.cmdKey=!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&setTimeout(function(){c="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==
top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1},findReplaceOptions:function(){top.get("rText").style.display=top.get("replace").style.display=top.get("rTarget").style.display="and"==document.findAndReplace.connector.value?"inline-block":"none"},findReplace:function(a,b,c){var d,e,f;d=a.toLowerCase();e=top.get("replace").value;f=top.get("results");if((a=
-ICEcoder.getcMInstance())&&0a.getScrollInfo().clientHeight;if(b)f.innerHTML=ICEcoder.results.length+" results";else{for(e=ICEcoder.findResult=0;eICEcoder.results.length-1&&(ICEcoder.findResult=0);f.innerHTML="Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results";b=a.getSearchCursor(d,a.getCursor(),!0);b.findNext();b.from()||(b=a.getSearchCursor(d,{line:0,ch:0},!0),b.findNext());a.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}d=c?parseInt(top.ICEcoder.content.style.height,10)/a.lineCount():a.defaultTextHeight();b=c?0:a.heightAtLine(0);top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=
c?"17px":"0";f="";for(e=1;e<=a.lineCount();e++)c=-1';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=f;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}f.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=
@@ -65,10 +65,10 @@ c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.get("content").content
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,e,f,g,m,h,k,n,p;b=top.get("canvasPicker").getContext("2d");c=new Image;c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.get("canvasPicker").onmousemove=function(a){d=a.pageX-this.offsetLeft;e=a.pageY-this.offsetTop;f=b.getImageData(d,e,1,1).data;g=f[0];m=f[1];h=f[2];k=g+","+m+","+h;n=top.ICEcoder.rgbToHex(g,
m,h);top.get("rgbMouseXY").value=k;top.get("hexMouseXY").value="#"+n;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+n;p=128>g||128>m||128>h&&200>g&&200>m&&50Cancelled tasks');setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,
"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a+"&csrf="+top.ICEcoder.csrf)},autoOpenFiles:function(){if(0');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",
@@ -113,4 +113,4 @@ if(71==c)return top.ICEcoder.tagWrapper("strong"),!1;if(69==c)return top.ICEcode
!1):32==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.addSnippet(),!1):32==c&&"content"!=a&&-1==["find","replace"].indexOf(document.activeElement.id)?(top.ICEcoder.getcMInstance()&&top.ICEcoder.focus(),!1):74==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):223==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(top.ICEcoder.lockedNav?"expand":"contract"),!1):190==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(c=ICEcoder.getcMInstance(),
d=c.getCursor().line,-1