diff --git a/lib/ice-coder.js b/lib/ice-coder.js index a2c9dc9..238a29c 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -57,7 +57,7 @@ var ICEcoder = { // On load, set the layout and get the nest location init: function() { - var autoOpenInt, screenIcon, sISrc; + var screenIcon, sISrc; // Set layout & the nest location ICEcoder.setLayout(); @@ -831,21 +831,36 @@ var ICEcoder = { // Show menu on right clicking in file manager showMenu: function(evt) { - var menuType; + var menuType, menuHeight, winH, fmYPos; if ( top.ICEcoder.selectedFiles.length == 0 || top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.rightClickedFile.replace(/\//g,"|")) == -1) { top.ICEcoder.selectFileFolder(evt); } + menuHeight = 124+5; // general options height in px plus 5px space + winH = window.innerHeight; if ("undefined" != typeof top.ICEcoder.thisFileFolderLink && top.ICEcoder.thisFileFolderLink!="") { menuType = top.ICEcoder.selectedFiles[0].indexOf(".")>-1 ? "file" : "folder"; top.get('folderMenuItems').style.display = menuType == "folder" && top.ICEcoder.selectedFiles.length == 1 ? "block" : "none"; + if (menuType == "folder" && top.ICEcoder.selectedFiles.length == 1) { + menuHeight += 20+20+1+23+1+2; // new file, new folder, hr, upload files(s), hr, padding + if (top.get('fmMenuPasteOption').style.display == "block") { + menuHeight += 19; + } + } top.get('singleFileMenuItems').style.display = top.ICEcoder.selectedFiles.length > 1 ? "none" : "block"; + if (top.ICEcoder.selectedFiles.length == 1) { + menuHeight += 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"; - top.get('fileMenu').style.top = (top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10) + "px"; + fmYPos = top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10; + if (fmYPos+menuHeight > winH) { + fmYPos -= (fmYPos+menuHeight-winH); + } + top.get('fileMenu').style.top = fmYPos + "px"; } return false; }, @@ -1179,7 +1194,7 @@ var ICEcoder = { }, // Indicate if the nesting structure of the code is OK - updateNestingIndicator: function () { + updateNestingIndicator: function() { var cM, nestOK, fileName; cM = ICEcoder.getcMInstance(); @@ -1194,16 +1209,14 @@ var ICEcoder = { // Get the caret position getCaretPosition: function() { - var cM, content, line, ch, chPos, chCount; + var cM, line, ch, chPos; cM = ICEcoder.getcMInstance(); - content = cM.getValue(); line = cM.getCursor().line; ch = cM.getCursor().ch; chPos = 0; for (var i=0;i0) {caretLocType="JavaScript"} - else if (fileName.indexOf(".coffee")>0) {caretLocType="CoffeeScript"} - else if (fileName.indexOf(".py")>0) {caretLocType="Python"} - else if (fileName.indexOf(".rb")>0) {caretLocType="Ruby"} - else if (fileName.indexOf(".css")>0) {caretLocType="CSS"} - else if (fileName.indexOf(".less")>0) {caretLocType="LESS"} - else if (fileName.indexOf(".md")>0) {caretLocType="Markdown"}; + else if (fileName.indexOf(".coffee")>0) {caretLocType="CoffeeScript"} + else if (fileName.indexOf(".py")>0) {caretLocType="Python"} + else if (fileName.indexOf(".rb")>0) {caretLocType="Ruby"} + else if (fileName.indexOf(".css")>0) {caretLocType="CSS"} + else if (fileName.indexOf(".less")>0) {caretLocType="LESS"} + else if (fileName.indexOf(".md")>0) {caretLocType="Markdown"}; } ICEcoder.caretLocType = caretLocType; @@ -1288,7 +1301,7 @@ var ICEcoder = { // Get the mouse position getMouseXY: function(e,area) { - var tempX, tempY, scrollTop; + var tempX, tempY; top.ICEcoder.mouseX = e.pageX ? e.pageX : e.clientX + document.body.scrollLeft; top.ICEcoder.mouseY = e.pageY ? e.pageY : e.clientY + document.body.scrollTop; @@ -1305,8 +1318,9 @@ var ICEcoder = { // Test if we need to show a drag cursor or not dragCursorTest: function() { - var winH, cursorName, diffX, zone; + var diffX, winH, cursorName, zone; + // Dragging tabs, started after dragging for 10px from origin diffX = top.ICEcoder.mouseX - top.ICEcoder.diffStartX; if (top.ICEcoder.draggingTab!==false && top.ICEcoder.diffStartX && (diffX <= -10 || diffX >= 10)) { if (top.ICEcoder.mouseX > parseInt(top.ICEcoder.files.style.width,10)) { @@ -1315,8 +1329,9 @@ var ICEcoder = { } } + // Dragging file manager, possible within 7px of file manager edge if (top.ICEcoder.ready) { - winH = window.innerWidth ? window.innerHeight : document.body.clientHeight; + winH = window.innerHeight; if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false}; cursorName = (!ICEcoder.draggingTab && ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW)) @@ -1324,8 +1339,8 @@ var ICEcoder = { : "auto"; if (top.ICEcoder.content.contentWindow.document && top.ICEcoder.filesFrame.contentWindow) { top.document.body.style.cursor = cursorName; - if (zone = top.ICEcoder.content.contentWindow.document.body) {zone.style.cursor = cursorName}; - if (zone = top.ICEcoder.filesFrame.contentWindow.document.body) {zone.style.cursor = cursorName}; + if (zone = top.ICEcoder.content.contentWindow.document.body) {zone.style.cursor = cursorName}; + if (zone = top.ICEcoder.filesFrame.contentWindow.document.body) {zone.style.cursor = cursorName}; } } }, @@ -1376,10 +1391,10 @@ var ICEcoder = { showColorPicker: function(color) { top.get('blackMask').style.visibility = "visible"; top.get('mediaContainer').innerHTML = '


'+ - ''+ - '
'+ - ''+ - ''; + ''+ + '
'+ + ''+ + ''; farbtastic('picker','color'); if (color) { top.get('picker').farbtastic.setColor(color); @@ -1438,7 +1453,7 @@ var ICEcoder = { n = parseInt(n,10); if (isNaN(n)) return "00"; n = Math.max(0,Math.min(n,255)); - return "0123456789abcdef".charAt((n-n%16)/16) + "0123456789abcdef".charAt(n%16); + return "0123456789abcdef".charAt((n-n%16)/16) + "0123456789abcdef".charAt(n%16); }, // Insert new color value @@ -1465,6 +1480,7 @@ var ICEcoder = { file = file.replace(/\|/g, "/").replace(top.docRoot+top.iceRoot,""); i = top.ICEcoder.openFiles.indexOf(file); + // return the array position or false return i!=-1 ? i : false; }, @@ -1514,7 +1530,7 @@ var ICEcoder = { // Queue items up for processing in turn serverQueue: function(action,item) { - var cM,nextSaveID,txtArea,topSaveID,element; + var cM, nextSaveID, txtArea, topSaveID, element; cM = ICEcoder.getcMInstance(); // Firstly, work out how many saves we have to carry out @@ -1689,9 +1705,10 @@ var ICEcoder = { // Change permissions on a file/folder chmod: function(file,perms) { + file = file.replace(top.iceRoot,""); top.ICEcoder.showHide('hide',top.get('blackMask')); - top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+file.replace(top.iceRoot,"")+"&perms="+perms); - top.ICEcoder.serverMessage('chMod '+perms+' on
'+file.replace(top.iceRoot,"")); + top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+file+"&perms="+perms); + top.ICEcoder.serverMessage('chMod '+perms+' on
'+file); }, // Open/show the preview window diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index cb5770e..d9c80fa 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -33,34 +33,34 @@ c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1Renaming to
"+b),top.ICEcoder.setPreviousFiles())},deleteFiles:function(){var a;a=top.ICEcoder.selectedFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n");0Deleting File
"+a))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;dPasting File
"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message("Sorry, cannot paste a whole root");else top.ICEcoder.message("Nothing to paste, copy a file/folder first!")},duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0, -a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showMenu:function(a){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;hc||"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=top.get("filesFrame").contentWindow.document.getElementById(e),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"chmod"==a&&(e=top.ICEcoder.rightClickedFile.replace(/\|/g, -"/"),h=top.get("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),h.innerHTML=d);"delete"==a&&(h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],!1),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";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}""!=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, -"-")),"selected files"==document.findAndReplace.target.value&&(filesQS="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML='')},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||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.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= +a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.rightClickedFile.replace(/\//g, +"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=-1c&&(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){var g,l,h,k,n,p,m,q;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){g=-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;hc||"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=top.get("filesFrame").contentWindow.document.getElementById(e),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g, +"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"chmod"==a&&(e=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),h.innerHTML=d);"delete"==a&&(h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0], +!1),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";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}""!=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,"-")),"selected files"==document.findAndReplace.target.value&&(filesQS="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show", +top.get("loadingMask")),top.get("mediaContainer").innerHTML='')},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.getCursor().line;c=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.innerHeight,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,l,h,k,n,p;b=top.get("canvasPicker").getContext("2d");c=new Image;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.get("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];l=f[1];h=f[2];k=g+","+l+","+h;n=top.ICEcoder.rgbToHex(g, l,h);top.get("rgbMouseXY").value=k;top.get("hexMouseXY").value="#"+n;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+n;p=128>g||128>l||128>h&&200>g&&200>l&&50chMod "+b+" on
"+a.replace(top.iceRoot,""))},openPreviewWindow:function(){if(0chMod "+b+" on
"+a)},openPreviewWindow:function(){if(0