From 51aa38764a5881873c9b253eff7d3eb94e992200 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 30 Jun 2013 11:54:31 +0100 Subject: [PATCH] Apply the linting to all JS files Cycle thru all open files, and if it's a JS file, apply or remove the linting option --- lib/ice-coder.js | 15 ++++++++++----- lib/ice-coder.min.js | 14 +++++++------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index e7a0f6b..5381e13 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1507,11 +1507,16 @@ var ICEcoder = { top.ICEcoder.cssColorPreview(); cM.focus(); - if (!top.ICEcoder.codeAssist) { - cM.clearGutter("CodeMirror-lint-markers"); - cM.setOption("lintWith",false); - } else { - cM.setOption("lintWith",top.ICEcoder.content.contentWindow.CodeMirror.javascriptValidator); + for (i=0;i-1) { + cM = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[i]]; + if (!top.ICEcoder.codeAssist) { + cM.clearGutter("CodeMirror-lint-markers"); + cM.setOption("lintWith",false); + } else { + cM.setOption("lintWith",top.ICEcoder.content.contentWindow.CodeMirror.javascriptValidator); + } + } } }, diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 4c1874d..26f0ddf 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -66,13 +66,13 @@ e,1,1).data;g=f[0];l=f[1];h=f[2];k=g+","+l+","+h;n=top.ICEcoder.rgbToHex(g,l,h); function(){document.getElementById("rgb").value=document.getElementById("rgbMouseXY").value;document.getElementById("hex").value=document.getElementById("hexMouseXY").value;document.getElementById("hex").style.backgroundColor=document.getElementById("rgb").style.backgroundColor=document.getElementById("hex").value;document.getElementById("hex").style.color=document.getElementById("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=b.getTokenAt(b.getCursor());b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,ch:c.end})},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){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; -a=ICEcoder.getcMInstance();top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.ICEcoder.cssColorPreview();a.focus();top.ICEcoder.codeAssist?a.setOption("lintWith",top.ICEcoder.content.contentWindow.CodeMirror.javascriptValidator):(a.clearGutter("CodeMirror-lint-markers"),a.setOption("lintWith",!1))},serverQueue:function(a,b){var c,d,e;c=ICEcoder.getcMInstance();for(e=d=0;eCancelled tasks');setTimeout(function(){top.ICEcoder.serverMessage()}, -2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a)},autoOpenFiles:function(){if(0');top.ICEcoder.showHide(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,l,h){var k;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");k=document.createElement("link");k.setAttribute("rel","stylesheet");k.setAttribute("type","text/css");k.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(k); +a=ICEcoder.getcMInstance();top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.ICEcoder.cssColorPreview();a.focus();for(i=0;iCancelled tasks');setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a)},autoOpenFiles:function(){if(0'); +top.ICEcoder.showHide(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,l,h){var k;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");k=document.createElement("link");k.setAttribute("rel","stylesheet");k.setAttribute("type","text/css");k.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(k); 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=l;for(d=0;d