Bug reporting initial setup

bugReportStatus added, off to begin with
bugFileMDTs also added to contain a list of modified datetimes for bug
files being checked upon
On init, startBugChecking()
When using new settings, pull through 3 x bug related settings so we can
restart service (to do!)
xhrObj setup to return cross browser XHR object to make our calls
openBugReport will look to bugStatusReport and display an appropriate
message, for now
startBugChecking is the main function. If we have a timer, clear any
existing interval and start a new one
That then builds up a URL to call, with null values if items don't exist
(for error handling later on - to do!). The MDTs will need something
other than push, as this will all be called after changing settings. Use
the i int instead to hard set each array key & value (after clearing the
array)
The XHR call is made using our object and on a successful state, we
parse the result to read and handle the bug icon changing before setting
the bugReportStatus value. Need to also handle other states & statuses.
The status is set to 'ok' on restarting the bug checking function
This commit is contained in:
Matt Pass
2014-02-28 12:31:56 +00:00
parent f5be67675b
commit 70ca67b3d5
2 changed files with 133 additions and 46 deletions

View File

@@ -45,6 +45,8 @@ var ICEcoder = {
overPopup: false, // Indicates if we're over a popup or not
cmdKey: false, // Tracking apple Command key up/down state
fmReady: false, // Indicates if the file manager is ready for action
bugReportStatus: "off", // Values of: off, error, ok, bugs
bugFileMDTs: [], // Array of bug file modification datetimes user last saw
ready: false, // Indicates if ICEcoder is ready for action
// Set our aliases
@@ -76,6 +78,9 @@ var ICEcoder = {
// Update the nesting indicator every 30ms
setInterval(ICEcoder.updateNestingIndicator,30);
// Start bug checking
top.ICEcoder.startBugChecking();
// ICEcoder is ready to start using
top.ICEcoder.ready = true;
},
@@ -1831,7 +1836,7 @@ var ICEcoder = {
},
// Update the settings used when we make a change to them
useNewSettings: function(themeURL,codeAssist,lockedNav,tagWrapperCommand,autoComplete,visibleTabs,fontSize,lineWrapping,indentWithTabs,indentSize,pluginPanelAligned,refreshFM) {
useNewSettings: function(themeURL,codeAssist,lockedNav,tagWrapperCommand,autoComplete,visibleTabs,fontSize,lineWrapping,indentWithTabs,indentSize,pluginPanelAligned,bugFilePaths,bugFileCheckTimer,bugFileMaxLines,refreshFM) {
var styleNode, strCSS, cMCSS, activeLineBG;
// Add new stylesheet for selected theme
@@ -1886,6 +1891,8 @@ var ICEcoder = {
top.get('plugins').style.left = pluginPanelAligned == "left" ? "0" : "auto";
top.get('plugins').style.right = pluginPanelAligned == "right" ? "0" : "auto";
console.log(bugFilePaths + "," + bugFileCheckTimer + "," + bugFileMaxLines);
// Finally, refresh the file manager if we need to
if (refreshFM) {top.ICEcoder.refreshFileManager()};
},
@@ -1993,6 +2000,83 @@ var ICEcoder = {
}
},
// XHR object
xhrObj: function(){
try {return new XMLHttpRequest();}catch(e){}
try {return new ActiveXObject("Msxml3.XMLHTTP");}catch(e){}
try {return new ActiveXObject("Msxml2.XMLHTTP.6.0");}catch(e){}
try {return new ActiveXObject("Msxml2.XMLHTTP.3.0");}catch(e){}
try {return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){}
try {return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}
return null;
},
// Open bug report
openBugReport: function() {
if(top.ICEcoder.bugReportStatus=="off") {
top.ICEcoder.message('You can start bug reporting in Help > Settings');
}
if(top.ICEcoder.bugReportStatus=="error") {
top.ICEcoder.message('Error: can\'t find/access the error file paths');
}
if(top.ICEcoder.bugReportStatus=="ok") {
top.ICEcoder.message('No new errors found');
}
if(top.ICEcoder.bugReportStatus=="bugs") {
top.ICEcoder.message('Need to open bugs log file at this point...');
}
},
// Start bug checking by looking in bug file paths on a timer
startBugChecking: function() {
var bugCheckURL;
if (top.ICEcoder.bugFileCheckTimer !== 0) {
// Clear any existing interval
if ("undefined" != typeof top.ICEcoder.bugFileCheckTimerInt) {
clearInterval(top.ICEcoder.bugFileCheckTimerInt);
}
// Start a new timer
top.ICEcoder.bugFileCheckInt = setInterval(function() {
bugCheckURL = "lib/bug-files-check.php?";
bugCheckURL += "files="+(top.ICEcoder.bugFilePaths[0] !== "" ? top.ICEcoder.bugFilePaths.join() : "null");
bugCheckURL += "&filesMDTs="
if (top.ICEcoder.bugFileMDTs.length != top.ICEcoder.bugFilePaths.length) {
// Fill the array with nulls
for (var i=0; i<top.ICEcoder.bugFilePaths.length; i++) {
top.ICEcoder.bugFileMDTs.push("null");
}
}
bugCheckURL += top.ICEcoder.bugFileMDTs.join();
bugCheckURL += "&maxLines="+top.ICEcoder.bugFileMaxLines;
// top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = bugCheckURL;
var xhr = top.ICEcoder.xhrObj();
xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status==200) {
console.log(xhr.responseText);
var statusArray = JSON.parse(xhr.responseText);
console.log(statusArray);
top.get('bugIcon').style.backgroundPosition =
statusArray['result'] == "off" ? "0 0" :
statusArray['result'] == "ok" ? "-32 0" :
statusArray['result'] == "bugs" ? "-48 0" :
"-16 0"; // if the result is 'error' or another value
top.ICEcoder.bugReportStatus = statusArray['result'];
}
};
console.log('Calling '+bugCheckURL+' via XHR');
xhr.open("GET",bugCheckURL,true);
xhr.send();
},parseInt(top.ICEcoder.bugFileCheckTimer*1000,10));
// State that we're checking for bugs
top.ICEcoder.bugReportStatus = "ok";
}
},
// ==============
// TABS
// ==============

