diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 4c6971f..c4a23f6 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -252,6 +252,7 @@ var ICEcoder = { : fileName.indexOf('.css')>0 ? cM.setOption("mode","css") : fileName.indexOf('.less')>0 ? cM.setOption("mode","less") : fileName.indexOf('.md')>0 ? cM.setOption("mode","markdown") + : fileName.indexOf('.xml')>0 ? cM.setOption("mode","xml") : cM.setOption("mode","application/x-httpd-php"); } }, @@ -1183,11 +1184,23 @@ var ICEcoder = { if (cM) { nestCheck = cM.getValue(); - // Set up array to store nest data + // Get the token state at our cursor state = cM.getTokenAt(cM.getCursor()).state; + cx = false; + + // XML + if ("undefined" != typeof state) { + cx = state.context; + } + // HTML if ("undefined" != typeof state.curState && "undefined" != typeof state.curState.htmlState) { - ICEcoder.htmlTagArray = []; - for (cx = state.curState.htmlState.context; cx; cx = cx.prev) { + cx = state.curState.htmlState.context; + } + + // Set up array to store nest data + ICEcoder.htmlTagArray = []; + if (cx) { + for (cx = cx; cx; cx = cx.prev) { if ("undefined" != typeof cx.tagName) { ICEcoder.htmlTagArray.unshift(cx.tagName); } @@ -1205,8 +1218,7 @@ var ICEcoder = { if ("undefined" != typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]) { fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1]; if (["js","coffee","css","less"].indexOf(fileName.split(".")[1])<0 && - (nestCheck.indexOf("include(")==-1)&&(nestCheck.indexOf("include_once(")==-1)&& - (nestCheck.indexOf("-1||nestCheck.indexOf("-1)) { + (nestCheck.indexOf("include(")==-1)&&(nestCheck.indexOf("include_once(")==-1)) { // Then for all the array items, output as the nest display for (var i=0;i' : '
'; } - if ("undefined" != typeof state.curState && ICEcoder.htmlTagArray.length > 0) { - ICEcoder.nestDisplay.innerHTML += ''+(state.curState.tagName ? state.curState.tagName : 'content')+''; + if (ICEcoder.tagString != "script") { + ICEcoder.nestDisplay.innerHTML += 'content'; } } } @@ -1296,7 +1308,8 @@ var ICEcoder = { 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(".md")>0) {caretLocType="Markdown"} + else if (fileName.indexOf(".xml")>0) {caretLocType="XML"}; } ICEcoder.caretLocType = caretLocType; diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 286efbb..18b7110 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -7,19 +7,19 @@ ICEcoder.changeFilesInt=setInterval(function(){ICEcoder.changeFilesWStep(a)},10) clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){top.ICEcoder.ready&&"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.get("fmLock");ICEcoder.lockedNav=!ICEcoder.lockedNav;a.style.backgroundPosition=ICEcoder.lockedNav?"-64px -16px":"-80px -16px"},contentCleanUp:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getValue();b=b.replace(//g,"");a.setValue(b);a.clearHistory()},moveLine:function(a){var b,c,d,e;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?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);top.ICEcoder.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")})):-1<"p a b i strong em h1 h2 h3 h4 h5 h6".split(" ").indexOf(a)&&b.getSelection().substr(0,a.length+1)=="<"+c&&b.getSelection().substr(-(a.length+3))==""?b.replaceSelection(b.getSelection().substr(b.getSelection().indexOf(">")+1,b.getSelection().length-b.getSelection().indexOf(">")-1-a.length-3)):("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)+"
")},duplicateLines:function(a){var b,c,d;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"start"),b.setSelection(c,d)):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.setLine(a,b.getLine(a)+ -"\n"+b.getLine(a)),b.setCursor(a+1,c))},removeLines:function(a){var b,c;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?b.replaceSelection(""):(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 for(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],b=0;b=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?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);top.ICEcoder.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")})):-1<"p a b i strong em h1 h2 h3 h4 h5 h6".split(" ").indexOf(a)&&b.getSelection().substr(0,a.length+1)=="<"+c&&b.getSelection().substr(-(a.length+3))==""?b.replaceSelection(b.getSelection().substr(b.getSelection().indexOf(">")+1,b.getSelection().length-b.getSelection().indexOf(">")-1-a.length-3)):("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)+"
")},duplicateLines:function(a){var b,c,d;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"start"),b.setSelection(c,d)):(a|| +(a=b.getCursor().line),c=b.getCursor().ch,b.setLine(a,b.getLine(a)+"\n"+b.getLine(a)),b.setCursor(a+1,c))},removeLines:function(a){var b,c;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?b.replaceSelection(""):(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 for(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],b=0;be.replace(/\d+/g,g)?c:e;if(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",0';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=f;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}f.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=d&&c?(f=b=a="","and"== document.findAndReplace.connector.value&&(a="&replace="+e),0<=document.findAndReplace.target.value.indexOf("file")&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),"selected files"==document.findAndReplace.target.value&&(f="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),d=d.replace(/\'/g,"'"),d!=encodeURIComponent(d)?d="ICEcoder:"+encodeURIComponent(d):d,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML=''):(f.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.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='



'; +a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;d=!1;"undefined"!=typeof b&&(d=b.context);"undefined"!=typeof b.curState&&"undefined"!=typeof b.curState.htmlState&&(d=b.curState.htmlState.context);ICEcoder.htmlTagArray=[];if(d)for(;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(")))){for(a=0;a'),ICEcoder.nestDisplay.innerHTML+="'+ICEcoder.htmlTagArray[a]+"",ICEcoder.nestDisplay.innerHTML+=a':"
';"script"!=ICEcoder.tagString&&(ICEcoder.nestDisplay.innerHTML+='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&&50