Updated min file to match dev JS file

This commit is contained in:
Matt Pass
2013-05-13 08:57:44 +01:00
parent c34bf50c39
commit 236b55fce6

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

@@ -1,4 +1,4 @@
var ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,changedContent:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,lockedNav:!0,htmlTagArray:[],codeAssist:!0,mouseDown:!1,draggingFilesW:!1,draggingTab:!1,tabLeftPos:[],serverQueueItems:[],previewWindow:!1,pluginIntervalRefs:[],overPopup:!1,ready:!1,initAliases:function(){for(var a="header files account fmLock filesFrame editor tabsBar findBar content footer nestValid nestDisplay charDisplay".split(" "),
var ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,changedContent:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,lockedNav:!0,htmlTagArray:[],codeAssist:!0,mouseDown:!1,draggingFilesW:!1,draggingTab:!1,tabLeftPos:[],serverQueueItems:[],previewWindow:!1,pluginIntervalRefs:[],overPopup:!1,ready:!1,initAliases:function(){for(var a="header files account fmLock filesFrame editor tabsBar findBar content footer system nestValid nestDisplay charDisplay".split(" "),
b=0;b<a.length;b++)ICEcoder[a[b]]=top.document.getElementById(a[b])},init:function(){var a,b;ICEcoder.setLayout();top.ICEcoder.showHide("hide",top.document.getElementById("loadingMask"));top.ICEcoder.openLastFiles&&top.ICEcoder.autoOpenFiles();setInterval(ICEcoder.updateNestingIndicator,30);a=top.document.getElementById("screenMode");b=["images/restored-screen.gif","images/full-screen.gif"];document.addEventListener("fullscreenchange",function(){a.src=document.fullscreen?b[0]:b[1]},!1);document.addEventListener("mozfullscreenchange",
function(){a.src=document.mozFullScreen?b[0]:b[1]},!1);document.addEventListener("webkitfullscreenchange",function(){a.src=document.webkitIsFullScreen?b[0]:b[1]},!1);top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth?window.innerWidth:document.body.clientWidth;c=window.innerHeight?window.innerHeight:document.body.clientHeight;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.account.style.height=
this.accountH+"px";this.fmLock.style.marginLeft=this.filesW-42+"px";this.filesFrame.style.height=c-40-50-30+"px";this.nestValid.style.left=this.filesW+10+"px";this.nestDisplay.style.left=this.filesW+17+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-40-30-21-28+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize("100%",
@@ -15,27 +15,27 @@ d.line=e.from().line,g==a&&(f=c.getSearchCursor(">",d),f.findNext(),c.setCursor(
3,!top.ICEcoder.dontSelect?c.setSelection(d,e):top.ICEcoder.dontSelect=!1,c.scrollIntoView(d))}},setPosition:function(a,b,c){var d;d=ICEcoder.getcMInstance();c=d.getLine(b).indexOf(">",d.getLine(b).indexOf("<"+c))+1;d.setCursor(b,c);d.focus();for(d=b=0;d<=a;d++)b=ICEcoder.nestDisplay.innerHTML.indexOf("&gt;",b+1);ICEcoder.nestDisplay.innerHTML=ICEcoder.nestDisplay.innerHTML.substr(0,b).replace(/<(?:.|\n)*?>/gm,"");top.ICEcoder.dontUpdateNest=!1;top.ICEcoder.dontSelect=!0},tagWrapper:function(a){var b,
c,d,e;b=ICEcoder.getcMInstance();c=a;"div"==a?(d=b.getCursor("start").line,e=b.getCursor().line,b.operation(function(){b.replaceSelection("<div>\n"+b.getSelection()+"\n</div>");for(var a=d+1;a<=e+1;a++)b.indentLine(a);b.indentLine(e+2,"prev");b.indentLine(e+2,"subtract")})):("a"==a&&(c='a href=""'),b.replaceSelection("<"+c+">"+b.getSelection()+"</"+a+">"));"a"==a&&b.setCursor({line:b.getCursor("start").line,ch:b.getCursor("start").ch+9})},addLineBreakAtEnd:function(a){var b;b=ICEcoder.getcMInstance();
a||(a=b.getCursor().line);b.setLine(a,b.getLine(a)+"<br>")},duplicateLine:function(a){var b,c;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);c=b.getCursor().ch;b.setLine(a,b.getLine(a)+"\n"+b.getLine(a));b.setCursor(a+1,c)},removeLine:function(a){var b,c;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);c=b.getCursor().ch;b.removeLine(a);b.setCursor(a-1,c)},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);
else{top.ICEcoder.origCurorPos=a.getCursor();a=["var "+b,"function "+b,b+"=function",b+"=new function",b+":","def "+b,"class "+b];for(b=0;b<a.length;b++)top.ICEcoder.findReplace(a[b],!1,!1)&&(b=a.length)}},openCloseDir:function(a,b){var c,d;a.onclick=function(){top.ICEcoder.openCloseDir(this,!1)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"==c.tagName&&((d="none"==c.style.display)?b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");
else{top.ICEcoder.origCurorPos=a.getCursor();a=["var "+b,"function "+b,b+"=function",b+"=new function",b+":","def "+b,"class "+b];for(b=0;b<a.length;b++)top.ICEcoder.findReplace(a[b],!1,!1)&&(b=a.length)}},openCloseDir:function(a,b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.openCloseDir(this,!1)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"==c.tagName&&((d="none"==c.style.display)?b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");
b&&(top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/get-branch.php?location="+a.childNodes[1].id);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=a;ICEcoder.thisFileFolderLink=b},selectFileFolder:function(a){var b,c;""==top.ICEcoder.thisFileFolderLink?a.ctrlKey||top.ICEcoder.deselectAllFiles():top.ICEcoder.thisFileFolderLink&&(c=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),b=ICEcoder.filesFrame.contentWindow.document.getElementById(c),a.ctrlKey?
-1<top.ICEcoder.selectedFiles.indexOf(c)?(ICEcoder.selectDeselectFile("deselect",b),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(c),1)):(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c)):(top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c)));document.findAndReplace.target[2].innerHTML=!top.ICEcoder.selectedFiles[0]?"all files":"selected files";document.findAndReplace.target[3].innerHTML=!top.ICEcoder.selectedFiles[0]?
"all filenames":"selected filenames";top.ICEcoder.fMIconVis("fMOpen",1==top.ICEcoder.selectedFiles.length?1:0.3);top.ICEcoder.fMIconVis("fMNewFile",1==top.ICEcoder.selectedFiles.length&&"folder"==top.ICEcoder.thisFileFolderType?1:0.3);top.ICEcoder.fMIconVis("fMNewFolder",1==top.ICEcoder.selectedFiles.length&&"folder"==top.ICEcoder.thisFileFolderType?1:0.3);top.ICEcoder.fMIconVis("fMDelete",0<top.ICEcoder.selectedFiles.length?1:0.3);top.ICEcoder.fMIconVis("fMRename",1==top.ICEcoder.selectedFiles.length?
1:0.3);top.document.getElementById("fileMenu").style.display="none"},deselectAllFiles:function(){for(var a,b=0;b<top.ICEcoder.selectedFiles.length;b++)a=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selectedFiles[b]),ICEcoder.selectDeselectFile("deselect",a);top.ICEcoder.selectedFiles.length=0},selectDeselectFile:function(a,b){var c;b&&(c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g,"/"))?!0:!1,b.style.backgroundColor=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
1]==b.id.replace(/\|/g,"/")?"#49d":"select"==a?"#888":b.style.backgroundColor=c?"rgba(255,255,255,0.15)":"transparent",b.style.color="select"==a?"#fff":"#eee")},newFile:function(){top.ICEcoder.newTab();top.ICEcoder.saveFile()},newFolder:function(){var a,b;a=top.ICEcoder.rightClickedFile.replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter New Folder Name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>Creating Folder</b><br>"+
b)},openFile:function(a){var b;a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType="file");!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),b=!0,100>top.ICEcoder.openFiles.length?-1<top.ICEcoder.openFiles.indexOf(a)&&"/[NEW]"!=a&&(b=!1,top.ICEcoder.switchTab(i+1)):
(top.ICEcoder.message("Sorry, you can only have 100 files open at a time!"),b=!1),b&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink),top.ICEcoder.serverMessage("<b>Opening File</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab(),top.ICEcoder.fMIconVis("fMView",1)))},openPrompt:function(){var a;(a=top.ICEcoder.getInput("Enter relative file path prefixed with /",
""))&&top.ICEcoder.openFile(a)},saveFile:function(a){top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|")+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+(a?"saveAs":"save"));top.ICEcoder.serverMessage("<b>Saving</b><br>"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.rightClickedFile.replace(/\|/g,
"/"),a=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput("Please enter the new name for",c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1<d&&(top.ICEcoder.openFiles[d]=b,closeTabLink='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>',
(top.ICEcoder.message("Sorry, you can only have 100 files open at a time!"),b=!1),b&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink),top.ICEcoder.serverMessage("<b>Opening File</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab(),top.ICEcoder.fMIconVis("fMView",1)))},openPrompt:function(){var a;if(a=top.ICEcoder.getInput("Enter relative file path (prefixed with /) or remote URL",
""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):top.ICEcoder.openFile(a)},getRemoteFile:function(a){top.ICEcoder.serverQueue("add","lib/file-control.php?action=getRemoteFile&file="+a);top.ICEcoder.serverMessage("<b>Getting</b><br>"+a)},saveFile:function(a){top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|")+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+(a?"saveAs":
"save"));top.ICEcoder.serverMessage("<b>Saving</b><br>"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"),a=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput("Please enter the new name for",c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1<d&&(top.ICEcoder.openFiles[d]=b,closeTabLink='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>',
c=top.ICEcoder.openFiles[d],top.document.getElementById("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.document.getElementById("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+b+"&oldFileName="+a.replace(/\|/g,"/")),top.ICEcoder.serverMessage("<b>Renaming to</b><br>"+b),top.ICEcoder.setPreviousFiles())},deleteFile:function(){var a;0<top.ICEcoder.selectedFiles.length&&(a=top.ICEcoder.ask("Delete:\n\n"+top.ICEcoder.selectedFiles.toString().replace(/\|/g,
"/").replace(/,/g,"\n")+"?"));if(a){a="";for(var b=0;b<top.ICEcoder.selectedFiles.length;b++)a+=top.ICEcoder.selectedFiles[b],b<top.ICEcoder.selectedFiles.length-1&&(a+=";");top.ICEcoder.serverQueue("add","lib/file-control.php?action=delete&file="+a);top.ICEcoder.serverMessage("<b>Deleting File</b><br>"+top.ICEcoder.selectedFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n"))}},copyFile:function(a){top.ICEcoder.copiedFile=a;top.document.getElementById("fmMenuPasteOption").style.display="block";
top.ICEcoder.hideFileMenu()},pasteFile:function(a){top.ICEcoder.copiedFile?(top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFile+"&location="+a),top.ICEcoder.serverMessage("<b>Pasting File</b><br>"+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message("Nothing to paste, copy a file/folder first!")},uploadFilesSelect:function(a){top.document.getElementById("uploadDir").value=a;top.document.getElementById("fileInput").click()},
uploadFilesSubmit:function(){""!=top.document.getElementById("fileInput").value&&(top.ICEcoder.showHide("show",top.document.getElementById("loadingMask")),document.getElementById("uploadFilesForm").submit(),event.preventDefault())},showMenu:function(a){var b;(0==top.ICEcoder.selectedFiles.length||-1==top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.rightClickedFile.replace(/\//g,"|")))&&top.ICEcoder.selectFileFolder(a);"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&
(a=-1<top.ICEcoder.selectedFiles[0].indexOf(".")?"file":"folder",b=top.document.getElementById("folderMenuItems"),b.style.display="folder"==a&&1==top.ICEcoder.selectedFiles.length?"block":"none",singleFileMenuItems.style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",document.getElementById("fileMenu").style.display="inline-block",document.getElementById("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",document.getElementById("fileMenu").style.top=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-
10+"px");return!1},showFileMenu:function(){document.getElementById("fileMenu").style.display="inline-block"},hideFileMenu:function(){document.getElementById("fileMenu").style.display="none"},updateFileManagerList:function(a,b,c,d,e,f){var g,l,j,h,m,n,k,p;if("add"==a&&!document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){g=-1<c.indexOf(".")?"file":"folder";l="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d=
"file"==g?664:705;b||(b="/");b=b.replace(top.iceRoot,"");j=document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));h=j.parentNode.parentNode.nextSibling;m=document.createTextNode("\n");n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="top.ICEcoder.overFileFolder(\''+g+"','"+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+"')\" onMouseOut=\"top.ICEcoder.overFileFolder('"+g+'\',\'\')" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+
b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="color: #888; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(3>h.childNodes.length)k=document.createElement("ul"),h=j.parentNode.parentNode,h.parentNode.insertBefore(k,h.nextSibling),k=document.createElement("li"),k.className=l,k.innerHTML=n,h.nextSibling.appendChild(k),h.nextSibling.appendChild(m);else for(j=0;j<=h.childNodes.length-1;j++)if(h.childNodes[j].className&&(k=0<h.childNodes[j].className.indexOf("directory")?
"folder":"file",p=h.childNodes[j].getElementsByTagName("span")[0].innerHTML,k==g&&p>c||"folder"==g&&"file"==k||j==h.childNodes.length-1)){k=document.createElement("li");k.className=l;k.innerHTML=n;j==h.childNodes.length-1?(h.appendChild(k),h.appendChild(m)):(h.insertBefore(k,h.childNodes[j]),h.insertBefore(m,h.childNodes[j+1]));break}"file"==g&&!f&&(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(e=e.replace(/\//g,"|"),j=document.getElementById("filesFrame").contentWindow.document.getElementById(e),
j.innerHTML=c,j.id=b.replace(/\//g,"|")+"|"+c,f=j.parentNode.onmouseover.toString().replace(e.substring(e.lastIndexOf("|")+1),c).split("'"),eval("targetElem.parentNode.onmouseover = function() { top.ICEcoder.overFileFolder('"+f[1]+"','"+f[3]+"');}"),eval("targetElem.parentNode.title = newMouseOver[3];"),targetElemPerms=document.getElementById("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"chmod"==a&&(e=top.ICEcoder.rightClickedFile.replace(/\|/g,
"/"),j=document.getElementById("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),j.innerHTML=d);"delete"==a&&(j=document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c).parentNode.parentNode,j.parentNode.removeChild(j))},fMIcon:function(a){"save"==a&&0<ICEcoder.openFiles.length&&top.ICEcoder.saveFile();1==ICEcoder.selectedFiles.length&&(top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.selectedFiles[0].replace("|",
"/").replace(/,/g,"\n")+"?"));if(a){a="";for(var b=0;b<top.ICEcoder.selectedFiles.length;b++)a+=top.ICEcoder.selectedFiles[b],b<top.ICEcoder.selectedFiles.length-1&&(a+=";");top.ICEcoder.serverQueue("add","lib/file-control.php?action=delete&file="+a);top.ICEcoder.serverMessage("<b>Deleting File</b><br>"+top.ICEcoder.selectedFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n"))}},copyFile:function(){top.ICEcoder.copiedFiles=[];for(var a=0;a<top.ICEcoder.selectedFiles.length;a++)top.ICEcoder.copiedFiles[a]=
top.ICEcoder.selectedFiles[a];top.document.getElementById("fmMenuPasteOption").style.display="block";top.ICEcoder.hideFileMenu()},pasteFile:function(a){if(top.ICEcoder.copiedFiles)for(var b=0;b<top.ICEcoder.copiedFiles.length;b++)top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFiles[b]+"&location="+a),top.ICEcoder.serverMessage("<b>Pasting File</b><br>"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"));else top.ICEcoder.message("Nothing to paste, copy a file/folder first!")},
uploadFilesSelect:function(a){top.document.getElementById("uploadDir").value=a;top.document.getElementById("fileInput").click()},uploadFilesSubmit:function(){""!=top.document.getElementById("fileInput").value&&(top.ICEcoder.showHide("show",top.document.getElementById("loadingMask")),document.getElementById("uploadFilesForm").submit(),event.preventDefault())},showMenu:function(a){var b;(0==top.ICEcoder.selectedFiles.length||-1==top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.rightClickedFile.replace(/\//g,
"|")))&&top.ICEcoder.selectFileFolder(a);"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(a=-1<top.ICEcoder.selectedFiles[0].indexOf(".")?"file":"folder",b=top.document.getElementById("folderMenuItems"),b.style.display="folder"==a&&1==top.ICEcoder.selectedFiles.length?"block":"none",singleFileMenuItems.style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",document.getElementById("fileMenu").style.display="inline-block",document.getElementById("fileMenu").style.left=
top.ICEcoder.mouseX+20+"px",document.getElementById("fileMenu").style.top=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10+"px");return!1},showFileMenu:function(){document.getElementById("fileMenu").style.display="inline-block"},hideFileMenu:function(){document.getElementById("fileMenu").style.display="none"},updateFileManagerList:function(a,b,c,d,e,f){var g,l,h,j,m,n,k,p;if("add"==a&&!document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,
"").replace(/\//g,"|")+"|"+c)){g=-1<c.indexOf(".")?"file":"folder";l="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?664:705;b||(b="/");b=b.replace(top.iceRoot,"");h=document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));j=h.parentNode.parentNode.nextSibling;m=document.createTextNode("\n");n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="top.ICEcoder.overFileFolder(\''+g+"','"+b.replace(/\/$/,"").replace(/\//g,
"|")+"|"+c+"')\" onMouseOut=\"top.ICEcoder.overFileFolder('"+g+'\',\'\')" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="color: #888; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(3>j.childNodes.length)k=document.createElement("ul"),j=h.parentNode.parentNode,j.parentNode.insertBefore(k,j.nextSibling),k=document.createElement("li"),
k.className=l,k.innerHTML=n,j.nextSibling.appendChild(k),j.nextSibling.appendChild(m);else for(h=0;h<=j.childNodes.length-1;h++)if(j.childNodes[h].className&&(k=0<j.childNodes[h].className.indexOf("directory")?"folder":"file",p=j.childNodes[h].getElementsByTagName("span")[0].innerHTML,k==g&&p>c||"folder"==g&&"file"==k||h==j.childNodes.length-1)){k=document.createElement("li");k.className=l;k.innerHTML=n;h==j.childNodes.length-1?(j.appendChild(k),j.appendChild(m)):(j.insertBefore(k,j.childNodes[h]),
j.insertBefore(m,j.childNodes[h+1]));break}"file"==g&&!f&&(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(e=e.replace(/\//g,"|"),h=document.getElementById("filesFrame").contentWindow.document.getElementById(e),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=document.getElementById("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"chmod"==a&&(e=top.ICEcoder.rightClickedFile.replace(/\|/g,
"/"),h=document.getElementById("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),h.innerHTML=d);"delete"==a&&(h=document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c).parentNode.parentNode,h.parentNode.removeChild(h))},fMIcon:function(a){"save"==a&&0<ICEcoder.openFiles.length&&top.ICEcoder.saveFile();1==ICEcoder.selectedFiles.length&&(top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.selectedFiles[0].replace("|",
"/"),"open"==a&&-1<ICEcoder.selectedFiles[0].indexOf(".")?(top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()):"newFile"==a?top.ICEcoder.newFile():"newFolder"==a?top.ICEcoder.newFolder():"rename"==a&&top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile));"delete"==a&&0<ICEcoder.selectedFiles.length&&top.ICEcoder.deleteFile();"view"==a&&0<ICEcoder.openFiles.length&&window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])},refreshFileManager:function(){var a;a=top.document.getElementById("progressBar").style;
a.webkitAnimation=a.mozAnimation="";setTimeout(function(){a.webkitAnimation=a.mozAnimation="fullexpand 10s ease-out"},4);top.ICEcoder.showHide("show",top.document.getElementById("loadingMask"));top.ICEcoder.filesFrame.src="files.php";top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.document.getElementById("loadingMask"))}},findReplaceOptions:function(){top.document.getElementById("rText").style.display=
top.document.getElementById("replace").style.display=top.document.getElementById("rTarget").style.display="and"==document.findAndReplace.connector.value?"inline-block":"none"},findReplace:function(a,b,c){var d,e,f,g;a=a.toLowerCase();d=top.document.getElementById("replace").value;e=top.document.getElementById("results");if((f=ICEcoder.getcMInstance())&&0<a.length&&"this document"==document.findAndReplace.target.value){f.getValue().toLowerCase();"and"==document.findAndReplace.connector.value&&("replace"==
@@ -43,7 +43,7 @@ document.findAndReplace.replaceAction.value&&f.getSelection().toLowerCase()==a?f
" results";else{b=1;for(d=g=0;d<c.length;d++)c.indexOf("\n",d)==d&&b<=f.getCursor().line&&(b++,g=d);b=g+f.getCursor().ch+1;for(d=ICEcoder.findResult=0;d<ICEcoder.results.length;d++)ICEcoder.results[d]<b&&ICEcoder.findResult++;ICEcoder.findResult>ICEcoder.results.length-1&&(ICEcoder.findResult=0);e.innerHTML="Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results";for(d=b=0;d<ICEcoder.results[ICEcoder.findResult];d++)c.indexOf("\n",d)==d&&b++;f.lineInfo(0);e=f.getSearchCursor(a,
f.getCursor(),!0);e.findNext();e.from()||(e=f.getSearchCursor(a,{line:0,ch:0},!0),e.findNext());f.setSelection(e.from(),e.to());f.focus();top.ICEcoder.findMode=!0}return!0}e.innerHTML="No results";return!1}if(""!=a&&c){filesQS=e=f="";"and"==document.findAndReplace.connector.value&&(f="&replace="+d);0<=document.findAndReplace.target.value.indexOf("file")&&(e="&target="+document.findAndReplace.target.value.replace(/ /g,"-"));if("selected files"==document.findAndReplace.target.value){filesQS="&selectedFiles=";
for(d=0;d<top.ICEcoder.selectedFiles.length;d++)filesQS+=top.ICEcoder.selectedFiles[d]+":";filesQS=filesQS.replace(/\:$/,"")}a=a.replace(/\'/g,"&#39;");a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a;top.ICEcoder.showHide("show",top.document.getElementById("loadingMask"));top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+f+e+filesQS+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'}},replaceInFile:function(a,b,
c){top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+a.replace(/\//g,"|")+"&find="+b+"&replace="+c);top.ICEcoder.serverMessage("<b>Replacing text in</b><br>"+a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;if("undefined"!=typeof b.curState){ICEcoder.htmlTagArray=[];for(d=b.curState.htmlState.context;d;d=d.prev)"undefined"!=typeof d.tagName&&ICEcoder.htmlTagArray.unshift(d.tagName)}ICEcoder.tagString=
c){top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+a.replace(/\//g,"|")+"&find="+b+"&replace="+c);top.ICEcoder.serverMessage("<b>Replacing text in</b><br>"+a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;if("undefined"!=typeof b.curState&&"undefined"!=typeof b.curState.htmlState){ICEcoder.htmlTagArray=[];for(d=b.curState.htmlState.context;d;d=d.prev)"undefined"!=typeof d.tagName&&ICEcoder.htmlTagArray.unshift(d.tagName)}ICEcoder.tagString=
ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1];"JavaScript"==ICEcoder.caretLocType&&(ICEcoder.tagString="script");if(a&&!top.ICEcoder.dontUpdateNest&&(ICEcoder.nestDisplay.innerHTML="","undefined"!=typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]&&(a=ICEcoder.openFiles[ICEcoder.selectedTab-1],0>["js","coffee","css","less"].indexOf(a.split(".")[1])&&-1==c.indexOf("include(")&&-1==c.indexOf("include_once(")&&(-1<c.indexOf("<html")||-1<c.indexOf("<body"))))){for(a=0;a<ICEcoder.htmlTagArray.length;a++)c=
'onMouseover="top.ICEcoder.highlightBlock('+a+')" onMouseout="top.ICEcoder.highlightBlock('+a+",'hide')\" onClick=\"top.ICEcoder.setPosition("+a+",top.ICEcoder.startPosLine,'"+ICEcoder.htmlTagArray[a]+"')\"",0==a&&(ICEcoder.nestDisplay.innerHTML+="<div "+c+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif)"></div>'),ICEcoder.nestDisplay.innerHTML+="<a "+c+' style="display: inline-block; cursor: pointer; background: #333; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px">'+
ICEcoder.htmlTagArray[a]+"</a>",ICEcoder.nestDisplay.innerHTML+=a<ICEcoder.htmlTagArray.length-1?"<div "+c+' style="display: inline-block; width: 8px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -7px 0; cursor: pointer"></div>':"<div "+c+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -15px 0; cursor: pointer"></div>';"undefined"!=typeof b.curState&&
@@ -70,10 +70,10 @@ ICEcoder.serverQueueItems[0]},1)},cancelAllActions:function(){window.stop();0<IC
"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a)},autoOpenFiles:function(){if(0<top.ICEcoder.previousFiles.length&&top.ICEcoder.ask("Open previous files?\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a<top.ICEcoder.previousFiles.length;a++)top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[a].replace("|",
"/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},settingsScreen:function(a){a||(top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/settings-screen.php" class="whiteGlow" style="width: 970px; height: 600px"></iframe>');top.ICEcoder.showHide(a?"hide":"show",top.document.getElementById("blackMask"))},helpScreen:function(){top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/help.php" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';
top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},showManual:function(a){top.document.getElementById("mediaContainer").innerHTML='<iframe src="http://icecoder.net/manual?version='+a+'" class="whiteGlow" style="width: 500px; height: 500px"></iframe>';top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},propertiesScreen:function(a){top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';
top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,l,j){var h;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");h=document.createElement("link");h.setAttribute("rel","stylesheet");h.setAttribute("type","text/css");h.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(h);a=-1<["eclipse","elegant","neat"].indexOf(top.ICEcoder.theme)?
top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,l,h){var j;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");j=document.createElement("link");j.setAttribute("rel","stylesheet");j.setAttribute("type","text/css");j.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(j);a=-1<["eclipse","elegant","neat"].indexOf(top.ICEcoder.theme)?
"#ccc":"#000";top.ICEcoder.switchTab(top.ICEcoder.selectedTab);top.document.getElementById("codeAssist").checked=b;c!=top.ICEcoder.lockedNav&&top.ICEcoder.lockUnlockNav();c||(ICEcoder.changeFilesW("contract"),top.document.getElementById("fileMenu").style.display="none");c=ICEcoder.content.contentWindow.document.styleSheets[3];b=c.rules?"rules":"cssRules";c[b][0].style.fontSize=e;c[b][5].style.content=d?'"\\21e5"':'" "';c[b][2].style.cssText="background: "+a+" !important";top.ICEcoder.lineWrapping=
f;top.ICEcoder.indentWithTabs=g;top.ICEcoder.indentSize=l;for(d=0;d<ICEcoder.cMInstances.length;d++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("tabSize",
top.ICEcoder.indentSize);j&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.document.getElementById("find").value,!0,!1);document.getElementById("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen?document.mozCancelFullScreen():
top.ICEcoder.indentSize);h&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.document.getElementById("find").value,!0,!1);document.getElementById("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen?document.mozCancelFullScreen():
document.body.mozRequestFullScreen():"undefined"!=typeof document.webkitCancelFullScreen&&(document.webkitIsFullScreen?document.webkitCancelFullScreen():document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))},zipIt:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="plugins/zip-it/index.php?zip="+a},chmod:function(a,b){top.ICEcoder.showHide("hide",top.document.getElementById("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+
a.replace(top.iceRoot,"")+"&perms="+b);top.ICEcoder.serverMessage("<b>chMod "+b+" on </b><br>"+a.replace(top.iceRoot,""))},openPreviewWindow:function(){var a,b,c;b=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];c=b.substr(b.lastIndexOf("/")+1);c=c.substr(c.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();top.ICEcoder.previewWindow=window.open(b,"previewWindow");-1<["md"].indexOf(c)&&(top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())})},
openTerminal:function(){top.ICEcoder.demoMode?top.ICEcoder.message("Sorry, you need to be logged in to use the terminal"):window.open("terminal")},logout:function(){window.location+="?logout"},message:function(a){alert(a)},ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b;b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},switchTab:function(a,b){var c;ICEcoder.selectedTab=a;if(c=
@@ -100,7 +100,7 @@ a.length;f++)a[f]<d&&(d=a[f],nextValueFull=top.ICEcoder.openFiles[top.ICEcoder.o
if(80==c)return top.ICEcoder.tagWrapper("p"),!1;if(65==c)return top.ICEcoder.tagWrapper("a"),!1;if(66==c)return top.ICEcoder.tagWrapper("b"),!1;if(73==c)return top.ICEcoder.tagWrapper("i"),!1;if(71==c)return top.ICEcoder.tagWrapper("strong"),!1;if(69==c)return top.ICEcoder.tagWrapper("em"),!1;if(49==c)return top.ICEcoder.tagWrapper("h1"),!1;if(50==c)return top.ICEcoder.tagWrapper("h2"),!1;if(51==c)return top.ICEcoder.tagWrapper("h3"),!1;if(52==c)return top.ICEcoder.tagWrapper("h4"),!1;if(53==c)return top.ICEcoder.tagWrapper("h5"),
!1;if(54==c)return top.ICEcoder.tagWrapper("h6"),!1;if(55==c)return top.ICEcoder.tagWrapper("h7"),!1;if(13==c)return top.ICEcoder.addLineBreakAtEnd(),!1}return c}return 70==c&&b.ctrlKey?(top.document.getElementById("find").focus(),!1):71==c&&b.ctrlKey?(top.document.getElementById("goToLineNo").focus(),!1):73==c&&b.ctrlKey&&"content"==a?(c=top.ICEcoder.caretLocType.toLowerCase()+" ","CSS"==top.ICEcoder.caretLocType||"PHP"==top.ICEcoder.caretLocType?window.open("http://voke.fm/"+c+top.ICEcoder.getcMInstance().getSelection()):
("Content"==top.ICEcoder.caretLocType&&(c=""),window.open("http://www.google.com/#output=search&q="+c+top.ICEcoder.getcMInstance().getSelection())),!1):39==c&&b.ctrlKey&&"content"!=a?(top.ICEcoder.nextTab(),!1):37==c&&b.ctrlKey&&"content"!=a?(top.ICEcoder.previousTab(),!1):38==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.moveLine("up"),!1):40==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.moveLine("down"),!1):107==c&&b.ctrlKey?("content"==a?top.ICEcoder.duplicateLine():top.ICEcoder.newTab(),!1):109==c&&b.ctrlKey?
("content"==a?top.ICEcoder.removeLine():top.ICEcoder.closeTab(top.ICEcoder.selectedTab),!1):83==c&&b.ctrlKey?(b.shiftKey?top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1):13==c&&b.ctrlKey&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]?(window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1):79==c&&b.ctrlKey?(top.ICEcoder.openPrompt(),!1):32==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.addSnippet(),!1):74==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.jumpToDefinition(),
!1):27==c&&"content"==a?(top.ICEcoder.lineCommentToggle(),!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c},resetKeys:function(){},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=a.getCursor().line;c=a.getLine(b).length-a.getLine(b).replace(/^\s\s*/,"").length;a=a.getLine(b).slice(c);"function"==a.slice(0,8)?top.ICEcoder.doSnippet("function","function VAR() {\nINDENT\tCURSOR\nINDENT}"):"if"==a.slice(0,2)?top.ICEcoder.doSnippet("if","if (CURSOR) {\nINDENT\t\nINDENT}"):"for"==
a.slice(0,3)&&top.ICEcoder.doSnippet("for","for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}")},doSnippet:function(a,b){var c,d,e,f,g,l;c=top.ICEcoder.getcMInstance();d=c.getCursor().line;if(-1<c.getLine(d).indexOf(a)){e=c.getLine(d);f=e.indexOf(a);e=e.slice(e.indexOf(a)+a.length);b=b.replace(/VAR/g,e);e=c.getLine(d).slice(0,f);f=c.getLine(d).length-c.getLine(d).replace(/^\s\s*/,"").length;f=c.getLine(d).slice(0,f);b=b.replace(/INDENT/g,f);e+=b;f=e.indexOf("CURSOR");g=0;l=d;for(i=0;i<e.length;i++)e.indexOf("\n",
g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,l+=1);c.setLine(d,e.replace("CURSOR",""));c.setCursor(l,f);c.focus()}}};
("content"==a?top.ICEcoder.removeLine():top.ICEcoder.closeTab(top.ICEcoder.selectedTab),!1):83==c&&b.ctrlKey?(b.shiftKey?top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1):13==c&&b.ctrlKey&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]?(window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1):79==c&&b.ctrlKey?(top.ICEcoder.openPrompt(),!1):32==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.addSnippet(),!1):32==c&&"content"!=a?(top.ICEcoder.getcMInstance().focus(),!1):
74==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):27==c&&"content"==a?(top.ICEcoder.lineCommentToggle(),!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c},resetKeys:function(){},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=a.getCursor().line;c=a.getLine(b).length-a.getLine(b).replace(/^\s\s*/,"").length;a=a.getLine(b).slice(c);"function"==a.slice(0,8)?top.ICEcoder.doSnippet("function","function VAR() {\nINDENT\tCURSOR\nINDENT}"):"if"==a.slice(0,2)?top.ICEcoder.doSnippet("if",
"if (CURSOR) {\nINDENT\t\nINDENT}"):"for"==a.slice(0,3)&&top.ICEcoder.doSnippet("for","for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}")},doSnippet:function(a,b){var c,d,e,f,g,l;c=top.ICEcoder.getcMInstance();d=c.getCursor().line;if(-1<c.getLine(d).indexOf(a)){e=c.getLine(d);f=e.indexOf(a);e=e.slice(e.indexOf(a)+a.length);b=b.replace(/VAR/g,e);e=c.getLine(d).slice(0,f);f=c.getLine(d).length-c.getLine(d).replace(/^\s\s*/,"").length;f=c.getLine(d).slice(0,f);b=b.replace(/INDENT/g,f);e+=b;f=e.indexOf("CURSOR");
g=0;l=d;for(i=0;i<e.length;i++)e.indexOf("\n",g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,l+=1);c.setLine(d,e.replace("CURSOR",""));c.setCursor(l,f);c.focus()}}};