diff --git a/lib/ice-coder.js b/lib/ice-coder.js index b63acb1..2f34344 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -676,12 +676,15 @@ var ICEcoder = { // Save a file saveFile: function(saveAs) { - var saveType, filePath; + var saveType, filePath, pathPrefix; saveType = saveAs ? "saveAs" : "save"; filePath = ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|"); if (filePath=="|[NEW]" && top.ICEcoder.selectedFiles.length>0) { - filePath = top.ICEcoder.selectedFiles[0]+filePath; + pathPrefix = top.ICEcoder.selectedFiles[0]; + filePath = pathPrefix.lastIndexOf(".") == -1 || pathPrefix.lastIndexOf(".") < pathPrefix.lastIndexOf("|") + ? pathPrefix+filePath + : "|[NEW]"; } filePath = filePath.replace("||","|"); top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+filePath+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+saveType); diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 361f184..345053b 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -8,64 +8,64 @@ b-this.filesW+"px",ICEcoder.content.style.height=c-40-30-21-28+"px",setTimeout(f !1:!0;a.style.backgroundPosition=ICEcoder.lockedNav?"-64px -16px":"-80px -16px"},contentCleanUp:function(){var a,b;0>["js","coffee","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= +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?top.ICEcoder.dontSelect=!1:c.setSelection(d,e),c.scrollIntoView(d))}},setPosition:function(a,b,c){var d;d=ICEcoder.getcMInstance();c=d.getLine(b).indexOf(">",d.getLine(b).indexOf("<"+c))+1;d.setCursor(b,c);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+"= function",b+" =function",b+" = function",b+"=new function",b+"= new function",b+" =new function",b+" = new function","window['"+b+"']",'window["'+b+'"]',"this['"+b+"']",'this["'+b+'"]',b+":",b+" :","def "+ -b,"class "+b];for(b=0;be?c:e,0c&&!("LI"!=d.childNodes[c].nodeName&&c++,b=d.childNodes[c].childNodes[0].childNodes[1],b.id==f&&(a=!0),!0==a&&-1==top.ICEcoder.selectedFiles.indexOf(b.id)&&(ICEcoder.selectDeselectFile("select", -b),top.ICEcoder.selectedFiles.push(b.id)),b.id==e);c+=2);else ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c);else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c);document.findAndReplace.target[2].innerHTML=!top.ICEcoder.selectedFiles[0]?"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)):(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c));else if(a.shiftKey)if(a=!1,d=b.parentNode.parentNode.parentNode,e=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1],f=ce?c:e,0c&&("LI"!=d.childNodes[c].nodeName&&c++,b=d.childNodes[c].childNodes[0].childNodes[1],b.id==f&&(a=!0),!0==a&&-1==top.ICEcoder.selectedFiles.indexOf(b.id)&&(ICEcoder.selectDeselectFile("select", +b),top.ICEcoder.selectedFiles.push(b.id)),b.id!=e);c+=2);else ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c);else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c);document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?"selected files":"all files";document.findAndReplace.target[3].innerHTML=top.ICEcoder.selectedFiles[0]?"selected filenames":"all filenames";top.ICEcoder.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",0Creating Folder
"+ +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=-1Creating 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;if(a=top.ICEcoder.getInput("Enter relative file path (prefixed with /) or remote URL", -""))-1Getting
"+a)},saveFile:function(a){var b;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0Saving
"+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.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.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(){top.ICEcoder.copiedFiles=[];for(var a=0;aPasting File
"+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.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(){""!=top.get("fileInput").value&& -(top.ICEcoder.showHide("show",top.get("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>j.childNodes.length)l=document.createElement("ul"),j=h.parentNode.parentNode,j.parentNode.insertBefore(l,j.nextSibling),l=document.createElement("li"),l.className=k,l.innerHTML=n,j.nextSibling.appendChild(l), -j.nextSibling.appendChild(m);else for(h=0;h<=j.childNodes.length-1;h++)if(j.childNodes[h].className&&(l=0c||"folder"==g&&"file"==l||h==j.childNodes.length-1)){l=document.createElement("li");l.className=k;l.innerHTML=n;h==j.childNodes.length-1?(j.appendChild(l),j.appendChild(m)):(j.insertBefore(l,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&&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&&"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'), +""))-1Getting
"+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==b&&0Saving
"+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.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.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.copiedFiles=[];for(a=0;aPasting File
"+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.get("uploadDir").value= +a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("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>k.childNodes.length)m=document.createElement("ul"),k=h.parentNode.parentNode,k.parentNode.insertBefore(m,k.nextSibling),m=document.createElement("li"), +m.className=l,m.innerHTML=p,k.nextSibling.appendChild(m),k.nextSibling.appendChild(n);else for(h=0;h<=k.childNodes.length-1;h++)if(k.childNodes[h].className&&(m=0c||"folder"==g&&"file"==m||h==k.childNodes.length-1)){m=document.createElement("li");m.className=l;m.innerHTML=p;h==k.childNodes.length-1?(k.appendChild(m),k.appendChild(n)):(k.insertBefore(m,k.childNodes[h]), +k.insertBefore(n,k.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(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&&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&& +"undefined"!=typeof b.curState.htmlState)for(ICEcoder.htmlTagArray=[],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'), 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","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.title=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||123c||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, +62=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.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)},drawCanvasImage:function(a){var b,c,d,e,f,g,k,h,j,m,n;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){d=a.pageX-this.offsetLeft;e=a.pageY-this.offsetTop;f=b.getImageData(d, -e,1,1).data;g=f[0];k=f[1];h=f[2];j=g+","+k+","+h;m=top.ICEcoder.rgbToHex(g,k,h);document.getElementById("rgbMouseXY").value=j;document.getElementById("hexMouseXY").value="#"+m;document.getElementById("hexMouseXY").style.backgroundColor=document.getElementById("rgbMouseXY").style.backgroundColor="#"+m;n=128>g||128>k||128>h&&200>g&&200>k&&50g||128>l||128>h&&200>g&&200>l&&50');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML=''; top.ICEcoder.showHide("show",top.get("blackMask"))},showManual:function(a){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"))},useNewSettings:function(a,b,c,d,e,f,g,k,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.get("codeAssist").checked=b;c!=top.ICEcoder.lockedNav&&top.ICEcoder.lockUnlockNav();c||(ICEcoder.changeFilesW("contract"),top.ICEcoder.hideFileMenu());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=k;for(d=0;dchMod "+b+" on
"+a.replace(top.iceRoot,""))},openPreviewWindow:function(){if(0< @@ -85,9 +85,9 @@ ICEcoder.selectedTab=ICEcoder.cMInstances.length;ICEcoder.showHide("show",ICEcod "cm-s-activeLine");ICEcoder.nextcMInstance++},createNewTab:function(){var a;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+top.ICEcoder.openFiles.length).style.display="inline-block";a=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("tab"+top.ICEcoder.openFiles.length).innerHTML=' '+ a.slice(a.lastIndexOf("/")).replace(/\//,"");top.get("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");top.ICEcoder.setTabWidths();top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);top.ICEcoder.selectedTab=top.ICEcoder.openFiles.length;top.ICEcoder.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.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.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?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab;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?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile;document.getElementById("tab"+d).style.color=b;document.getElementById("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen}top.ICEcoder.fMIconVis("fMSave",1==ICEcoder.changedContent[a- -1]?1:0.3)},closeTab:function(a,b,c){var d;a||(a=top.ICEcoder.selectedTab);ICEcoder.getcMInstance();d=!0;!c&&1==ICEcoder.changedContent[a-1]&&(d=top.ICEcoder.ask("You have made changes.\n\nAre you sure you want to close without saving?"));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;d