diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index e78694d..dd55781 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -1,149 +1,149 @@ var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,savedPoints:[],savedContents:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],openFileVersions:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,scrollbarVisible:!1,mouseDown:!1,mouseDownInCM:!1,mouseDownMinimap:!1,draggingFilesW:!1,draggingTab:!1,draggingWithKey:!1,tabLeftPos:[],tabBGcurrent:"#1d1d1b",tabBGselected:"#49d",tabBGopen:"#c3c3c3",tabBGnormal:"transparent", tabFGcurrent:"#fff",tabFGselected:"#fff",tabFGopenFile:"#000",tabFGnormalFile:"#eee",tabFGnormalTab:"#888",serverQueueItems:[],miniMapBoxTop:0,miniMapBoxHeight:0,previewWindow:!1,previewWindowLoading:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,oppTagReplaceData:[],fmReady:!1,bugReportStatus:"off",bugReportPath:"",bugFilesSizesSeen:[],bugFilesSizesActual:[],githubDiff:!1,githubAuthTokenSet:!1,splitPane:!1,splitPaneLeftPerc:100,renderLineStyle:[],renderPaneShiftAmount:0,debounce:"",editorFocusInstance:"", openSeconds:0,ready:!1,initAliases:function(){for(var a="header files fileOptions optionsFile optionsEdit optionsSource optionsHelp filesFrame editor tabsBar findBar content terminal footer nestValid versionsDisplay splitPaneControls splitPaneNamesMain splitPaneNamesDiff charDisplay byteDisplay docExplorer miniMap miniMapContainer miniMapContent functionClassList".split(" "),b=0;b=60*top.ICEcoder.autoLogoutMins&&top.ICEcoder.logout("autoLogout");top.ICEcoder.openSeconds++;0==top.ICEcoder.openSeconds%300&&(top.ICEcoder.filesFrame.contentWindow.frames.pingActive.location.href="lib/session-active-ping.php")},1E3);top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth;c=window.innerHeight;this.header.style.width= +ICEcoder.setLayout();top.ICEcoder.overFileFolder("folder","|");top.ICEcoder.selectFileFolder("init");top.ICEcoder.filesFrame.contentWindow.focus();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.autoLogoutTimer=0;top.ICEcoder.oneSecondInt= +setInterval(function(){top.ICEcoder.autoLogoutTimer++;for(var a=!1,b=1;b<=ICEcoder.savedPoints.length;b++)ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()&&(a=!0);!a&&1=60*top.ICEcoder.autoLogoutMins&&top.ICEcoder.logout("autoLogout");top.ICEcoder.openSeconds++;0==top.ICEcoder.openSeconds%300&&(top.ICEcoder.filesFrame.contentWindow.frames.pingActive.location.href="lib/session-active-ping.php")},1E3);top.ICEcoder.ready=!0},setLayout:function(a){var b=window.innerWidth;var 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.optionsSource.style.width=this.optionsHelp.style.width=this.filesW-60+"px";this.filesFrame.style.height=c-25-35+"px";this.nestValid.style.left=this.filesW+10+"px";this.versionsDisplay.style.left=this.filesW+25+"px";this.splitPaneControls.style.left=parseInt((b-this.filesW)/2,10)-25-4+this.filesW-100+"px";this.splitPaneNamesMain.style.left= parseInt(.25*(b-this.filesW),10)-50+this.filesW-60+"px";this.splitPaneNamesDiff.style.left=parseInt(.75*(b-this.filesW),10)-50+this.filesW-135+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW-200+"px",ICEcoder.terminal.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-25-21-28-26+"px",ICEcoder.terminal.style.height=c+"px",setTimeout(function(){for(var a=0;atop.ICEcoder.splitPaneLeftPerc?top.ICEcoder.splitPaneLeftPerc=50-(100-top.ICEcoder.splitPaneLeftPerc)/1.8+50:(top.ICEcoder.splitPaneLeftPerc=top.ICEcoder.splitPane?50:100,clearInterval(top.ICEcoder.animSplitPaneInt));top.ICEcoder.setLayout()},4)},docExplorerShow:function(a){var b;"terminal"==a?(get("terminal").style.display="block",setTimeout(function(){top.ICEcoder.terminal.contentWindow.document.getElementById("command").focus()},0)):(get("terminal").style.display="none",get("miniMap").style.display= "miniMap"==a?"block":"none",get("functionClassList").style.display="functionClassList"==a?"block":"none","miniMap"==a&&(top.miniMapInt=setInterval(function(){0!=get("miniMapContent").getBoundingClientRect().height&&(b=top.ICEcoder.getcMInstance(),top.ICEcoder.setMinimapLayout(b),clearInterval(top.miniMapInt))},10)))},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.filesWICEcoder.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&&"gutter"==top.ICEcoder.mouseDownInCM&&(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.ICEcoder.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")},cMonFocus:function(a,b){top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay(); -top.ICEcoder.editorFocusInstance=b;top.ICEcoder.getCaretPosition()},cMonBlur:function(a,b){},cMonKeyUp:function(a,b){"undefined"!=typeof top.doFind&&clearInterval(top.doFind);top.doFind=setTimeout(function(){top.ICEcoder.findReplace(top.get("find").value,!0,!1)},500);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()},cMonCursorActivity:function(a,b){var c;top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay(); -a.removeLineClass(top.ICEcoder["cMActiveLine"+b],"background");a.getCursor("start").line==a.getCursor().line&&(top.ICEcoder["cMActiveLine"+b]=a.addLineClass(a.getCursor().line,"background","cm-s-activeLine"));"CSS"==top.ICEcoder.caretLocType&&top.ICEcoder.cssColorPreview();c=-1")&&"undefined"!=typeof e&&"undo"!=c.origin&&"redo"!=c.origin&&"undefined"!=typeof e.open&&"undefined"!=typeof e.close&&(f="open"==e.at?"close":"open",null!==e[f]&&(e=e[f].tag+";"+e[f].from.line+":"+e[f].from.ch,-1==top.ICEcoder.oppTagReplaceData.indexOf(e)&&top.ICEcoder.oppTagReplaceData.push(e)))},cMonChange:function(a,b,c,d){var e,f,g,k,h,l,p,n,m,r;b=a.listSelections();top.ICEcoder.loadingFile?setTimeout(function(){a.replaceRange("X", -{line:1,ch:1},{line:1,ch:1});a.undo();a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},0):top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if("undefined"!=typeof top.ICEcoder.oppTagReplaceData[0])for(var t=0;ta.defaultTextHeight()&&(f+=b.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main", -c[d][2],"height",f+"px"]);for(e=0;ea.defaultTextHeight()&&(f+=a.getLineHandle(e).height-a.defaultTextHeight()); -f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",f+"px"]);for(e=0;ec&e>c&a[d-1]==b[e-1];d--)e--;return[c,d-c,e-c]},updatePreviewWindow:function(a,b,c,d){top.ICEcoder.previewWindow.location.pathname==b?-1<["htm","html","txt"].indexOf(d)?top.ICEcoder.previewWindow.document.documentElement.innerHTML=a.getValue():-1<["md"].indexOf(d)&&(top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())):-1<["css"].indexOf(d)&&-1/g,"");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},undo:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();(-1=e.line;b--)d.replaceRange(d.getLine(b),{line:b+1,ch:0},{line:b+1,ch:1E6});d.replaceRange(k,{line:"up"==a?f.line: -e.line,ch:0},{line:"up"==a?f.line:e.line,ch:1E6});d.setSelection({line:e.line+("up"==a?-1:1),ch:e.ch},{line:f.line+("up"==a?-1:1),ch:f.ch})}))},highlightLine:function(a){var b,c;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();b=-1\n"+d.getSelection()+"\n","around");for(var a=e+1;a<=f+1;a++)d.indentLine(a);d.indentLine(f+2,"prev");d.indentLine(f+2,"subtract")})):-1<["p","a","h1","h2","h3"].indexOf(a)&&d.getSelection().substr(0,a.length+1)=="<"+b&&d.getSelection().substr(-(a.length+ -3))==""?d.replaceSelection(d.getSelection().substr(d.getSelection().indexOf(">")+1,d.getSelection().length-d.getSelection().indexOf(">")-1-a.length-3),"around"):("a"==a&&(b='a href=""'),d.replaceSelection("<"+b+">"+d.getSelection()+"","around"),"a"==a&&d.setCursor({line:d.getCursor("start").line,ch:d.getCursor("start").ch+9}))},addLineBreakAtEnd:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1",{line:a,ch:0},{line:a,ch:1E6})},insertLineBefore:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1'+top.ICEcoder.functionClassList[a].name+'
'+top.ICEcoder.functionClassList[a].params+"");get("functionClassList").innerHTML=b},0))},updateFunctionClassListItems:function(a){var b,c;b=ICEcoder.getcMInstance();c="";-1'+get("miniMapContent").innerHTML+"";get("miniMapContent").innerHTML=get("miniMapContent").innerHTML.replace(/\';var b=get("miniMapBox"),b=new Draggabilly(b,{axis:"y",containment:!0});b.on("dragMove",function(b,d,e){yPos=this.position.y;maxHeight=parseInt(get("docExplorer").style.height, -10)<=parseInt(get("miniMapContent").getBoundingClientRect().height,10)?parseInt(get("docExplorer").style.height,10):parseInt(get("miniMapContent").getBoundingClientRect().height,10);newPerc=this.position.y/(maxHeight-top.ICEcoder.miniMapBoxHeight);yPos=(a.getScrollInfo().height-a.getScrollInfo().clientHeight)*newPerc;a.scrollTo(0,yPos)});b.on("pointerDown",function(a,b){top.ICEcoder.mouseDownMinimap=!0});b.on("pointerUp",function(a,b){top.ICEcoder.mouseDownMinimap=!1});top.ICEcoder.setMinimapLayout(a); -get("docExplorer").style.right="-220px"}},setMinimapLayout:function(a,b){var c,d;get("miniMapBox")&&a&&(c=top.ICEcoder.getcMInstance(),d=a.getScrollInfo().top/(a.getScrollInfo().height-a.getScrollInfo().clientHeight),parseInt(get("miniMapContent").getBoundingClientRect().height,10)>parseInt(get("docExplorer").style.height,10)?(get("miniMapContainer").style.height=parseInt(get("docExplorer").style.height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height,10)/c.defaultTextHeight()* -2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("docExplorer").style.height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=-(parseInt(get("miniMapContent").getBoundingClientRect().height,10)-parseInt(get("docExplorer").style.height,10))*d+"px"):(get("miniMapContainer").style.height=parseInt(get("miniMapContent").getBoundingClientRect().height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height, -10)/c.defaultTextHeight()*2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("miniMapContainer").getBoundingClientRect().height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=0),top.ICEcoder.mouseDownMinimap||(get("miniMapBox").style.top=top.ICEcoder.miniMapBoxTop+"px"))},autocomplete:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1f.replace(/\d+/g,g)?e:f;if(0e&&("LI"!=b.childNodes[e].nodeName&&e++,d=b.childNodes[e].childNodes[0].childNodes[1],d.id==c&&(a=!0),1==a&&-1==top.ICEcoder.selectedFiles.indexOf(d.id)&&(ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(d.id)),d.id!=f);e+=2);else ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e); -top.ICEcoder.githubDiff&&(top.get("githubNavSelectedCount").innerHTML="Selected: "+top.ICEcoder.selectedFiles.length,top.get("githubNavCommit").style.color=0"+top.t["Creating Folder"]+"
"+b)},returnFileAndLine:function(a){var b=1,c=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a);null!==c?(b=c[4],a=c[1]):0"+top.t["Opening File"]+"
"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
"+a)},getChangesToSave:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1];a=difflib.stringAsLines(a.getValue()); -b=difflib.stringAsLines(b);b=(new difflib.SequenceMatcher(b,a)).get_opcodes();for(var c=0;c"+top.t.Saving+"
"+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(top.t["Please enter the..."],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-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\+/g,"%2B")),top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
"+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&b!=a&&(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.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage(""+top.t["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");0"+top.t["Deleting File"]+"
"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])},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","optionsSource","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 k,h,l,p,n,m,r;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g, -"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='        '+c+' '+d+"";if(!l||3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m,l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)},m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&& -(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m),l.nextSibling.appendChild(p);else for(h=0;hc||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className=k;m.draggable=!1;m.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};m.ondragend= -function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;h==l.childNodes.length-1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[h]),l.insertBefore(p,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=b.replace(/\//g,"|")+"|"+c+"_perms",top.ICEcoder.renameInChildren(h,e,b,c));"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),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.style.background=777==d?"#800":"none",h.style.color=777== -d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},renameInChildren:function(a,b,c,d){var e,f;if(a.parentNode.parentNode.nextSibling&&"UL"==a.parentNode.parentNode.nextSibling.nodeName){a=a.parentNode.parentNode.nextSibling; -for(var g=0;gd.indexFromPos({ch:d.getCursor().ch-1,line:d.getCursor().line})&&ICEcoder.findResult--;else for(f=ICEcoder.findResult=0;fICEcoder.results.length-1&&(ICEcoder.findResult=0);e&&1==ICEcoder.findResult&&(ICEcoder.findResult=ICEcoder.results.length+1);g.innerHTML="Highlighted result "+(ICEcoder.findResult+(e?-1:1))+" of "+ICEcoder.results.length+" results";e?(b=d.getSearchCursor(a,{ch:d.getCursor().ch-1,line:d.getCursor().line},!0),b.findPrevious(),b.from()||(b=d.getSearchCursor(a,{line:1E6,ch:1E6},!0),b.findPrevious())): -(b=d.getSearchCursor(a,{ch:d.getCursor().ch+1,line:d.getCursor().line},!0),b.findNext(),b.from()||(b=d.getSearchCursor(a,{line:0,ch:0},!0),b.findNext()));d.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/d.lineCount():d.defaultTextHeight();b=top.ICEcoder.scrollBarVisible?0:d.heightAtLine(0);e="";for(f=1;f<=d.lineCount();f++)g=-1';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=e;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}g.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display= -"none";return!1}""!=a&&c?(e=b=d="",document.findAndReplace.connector.value==top.t.and&&(d="&replace="+f),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(e="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")), -top.get("mediaContainer").innerHTML=''):(g.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-xhr.php?action=replaceText&find="+ -b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|").replace(/\+/g,"%2B"));top.ICEcoder.serverMessage(""+top.t["Replacing text in"]+"
"+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1=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.mouseX").replace(/\<\/b\>/g,"").replace(/\<br\>/g,"
"),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();if(a=-1d.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)},initCanvasImage:function(a){var b,c;b=top.get("canvasPicker").getContext("2d");c=new Image;c.crossOrigin="Anonymous";c.src=a.src;c.onerror=function(){get("floatingContainer").style.visibility="hidden";get("canvasPickerColorInfo").style.display="none";get("canvasPickerCORSInfo").style.display="block"};c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height); -get("canvasPickerColorInfo").style.display="block";get("canvasPickerCORSInfo").style.display="none";top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"}};top.document.getElementById("floatingContainer").style.backgroundSize=5*a.naturalWidth+"px "+5*a.naturalHeight+"px"},interactCanvasImage:function(a){var b,c,d,e,f,g,k,h,l,p,n,m,r;b=top.get("canvasPicker").getContext("2d"); -top.get("canvasPicker").onmousemove=function(t){c=t.pageX-this.offsetLeft;d=t.pageY-this.offsetTop;e=b.getImageData(c,d,1,1).data;f=e[0];g=e[1];k=e[2];h=f+","+g+","+k;l=top.ICEcoder.rgbToHex(f,g,k);top.get("rgbMouseXY").value=h;top.get("hexMouseXY").value="#"+l;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+l;p=128>f||128>g||128>k&&200>f&&200>g&&50")&&"undefined"!=typeof f&&"undo"!=c.origin&&"redo"!=c.origin&&"undefined"!=typeof f.open&&"undefined"!=typeof f.close){var g="open"==f.at?"close":"open";null!==f[g]&&(f=f[g].tag+";"+f[g].from.line+":"+f[g].from.ch,-1==top.ICEcoder.oppTagReplaceData.indexOf(f)&&top.ICEcoder.oppTagReplaceData.push(f))}}},cMonChange:function(a,b,c,d){var e;b=a.listSelections();top.ICEcoder.loadingFile?setTimeout(function(){a.replaceRange("X",{line:1,ch:1},{line:1,ch:1});a.undo();a.clearHistory(); +top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},0):top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if("undefined"!=typeof top.ICEcoder.oppTagReplaceData[0])for(var f=0;fa.defaultTextHeight()&&(f+=b.getLineHandle(e).height-a.defaultTextHeight()); +f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",f+"px"]);for(e=0;ea.defaultTextHeight()&&(f+=a.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",f+"px"]);for(e=0;ec&e>c&a[d-1]==b[e-1];d--)e--;return[c,d-c,e-c]},updatePreviewWindow:function(a,b,c,d){top.ICEcoder.previewWindow.location.pathname==b?-1<["htm","html","txt"].indexOf(d)?top.ICEcoder.previewWindow.document.documentElement.innerHTML=a.getValue():-1<["md"].indexOf(d)&&(top.ICEcoder.previewWindow.document.documentElement.innerHTML= +mmd(a.getValue())):-1<["css"].indexOf(d)&&-1/g,"");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab- +1]=a.getValue()},undo:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();(-1=f.line;b--)e.replaceRange(e.getLine(b),{line:b+1,ch:0},{line:b+1,ch:1E6});e.replaceRange(m,{line:"up"==a?g.line:f.line,ch:0},{line:"up"==a?g.line:f.line,ch:1E6});e.setSelection({line:f.line+("up"==a?-1:1),ch:f.ch},{line:g.line+("up"==a?-1:1),ch:g.ch})})}},highlightLine:function(a){var b=top.ICEcoder.getcMInstance();var c=top.ICEcoder.getcMdiffInstance();b=-1\n"+d.getSelection()+"\n","around");for(var a=e+1;a<=f+1;a++)d.indentLine(a); +d.indentLine(f+2,"prev");d.indentLine(f+2,"subtract")})}else-1<["p","a","h1","h2","h3"].indexOf(a)&&d.getSelection().substr(0,a.length+1)=="<"+b&&d.getSelection().substr(-(a.length+3))==""?d.replaceSelection(d.getSelection().substr(d.getSelection().indexOf(">")+1,d.getSelection().length-d.getSelection().indexOf(">")-1-a.length-3),"around"):("a"==a&&(b='a href=""'),d.replaceSelection("<"+b+">"+d.getSelection()+"","around"),"a"==a&&d.setCursor({line:d.getCursor("start").line,ch:d.getCursor("start").ch+ +9}))},addLineBreakAtEnd:function(a){var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1",{line:a,ch:0},{line:a,ch:1E6})},insertLineBefore:function(a){var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();var d=-1'+top.ICEcoder.functionClassList[b].name+'
'+top.ICEcoder.functionClassList[b].params+"");get("functionClassList").innerHTML=a},0))},updateFunctionClassListItems:function(a){var b=ICEcoder.getcMInstance();var c="";-1< +a.text.indexOf("function ")&&-1'+get("miniMapContent").innerHTML+"";get("miniMapContent").innerHTML=get("miniMapContent").innerHTML.replace(/'; +var b=get("miniMapBox");b=new Draggabilly(b,{axis:"y",containment:!0});b.on("dragMove",function(b,d,e){yPos=this.position.y;maxHeight=parseInt(get("docExplorer").style.height,10)<=parseInt(get("miniMapContent").getBoundingClientRect().height,10)?parseInt(get("docExplorer").style.height,10):parseInt(get("miniMapContent").getBoundingClientRect().height,10);newPerc=this.position.y/(maxHeight-top.ICEcoder.miniMapBoxHeight);yPos=(a.getScrollInfo().height-a.getScrollInfo().clientHeight)*newPerc;a.scrollTo(0, +yPos)});b.on("pointerDown",function(a,b){top.ICEcoder.mouseDownMinimap=!0});b.on("pointerUp",function(a,b){top.ICEcoder.mouseDownMinimap=!1});top.ICEcoder.setMinimapLayout(a);get("docExplorer").style.right="-220px"}},setMinimapLayout:function(a,b){if(get("miniMapBox")&&a){var c=top.ICEcoder.getcMInstance();var d=a.getScrollInfo().top/(a.getScrollInfo().height-a.getScrollInfo().clientHeight);parseInt(get("miniMapContent").getBoundingClientRect().height,10)>parseInt(get("docExplorer").style.height, +10)?(get("miniMapContainer").style.height=parseInt(get("docExplorer").style.height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height,10)/c.defaultTextHeight()*2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("docExplorer").style.height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=-(parseInt(get("miniMapContent").getBoundingClientRect().height,10)-parseInt(get("docExplorer").style.height, +10))*d+"px"):(get("miniMapContainer").style.height=parseInt(get("miniMapContent").getBoundingClientRect().height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height,10)/c.defaultTextHeight()*2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("miniMapContainer").getBoundingClientRect().height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=0);top.ICEcoder.mouseDownMinimap||(get("miniMapBox").style.top= +top.ICEcoder.miniMapBoxTop+"px")}},autocomplete:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1g.replace(/\d+/g,f)?d:g;if(0d&&("LI"!=b.childNodes[d].nodeName&&d++,e=b.childNodes[d].childNodes[0].childNodes[1],e.id==c&&(a=!0),1==a&&-1==top.ICEcoder.selectedFiles.indexOf(e.id)&&(ICEcoder.selectDeselectFile("select",e),top.ICEcoder.selectedFiles.push(e.id)),e.id!=g);d+=2);else ICEcoder.selectDeselectFile("select", +e),top.ICEcoder.selectedFiles.push(d)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",e),top.ICEcoder.selectedFiles.push(d)}top.ICEcoder.githubDiff&&(top.get("githubNavSelectedCount").innerHTML="Selected: "+top.ICEcoder.selectedFiles.length,top.get("githubNavCommit").style.color=0"+top.t["Creating Folder"]+ +"
"+a)},returnFileAndLine:function(a){var b=1,c=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a);null!==c?(b=c[4],a=c[1]):0"+top.t["Opening File"]+"
"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1))}},openFilesFromList:function(a){for(var b=0;b"+top.t.Getting+"
"+a)},getChangesToSave:function(){var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1];a=difflib.stringAsLines(a.getValue());b=difflib.stringAsLines(b);b=(new difflib.SequenceMatcher(b,a)).get_opcodes();for(var c=0;c"+top.t.Saving+"
"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){if(a)var c=a.replace(/\|/g,"/");else 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(top.t["Please enter the..."],c));if(b){var 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-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\+/g,"%2B"));top.ICEcoder.serverMessage(""+top.t["Renaming to"]+"
"+b);top.ICEcoder.setPreviousFiles()}},moveFile:function(a,b){if(b&&b!=a){var c=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/"));if(-1'; +var d=top.ICEcoder.openFiles[c];top.get("tab"+(c+1)).innerHTML=closeTabLink+" "+d.slice(d.lastIndexOf("/")).replace(/\//,"");top.get("tab"+(c+1)).title=b}top.ICEcoder.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage(""+top.t["Moving to"]+"
"+b));top.ICEcoder.setPreviousFiles()}}, +deleteFiles:function(a){a=a?a:top.ICEcoder.selectedFiles;var b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0"+top.t["Deleting File"]+"
"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d"+top.t["Pasting File"]+"
"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]); +else top.ICEcoder.message(top.t["Nothing to paste..."])},duplicateFiles:function(a){if(top.ICEcoder.copiedFiles)var 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","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;ab&&(c-=c+a-b);top.get("fileMenu").style.top=c+"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){if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot, +"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){var m="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");var h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));var l=h.parentNode.parentNode.nextSibling;var n=document.createTextNode("\n");var p=777==d?"background: #800; color: #eee":"color: #888";p='        '+c+' '+d+"";if(!l||3>l.childNodes.length){var k=document.createElement("ul");l=h.parentNode.parentNode; +l.parentNode.insertBefore(k,l.nextSibling);k=document.createElement("li");k.className=m;k.draggable=!1;k.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};k.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};k.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};k.ondragend=function(){top.ICEcoder.dropFile(this)}; +k.innerHTML=p;l.nextSibling.appendChild(k);l.nextSibling.appendChild(n)}else for(h=0;hc||"folder"==g&&"file"==k||h==l.childNodes.length-1){k=document.createElement("li");k.className=m;k.draggable=!1;k.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};k.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a); +top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};k.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};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=b.replace(/\//g,"|")+"|"+c+"_perms",top.ICEcoder.renameInChildren(h,e,b,c));"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),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.style.background=777==d?"#800":"none",h.style.color=777==d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode, +top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},renameInChildren:function(a,b,c,d){if(a.parentNode.parentNode.nextSibling&&"UL"==a.parentNode.parentNode.nextSibling.nodeName){a=a.parentNode.parentNode.nextSibling;for(var e=0;ed.indexFromPos({ch:d.getCursor().ch- +1,line:d.getCursor().line})&&ICEcoder.findResult--;else for(f=ICEcoder.findResult=0;fICEcoder.results.length-1&&(ICEcoder.findResult=0);e&&1==ICEcoder.findResult&&(ICEcoder.findResult=ICEcoder.results.length+1);g.innerHTML="Highlighted result "+(ICEcoder.findResult+(e?-1:1))+" of "+ICEcoder.results.length+" results";e?(b=d.getSearchCursor(a, +{ch:d.getCursor().ch-1,line:d.getCursor().line},!0),b.findPrevious(),b.from()||(b=d.getSearchCursor(a,{line:1E6,ch:1E6},!0),b.findPrevious())):(b=d.getSearchCursor(a,{ch:d.getCursor().ch+1,line:d.getCursor().line},!0),b.findNext(),b.from()||(b=d.getSearchCursor(a,{line:0,ch:0},!0),b.findNext()));d.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/d.lineCount():d.defaultTextHeight();b=top.ICEcoder.scrollBarVisible? +0:d.heightAtLine(0);e="";for(f=1;f<=d.lineCount();f++)g=-1';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=e;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}g.innerHTML="No results"; +top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=a&&c?(e=b=d="",document.findAndReplace.connector.value==top.t.and&&(d="&replace="+f),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(e="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")), +a=a.replace(/'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML=''):(g.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-xhr.php?action=replaceText&find="+b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|").replace(/\+/g,"%2B"));top.ICEcoder.serverMessage(""+top.t["Replacing text in"]+"
"+a)},getCaretPosition:function(){var a;var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1=b||10<=b)&&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),b=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX").replace(/<\/b>/g,"").replace(/<br>/g,"
"),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a, +b;var c=ICEcoder.getcMInstance();var d=ICEcoder.getcMdiffInstance();if(c=-1b.index+b[0].length;);(d=top.get("content").contentWindow.document.getElementById("cssColor"))&&d.parentNode.removeChild(d);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(d=top.document.createElement("div"),d.id= +"cssColor",d.style.position="absolute",d.style.display="block",d.style.width=d.style.height="20px",d.style.zIndex="1000",d.style.background=b?b[0]:"",d.style.cursor="pointer",d.onclick=function(){top.ICEcoder.showColorPicker(b[0])},""==d.style.backgroundColor&&(d.style.display="none"),top.get("header").appendChild(d),c.addWidget(c.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)},initCanvasImage:function(a){var b=top.get("canvasPicker").getContext("2d");var c=new Image;c.crossOrigin="Anonymous";c.src=a.src;c.onerror=function(){get("floatingContainer").style.visibility="hidden";get("canvasPickerColorInfo").style.display="none";get("canvasPickerCORSInfo").style.display="block"};c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height); +get("canvasPickerColorInfo").style.display="block";get("canvasPickerCORSInfo").style.display="none";top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"}};top.document.getElementById("floatingContainer").style.backgroundSize=5*a.naturalWidth+"px "+5*a.naturalHeight+"px"},interactCanvasImage:function(a){var b,c,d,e,f,g,m,h,l,n,p,k;var r=top.get("canvasPicker").getContext("2d"); +top.get("canvasPicker").onmousemove=function(t){b=t.pageX-this.offsetLeft;c=t.pageY-this.offsetTop;d=r.getImageData(b,c,1,1).data;e=d[0];f=d[1];g=d[2];m=e+","+f+","+g;h=top.ICEcoder.rgbToHex(e,f,g);top.get("rgbMouseXY").value=m;top.get("hexMouseXY").value="#"+h;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+h;l=128>e||128>f||128>g&&200>e&&200>f&&50'+top.t["Cancelled tasks"]+""); -setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a+"&csrf="+top.ICEcoder.csrf);top.ICEcoder.updateLast10List(a)},updateLast10List:function(a){var b,c,d;a=a.split(",");for(var e=0;e"+a[e].replace(/\|/g,"/")+"\n",c=top.ICEcoder.content.contentWindow.document.getElementById("last10Files"),-1==c.innerHTML.indexOf(b)&&(d=c.innerHTML.split("\n"),(10<=d.length||'
[none]


'==d[0]||""==d[d.length-1])&&d.pop(),c.innerHTML=b+d.join("\n")))},autoOpenFiles:function(){if(0< +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(){top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.get("codeAssistDisplay").style.backgroundPosition=top.ICEcoder.codeAssist?"0 0":"-16px 0";top.ICEcoder.cssColorPreview();top.ICEcoder.focus(-1'+top.t["Cancelled tasks"]+""); +setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a+"&csrf="+top.ICEcoder.csrf);top.ICEcoder.updateLast10List(a)},updateLast10List:function(a){a=a.split(",");for(var b=0;b"+a[b].replace(/\|/g,"/")+"\n";var d=top.ICEcoder.content.contentWindow.document.getElementById("last10Files");if(-1==d.innerHTML.indexOf(c)){var e=d.innerHTML.split("\n");(10<=e.length||'
[none]


'==e[0]||""==e[e.length-1])&&e.pop();d.innerHTML=c+e.join("\n")}}},autoOpenFiles:function(){if(0< top.ICEcoder.previousFiles.length&&top.ICEcoder.ask(top.t["Open previous files"]+"\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a';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"))},autoLogoutWarningScreen:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},pluginsManager:function(){top.get("mediaContainer").innerHTML=''; +'" class="whiteGlow" style="width: 970px; height: 640px">';top.ICEcoder.showHide("show",top.get("blackMask"))},showManual:function(a,b){var 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"))},autoLogoutWarningScreen:function(){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},pluginsManager:function(){top.get("mediaContainer").innerHTML=''; top.ICEcoder.showHide("show",top.get("blackMask"))},goLocalhostRoot:function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/go-localhost-root.php"},githubAction:function(a){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},githubTokenAsk:function(a){if(githubAuthToken= top.ICEcoder.getInput(top.t["Please enter your..."],""))top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/github.php?action=auth&token="+githubAuthToken+"&goNext="+a+"&csrf="+top.ICEcoder.csrf,githubAuthToken=""},showHideGithubNav:function(a){top.get("githubNav").style.display="show"==a?"block":"none";top.get("fileNav").style.display="show"==a?"none":"block"},githubManager:function(){top.ICEcoder.githubAuthTokenSet?(top.get("mediaContainer").innerHTML='', -top.ICEcoder.showHide("show",top.get("blackMask"))):top.ICEcoder.githubTokenAsk("showManager")},githubDiffToggle:function(){var a;if(!top.ICEcoder.githubAuthTokenSet)top.ICEcoder.githubTokenAsk("loadFiles");else if(top.ICEcoder.githubDiff||top.ICEcoder.ask(top.t["This will compare..."]))top.ICEcoder.githubDiff=!top.ICEcoder.githubDiff,a=top.ICEcoder.githubDiff?"true":"false",top.ICEcoder.filesFrame.src="files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf},ftpManager:function(){top.get("mediaContainer").innerHTML= -'';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,k,h,l,p,n,m,r,t,w,v,x,y,z,A,B,C,D){var q,u=a.slice(0,a.lastIndexOf("?")),u=u.slice(u.lastIndexOf("/")+1,u.lastIndexOf("."));top.ICEcoder.theme!==u&&(top.ICEcoder.theme=u,"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),q=document.createElement("link"),q.setAttribute("rel","stylesheet"),q.setAttribute("type","text/css"),q.setAttribute("href",a),top.document.getElementsByTagName("head")[0].appendChild(q),q=-1<"3024-day base16-light eclipse elegant mdn-like neat neo paraiso-light solarized the-matrix xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":-1<"3024-night blackboard colorforth liquibyte night tomorrow-night-bright tomorrow-night-eighties vibrant-ink".split(" ").indexOf(top.ICEcoder.theme)? -"#888":"#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(),ICEcoder.changeFilesW(c?"expand":"contract"),top.ICEcoder.hideFileMenu());a=top.document.styleSheets[0];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.filesFrame.contentWindow.document.styleSheets[3];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.content.contentWindow.document.styleSheets[4]; -b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a[b][4].style["border-left-width"]=f?"1px":"0";a[b][4].style["margin-left"]=f?"-1px":"0";a[b][2].style.cssText="background-color: "+q+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=l;top.ICEcoder.matchBrackets=p;top.ICEcoder.autoCloseTags=n;top.ICEcoder.autoCloseBrackets=m;top.ICEcoder.indentWithTabs=r;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=t;for(f=0;f';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,m,h,l,n,p,k,r,t,w,v,x,y,z,A,B,C,D){var u=a.slice(0,a.lastIndexOf("?"));u=u.slice(u.lastIndexOf("/")+1,u.lastIndexOf("."));if(top.ICEcoder.theme!==u){top.ICEcoder.theme=u;"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");var 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);q=document.createElement("link");q.setAttribute("rel","stylesheet");q.setAttribute("type","text/css");q.setAttribute("href",a);top.document.getElementsByTagName("head")[0].appendChild(q);q=-1<"3024-day base16-light eclipse elegant mdn-like neat neo paraiso-light solarized the-matrix xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":-1<"3024-night blackboard colorforth liquibyte night tomorrow-night-bright tomorrow-night-eighties vibrant-ink".split(" ").indexOf(top.ICEcoder.theme)? +"#888":"#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(),ICEcoder.changeFilesW(c?"expand":"contract"),top.ICEcoder.hideFileMenu());a=top.document.styleSheets[0];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.filesFrame.contentWindow.document.styleSheets[3];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.content.contentWindow.document.styleSheets[4]; +b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a[b][4].style["border-left-width"]=f?"1px":"0";a[b][4].style["margin-left"]=f?"-1px":"0";a[b][2].style.cssText="background-color: "+q+" !important";top.ICEcoder.lineWrapping=m;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=l;top.ICEcoder.matchBrackets=n;top.ICEcoder.autoCloseTags=p;top.ICEcoder.autoCloseBrackets=k;top.ICEcoder.indentWithTabs=r;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=t;for(f=0;fchMod "+ -b+" on
"+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(060*top.ICEcoder.autoLogoutMins-60&&ICEcoder.showHide("hide",get("blackMask")); -top.ICEcoder.autoLogoutTimer=0},logout:function(a){window.location=window.location+"?logout&"+(a?"type="+a+"&":"")+"csrf="+top.ICEcoder.csrf},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(top.t["Please note for..."])?(top.ICEcoder.showHide("show",top.get("loadingMask")), +b+" on
"+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(060*top.ICEcoder.autoLogoutMins-60&&ICEcoder.showHide("hide",get("blackMask")); +top.ICEcoder.autoLogoutTimer=0},logout:function(a){window.location=window.location+"?logout&"+(a?"type="+a+"&":"")+"csrf="+top.ICEcoder.csrf},message:function(a){alert(a)},ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},update:function(){confirm(top.t["Please note for..."])?(top.ICEcoder.showHide("show",top.get("loadingMask")), window.location="lib/updater.php"):window.open("https://icecoder.net")},updated:function(){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='

Thanks for updating to v'+top.ICEcoder.versionNo+'!

Click anywhere to continue using ICEcoder...

'},xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}return null}, -openBugReport:function(){var a;"off"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["You can start..."]);"error"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["Error cannot find..."]);"ok"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["No new errors..."]);"bugs"==top.ICEcoder.bugReportStatus&&(a=top.ICEcoder.openFiles.indexOf(top.ICEcoder.bugReportPath.replace(/\|/g,"/")),-1/g,">").replace(/"/g, -""").replace(/'/g,"'")},printCode:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();a=-1ICEcoder code output
'+top.ICEcoder.xssClean(a.getValue())+"
";b.focus();b.print();a.focus()},indicateChanges:function(){var a; -if(!top.ICEcoder.loadingFile){a="ICEcoder v "+top.ICEcoder.versionNo;for(var b=1;b<=top.ICEcoder.savedPoints.length;b++)if(top.ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()){a+=" \u2744";break}top.document.title=a}},switchTab:function(a,b){var c,d;ICEcoder.selectedTab=a;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();if(-1 '+ +""").replace(/'/g,"'")},printCode:function(){var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.getcMdiffInstance();a=-1ICEcoder code output
'+top.ICEcoder.xssClean(a.getValue())+"
";b.focus();b.print();a.focus()},indicateChanges:function(){if(!top.ICEcoder.loadingFile){var a= +"ICEcoder v "+top.ICEcoder.versionNo;for(var b=1;b<=top.ICEcoder.savedPoints.length;b++)if(top.ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()){a+=" \u2744";break}top.document.title=a}},switchTab:function(a,b){ICEcoder.selectedTab=a;var c=ICEcoder.getcMInstance();var d=ICEcoder.getcMdiffInstance();if(-1 '+ b.slice(b.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.savedContents.push("");a||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=' '+ +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){top.ICEcoder.openFiles[a-1]=b;var c=top.ICEcoder.openFiles[a-1];top.get("tab"+a).innerHTML=' '+ 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(); -ICEcoder.getcMdiffInstance();d=!0;c||ICEcoder.savedPoints[a-1]==top.ICEcoder.getcMInstance(a).changeGeneration()||(d=top.ICEcoder.ask(top.t["You have made..."]));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;db?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+ -18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX-(parseInt(top.ICEcoder.files.style.width,10)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide": -"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:53;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.get("tab"+c).style.opacity= -c==top.ICEcoder.draggingTab?1:.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-top.ICEcoder.tabLeftPos[c-1]:b,c!=top.ICEcoder.draggingTab&&(c=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>= -top.ICEcoder.tabLeftPos[c-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>c?c+1:c),top.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("tab"+c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths(); -top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.savedPoints,ICEcoder.savedContents,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.openFileVersions,ICEcoder.cMInstances];c=[[],[],[],[],[],[]];for(var e=0;eb-5;)d.undo(),a++;if(top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]==d.changeGeneration())top.ICEcoder.startSnake();else for(b=1;b<=a;b++)d.redo()},0);if(top.ICEcoder.snakePlaying)return 37==c&&(top.ICEcoder.snakeDir= -"left"),39==c&&(top.ICEcoder.snakeDir="right"),38==c&&(top.ICEcoder.snakeDir="up"),40==c&&(top.ICEcoder.snakeDir="down"),!1;if(224==c||91==c||93==c)top.ICEcoder.cmdKey=!0;if(46==c&&"files"==a)return top.ICEcoder.deleteFiles(),!1;if(b.altKey){var f=b.ctrlKey||top.ICEcoder.cmdKey?!0:!1;return"ctrl+alt"==top.ICEcoder.tagWrapperCommand&&f||"alt-left"==top.ICEcoder.tagWrapperCommand&&!f?"content"==a?68==c?(top.ICEcoder.tagWrapper("div"),!1):83==c?(top.ICEcoder.tagWrapper("span"),!1):80==c?(top.ICEcoder.tagWrapper("p"), +!1);top.ICEcoder.indicateChanges()},setTabWidths:function(a){if(top.ICEcoder.ready){var b=parseInt(top.ICEcoder.content.style.width,10)-53-22-10;var c=b/top.ICEcoder.openFiles.length-18;var d=-18;var e=53;var f=0;top.ICEcoder.tabLeftPos=[];for(var g=0;gb?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width, +10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX-(parseInt(top.ICEcoder.files.style.width,10)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide": +"tab tabDrag"},tabDragMove:function(){var a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:53;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var b=1;b<=top.ICEcoder.openFiles.length;b++){top.get("tab"+b).style.opacity= +b==top.ICEcoder.draggingTab?1:.5;var c=top.ICEcoder.tabLeftPos[b]?top.ICEcoder.tabLeftPos[b]-top.ICEcoder.tabLeftPos[b-1]:c;b!=top.ICEcoder.draggingTab&&(b=top.ICEcoder.tabLeftPos[b-1]?top.ICEcoder.tabLeftPos[b-1]-c:top.ICEcoder.tabLeftPos[b-1])}},tabDragEnd:function(){var a;top.ICEcoder.setTabWidths();for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.ICEcoder.thisLeft>= +top.ICEcoder.tabLeftPos[b-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>b?b+1:b),top.get("tab"+b).className="tab",top.get("tab"+b).style.opacity=1,b!=top.ICEcoder.dragTabNo?top.get("tab"+b).style.zIndex=1:setTimeout(function(){top.get("tab"+b).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){var c=[];for(b=1;b<=top.ICEcoder.openFiles.length;b++)c.push(b);c.splice(top.ICEcoder.dragTabNo-1,1);c.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(c)}top.ICEcoder.setTabWidths(); +top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b;var c=[ICEcoder.savedPoints,ICEcoder.savedContents,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.openFileVersions,ICEcoder.cMInstances];var d=[[],[],[],[],[],[]];for(var e=0;eb-5;)e.undo(),a++;if(top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]==e.changeGeneration())top.ICEcoder.startSnake();else for(b=1;b<=a;b++)e.redo()},0);if(top.ICEcoder.snakePlaying)return 37==c&&(top.ICEcoder.snakeDir= +"left"),39==c&&(top.ICEcoder.snakeDir="right"),38==c&&(top.ICEcoder.snakeDir="up"),40==c&&(top.ICEcoder.snakeDir="down"),!1;if(224==c||91==c||93==c)top.ICEcoder.cmdKey=!0;if(46==c&&"files"==a)return top.ICEcoder.deleteFiles(),!1;if(b.altKey){var d=b.ctrlKey||top.ICEcoder.cmdKey?!0:!1;return"ctrl+alt"==top.ICEcoder.tagWrapperCommand&&d||"alt-left"==top.ICEcoder.tagWrapperCommand&&!d?"content"==a?68==c?(top.ICEcoder.tagWrapper("div"),!1):83==c?(top.ICEcoder.tagWrapper("span"),!1):80==c?(top.ICEcoder.tagWrapper("p"), !1):65==c?(top.ICEcoder.tagWrapper("a"),!1):49==c?(top.ICEcoder.tagWrapper("h1"),!1):50==c?(top.ICEcoder.tagWrapper("h2"),!1):51==c?(top.ICEcoder.tagWrapper("h3"),!1):13==c?(top.ICEcoder.addLineBreakAtEnd(),!1):37==c?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):c:37==c?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):39==c?(top.ICEcoder.focus(-1Let\'s play
snake


Use arrow keys to eat your code

(it returns afterwards of course) :-)
'; -setTimeout(function(){top.ICEcoder.showHide("hide",top.get("blackMask"));top.get("mediaContainer").innerHTML="";top.ICEcoder.playSnake()},2E3)},playSnake:function(){var a;a=ICEcoder.getcMInstance();a.setOption("readOnly","nocursor");a.focus();top.ICEcoder.snakePreHistory=a.getHistory();top.ICEcoder.snakePreContent=a.getValue();top.ICEcoder.snakePreCursor=a.getCursor();a=Math.floor(50*Math.random());top.ICEcoder.snakePos=[[a,0],[a,-1],[a,-2],[a,-3],[a,-4]];top.ICEcoder.content.contentWindow.document.getElementById("game").style.display= -"block";top.ICEcoder.snakeDir="down";top.ICEcoder.doSnake();top.ICEcoder.snakeInt=setInterval(function(){var a=[];a[0]=top.ICEcoder.snakePos[0][0]+("right"==top.ICEcoder.snakeDir?1:"left"==top.ICEcoder.snakeDir?-1:0);a[1]=top.ICEcoder.snakePos[0][1]+("down"==top.ICEcoder.snakeDir?1:"up"==top.ICEcoder.snakeDir?-1:0);top.ICEcoder.snakePos.unshift(a);top.ICEcoder.snakePos.pop();top.ICEcoder.doSnake()},100)},doSnake:function(){var a,b,c,d,e,f,g;a=ICEcoder.getcMInstance();b=a.defaultCharWidth();c=a.defaultTextHeight(); -d=top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML="";for(g=0;g';top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML=d;d=a.coordsChar({top:top.ICEcoder.snakePos[0][1]*c+4,left:top.ICEcoder.snakePos[0][0]*b+ -60});e=a.getLine(d.line);if(top.ICEcoder.snakePos[0][0]-1<=e.length-2){f="";if("\t"===e.substr(d.ch,1))for(g=0;gtop.ICEcoder.snakePos[0][0]||0>top.ICEcoder.snakePos[0][1]||top.ICEcoder.snakePos[0][0]*b+60>g.clientWidth||top.ICEcoder.snakePos[0][1]*c+4>g.clientHeight||d)clearInterval(top.ICEcoder.snakeInt),top.ICEcoder.content.contentWindow.document.getElementById("game").style.display= -"none",a.setValue(top.ICEcoder.snakePreContent),top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration(),top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=top.ICEcoder.snakePreContent,a.setHistory(top.ICEcoder.snakePreHistory),top.ICEcoder.indicateChanges(),top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab),a.setOption("readOnly",!1),a.setCursor(top.ICEcoder.snakePreCursor),a.focus(),top.ICEcoder.snakePlaying=!1}}; \ No newline at end of file +window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1;if(13==c&&"files"==a)return b.ctrlKey||top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,"enter")),!1;if(38!=c&&40!=c&&37!=c&&39!=c||"files"!=a){if(79==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return top.ICEcoder.openPrompt(),!1;if(32==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.addSnippet(),!1;if(74== +c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.jumpToDefinition(),!1;if(223==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(top.ICEcoder.lockedNav?"expand":"contract"),!1;if(190==c&&(b.ctrlKey||top.ICEcoder.cmdKey)){var e=ICEcoder.getcMInstance();var f=ICEcoder.getcMdiffInstance();f=-1Let\'s play
snake


Use arrow keys to eat your code

(it returns afterwards of course) :-)
'; +setTimeout(function(){top.ICEcoder.showHide("hide",top.get("blackMask"));top.get("mediaContainer").innerHTML="";top.ICEcoder.playSnake()},2E3)},playSnake:function(){var a=ICEcoder.getcMInstance();a.setOption("readOnly","nocursor");a.focus();top.ICEcoder.snakePreHistory=a.getHistory();top.ICEcoder.snakePreContent=a.getValue();top.ICEcoder.snakePreCursor=a.getCursor();a=Math.floor(50*Math.random());top.ICEcoder.snakePos=[[a,0],[a,-1],[a,-2],[a,-3],[a,-4]];top.ICEcoder.content.contentWindow.document.getElementById("game").style.display= +"block";top.ICEcoder.snakeDir="down";top.ICEcoder.doSnake();top.ICEcoder.snakeInt=setInterval(function(){var a=[];a[0]=top.ICEcoder.snakePos[0][0]+("right"==top.ICEcoder.snakeDir?1:"left"==top.ICEcoder.snakeDir?-1:0);a[1]=top.ICEcoder.snakePos[0][1]+("down"==top.ICEcoder.snakeDir?1:"up"==top.ICEcoder.snakeDir?-1:0);top.ICEcoder.snakePos.unshift(a);top.ICEcoder.snakePos.pop();top.ICEcoder.doSnake()},100)},doSnake:function(){var a;var b=ICEcoder.getcMInstance();var c=b.defaultCharWidth();var d=b.defaultTextHeight(); +var e=top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML="";for(a=0;a';top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML=e;e=b.coordsChar({top:top.ICEcoder.snakePos[0][1]*d+4,left:top.ICEcoder.snakePos[0][0]* +c+60});var f=b.getLine(e.line);if(top.ICEcoder.snakePos[0][0]-1<=f.length-2){var g="";if("\t"===f.substr(e.ch,1))for(a=0;atop.ICEcoder.snakePos[0][0]||0>top.ICEcoder.snakePos[0][1]||top.ICEcoder.snakePos[0][0]*c+60>a.clientWidth||top.ICEcoder.snakePos[0][1]*d+4>a.clientHeight||e)clearInterval(top.ICEcoder.snakeInt), +top.ICEcoder.content.contentWindow.document.getElementById("game").style.display="none",b.setValue(top.ICEcoder.snakePreContent),top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=b.changeGeneration(),top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=top.ICEcoder.snakePreContent,b.setHistory(top.ICEcoder.snakePreHistory),top.ICEcoder.indicateChanges(),top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab),b.setOption("readOnly",!1),b.setCursor(top.ICEcoder.snakePreCursor),b.focus(),top.ICEcoder.snakePlaying= +!1}};