93
lib/ice-coder.min.js vendored
View File

@@ -1,32 +1,32 @@
var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,savedPoints:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,lockedNav:!0,htmlTagArray:[],mouseDown:!1,draggingFilesW:!1,draggingTab:!1,draggingWithKey:!1,tabLeftPos:[],tabBGcurrent:"#141414",tabBGselected:"#49d",tabBGopen:"#c3c3c3",tabBGnormal:"transparent",tabFGcurrent:"#fff",tabFGselected:"#fff",tabFGopenFile:"#000",
tabFGnormalFile:"#eee",tabFGnormalTab:"#888",serverQueueItems:[],previewWindow:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,fmReady:!1,ready:!1,initAliases:function(){for(var a="header files fileOptions optionsFile optionsEdit optionsRemote optionsHelp filesFrame editor tabsBar findBar content footer nestValid nestDisplay charDisplay byteDisplay".split(" "),b=0;b<a.length;b++)ICEcoder[a[b]]=top.get(a[b])},init:function(){ICEcoder.setLayout();top.ICEcoder.showHide("hide",top.get("loadingMask"));
top.ICEcoder.autoOpenInt=setInterval(function(){top.ICEcoder.fmReady&&(top.ICEcoder.openLastFiles&&top.ICEcoder.autoOpenFiles(),clearInterval(top.ICEcoder.autoOpenInt))},4);setInterval(ICEcoder.updateNestingIndicator,30);top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth;c=window.innerHeight;this.header.style.width=this.tabsBar.style.width=this.findBar.style.width=b+"px";this.files.style.width=this.editor.style.left=this.filesW+"px";this.optionsFile.style.width=this.optionsEdit.style.width=
this.optionsRemote.style.width=this.optionsHelp.style.width=this.filesW-60+"px";this.filesFrame.style.height=c-25-45+"px";this.nestValid.style.left=this.filesW+10+"px";this.nestDisplay.style.left=this.filesW+17+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-25-21-28-26+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize("100%",
top.ICEcoder.content.style.height)},4))},changeFilesW:function(a){ICEcoder.lockedNav&&ICEcoder.filesW!=ICEcoder.minFilesW||("undefined"!=typeof ICEcoder.changeFilesInt&&clearInterval(ICEcoder.changeFilesInt),ICEcoder.changeFilesInt=setInterval(function(){ICEcoder.changeFilesWStep(a)},10))},changeFilesWStep:function(a){"expand"==a?ICEcoder.filesW<ICEcoder.maxFilesW-1?ICEcoder.filesW+=Math.ceil((ICEcoder.maxFilesW-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(/<ICEcoder:\/:textarea>/g,"</textarea>");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=c.line-1);"down"==a&&d.line<b.lineCount()-1&&(e=d.line+1);isNaN(e)||(f=b.getLine(e),b.operation(function(){if("up"==a)for(var e=c.line;e<=d.line;e++)b.setLine(e-1,b.getLine(e));else for(e=d.line;e>=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},switchMode:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.openFiles[ICEcoder.selectedTab-
1];b&&a?b.setOption("mode",a):b&&c&&(0<c.indexOf(".js")?b.setOption("mode","javascript"):0<c.indexOf(".coffee")?b.setOption("mode","coffeescript"):0<c.indexOf(".rb")?b.setOption("mode","ruby"):0<c.indexOf(".py")?b.setOption("mode","python"):0<c.indexOf(".css")?b.setOption("mode","css"):0<c.indexOf(".less")?b.setOption("mode","less"):0<c.indexOf(".md")?b.setOption("mode","markdown"):0<c.indexOf(".xml")?b.setOption("mode","xml"):0<c.indexOf(".sql")?b.setOption("mode","text/x-mysql"):b.setOption("mode",
"application/x-httpd-php"))},lineCommentToggle:function(){var a,b,c,d,e,f;a=ICEcoder.getcMInstance();b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);e=d.length;f=2;if(-1<"JavaScript CoffeeScript PHP Python Ruby CSS SQL".split(" ").indexOf(ICEcoder.caretLocType))if(a.somethingSelected())if("Ruby"==ICEcoder.caretLocType||"Python"==ICEcoder.caretLocType)for(e=a.getCursor(!0).line,d=a.getCursor().line;e<=d;e++)a.setLine(e,"#"!=a.getLine(e).slice(0,1)?"#"+a.getLine(e):a.getLine(e).slice(1,a.getLine(e).length));
else a.replaceSelection("/*"!=a.getSelection().slice(0,2)?"/*"+a.getSelection()+"*/":a.getSelection().slice(2,a.getSelection().length-2));else-1<["CoffeeScript","CSS","SQL"].indexOf(ICEcoder.caretLocType)?(a.setLine(c,"/*"!=d.slice(0,2)?"/*"+d+"*/":d.slice(2,e).slice(0,e-4)),"/*"==d.slice(0,2)&&(f=-f)):"Ruby"==ICEcoder.caretLocType?(a.setLine(c,"#"!=d.slice(0,1)?"#"+d:d.slice(1,e)),"#"==d.slice(0,1)&&(f=-f)):(a.setLine(c,"//"!=d.slice(0,2)?"//"+d:d.slice(2,e)),"//"==d.slice(0,2)&&(f=-f));else a.somethingSelected()?
a.replaceSelection("\x3c!--"!=a.getSelection().slice(0,4)?"\x3c!--"+a.getSelection()+"//--\x3e":a.getSelection().slice(4,a.getSelection().length-5)):(a.setLine(c,"\x3c!--"!=d.slice(0,4)?"\x3c!--"+d+"//--\x3e":d.slice(4,e).slice(0,e-9)),f="\x3c!--"==d.slice(0,4)?-4:4);a.somethingSelected()||a.setCursor(c,b+f)},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("&gt;",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("<div>\n"+
b.getSelection()+"\n</div>");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)+"<br>")},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;b<a.length&&!top.ICEcoder.findReplace(a[b],!1,!1);b++);},autocomplete:function(){var a;a=ICEcoder.getcMInstance();top.ICEcoder.content.contentWindow.CodeMirror.commands.autocomplete(a)},pasteURL:function(a){var b;b=ICEcoder.getcMInstance();
"CTRL"==top.ICEcoder.draggingWithKey&&(a=window.location.protocol+"//"+window.location.hostname+a);b.replaceSelection(a)},searchForSelected:function(){if(top.ICEcoder.caretLocType)if(""!=top.ICEcoder.getcMInstance().getSelection()){var a=top.ICEcoder.caretLocType.toLowerCase()+" ";"Content"==top.ICEcoder.caretLocType&&(a="");window.open("http://www.google.com/#output=search&q="+a+top.ICEcoder.getcMInstance().getSelection())}else top.ICEcoder.message("No text selected to search on")},openCloseDir:function(a,
b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.openCloseDir(this,!1)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"==c.tagName&&((d="none"==c.style.display)?b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");b&&(top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/get-branch.php?location="+a.childNodes[1].id);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=a;ICEcoder.thisFileFolderLink=
b},selectFileFolder:function(a){var b,c,d,e,f;if(""==top.ICEcoder.thisFileFolderLink)a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.deselectAllFiles();else if(top.ICEcoder.thisFileFolderLink)if(c=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),b=ICEcoder.filesFrame.contentWindow.document.getElementById(c),a.ctrlKey||top.ICEcoder.cmdKey)-1<top.ICEcoder.selectedFiles.indexOf(c)?(ICEcoder.selectDeselectFile("deselect",b),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(c),1)):(ICEcoder.selectDeselectFile("select",
b),top.ICEcoder.selectedFiles.push(c));else if(a.shiftKey){a=!1;d=b.parentNode.parentNode.parentNode;e=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1];var g=function(a,b,c,d){return("00000000000000000000"+a).substr(-20)};f=c.replace(/\d+/g,g)<e.replace(/\d+/g,g)?c:e;e=c.replace(/\d+/g,g)>e.replace(/\d+/g,g)?c:e;if(0<top.ICEcoder.selectedFiles.length&&f.substr(0,f.lastIndexOf("|"))==e.substr(0,e.lastIndexOf("|")))for(c=0;1E6>c&&("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;b<top.ICEcoder.selectedFiles.length;b++)a=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selectedFiles[b]),ICEcoder.selectDeselectFile("deselect",a);top.ICEcoder.selectedFiles.length=0},selectDeselectFile:function(a,b){var c;b&&(c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g,"/"))?!0:!1,top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
1]==b.id.replace(/\|/g,"/")?b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:top.ICEcoder.tabBGcurrent:b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},newFile:function(){top.ICEcoder.newTab();top.ICEcoder.saveFile()},newFolder:function(){var a,b;a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,
"/");if(b=top.ICEcoder.getInput("Enter new folder name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>Creating Folder</b><br>"+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)+
tabFGnormalFile:"#eee",tabFGnormalTab:"#888",serverQueueItems:[],previewWindow:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,fmReady:!1,bugReportStatus:"off",bugFileMDTs:[],ready:!1,initAliases:function(){for(var a="header files fileOptions optionsFile optionsEdit optionsRemote optionsHelp filesFrame editor tabsBar findBar content footer nestValid nestDisplay charDisplay byteDisplay".split(" "),b=0;b<a.length;b++)ICEcoder[a[b]]=top.get(a[b])},init:function(){ICEcoder.setLayout();top.ICEcoder.showHide("hide",
top.get("loadingMask"));top.ICEcoder.autoOpenInt=setInterval(function(){top.ICEcoder.fmReady&&(top.ICEcoder.openLastFiles&&top.ICEcoder.autoOpenFiles(),clearInterval(top.ICEcoder.autoOpenInt))},4);setInterval(ICEcoder.updateNestingIndicator,30);top.ICEcoder.startBugChecking();top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth;c=window.innerHeight;this.header.style.width=this.tabsBar.style.width=this.findBar.style.width=b+"px";this.files.style.width=this.editor.style.left=this.filesW+
"px";this.optionsFile.style.width=this.optionsEdit.style.width=this.optionsRemote.style.width=this.optionsHelp.style.width=this.filesW-60+"px";this.filesFrame.style.height=c-25-45+"px";this.nestValid.style.left=this.filesW+10+"px";this.nestDisplay.style.left=this.filesW+17+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-25-21-28-26+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.content.contentWindow["cM"+
ICEcoder.cMInstances[a]].setSize("100%",top.ICEcoder.content.style.height)},4))},changeFilesW:function(a){ICEcoder.lockedNav&&ICEcoder.filesW!=ICEcoder.minFilesW||("undefined"!=typeof ICEcoder.changeFilesInt&&clearInterval(ICEcoder.changeFilesInt),ICEcoder.changeFilesInt=setInterval(function(){ICEcoder.changeFilesWStep(a)},10))},changeFilesWStep:function(a){"expand"==a?ICEcoder.filesW<ICEcoder.maxFilesW-1?ICEcoder.filesW+=Math.ceil((ICEcoder.maxFilesW-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(/<ICEcoder:\/:textarea>/g,"</textarea>");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=c.line-1);"down"==a&&d.line<b.lineCount()-1&&(e=d.line+1);isNaN(e)||(f=b.getLine(e),b.operation(function(){if("up"==a)for(var e=c.line;e<=d.line;e++)b.setLine(e-1,b.getLine(e));else for(e=d.line;e>=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},switchMode:function(a){var b,
c;b=ICEcoder.getcMInstance();c=ICEcoder.openFiles[ICEcoder.selectedTab-1];b&&a?b.setOption("mode",a):b&&c&&(0<c.indexOf(".js")?b.setOption("mode","javascript"):0<c.indexOf(".coffee")?b.setOption("mode","coffeescript"):0<c.indexOf(".rb")?b.setOption("mode","ruby"):0<c.indexOf(".py")?b.setOption("mode","python"):0<c.indexOf(".css")?b.setOption("mode","css"):0<c.indexOf(".less")?b.setOption("mode","less"):0<c.indexOf(".md")?b.setOption("mode","markdown"):0<c.indexOf(".xml")?b.setOption("mode","xml"):
0<c.indexOf(".sql")?b.setOption("mode","text/x-mysql"):b.setOption("mode","application/x-httpd-php"))},lineCommentToggle:function(){var a,b,c,d,e,f;a=ICEcoder.getcMInstance();b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);e=d.length;f=2;if(-1<"JavaScript CoffeeScript PHP Python Ruby CSS SQL".split(" ").indexOf(ICEcoder.caretLocType))if(a.somethingSelected())if("Ruby"==ICEcoder.caretLocType||"Python"==ICEcoder.caretLocType)for(e=a.getCursor(!0).line,d=a.getCursor().line;e<=d;e++)a.setLine(e,
"#"!=a.getLine(e).slice(0,1)?"#"+a.getLine(e):a.getLine(e).slice(1,a.getLine(e).length));else a.replaceSelection("/*"!=a.getSelection().slice(0,2)?"/*"+a.getSelection()+"*/":a.getSelection().slice(2,a.getSelection().length-2));else-1<["CoffeeScript","CSS","SQL"].indexOf(ICEcoder.caretLocType)?(a.setLine(c,"/*"!=d.slice(0,2)?"/*"+d+"*/":d.slice(2,e).slice(0,e-4)),"/*"==d.slice(0,2)&&(f=-f)):"Ruby"==ICEcoder.caretLocType?(a.setLine(c,"#"!=d.slice(0,1)?"#"+d:d.slice(1,e)),"#"==d.slice(0,1)&&(f=-f)):
(a.setLine(c,"//"!=d.slice(0,2)?"//"+d:d.slice(2,e)),"//"==d.slice(0,2)&&(f=-f));else a.somethingSelected()?a.replaceSelection("\x3c!--"!=a.getSelection().slice(0,4)?"\x3c!--"+a.getSelection()+"//--\x3e":a.getSelection().slice(4,a.getSelection().length-5)):(a.setLine(c,"\x3c!--"!=d.slice(0,4)?"\x3c!--"+d+"//--\x3e":d.slice(4,e).slice(0,e-9)),f="\x3c!--"==d.slice(0,4)?-4:4);a.somethingSelected()||a.setCursor(c,b+f)},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("&gt;",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("<div>\n"+b.getSelection()+"\n</div>");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)+"<br>")},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;b<a.length&&!top.ICEcoder.findReplace(a[b],!1,!1);b++);},autocomplete:function(){var a;a=ICEcoder.getcMInstance();top.ICEcoder.content.contentWindow.CodeMirror.commands.autocomplete(a)},
pasteURL:function(a){var b;b=ICEcoder.getcMInstance();"CTRL"==top.ICEcoder.draggingWithKey&&(a=window.location.protocol+"//"+window.location.hostname+a);b.replaceSelection(a)},searchForSelected:function(){if(top.ICEcoder.caretLocType)if(""!=top.ICEcoder.getcMInstance().getSelection()){var a=top.ICEcoder.caretLocType.toLowerCase()+" ";"Content"==top.ICEcoder.caretLocType&&(a="");window.open("http://www.google.com/#output=search&q="+a+top.ICEcoder.getcMInstance().getSelection())}else top.ICEcoder.message("No text selected to search on")},
openCloseDir:function(a,b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.openCloseDir(this,!1)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"==c.tagName&&((d="none"==c.style.display)?b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");b&&(top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/get-branch.php?location="+a.childNodes[1].id);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=
a;ICEcoder.thisFileFolderLink=b},selectFileFolder:function(a){var b,c,d,e,f;if(""==top.ICEcoder.thisFileFolderLink)a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.deselectAllFiles();else if(top.ICEcoder.thisFileFolderLink)if(c=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),b=ICEcoder.filesFrame.contentWindow.document.getElementById(c),a.ctrlKey||top.ICEcoder.cmdKey)-1<top.ICEcoder.selectedFiles.indexOf(c)?(ICEcoder.selectDeselectFile("deselect",b),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(c),
1)):(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c));else if(a.shiftKey){a=!1;d=b.parentNode.parentNode.parentNode;e=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1];var g=function(a,b,c,d){return("00000000000000000000"+a).substr(-20)};f=c.replace(/\d+/g,g)<e.replace(/\d+/g,g)?c:e;e=c.replace(/\d+/g,g)>e.replace(/\d+/g,g)?c:e;if(0<top.ICEcoder.selectedFiles.length&&f.substr(0,f.lastIndexOf("|"))==e.substr(0,e.lastIndexOf("|")))for(c=0;1E6>c&&("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;b<top.ICEcoder.selectedFiles.length;b++)a=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selectedFiles[b]),ICEcoder.selectDeselectFile("deselect",a);top.ICEcoder.selectedFiles.length=0},selectDeselectFile:function(a,b){var c;b&&(c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g,"/"))?!0:
!1,top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]==b.id.replace(/\|/g,"/")?b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:top.ICEcoder.tabBGcurrent:b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},newFile:function(){top.ICEcoder.newTab();top.ICEcoder.saveFile()},newFolder:function(){var a,b;a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
1].replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter new folder name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>Creating Folder</b><br>"+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("<b>Opening File</b><br>"+
top.ICEcoder.shortURL)):top.ICEcoder.createNewTab(),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b<a.length;b++)top.ICEcoder.thisFileFolderLink=a[b].replace("|","/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},openPrompt:function(){var a;if(a=top.ICEcoder.getInput("Enter relative file path (prefixed with /) or remote URL",""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):top.ICEcoder.openFile(a)},getRemoteFile:function(a){top.ICEcoder.serverQueue("add",
"lib/file-control.php?action=getRemoteFile&file="+a);top.ICEcoder.serverMessage("<b>Getting</b><br>"+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0<top.ICEcoder.selectedFiles.length&&(c=top.ICEcoder.selectedFiles[0],b=-1==c.lastIndexOf(".")||c.lastIndexOf(".")<c.lastIndexOf("|")?c+b:"|[NEW]");b=b.replace("||","|");top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+b+"&fileMDT="+
@@ -40,11 +40,11 @@ a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.IC
0;a<c.length;a++)top.ICEcoder.showHide("hide",top.get(c[a])),top.get(c[a]+"Nav").style.color=""},150);else for(var d=0;d<c.length;d++)top.ICEcoder.showHide("hide",top.get(c[d])),top.get(c[d]+"Nav").style.color="";get("fileOptions").style.opacity=0;"show"==a&&("undefined"!=typeof fileNavInt&&clearTimeout(fileNavInt),top.ICEcoder.showHide(a,top.get(b)),top.get(b+"Nav").style.color="#fff",get("fileOptions").style.opacity=1)},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=-1<top.ICEcoder.selectedFiles[0].indexOf(".")?"file":"folder",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?"block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=
1<top.ICEcoder.selectedFiles.length?"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display="inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10,b+a>c&&(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){var g,m,h,l,n,p,k,q;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){g=-1<c.indexOf(".")?"file":"folder";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,
"|"));l=h.parentNode.parentNode.nextSibling;n=document.createTextNode("\n");p='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="top.ICEcoder.overFileFolder(\''+g+"','"+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+"')\" onMouseOut=\"top.ICEcoder.overFileFolder('"+g+'\',\'\')" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="color: #888; font-size: 8px" id="'+b.replace(/\/$/,
"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(3>l.childNodes.length)k=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(k,l.nextSibling),k=document.createElement("li"),k.className=m,k.draggable=!0,k.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&top.ICEcoder.getcMInstance().focus()},k.ondragend=function(){top.ICEcoder.dropFile(this)},k.innerHTML=p,l.nextSibling.appendChild(k),l.nextSibling.appendChild(n);else for(h=
0;h<l.childNodes.length;h++)if(l.childNodes[h].className&&(k=0<l.childNodes[h].className.indexOf("directory")?"folder":"file",q=l.childNodes[h].getElementsByTagName("span")[0].innerHTML,k==g&&q>c||"folder"==g&&"file"==k||h==l.childNodes.length-1)){k=document.createElement("li");k.className=m;k.draggable=!0;k.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&top.ICEcoder.getcMInstance().focus()};k.ondragend=function(){top.ICEcoder.dropFile(this)};k.innerHTML=p;h==
l.childNodes.length-1?(l.appendChild(k),l.appendChild(n)):(l.insertBefore(k,l.childNodes[h]),l.insertBefore(n,l.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+"_perms"),targetElemPerms.id=
"1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f){var g,m,h,k,n,p,l,r;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){g=-1<c.indexOf(".")?"file":"folder";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,
"|"));k=h.parentNode.parentNode.nextSibling;n=document.createTextNode("\n");p='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="top.ICEcoder.overFileFolder(\''+g+"','"+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+"')\" onMouseOut=\"top.ICEcoder.overFileFolder('"+g+'\',\'\')" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="color: #888; font-size: 8px" id="'+b.replace(/\/$/,
"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(3>k.childNodes.length)l=document.createElement("ul"),k=h.parentNode.parentNode,k.parentNode.insertBefore(l,k.nextSibling),l=document.createElement("li"),l.className=m,l.draggable=!0,l.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&top.ICEcoder.getcMInstance().focus()},l.ondragend=function(){top.ICEcoder.dropFile(this)},l.innerHTML=p,k.nextSibling.appendChild(l),k.nextSibling.appendChild(n);else for(h=
0;h<k.childNodes.length;h++)if(k.childNodes[h].className&&(l=0<k.childNodes[h].className.indexOf("directory")?"folder":"file",r=k.childNodes[h].getElementsByTagName("span")[0].innerHTML,l==g&&r>c||"folder"==g&&"file"==l||h==k.childNodes.length-1)){l=document.createElement("li");l.className=m;l.draggable=!0;l.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&top.ICEcoder.getcMInstance().focus()};l.ondragend=function(){top.ICEcoder.dropFile(this)};l.innerHTML=p;h==
k.childNodes.length-1?(k.appendChild(l),k.appendChild(n)):(k.insertBefore(l,k.childNodes[h]),k.insertBefore(n,k.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+"_perms"),targetElemPerms.id=
b.replace(/\//g,"|")+"|"+c+"_perms");"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c),top.ICEcoder.updateFileManagerList("delete",e.substr(0,e.lastIndexOf("/")),c));"chmod"==a&&(f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(f.replace(/\//g,"|")+"_perms"),h.innerHTML=d);"delete"==a&&(h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+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),
@@ -69,8 +69,8 @@ top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(top.ICEcoder.mouseDown||(top
a}},serverMessage:function(a){var b;b=top.get("serverMessage");a?(b.innerHTML=a,b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;if(a=ICEcoder.getcMInstance()){b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=c.exec(b))&&a.getCursor().ch>d.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='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'color\').value)" value="insert &gt;" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'colorRGB\').value)" value="insert &gt;" class="insertColorValue">';
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,e,f,g,m,h,l,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];l=g+","+m+","+h;n=top.ICEcoder.rgbToHex(g,
m,h);top.get("rgbMouseXY").value=l;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&&50<h?"#fff":"#000";top.get("hexMouseXY").style.color=top.get("rgbMouseXY").style.color=p};top.get("canvasPicker").onclick=function(){top.get("rgb").value=top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=
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&&50<h?"#fff":"#000";top.get("hexMouseXY").style.color=top.get("rgbMouseXY").style.color=p};top.get("canvasPicker").onclick=function(){top.get("rgb").value=top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=
top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=p}},rgbToHex:function(a,b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789abcdef".charAt((a-a%16)/16)+"0123456789abcdef".charAt(a%16)},insertColorValue:function(a){var b,c;b=ICEcoder.getcMInstance();c=b.getTokenAt(b.getCursor());b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,
ch:c.end})},fMIconVis:function(a,b){var c;if(c=top.get(a))c.style.opacity=b},isOpen:function(a){a=a.replace(/\|/g,"/").replace(top.docRoot+top.iceRoot,"");a=top.ICEcoder.openFiles.indexOf(a);return-1!=a?a:!1},startPluginIntervals:function(a,b,c,d){top.ICEcoder["plugTimer"+a]=-1<["_parent","_top","_self",""].indexOf(c)?top.ICEcoder["plugTimer"+a]=setInterval("window.location='"+b+"'",6E4*d):0==c.indexOf("fileControl")?top.ICEcoder["plugTimer"+a]=setInterval(function(){top.ICEcoder.serverQueue("add",
b);top.ICEcoder.serverMessage(c.split(":")[1])},6E4*d):top.ICEcoder["plugTimer"+a]=setInterval("window.open('"+b+"','"+c+"')",6E4*d);top.ICEcoder.pluginIntervalRefs.push(a)},codeAssistToggle:function(){var a;ICEcoder.getcMInstance();top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.get("codeAssistDisplay").style.backgroundPosition=top.ICEcoder.codeAssist?"0 0":"-16px 0";top.ICEcoder.cssColorPreview();top.ICEcoder.focus();for(i=0;i<top.ICEcoder.cMInstances.length;i++)-1<top.ICEcoder.openFiles[i].indexOf(".js")&&
@@ -80,20 +80,23 @@ setTimeout(function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.l
"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a)},autoOpenFiles:function(){if(0<top.ICEcoder.previousFiles.length&&top.ICEcoder.ask("Open previous files?\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a<top.ICEcoder.previousFiles.length;a++)top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[a].replace("|",
"/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},settingsScreen:function(a){a||(top.get("mediaContainer").innerHTML='<iframe src="lib/settings-screen.php" class="whiteGlow" style="width: 970px; height: 610px"></iframe>');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/help.php" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},
showManual:function(a,b){var c;c=b?"#"+b:"";top.get("mediaContainer").innerHTML='<iframe src="http://icecoder.net/manual?version='+a+c+'" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},
pluginsManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/plugins-manager.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,m,h,l,n,p){var k;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");k=document.createElement("link");k.setAttribute("rel","stylesheet");k.setAttribute("type","text/css");
k.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(k);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=l;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+
pluginsManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/plugins-manager.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';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;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+
ICEcoder.cMInstances[f]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("tabSize",top.ICEcoder.indentSize);d!=top.ICEcoder.tagWrapperCommand&&(top.ICEcoder.tagWrapperCommand=d);e!=top.ICEcoder.autoComplete&&(top.ICEcoder.autoComplete=e);top.get("plugins").style.left="left"==n?"0":"auto";top.get("plugins").style.right=
"right"==n?"0":"auto";p&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.get("find").value,!0,!1);top.get("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen?document.mozCancelFullScreen():document.body.mozRequestFullScreen():
"right"==n?"0":"auto";console.log(p+","+l+","+r);s&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.get("find").value,!0,!1);top.get("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen?document.mozCancelFullScreen():document.body.mozRequestFullScreen():
"undefined"!=typeof document.webkitCancelFullScreen&&(document.webkitIsFullScreen?document.webkitCancelFullScreen():document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))},zipIt:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="plugins/zip-it/index.php?zip="+a},downloadFile:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/download.php?file="+a},chmod:function(a,b){a=
a.replace(top.iceRoot,"");top.ICEcoder.showHide("hide",top.get("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+a+"&perms="+b);top.ICEcoder.serverMessage("<b>chMod "+b+" on </b><br>"+a)},openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c;b=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];c=b.substr(b.lastIndexOf("/")+1);c=c.substr(c.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();top.ICEcoder.previewWindow=window.open(b,"previewWindow");
-1<["md"].indexOf(c)&&(top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())})}},logout:function(){window.location+="?logout"},message:function(a){alert(a)},ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b;b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},update:function(){confirm("Updating is currently an experimental feature. While it should work fine, please note there may be issues here, plus the following isn't yet part of this:\n\n- Settings not ported to new version\n- Plugins not ported to new version\n- Any mods you've made not ported to new version\n\nIf you have write access on the whole of ICEcoder (ie, running locally) it should work fine. If tho you need to recover ICEcoder for any reason, you'll find this current version in its tmp dir.\n\nClick OK to proceed with an auto-update or cancel to visit the ICEcoder site so you can grab the zip and update manually")?
(top.ICEcoder.showHide("show",top.get("loadingMask")),window.location="lib/updater.php"):window.open("http://icecoder.net")},switchTab:function(a,b){var c;ICEcoder.selectedTab=a;if(c=ICEcoder.getcMInstance()){ICEcoder.switchMode();for(var d=0;d<ICEcoder.cMInstances.length;d++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].getWrapperElement().style.display="none";c.setOption("theme",top.ICEcoder.theme);c.getWrapperElement().style.display="block";b||setTimeout(function(){top.ICEcoder.focus()},
4);c.refresh();ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.get("find").value,!0,!1);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()}},newTab:function(){var a;ICEcoder.cMInstances.push(ICEcoder.nextcMInstance);ICEcoder.selectedTab=ICEcoder.cMInstances.length;ICEcoder.showHide("show",ICEcoder.content);ICEcoder.content.contentWindow.createNewCMInstance(ICEcoder.nextcMInstance);ICEcoder.setLayout();
ICEcoder.thisFileFolderType="file";ICEcoder.thisFileFolderLink="/[NEW]";ICEcoder.openFile();a=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);a.removeLineClass(ICEcoder["cMActiveLine"+ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]],"background");ICEcoder["cMActiveLine"+ICEcoder.selectedTab]=a.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++},createNewTab:function(){var a;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+top.ICEcoder.openFiles.length).style.display=
"inline-block";a=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("tab"+top.ICEcoder.openFiles.length).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+a.slice(a.lastIndexOf("/")).replace(/\//,
"");top.get("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");top.ICEcoder.setTabWidths();top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);top.ICEcoder.selectedTab=top.ICEcoder.openFiles.length;top.ICEcoder.savedPoints.push(0);top.ICEcoder.setPreviousFiles()},nextTab:function(){top.ICEcoder.switchTab(top.ICEcoder.selectedTab+1<=top.ICEcoder.openFiles.length?top.ICEcoder.selectedTab+1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<=
top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.get("tab"+a).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
(top.ICEcoder.showHide("show",top.get("loadingMask")),window.location="lib/updater.php"):window.open("http://icecoder.net")},xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(d){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(f){}return null},openBugReport:function(){"off"==
top.ICEcoder.bugReportStatus&&top.ICEcoder.message("You can start bug reporting in Help > 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&&top.ICEcoder.message("Need to open bugs log file at this point...")},startBugChecking:function(){var a;0!==top.ICEcoder.bugFileCheckTimer&&("undefined"!=typeof top.ICEcoder.bugFileCheckTimerInt&&
clearInterval(top.ICEcoder.bugFileCheckTimerInt),top.ICEcoder.bugFileCheckInt=setInterval(function(){a="lib/bug-files-check.php?";a+="files="+(""!==top.ICEcoder.bugFilePaths[0]?top.ICEcoder.bugFilePaths.join():"null");a+="&filesMDTs=";if(top.ICEcoder.bugFileMDTs.length!=top.ICEcoder.bugFilePaths.length)for(var b=0;b<top.ICEcoder.bugFilePaths.length;b++)top.ICEcoder.bugFileMDTs.push("null");a+=top.ICEcoder.bugFileMDTs.join();a+="&maxLines="+top.ICEcoder.bugFileMaxLines;var c=top.ICEcoder.xhrObj();
c.onreadystatechange=function(){if(4==c.readyState&&200==c.status){console.log(c.responseText);var a=JSON.parse(c.responseText);console.log(a);top.get("bugIcon").style.backgroundPosition="off"==a.result?"0 0":"ok"==a.result?"-32 0":"bugs"==a.result?"-48 0":"-16 0";top.ICEcoder.bugReportStatus=a.result}};console.log("Calling "+a+" via XHR");c.open("GET",a,!0);c.send()},parseInt(1E3*top.ICEcoder.bugFileCheckTimer,10)),top.ICEcoder.bugReportStatus="ok")},switchTab:function(a,b){var c;ICEcoder.selectedTab=
a;if(c=ICEcoder.getcMInstance()){ICEcoder.switchMode();for(var d=0;d<ICEcoder.cMInstances.length;d++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].getWrapperElement().style.display="none";c.setOption("theme",top.ICEcoder.theme);c.getWrapperElement().style.display="block";b||setTimeout(function(){top.ICEcoder.focus()},4);c.refresh();ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.get("find").value,!0,!1);top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()}},newTab:function(){var a;ICEcoder.cMInstances.push(ICEcoder.nextcMInstance);ICEcoder.selectedTab=ICEcoder.cMInstances.length;ICEcoder.showHide("show",ICEcoder.content);ICEcoder.content.contentWindow.createNewCMInstance(ICEcoder.nextcMInstance);ICEcoder.setLayout();ICEcoder.thisFileFolderType="file";ICEcoder.thisFileFolderLink="/[NEW]";ICEcoder.openFile();a=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);
a.removeLineClass(ICEcoder["cMActiveLine"+ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]],"background");ICEcoder["cMActiveLine"+ICEcoder.selectedTab]=a.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++},createNewTab:function(){var a;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+top.ICEcoder.openFiles.length).style.display="inline-block";a=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("tab"+top.ICEcoder.openFiles.length).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
a.slice(a.lastIndexOf("/")).replace(/\//,"");top.get("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");top.ICEcoder.setTabWidths();top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);top.ICEcoder.selectedTab=top.ICEcoder.openFiles.length;top.ICEcoder.savedPoints.push(0);top.ICEcoder.setPreviousFiles()},nextTab:function(){top.ICEcoder.switchTab(top.ICEcoder.selectedTab+1<=top.ICEcoder.openFiles.length?top.ICEcoder.selectedTab+
1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<=top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.get("tab"+a).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
c.slice(c.lastIndexOf("/")).replace(/\//,"");top.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.savedPoints.length;d++)top.get("tab"+d).childNodes[0]&&(top.get("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=ICEcoder.savedPoints[d-1]!=top.ICEcoder.getcMInstance(d).changeGeneration()?"#b00":"transparent"),b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab,"undefined"!=typeof top.ICEcoder.openFiles[d-
1]&&"/[NEW]"!=top.ICEcoder.openFiles[d-1]&&(c=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[d-1].replace(/\//g,"|")))&&(c.style.backgroundColor=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile),top.get("tab"+d).style.color=b,top.get("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen},closeTab:function(a,b,c){var d;a||(a=top.ICEcoder.selectedTab);ICEcoder.getcMInstance();
d=!0;c||ICEcoder.savedPoints[a-1]==top.ICEcoder.getcMInstance(a).changeGeneration()||(d=top.ICEcoder.ask("You have made changes.\n\nAre you sure you want to close without saving?"));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;d<ICEcoder.openFiles.length;d++)top.get("tab"+d).innerHTML=top.get("tab"+(d+1)).innerHTML,top.get("tab"+d).title=top.get("tab"+(d+1)).title,ICEcoder.openFiles[d-1]=ICEcoder.openFiles[d],ICEcoder.openFileMDTs[d-1]=ICEcoder.openFileMDTs[d];ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a-