Set drag data using new func on dragstart (FF need)

This commit is contained in:
Matt Pass
2016-03-18 22:10:18 +00:00
parent 2bbc2f5628
commit 891a4c2b8c
2 changed files with 40 additions and 33 deletions

View File

@@ -1785,6 +1785,7 @@ var ICEcoder = {
newLI = document.createElement("li");
newLI.className = cssStyle;
newLI.draggable = false;
newLI.ondragstart = function(event) {top.ICEcoder.addDefaultDragData(this,event)};
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}};
newLI.ondragend = function() {top.ICEcoder.dropFile(this)};
newLI.innerHTML = innerLI
@@ -1806,6 +1807,7 @@ var ICEcoder = {
newLI = document.createElement("li");
newLI.className = cssStyle;
newLI.draggable = false;
newLI.ondragstart = function(event) {top.ICEcoder.addDefaultDragData(this,event)};
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}};
newLI.ondragend = function() {top.ICEcoder.dropFile(this)};
newLI.innerHTML = innerLI;
@@ -1926,6 +1928,11 @@ var ICEcoder = {
top.ICEcoder.draggingWithKey = evt.ctrlKey||top.ICEcoder.cmdKey ? "CTRL" : false;
},
// Add default drag data (dragging in Firefox on DOM elems not possible otherwise)
addDefaultDragData: function(elem,evt) {
evt.dataTransfer.setData('Text', elem.id);
},
// On dropping a file, do something
dropFile: function(elem) {
var filePath, tgtPath;

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

@@ -71,38 +71,38 @@ b.onreadystatechange=function(){4==b.readyState&&(200==b.status?(c=JSON.parse(b.
console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)):eval(c.action.doNext)):(top.ICEcoder.message(top.t["Sorry there was..."]),console.log("ICEcoder error info for your request..."),console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))};b.open("POST","lib/file-control-xhr.php?action=checkExists&csrf="+top.ICEcoder.csrf,!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");d=(new Date).getTime();b.send("timeStart="+d+"&file="+
a.replace(/\+/g,"%2B"))},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=this.isPathFolder(top.ICEcoder.selectedFiles[0])?"folder":"file",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?
"block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display="inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-
10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){var k,h,l,p,n,m,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,"|"));l=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+
10,b+a>c&&(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='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+
g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" "+("folder"==g?"ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\"":"")+' onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {'+("folder"==g?"top.ICEcoder.openCloseDir(this,"+("folder"==g?"true":"false")+");":"")+' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="'+
b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+n+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(!l||3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m,l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?
top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m),l.nextSibling.appendChild(p);else for(h=0;h<l.childNodes.length;h++)if(l.childNodes[h].className&&(m=0<l.childNodes[h].className.indexOf("directory")?"folder":"file",q=l.childNodes[h].getElementsByTagName("span")[0].innerHTML,m==g&&q>c||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className=
k;m.draggable=!1;m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragend=function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;h==l.childNodes.length-1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[h]),l.insertBefore(p,l.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms",top.ICEcoder.renameInChildren(h,e,b,c));"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",e.substr(0,
e.lastIndexOf("/")),c));"chmod"==a&&(f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(f.replace(/\//g,"|")+"_perms"),h.style.background=777==d?"#800":"none",h.style.color=777==d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode,
top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},renameInChildren:function(a,b,c,d){var e,f;if(a.parentNode.parentNode.nextSibling&&"UL"==a.parentNode.parentNode.nextSibling.nodeName){a=a.parentNode.parentNode.nextSibling;for(var g=0;g<a.childNodes.length;g++)"LI"==a.childNodes[g].nodeName&&(e=a.childNodes[g].childNodes[0].childNodes[1],e.id=e.id.replace(b.replace(/\//g,"|"),c.replace(/\//g,"|")+"|"+d),e.parentNode.title=e.id.replace(/\|/g,"/"),f=top.get("filesFrame").contentWindow.document.getElementById(e.id).nextSibling.nextSibling,
f.id=e.id+"_perms",top.ICEcoder.renameInChildren(e,b,c,d))}},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b||93==b)top.ICEcoder.cmdKey=
!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&setTimeout(function(){c="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),
top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1},findReplaceOptions:function(){top.get("rText").style.display=top.get("replace").style.display=top.get("rTarget").style.display=document.findAndReplace.connector.value==top.t.and?"inline-block":"none"},findReplace:function(a,b,c,d,e){var f,g,k;if(d)top.get("find").value=top.get("find").value,top.ICEcoder.focus();else{"undefined"==typeof e&&(e=!1);a=a.toLowerCase();
f=top.get("replace").value;g=top.get("results");d=ICEcoder.getcMInstance();k=ICEcoder.getcMdiffInstance();if((d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?k:d)&&0<a.length&&document.findAndReplace.target.value==top.t["this document"]){d.getValue().toLowerCase();document.findAndReplace.connector.value==top.t.and&&c&&(document.findAndReplace.replaceAction.value==top.t.replace&&d.getSelection().toLowerCase()==a?d.replaceSelection(f,"around"):document.findAndReplace.replaceAction.value==top.t["replace all"]&&
(c=new RegExp(a,"gi"),d.setValue(d.getValue().replace(c,f))));c=d.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];ICEcoder.resultsLines=[];for(f=0;f<c.length;f++)c.substr(f,a.length)==a&&-1==ICEcoder.results.indexOf(f)&&(ICEcoder.results.push(f),-1==ICEcoder.resultsLines.indexOf(d.posFromIndex(f).line+1)&&ICEcoder.resultsLines.push(d.posFromIndex(f).line+1));ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)g.innerHTML=ICEcoder.results.length+
" results";else{if(e)for(ICEcoder.findResult="undefined"==typeof ICEcoder.findResult?ICEcoder.results.length+1:ICEcoder.results.length,f=ICEcoder.results.length-1;0<=f;f--)ICEcoder.results[f]>d.indexFromPos({ch:d.getCursor().ch-1,line:d.getCursor().line})&&ICEcoder.findResult--;else for(f=ICEcoder.findResult=0;f<ICEcoder.results.length;f++)ICEcoder.results[f]<d.indexFromPos({ch:d.getCursor().ch+1,line:d.getCursor().line})&&ICEcoder.findResult++;!e&&ICEcoder.findResult>ICEcoder.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<ICEcoder.resultsLines.indexOf(f)?d.getCursor().line+1==f?"#b00":"#888":"transparent",e+='<div style="position: absolute; display: block; width: 5px; height:'+a+"px; background: "+g+"; top: "+parseInt(a*(f-1)+b,10)+'px"></div>';
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,"&#39;"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+d+b+e+"&csrf="+top.ICEcoder.csrf+
'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'):(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("<b>"+
top.t["Replacing text in"]+"</b><br>"+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;c=a.getCursor().ch;for(var e=d=0;e<b;e++)d+=a.getLine(e).length+1;ICEcoder.caretPos=d+c-1},updateCharDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=
ICEcoder.caretLocType+", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateVersionsDisplay:function(){var a=top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1];get("versionsDisplay").innerHTML="undefined"!=typeof a?top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+" backup"+(1!=a?"s":""):""},updateByteDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.byteDisplay.innerHTML=a.getValue().length.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
",")+" bytes"},showDisplay:function(a){top.ICEcoder.byteDisplay.style.display="byte"==a?"inline-block":"none";top.ICEcoder.charDisplay.style.display="char"==a?"inline-block":"none"},showHide:function(a,b){b.style.visibility="show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow[isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1]]},getcMdiffInstance:function(a){return top.ICEcoder.content.contentWindow[(isNaN(a)?
"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1])+"diff"]},getMouseXY:function(a,b){top.ICEcoder.mouseX=a.pageX?a.pageX:a.clientX+document.body.scrollLeft;top.ICEcoder.mouseY=a.pageY?a.pageY:a.clientY+document.body.scrollTop;top.ICEcoder.area=b;"top"!=b&&(top.ICEcoder.mouseY+=70);"editor"==b&&(top.ICEcoder.mouseX+=top.ICEcoder.filesW);top.ICEcoder.dragCursorTest();62<top.ICEcoder.mouseY&&top.ICEcoder.setTabWidths()},
dragCursorTest:function(){var a,b;a=top.ICEcoder.mouseX-top.ICEcoder.diffStartX;!1!==top.ICEcoder.draggingTab&&top.ICEcoder.diffStartX&&(-10>=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<top.ICEcoder.filesW+7||top.ICEcoder.draggingFilesW)?"w-resize":"auto",top.ICEcoder.content.contentWindow.document&&top.ICEcoder.filesFrame.contentWindow)){top.document.body.style.cursor=a;if(b=top.ICEcoder.content.contentWindow.document.body)b.style.cursor=a;if(b=top.ICEcoder.filesFrame.contentWindow.document.body)b.style.cursor=a}},serverMessage:function(a){var b;b=top.get("serverMessage");a?(b.innerHTML=top.ICEcoder.xssClean(a).replace(/\&lt;b\&gt;/g,"<b>").replace(/\&lt;\/b\&gt;/g,
"</b>").replace(/\&lt;br\&gt;/g,"<br>"),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=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a){b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=c.exec(b))&&a.getCursor().ch>d.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='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'color\').value)" value="insert &gt;" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'colorRGB\').value)" value="insert &gt;" class="insertColorValue">';
b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+n+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";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.ondragend=function(){top.ICEcoder.dropFile(this)},l.innerHTML=n,m.nextSibling.appendChild(l),m.nextSibling.appendChild(p);else for(h=0;h<m.childNodes.length;h++)if(m.childNodes[h].className&&(l=0<m.childNodes[h].className.indexOf("directory")?"folder":"file",q=m.childNodes[h].getElementsByTagName("span")[0].innerHTML,l==g&&q>c||"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.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;g<a.childNodes.length;g++)"LI"==a.childNodes[g].nodeName&&(e=a.childNodes[g].childNodes[0].childNodes[1],e.id=e.id.replace(b.replace(/\//g,
"|"),c.replace(/\//g,"|")+"|"+d),e.parentNode.title=e.id.replace(/\|/g,"/"),f=top.get("filesFrame").contentWindow.document.getElementById(e.id).nextSibling.nextSibling,f.id=e.id+"_perms",top.ICEcoder.renameInChildren(e,b,c,d))}},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",
top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b||93==b)top.ICEcoder.cmdKey=!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},addDefaultDragData:function(a,b){b.dataTransfer.setData("Text",a.id)},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&
setTimeout(function(){c="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1},findReplaceOptions:function(){top.get("rText").style.display=top.get("replace").style.display=
top.get("rTarget").style.display=document.findAndReplace.connector.value==top.t.and?"inline-block":"none"},findReplace:function(a,b,c,d,e){var f,g,k;if(d)top.get("find").value=top.get("find").value,top.ICEcoder.focus();else{"undefined"==typeof e&&(e=!1);a=a.toLowerCase();f=top.get("replace").value;g=top.get("results");d=ICEcoder.getcMInstance();k=ICEcoder.getcMdiffInstance();if((d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?k:d)&&0<a.length&&document.findAndReplace.target.value==top.t["this document"]){d.getValue().toLowerCase();
document.findAndReplace.connector.value==top.t.and&&c&&(document.findAndReplace.replaceAction.value==top.t.replace&&d.getSelection().toLowerCase()==a?d.replaceSelection(f,"around"):document.findAndReplace.replaceAction.value==top.t["replace all"]&&(c=new RegExp(a,"gi"),d.setValue(d.getValue().replace(c,f))));c=d.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];ICEcoder.resultsLines=[];for(f=0;f<c.length;f++)c.substr(f,a.length)==a&&-1==ICEcoder.results.indexOf(f)&&
(ICEcoder.results.push(f),-1==ICEcoder.resultsLines.indexOf(d.posFromIndex(f).line+1)&&ICEcoder.resultsLines.push(d.posFromIndex(f).line+1));ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)g.innerHTML=ICEcoder.results.length+" results";else{if(e)for(ICEcoder.findResult="undefined"==typeof ICEcoder.findResult?ICEcoder.results.length+1:ICEcoder.results.length,f=ICEcoder.results.length-1;0<=f;f--)ICEcoder.results[f]>d.indexFromPos({ch:d.getCursor().ch-1,line:d.getCursor().line})&&ICEcoder.findResult--;
else for(f=ICEcoder.findResult=0;f<ICEcoder.results.length;f++)ICEcoder.results[f]<d.indexFromPos({ch:d.getCursor().ch+1,line:d.getCursor().line})&&ICEcoder.findResult++;!e&&ICEcoder.findResult>ICEcoder.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<ICEcoder.resultsLines.indexOf(f)?d.getCursor().line+1==f?"#b00":"#888":"transparent",e+='<div style="position: absolute; display: block; width: 5px; height:'+a+"px; background: "+g+"; top: "+parseInt(a*(f-1)+b,10)+'px"></div>';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,"&#39;"),a!=encodeURIComponent(a)?a=
"ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+d+b+e+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'):(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("<b>"+top.t["Replacing text in"]+"</b><br>"+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;c=a.getCursor().ch;for(var e=d=0;e<b;e++)d+=a.getLine(e).length+1;ICEcoder.caretPos=
d+c-1},updateCharDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=ICEcoder.caretLocType+", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateVersionsDisplay:function(){var a=top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1];get("versionsDisplay").innerHTML="undefined"!=typeof a?top.ICEcoder.openFileVersions[ICEcoder.selectedTab-
1]+" backup"+(1!=a?"s":""):""},updateByteDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.byteDisplay.innerHTML=a.getValue().length.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")+" bytes"},showDisplay:function(a){top.ICEcoder.byteDisplay.style.display="byte"==a?"inline-block":"none";top.ICEcoder.charDisplay.style.display="char"==a?"inline-block":"none"},showHide:function(a,b){b.style.visibility=
"show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow[isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1]]},getcMdiffInstance:function(a){return top.ICEcoder.content.contentWindow[(isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1])+"diff"]},getMouseXY:function(a,b){top.ICEcoder.mouseX=
a.pageX?a.pageX:a.clientX+document.body.scrollLeft;top.ICEcoder.mouseY=a.pageY?a.pageY:a.clientY+document.body.scrollTop;top.ICEcoder.area=b;"top"!=b&&(top.ICEcoder.mouseY+=70);"editor"==b&&(top.ICEcoder.mouseX+=top.ICEcoder.filesW);top.ICEcoder.dragCursorTest();62<top.ICEcoder.mouseY&&top.ICEcoder.setTabWidths()},dragCursorTest:function(){var a,b;a=top.ICEcoder.mouseX-top.ICEcoder.diffStartX;!1!==top.ICEcoder.draggingTab&&top.ICEcoder.diffStartX&&(-10>=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<top.ICEcoder.filesW+7||top.ICEcoder.draggingFilesW)?"w-resize":"auto",top.ICEcoder.content.contentWindow.document&&top.ICEcoder.filesFrame.contentWindow)){top.document.body.style.cursor=
a;if(b=top.ICEcoder.content.contentWindow.document.body)b.style.cursor=a;if(b=top.ICEcoder.filesFrame.contentWindow.document.body)b.style.cursor=a}},serverMessage:function(a){var b;b=top.get("serverMessage");a?(b.innerHTML=top.ICEcoder.xssClean(a).replace(/\&lt;b\&gt;/g,"<b>").replace(/\&lt;\/b\&gt;/g,"</b>").replace(/\&lt;br\&gt;/g,"<br>"),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=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a){b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=c.exec(b))&&a.getCursor().ch>d.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='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'color\').value)" value="insert &gt;" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'colorRGB\').value)" value="insert &gt;" class="insertColorValue">';
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,l,p,n,m,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;l=top.ICEcoder.rgbToHex(f,g,k);top.get("rgbMouseXY").value=h;top.get("hexMouseXY").value="#"+l;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+l;p=128>f||128>g||128>k&&200>f&&200>g&&50<k?"#fff":"#000";top.get("hexMouseXY").style.color=
top.get("rgbMouseXY").style.color=p;n=get("floatingContainer");n.style.left=top.ICEcoder.mouseX+20+"px";n.style.top=top.ICEcoder.mouseY+"px";m=-(a.naturalWidth/a.width*c*5)+25;q=-(a.naturalHeight/a.height*d*5)+25;n.style.backgroundPosition=m+"px "+q+"px"};top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"};top.get("canvasPicker").onclick=function(){top.get("rgb").value=
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<k?"#fff":"#000";top.get("hexMouseXY").style.color=
top.get("rgbMouseXY").style.color=p;n=get("floatingContainer");n.style.left=top.ICEcoder.mouseX+20+"px";n.style.top=top.ICEcoder.mouseY+"px";l=-(a.naturalWidth/a.width*c*5)+25;q=-(a.naturalHeight/a.height*d*5)+25;n.style.backgroundPosition=l+"px "+q+"px"};top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"};top.get("canvasPicker").onclick=function(){top.get("rgb").value=
top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=p}},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(a){var b,
c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;c=b.getTokenAt(b.getCursor());b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,ch:1E6})},fMIconVis:function(a,b){var c;if(c=top.get(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},startPluginIntervals:function(a,b,c,d){-1<b.indexOf("?")&&(b=b+"&csrf="+
top.ICEcoder.csrf);top.ICEcoder["plugTimer"+a]=-1<["_parent","_top","_self",""].indexOf(c)?top.ICEcoder["plugTimer"+a]=setInterval("window.location='"+b+"'",6E4*d):0==c.indexOf("fileControl")?top.ICEcoder["plugTimer"+a]=setInterval(function(){top.ICEcoder.serverQueue("add",b);top.ICEcoder.serverMessage(c.split(":")[1])},6E4*d):top.ICEcoder["plugTimer"+a]=setInterval("window.open('"+b+"','"+c+"')",6E4*d);top.ICEcoder.pluginIntervalRefs.push(a)},codeAssistToggle:function(){var a,b;top.ICEcoder.codeAssist=
@@ -120,13 +120,13 @@ top.ICEcoder.showHide("show",top.get("blackMask"))},versionsScreen:function(a,b)
top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},pluginsManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/plugins-manager.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';top.ICEcoder.showHide("show",
top.get("blackMask"))},githubAction:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/github.php?action='+a+"&selectedFiles="+top.ICEcoder.selectedFiles.join(";")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 340px; height: 340px"></iframe>';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='<iframe src="lib/github-manager.php" class="whiteGlow" style="width: 660px; height: 450px"></iframe>',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,l,p,n,m,q,u,v,w,x){var r,t=a.slice(0,a.lastIndexOf("?")),t=t.slice(t.lastIndexOf("/")+1,t.lastIndexOf("."));
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,v,w,x){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.indentWithTabs=h;top.ICEcoder.indentSize=p;top.ICEcoder.indentAuto=l;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+
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.indentWithTabs=h;top.ICEcoder.indentSize=p;top.ICEcoder.indentAuto=m;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+
ICEcoder.cMInstances[f]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("tabSize",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].refresh(),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+
ICEcoder.cMInstances[f]+"diff"].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("tabSize",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].refresh();d!=top.ICEcoder.tagWrapperCommand&&(top.ICEcoder.tagWrapperCommand=d);e!=top.ICEcoder.autoComplete&&(top.ICEcoder.autoComplete=
e);top.get("plugins").style.left="left"==n?"0":"auto";top.get("plugins").style.right="right"==n?"0":"auto";top.ICEcoder.bugFilePaths=m;top.ICEcoder.bugFileCheckTimer=q;top.ICEcoder.bugFileMaxLines=u;""!=top.ICEcoder.bugFilePaths[0]?top.ICEcoder.startBugChecking():"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt);top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();top.ICEcoder.githubAuthTokenSet=v;top.ICEcoder.updateDiffOnSave=w;x&&top.ICEcoder.refreshFileManager()},
e);top.get("plugins").style.left="left"==n?"0":"auto";top.get("plugins").style.right="right"==n?"0":"auto";top.ICEcoder.bugFilePaths=l;top.ICEcoder.bugFileCheckTimer=q;top.ICEcoder.bugFileMaxLines=u;""!=top.ICEcoder.bugFilePaths[0]?top.ICEcoder.startBugChecking():"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt);top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();top.ICEcoder.githubAuthTokenSet=v;top.ICEcoder.updateDiffOnSave=w;x&&top.ICEcoder.refreshFileManager()},
updateResultsDisplay:function(a){ICEcoder.findReplace(top.get("find").value,!0,!1);top.get("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+"&csrf="+top.ICEcoder.csrf},downloadFile:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/download.php?file="+a+"&csrf="+top.ICEcoder.csrf},chmod:function(a,b){a=a.replace(top.iceRoot,"");top.ICEcoder.showHide("hide",
top.get("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=perms&perms="+b+"&csrf="+top.ICEcoder.csrf,a.replace(/\+/g,"%2B"));top.ICEcoder.serverMessage("<b>chMod "+b+" on </b><br>"+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;d=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];a=d.substr(d.lastIndexOf("/")+1);e=a.substr(a.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?