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,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:[],previewWindow:!1,previewWindowLoading:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,endTagReplaceData:[],fmReady:!1,bugReportStatus:"off",bugReportPath:"",bugFilesSizesSeen:[],bugFilesSizesActual:[],githubDiff:!1,githubAuthTokenSet:!1,splitPane:!1,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 footer nestValid versionsDisplay splitPaneControls charDisplay byteDisplay".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=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+"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;aICEcoder.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=-1a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if(0a.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=-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&&(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,m,p,n,l,q;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,"|"));m=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='        '+c+' '+d+"";if(!m||3>m.childNodes.length)l=document.createElement("ul"),m=h.parentNode.parentNode,m.parentNode.insertBefore(l,m.nextSibling),l=document.createElement("li"),l.className=k,l.draggable=!1,l.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)},l.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&& (-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},l.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")},l.ondragend=function(){top.ICEcoder.dropFile(this)},l.innerHTML=n,m.nextSibling.appendChild(l),m.nextSibling.appendChild(p);else for(h=0;hc||"folder"==g&&"file"==l||h==m.childNodes.length-1)){l=document.createElement("li");l.className=k;l.draggable=!1;l.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};l.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};l.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};l.ondragend= function(){top.ICEcoder.dropFile(this)};l.innerHTML=n;h==m.childNodes.length-1?(m.appendChild(l),m.appendChild(p)):(m.insertBefore(l,m.childNodes[h]),m.insertBefore(p,m.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.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};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,m,p,n,l,q;b=top.get("canvasPicker").getContext("2d");top.get("canvasPicker").onmousemove=function(u){c=u.pageX-this.offsetLeft;d=u.pageY-this.offsetTop;e=b.getImageData(c,d,1,1).data;f=e[0];g=e[1];k=e[2];h=f+","+g+","+k;m=top.ICEcoder.rgbToHex(f,g,k);top.get("rgbMouseXY").value=h;top.get("hexMouseXY").value="#"+m;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+m;p=128>f||128>g||128>k&&200>f&&200>g&&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');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML= '';top.ICEcoder.showHide("show",top.get("blackMask"))},versionsScreen:function(a,b){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},showManual:function(a,b){var c;c=b?"#"+b:"";top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='';top.ICEcoder.showHide("show",top.get("blackMask"))},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"))},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},useNewSettings:function(a,b,c,d,e,f,g,k,h,m,p,n,l,q,u,w,v,x,y,z,A,B,C,D){var r,t=a.slice(0,a.lastIndexOf("?")),t=t.slice(t.lastIndexOf("/")+1,t.lastIndexOf("."));top.ICEcoder.theme!==t&&(top.ICEcoder.theme=t,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),r=document.createElement("link"),r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(r), r=-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: "+ r+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=m;top.ICEcoder.matchBrackets=p;top.ICEcoder.autoCloseTags=n;top.ICEcoder.autoCloseBrackets=l;top.ICEcoder.indentWithTabs=q;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=u;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")),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 '+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=' '+ 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;e