From 7ebd73916ebdf113ad71f26e1d795ad99f859564 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 6 May 2013 15:59:02 +0100 Subject: [PATCH] Added a minified version of ice-coder.js This saves about 40% of the load time on this file now. --- lib/ice-coder.min.js | 105 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 lib/ice-coder.min.js diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js new file mode 100644 index 0000000..a301131 --- /dev/null +++ b/lib/ice-coder.min.js @@ -0,0 +1,105 @@ +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:[],stickyTab:!1,pluginIntervalRefs:[],overPopup:!1,ready:!1,initAliases:function(){for(var a="header files account fmLock filesFrame editor tabsBar findBar content footer nestValid nestDisplayText nestDisplay charDisplay".split(" "), +b=0;bICEcoder.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(){"w-resize"==top.document.body.style.cursor?top.ICEcoder.mouseDown&&(top.ICEcoder.filesW=top.ICEcoder.maxFilesW=250<=top.ICEcoder.mouseX&&400>=top.ICEcoder.mouseX?top.ICEcoder.mouseX:250>top.ICEcoder.mouseX?250:400,top.ICEcoder.files.style.width=top.ICEcoder.account.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.document.getElementById("fmLock");ICEcoder.lockedNav=ICEcoder.lockedNav?!1:!0;a.style.backgroundPosition=ICEcoder.lockedNav?"-64px -16px":"-80px -16px"},contentCleanUp:function(){var a,b;0>["js","coffee","rb","css","less"].indexOf(ICEcoder.openFiles[ICEcoder.selectedTab-1].split(".")[1])&&(a=ICEcoder.getcMInstance(), +b=a.getValue(),b=b.replace(//g,""),a.setValue(b),a.clearHistory())},moveLine:function(a){var b,c,d;b=top.ICEcoder.getcMInstance();c=b.getCursor().line;"up"==a&&0=a;g--)e=c.getSearchCursor("<"+top.ICEcoder.htmlTagArray[g],d),e.findPrevious(),d.ch=e.from().ch,d.line=e.from().line,g==a&&(f=c.getSearchCursor(">",d),f.findNext(),c.setCursor(f.from().line,f.from().ch+1),top.ICEcoder.getNestLocation(),ICEcoder.htmlTagArray.length- +1!=a&&g++);e.from()&&(d={},top.ICEcoder.startPosLine=d.line=e.from().line,top.ICEcoder.startPosCh=d.ch=e.from().ch,e={},e.line=top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(c,d)||d.line,e.line=e.line.to?e.line.to.line:e.line,e.ch=c.getLine(e.line).indexOf("")+top.ICEcoder.htmlTagArray[a].length+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(">",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("
\n"+b.getSelection()+ +"\n
");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&&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)+"
")},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;bCreating Folder
"+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?-1Opening File
"+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("Saving
"+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', +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("Renaming to
"+b),top.ICEcoder.setPreviousFiles())},deleteFile:function(){var a;0Deleting File
"+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("Pasting File
"+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??????? '+c+' '+d+"";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=0c||"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&&0ICEcoder.results.length-1&&(ICEcoder.findResult=0);e.innerHTML="Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results";for(d=b=0;d'}},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add", +"lib/file-control.php?action=replaceText&fileRef="+a.replace(/\//g,"|")+"&find="+b+"&replace="+c);top.ICEcoder.serverMessage("Replacing text in
"+a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;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=ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length- +1];"JavaScript"==ICEcoder.caretLocType&&(ICEcoder.tagString="script");if(a&&!top.ICEcoder.dontUpdateNest&&(ICEcoder.nestDisplayText.innerHTML="",ICEcoder.nestDisplay.innerHTML="","undefined"!=typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]&&(a=ICEcoder.openFiles[ICEcoder.selectedTab-1],0>["js","coffee","rb","css","less"].indexOf(a.split(".")[1])&&-1==c.indexOf("include(")&&-1==c.indexOf("include_once(")&&(-1'),ICEcoder.nestDisplay.innerHTML+="'+ +ICEcoder.htmlTagArray[a]+"",ICEcoder.nestDisplay.innerHTML+=a':"
';"undefined"!=typeof b.curState&& +0'+(b.curState.tagName?b.curState.tagName:"content")+"")}}},updateNestingIndicator:function(){var a,b,c;a=ICEcoder.getcMInstance();b=!0;c=ICEcoder.openFiles[ICEcoder.selectedTab-1];a&&(c&&-1==["js","coffee","rb","css","less"].indexOf(c.split(".")[1]))&&(b="error"!=a.getTokenAt({line:a.lineCount(),ch:a.lineInfo(a.lineCount()- +1).text.length}).className?!0:!1);ICEcoder.nestValid.style.background=b?"#0b0":"#f00";ICEcoder.nestValid.innerHTML=b?"Nesting OK":"Nesting Broken"},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getValue();c=a.getCursor().line;a=a.getCursor().ch;for(var e=d=0;ea.lastIndexOf("\x3c/script>")&&"Unknown"==b?b="JavaScript":a.lastIndexOf("a.lastIndexOf("?>")&&"Unknown"==b?b="PHP":a.lastIndexOf("<%")>a.lastIndexOf("%>")&&"Unknown"==b?b="Ruby":a.lastIndexOf("<")>a.lastIndexOf(">")&&"Unknown"==b?b="HTML":"Unknown"==b&&(b="Content");a=ICEcoder.openFiles[ICEcoder.selectedTab- +1];0c||19c||40c||36c||123=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&&(a=window.innerWidth?window.innerHeight:document.body.clientHeight,top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseXd.index+d[0].length;);(b=top.document.getElementById("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.document.getElementById("header").appendChild(b),a.addWidget(a.getCursor(),top.document.getElementById("cssColor"),!0))},showColorPicker:function(a){top.document.getElementById("blackMask").style.visibility="visible";top.document.getElementById("mediaContainer").innerHTML='


'; +farbtastic("picker","color");a&&top.document.getElementById("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b=document.getElementById("canvasPicker").getContext("2d"),c=new Image;c.src=a.src;c.onload=function(){document.getElementById("canvasPicker").width=a.width;document.getElementById("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};document.getElementById("canvasPicker").onmousemove=function(a){var c=b.getImageData(a.pageX-this.offsetLeft,a.pageY-this.offsetTop, +1,1).data;a=c[0];var f=c[1],g=c[2],c=a+","+f+","+g;a=top.ICEcoder.rgbToHex(a,f,g);document.getElementById("rgbMouseXY").value=c;document.getElementById("hexMouseXY").value="#"+a;document.getElementById("hexMouseXY").style.backgroundColor=document.getElementById("rgbMouseXY").style.backgroundColor="#"+a};document.getElementById("canvasPicker").onclick=function(){document.getElementById("rgb").value=document.getElementById("rgbMouseXY").value;document.getElementById("hex").value=document.getElementById("hexMouseXY").value; +document.getElementById("hex").style.backgroundColor=document.getElementById("rgb").style.backgroundColor=document.getElementById("hex").value}},rgbToHex:function(a,b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789ABCDEF".charAt((a-a%16)/16)+"0123456789ABCDEF".charAt(a%16)},insertColorValue:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getTokenAt(a.getCursor()); +a.replaceRange(top.document.getElementById("color").value,{line:a.getCursor().line,ch:b.start},{line:a.getCursor().line,ch:b.end})},fMIconVis:function(a,b){var c;if(c=top.document.getElementById(a))c.style.opacity=b},isOpen:function(a){a=a.replace(/\|/g,"/").replace(top.docRoot+top.iceRoot,"");a=top.ICEcoder.openFiles.indexOf(a);return-1!=a?a:!1},updateHints:function(){var a;if("undefined"!=typeof JSHINT&&-1Cancelled tasks');setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g, +"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a)},autoOpenFiles:function(){if(0';top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},propertiesScreen:function(a){top.document.getElementById("mediaContainer").innerHTML=''; +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)? +"#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;dchMod "+b+" on
"+a.replace(top.iceRoot,""))},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=ICEcoder.getcMInstance()){ICEcoder.switchMode(); +for(var d=0;d '+ +a.slice(a.lastIndexOf("/")).replace(/\//,"");top.document.getElementById("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.changedContent.push(0);top.ICEcoder.setPreviousFiles()},nextTab:function(){top.ICEcoder.switchTab(top.ICEcoder.selectedTab+1<=top.ICEcoder.openFiles.length? +top.ICEcoder.selectedTab+1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<=top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.document.getElementById("tab"+a).innerHTML=' '+ +c.slice(c.lastIndexOf("/")).replace(/\//,"");top.document.getElementById("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.changedContent.length;d++){document.getElementById("tab"+d).childNodes[0]&&(document.getElementById("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=1==ICEcoder.changedContent[d-1]?"#b00":"transparent");b=d==a?"#000":"#fff";if("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?"#49d":"rgba(255,255,255,0.15)";document.getElementById("tab"+d).style.color=b;b=d==a?-22:0;document.getElementById("tab"+d).style.backgroundPosition="0 "+b+"px"}top.ICEcoder.fMIconVis("fMSave",1==ICEcoder.changedContent[a-1]?1:0.3)},closeTab:function(a,b){var c;ICEcoder.getcMInstance();c=!0;1==ICEcoder.changedContent[a-1]&&(c=top.ICEcoder.ask("You have made changes.\n\nAre you sure you want to close without saving?")); +if(c){c=top.ICEcoder.openFiles[a-1];for(var d=a;db?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?41:parseInt(top.document.getElementById("tab"+g).style.left,10),f=0==g?0:parseInt(top.document.getElementById("tab"+ +g).style.width,10)+18,a?d=-18:(top.document.getElementById("tab"+(g+1)).style.left=e+f+"px",top.document.getElementById("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.document.getElementById("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)+41+18))%150;top.document.getElementById("tab"+a).style.zIndex= +2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.document.getElementById("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.document.getElementById("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=41<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.document.getElementById("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.document.getElementById("newTab").style.left,10)-a:41; +top.document.getElementById("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.document.getElementById("tab"+c).style.opacity=c==top.ICEcoder.draggingTab?1:0.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.document.getElementById("tab"+c).className="tab",top.document.getElementById("tab"+ +c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.document.getElementById("tab"+c).style.zIndex=1:setTimeout(function(){top.document.getElementById("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.changedContent,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances];c=[[],[],[],[]];for(var e=0;e