diff --git a/lib/ice-coder.js b/lib/ice-coder.js
index 7a0b3ce..0aa6d7c 100644
--- a/lib/ice-coder.js
+++ b/lib/ice-coder.js
@@ -544,7 +544,7 @@ var ICEcoder = {
dir.parentNode.className = dir.className = d ? "pft-directory dirOpen" : "pft-directory";
}
if (load) {
- top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/get-branch.php?location="+dir.childNodes[1].id;
+ top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/get-branch.php?location="+dir.childNodes[1].id+"&csrf="+top.ICEcoder.csrf;
}
return false;
},
@@ -674,7 +674,7 @@ var ICEcoder = {
newFolder = top.ICEcoder.getInput('Enter new folder name at '+shortURL,'');
if (newFolder) {
newFolder = (shortURL + "/" + newFolder).replace(/\/\//,"/");
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+newFolder.replace(/\//g,"|"));
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+newFolder.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('Creating Folder
'+newFolder);
}
},
@@ -707,7 +707,7 @@ var ICEcoder = {
if (shortURL!="/[NEW]") {
top.ICEcoder.thisFileFolderLink = top.ICEcoder.thisFileFolderLink.replace(/\//g,"|");
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink);
+ 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);
} else {
top.ICEcoder.createNewTab();
@@ -739,7 +739,7 @@ var ICEcoder = {
// Get remote file contents
getRemoteFile: function(remoteFile) {
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=getRemoteFile&file="+remoteFile);
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=getRemoteFile&file="+remoteFile+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('Getting
'+remoteFile);
},
@@ -756,7 +756,7 @@ var ICEcoder = {
: "|[NEW]";
}
filePath = filePath.replace("||","|");
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+filePath+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+saveType);
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+filePath+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+saveType+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('Saving
'+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""));
},
@@ -783,7 +783,7 @@ var ICEcoder = {
top.get('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
top.get('tab'+(i+1)).title = newName;
}
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('Renaming to
'+newName);
top.ICEcoder.setPreviousFiles();
@@ -804,7 +804,7 @@ var ICEcoder = {
top.get('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
top.get('tab'+(i+1)).title = newName;
}
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=move&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=move&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/")+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('Moving to
'+newName);
top.ICEcoder.setPreviousFiles();
@@ -818,7 +818,7 @@ var ICEcoder = {
tgtFiles = fileList ? fileList : top.ICEcoder.selectedFiles;
tgtListDisplay = tgtFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n");
if (tgtFiles.length>0 && top.ICEcoder.ask('Delete:\n\n'+tgtListDisplay+'?')) {
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=delete&file="+tgtFiles.join(";"));
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=delete&file="+tgtFiles.join(";")+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('Deleting File
'+tgtListDisplay);
};
},
@@ -842,7 +842,7 @@ var ICEcoder = {
if (top.ICEcoder.copiedFiles) {
for (var i=0; iPasting File
'+top.ICEcoder.copiedFiles[i].toString().replace(/\|/g,"/").replace(/,/g,"\n"));
} else {
top.ICEcoder.message("Sorry, cannot paste a whole root");
@@ -1250,7 +1250,7 @@ var ICEcoder = {
find = find.replace(/\'/g, '\'');
find != encodeURIComponent(find) ? find = 'ICEcoder:'+encodeURIComponent(find) : find;
top.ICEcoder.showHide('show',top.get('loadingMask'));
- top.get('mediaContainer').innerHTML = '';
+ top.get('mediaContainer').innerHTML = '';
// We have nothing to search for, blank it all out
} else {
results.innerHTML = "No results";
@@ -1262,7 +1262,7 @@ var ICEcoder = {
// Replace text in a file
replaceInFile: function(fileRef,find,replace) {
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+fileRef.replace(/\//g,"|")+"&find="+find+"&replace="+replace);
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+fileRef.replace(/\//g,"|")+"&find="+find+"&replace="+replace+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('Replacing text in
'+fileRef);
},
@@ -1666,7 +1666,7 @@ var ICEcoder = {
previousFiles = top.ICEcoder.openFiles.join(',').replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");
if (previousFiles=="") {previousFiles="CLEAR"};
// Then send through to the settings page to update setting
- top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+previousFiles);
+ top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+previousFiles+"&csrf="+top.ICEcoder.csrf);
},
// Opens the last files we had open
@@ -1705,7 +1705,7 @@ var ICEcoder = {
// Show the properties screen
propertiesScreen: function(fileName) {
- top.get('mediaContainer').innerHTML = '';
+ top.get('mediaContainer').innerHTML = '';
top.ICEcoder.showHide('show',top.get('blackMask'));
},
@@ -1811,20 +1811,20 @@ var ICEcoder = {
// Pass target file/folder to Zip It!
zipIt: function(tgt) {
tgt=tgt.replace(/\//g,"|");
- top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt;
+ top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt+"&csrf="+top.ICEcoder.csrf;
},
// Prompt to download our file
downloadFile: function(file) {
file=file.replace(/\//g,"|");
- top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="lib/download.php?file="+file;
+ top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="lib/download.php?file="+file+"&csrf="+top.ICEcoder.csrf;
},
// Change permissions on a file/folder
chmod: function(file,perms) {
file = file.replace(top.iceRoot,"");
top.ICEcoder.showHide('hide',top.get('blackMask'));
- top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+file+"&perms="+perms);
+ top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+file+"&perms="+perms+"&csrf="+top.ICEcoder.csrf);
top.ICEcoder.serverMessage('chMod '+perms+' on
'+file);
},
@@ -1949,6 +1949,7 @@ var ICEcoder = {
}
bugCheckURL += top.ICEcoder.bugFilesSizesSeen.join();
bugCheckURL += "&maxLines="+top.ICEcoder.bugFileMaxLines;
+ bugCheckURL += "&csrf="+top.ICEcoder.csrf;
var xhr = top.ICEcoder.xhrObj();
diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js
index 6738c1b..bec4996 100644
--- a/lib/ice-coder.min.js
+++ b/lib/ice-coder.min.js
@@ -17,24 +17,25 @@ addLineBreakAtEnd:function(a){var b;b=ICEcoder.getcMInstance();a||(a=b.getCursor
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),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,"/")),-1e.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=
-b),top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+b+"&oldFileName="+a.replace(/\|/g,"/")),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=b),top.ICEcoder.serverQueue("add","lib/file-control.php?action=move&file="+b+"&oldFileName="+a.replace(/\|/g,"/")),top.ICEcoder.serverMessage("Moving to
"+b),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a=a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0Deleting File
"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;dPasting File
"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message("Sorry, cannot paste a whole root");else top.ICEcoder.message("Nothing to paste, copy a file/folder first!")},duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,
-a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsRemote","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=
-0;aMoving to
"+b),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a=a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0Deleting File
"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;dPasting File
"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message("Sorry, cannot paste a whole root");else top.ICEcoder.message("Nothing to paste, copy a file/folder first!")},duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=
+typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsRemote","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;ac&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity=
"1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){var m,h,k,n,p,l,r;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){m="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?664:705;b||(b="/");b=b.replace(top.iceRoot,"");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,
@@ -51,16 +52,16 @@ ICEcoder.getcMInstance())&&0ICEcoder.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=
"";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=d&&c?(f=b=a="","and"==document.findAndReplace.connector.value&&(a="&replace="+e),0<=document.findAndReplace.target.value.indexOf("file")&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),"selected files"==document.findAndReplace.target.value&&(f="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),d=d.replace(/\'/g,"'"),d!=encodeURIComponent(d)?d="ICEcoder:"+encodeURIComponent(d):
-d,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML=''):(f.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none")},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+
-a.replace(/\//g,"|")+"&find="+b+"&replace="+c);top.ICEcoder.serverMessage("Replacing text in
"+a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;d=!1;"undefined"!=typeof b&&(d=b.context);"undefined"!=typeof b.curState&&"undefined"!=typeof b.curState.htmlState&&(d=b.curState.htmlState.context);ICEcoder.htmlTagArray=[];if(d)for(;d;d=d.prev)"undefined"!=typeof d.tagName&&ICEcoder.htmlTagArray.unshift(d.tagName);ICEcoder.tagString=
-ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1];"JavaScript"==ICEcoder.caretLocType&&(ICEcoder.tagString="script");a&&!top.ICEcoder.dontUpdateNest&&(ICEcoder.nestDisplay.innerHTML="","undefined"!=typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]&&(a=ICEcoder.openFiles[ICEcoder.selectedTab-1],ICEcoder.getNestLocationSub(c,a)))}},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getCursor().line;c=a.getCursor().ch;for(var e=d=0;e=a||10<=a)&&top.ICEcoder.mouseX>parseInt(top.ICEcoder.files.style.width,10)&&(top.ICEcoder.tabDragMouseX=top.ICEcoder.mouseX-parseInt(top.ICEcoder.files.style.width,
-10)-top.ICEcoder.tabDragMouseXStart,top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseXd.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&&b.parentNode.removeChild(b);
-top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}},showColorPicker:function(a){top.get("blackMask").style.visibility=
-"visible";top.get("mediaContainer").innerHTML='
';
+d,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML=''):(f.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none")},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add",
+"lib/file-control.php?action=replaceText&fileRef="+a.replace(/\//g,"|")+"&find="+b+"&replace="+c+"&csrf="+top.ICEcoder.csrf);top.ICEcoder.serverMessage("Replacing text in
"+a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;d=!1;"undefined"!=typeof b&&(d=b.context);"undefined"!=typeof b.curState&&"undefined"!=typeof b.curState.htmlState&&(d=b.curState.htmlState.context);ICEcoder.htmlTagArray=[];if(d)for(;d;d=d.prev)"undefined"!=
+typeof d.tagName&&ICEcoder.htmlTagArray.unshift(d.tagName);ICEcoder.tagString=ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1];"JavaScript"==ICEcoder.caretLocType&&(ICEcoder.tagString="script");a&&!top.ICEcoder.dontUpdateNest&&(ICEcoder.nestDisplay.innerHTML="","undefined"!=typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]&&(a=ICEcoder.openFiles[ICEcoder.selectedTab-1],ICEcoder.getNestLocationSub(c,a)))}},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getCursor().line;
+c=a.getCursor().ch;for(var e=d=0;e=a||10<=a)&&top.ICEcoder.mouseX>parseInt(top.ICEcoder.files.style.width,10)&&(top.ICEcoder.tabDragMouseX=top.ICEcoder.mouseX-
+parseInt(top.ICEcoder.files.style.width,10)-top.ICEcoder.tabDragMouseXStart,top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseXd.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&&
+b.parentNode.removeChild(b);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}},
+showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='
';
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)},autoOpenFiles:function(){if(0');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},
-showManual:function(a,b){var c;c=b?"#"+b:"";top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},
-pluginsManager:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,m,h,k,n,p,l,r,s){var q;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");q=document.createElement("link");q.setAttribute("rel","stylesheet");q.setAttribute("type","text/css");
-q.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(q);a=-1<"3024-day base16-light eclipse elegant neat paraiso-light solarized xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":"#000";top.ICEcoder.switchTab(top.ICEcoder.selectedTab);b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&top.ICEcoder.lockUnlockNav();c||(ICEcoder.changeFilesW("contract"),top.ICEcoder.hideFileMenu());
-c=ICEcoder.content.contentWindow.document.styleSheets[4];b=c.rules?"rules":"cssRules";c[b][0].style.fontSize=g;c[b][4].style["border-left-width"]=f?"1px":"0";c[b][4].style["margin-left"]=f?"-1px":"0";c[b][2].style.cssText="background-color: "+a+" !important";top.ICEcoder.lineWrapping=m;top.ICEcoder.indentWithTabs=h;top.ICEcoder.indentSize=k;for(f=0;fchMod "+b+" on
"+a)},openPreviewWindow:function(){if(0');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",
+top.get("blackMask"))},showManual:function(a,b){var c;c=b?"#"+b:"";top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='';
+top.ICEcoder.showHide("show",top.get("blackMask"))},pluginsManager:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,m,h,k,n,p,l,r,s){var q;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");q=document.createElement("link");q.setAttribute("rel",
+"stylesheet");q.setAttribute("type","text/css");q.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(q);a=-1<"3024-day base16-light eclipse elegant neat paraiso-light solarized xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":"#000";top.ICEcoder.switchTab(top.ICEcoder.selectedTab);b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&top.ICEcoder.lockUnlockNav();c||
+(ICEcoder.changeFilesW("contract"),top.ICEcoder.hideFileMenu());c=ICEcoder.content.contentWindow.document.styleSheets[4];b=c.rules?"rules":"cssRules";c[b][0].style.fontSize=g;c[b][4].style["border-left-width"]=f?"1px":"0";c[b][4].style["margin-left"]=f?"-1px":"0";c[b][2].style.cssText="background-color: "+a+" !important";top.ICEcoder.lineWrapping=m;top.ICEcoder.indentWithTabs=h;top.ICEcoder.indentSize=k;for(f=0;fchMod "+b+" on
"+a)},openPreviewWindow:function(){if(0 Settings");"error"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message("Error: can't find/access the error file paths");"ok"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message("No new errors found");"bugs"==top.ICEcoder.bugReportStatus&&(a=top.ICEcoder.openFiles.indexOf(top.ICEcoder.bugReportPath.replace(/\|/g,"/")),-1
'+