mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Close tag on same line needs extra adjustment + 1
This commit is contained in:
@@ -421,7 +421,7 @@ var ICEcoder = {
|
||||
|
||||
// On change
|
||||
cMonChange: function(thisCM,cMinstance,changeObj,cM) {
|
||||
var sels, rData, theTag, thisLine, thisChar, tagInfo, charDiff, repl1, repl2, thisToken, tTS, filepath, filename, fileExt;
|
||||
var sels, rData, theTag, thisLine, thisChar, tagInfo, charDiff, closeDiff, repl1, repl2, thisToken, tTS, filepath, filename, fileExt;
|
||||
|
||||
// Get the selections
|
||||
sels = thisCM.listSelections();
|
||||
@@ -462,9 +462,13 @@ var ICEcoder = {
|
||||
charDiff = thisLine == changeObj.from.line
|
||||
? changeObj.text[0].length - changeObj.removed[0].length
|
||||
: 0;
|
||||
// Also need to adjust if we're in the close tag on same line
|
||||
closeDiff = tagInfo.at == "close" && thisLine == changeObj.from.line
|
||||
? changeObj.removed[0].length - changeObj.text[0].length + 1
|
||||
: 1
|
||||
// Work out the replace from and to positions
|
||||
repl1 = {line: thisLine, ch: thisChar+charDiff+(tagInfo.at == "open" ? 2 : 1)};
|
||||
repl2 = {line: thisLine, ch: thisChar+charDiff+(tagInfo.at == "open" ? 2 : 1)+rData[0].length};
|
||||
repl1 = {line: thisLine, ch: thisChar+charDiff+(tagInfo.at == "open" ? 2 : closeDiff)};
|
||||
repl2 = {line: thisLine, ch: thisChar+charDiff+(tagInfo.at == "open" ? 2 : closeDiff)+rData[0].length};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
26
lib/ice-coder.min.js
vendored
26
lib/ice-coder.min.js
vendored
@@ -17,15 +17,15 @@ Math.ceil((ICEcoder.filesW-ICEcoder.minFilesW)/2):ICEcoder.filesW=ICEcoder.minFi
|
||||
top.ICEcoder.updateByteDisplay()},cMonCursorActivity:function(a,b){var c;top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();a.removeLineClass(top.ICEcoder["cMActiveLine"+b],"background");a.getCursor("start").line==a.getCursor().line&&(top.ICEcoder["cMActiveLine"+b]=a.addLineClass(a.getCursor().line,"background","cm-s-activeLine"));"CSS"==top.ICEcoder.caretLocType&&top.ICEcoder.cssColorPreview();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.prevLineDiff:
|
||||
top.ICEcoder.prevLine;c!=a.getCursor().line&&a.getLine(c)&&0<a.getLine(c).length&&0==a.getLine(c).replace(/\s/g,"").length&&a.replaceRange("",{line:c,ch:0},{line:c,ch:1E6});setTimeout(function(){for(var c,e=0;e<top.ICEcoder.renderLineStyle.length;e++){c=!1;if("diff"!=top.ICEcoder.renderLineStyle[e][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[e][0]&&-1<b.indexOf("diff"))c=!0;c&&a.getCursor().line+1==top.ICEcoder.renderLineStyle[e][1]?a.setOption("cursorHeight",a.defaultTextHeight()/
|
||||
a.lineInfo(a.getCursor().line).handle.height):a.setOption("cursorHeight",1)}},0)},cMonBeforeChange:function(a,b,c,d){var e,f;b=a.listSelections();for(var g=0;g<b.length;g++)e=d.findMatchingTag(a,b[g].anchor),0!==c.text[0].indexOf(">")&&"undefined"!=typeof e&&"undo"!=c.origin&&"redo"!=c.origin&&"undefined"!=typeof e.open&&"undefined"!=typeof e.close&&(f="open"==e.at?"close":"open",e=e[f].tag+";"+e[f].from.line+":"+e[f].from.ch,-1==top.ICEcoder.oppTagReplaceData.indexOf(e)&&top.ICEcoder.oppTagReplaceData.push(e))},
|
||||
cMonChange:function(a,b,c,d){var e,f,g,k,h,l,p,n,m;b=a.listSelections();top.ICEcoder.loadingFile||top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if("undefined"!=typeof top.ICEcoder.oppTagReplaceData[0])for(var q=0;q<top.ICEcoder.oppTagReplaceData.length;q++)e=top.ICEcoder.oppTagReplaceData[q].split(";"),f=e[0],g=1*e[1].split(":")[0],k=1*e[1].split(":")[1],
|
||||
b[q]&&(h=d.findMatchingTag(a,b[q].anchor)),"undefined"!=typeof h&&(f="open"==h.at?h.open.tag:h.close.tag,"undefined"!=typeof c.from&&(l=g==c.from.line?c.text[0].length-c.removed[0].length:0,p={line:g,ch:k+l+("open"==h.at?2:1)},l={line:g,ch:k+l+("open"==h.at?2:1)+e[0].length})),""!=f.trim()&&"undefined"!=typeof p&&"undefined"!=typeof l&&a.getRange(p,l)==e[0]&&(a.replaceRange(f,p,l),"close"==h.at&&(top.ICEcoder.autocompleteSkip=!0));top.ICEcoder.oppTagReplaceData=[];top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.updateNestingIndicator();top.ICEcoder.findMode&&(top.ICEcoder.results.splice(top.ICEcoder.findResult,1),top.get("results").innerHTML=top.ICEcoder.results.length+" "+top.t.results,top.ICEcoder.findMode=!1);if(c=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])n=c.substr(c.lastIndexOf("/")+1),m=n.substr(n.lastIndexOf(".")+1);top.ICEcoder.splitPane&&setTimeout(function(){top.ICEcoder.updateDiffs()},0);c&&top.ICEcoder.previewWindow.location&&
|
||||
"/[NEW]"!=c&&top.ICEcoder.updatePreviewWindow(a,c,n,m);top.ICEcoder.indicateChanges()},cMonScroll:function(a,b){var c,d,e;top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1;top.ICEcoder.splitPane&&(c=top.ICEcoder.getcMInstance(),d=top.ICEcoder.getcMdiffInstance(),e=-1<b.indexOf("diff")?c:d,c&&setTimeout(function(){e.scrollTo(a.getScrollInfo().left,a.getScrollInfo().top)},0))},cMonInputRead:function(a,b){"keypress"==top.ICEcoder.autoComplete&&top.ICEcoder.codeAssist&&!a.state.completionActive&&
|
||||
(top.ICEcoder.autocompleteSkip?top.ICEcoder.autocompleteSkip=!1:top.ICEcoder.autocomplete())},cMonGutterClick:function(a,b,c,d,e){top.ICEcoder.mouseDownInCM="gutter"},cMonMouseDown:function(a,b){top.ICEcoder.mouseDownInCM="editor"},cMonDragOver:function(a,b,c){top.ICEcoder.setDragCursor(b,"editor")},cMonRenderLine:function(a,b,c,d){for(var e,f=0;f<top.ICEcoder.renderLineStyle.length;f++){e=!1;if("diff"!=top.ICEcoder.renderLineStyle[f][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[f][0]&&
|
||||
-1<b.indexOf("diff"))e=!0;e&&a.lineInfo(c).line+1==top.ICEcoder.renderLineStyle[f][1]&&(d.style[top.ICEcoder.renderLineStyle[f][2]]=top.ICEcoder.renderLineStyle[f][3])}},updateDiffs:function(){var a,b,c,d,e,f;top.ICEcoder.renderLineStyle=[];top.ICEcoder.renderPaneShiftAmount=0;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();c=a?difflib.stringAsLines(a.getValue()):"";d=b?difflib.stringAsLines(b.getValue()):"";c=(new difflib.SequenceMatcher(c,d)).get_opcodes();if(a){e=a.getAllMarks();
|
||||
for(d=0;d<e.length;d++)e[d].clear();e=b.getAllMarks();for(d=0;d<e.length;d++)e[d].clear()}if(a&&""!=b.getValue())for(d=0;d<c.length;d++)if("equal"!==c[d][0]){if("replace"==c[d][0]){f=(c[d][4]-c[d][2]+1+top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)b.getLineHandle(e).height>a.defaultTextHeight()&&(f+=b.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",f+"px"]);for(e=0;e<c[d][2]-
|
||||
c[d][1];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),a.markText({line:c[d][1]+e,ch:0},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{className:"diffGreyLighter"}),a.markText({line:c[d][1]+e,ch:f[0]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]+f[1]},{className:"diffGrey"}),a.markText({line:c[d][1]+e,ch:f[0]+f[1]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:1E6},{className:"diffGreyLighter"})}else a.markText({line:c[d][1],ch:0},
|
||||
{line:c[d][2]-1,ch:1E6},{className:"diffGreen"});"replace"!=c[d][0]&&c[d][1]==c[d][2]&&(top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",(c[d][4]-c[d][3]+1)*a.defaultTextHeight()+"px"]),a.markText({line:c[d][2]-1,ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffNone"}));if("replace"==c[d][0]){f=(c[d][2]-c[d][4]+1-top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)a.getLineHandle(e).height>a.defaultTextHeight()&&(f+=a.getLineHandle(e).height-a.defaultTextHeight());
|
||||
cMonChange:function(a,b,c,d){var e,f,g,k,h,l,p,n,m,q;b=a.listSelections();top.ICEcoder.loadingFile||top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if("undefined"!=typeof top.ICEcoder.oppTagReplaceData[0])for(var r=0;r<top.ICEcoder.oppTagReplaceData.length;r++)e=top.ICEcoder.oppTagReplaceData[r].split(";"),f=e[0],g=1*e[1].split(":")[0],k=1*e[1].split(":")[1],
|
||||
b[r]&&(h=d.findMatchingTag(a,b[r].anchor)),"undefined"!=typeof h&&(f="open"==h.at?h.open.tag:h.close.tag,"undefined"!=typeof c.from&&(l=g==c.from.line?c.text[0].length-c.removed[0].length:0,p="close"==h.at&&g==c.from.line?c.removed[0].length-c.text[0].length+1:1,n={line:g,ch:k+l+("open"==h.at?2:p)},l={line:g,ch:k+l+("open"==h.at?2:p)+e[0].length})),""!=f.trim()&&"undefined"!=typeof n&&"undefined"!=typeof l&&a.getRange(n,l)==e[0]&&(a.replaceRange(f,n,l),"close"==h.at&&(top.ICEcoder.autocompleteSkip=
|
||||
!0));top.ICEcoder.oppTagReplaceData=[];top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.updateNestingIndicator();top.ICEcoder.findMode&&(top.ICEcoder.results.splice(top.ICEcoder.findResult,1),top.get("results").innerHTML=top.ICEcoder.results.length+" "+top.t.results,top.ICEcoder.findMode=!1);if(c=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])m=c.substr(c.lastIndexOf("/")+1),q=m.substr(m.lastIndexOf(".")+1);top.ICEcoder.splitPane&&
|
||||
setTimeout(function(){top.ICEcoder.updateDiffs()},0);c&&top.ICEcoder.previewWindow.location&&"/[NEW]"!=c&&top.ICEcoder.updatePreviewWindow(a,c,m,q);top.ICEcoder.indicateChanges()},cMonScroll:function(a,b){var c,d,e;top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1;top.ICEcoder.splitPane&&(c=top.ICEcoder.getcMInstance(),d=top.ICEcoder.getcMdiffInstance(),e=-1<b.indexOf("diff")?c:d,c&&setTimeout(function(){e.scrollTo(a.getScrollInfo().left,a.getScrollInfo().top)},0))},cMonInputRead:function(a,
|
||||
b){"keypress"==top.ICEcoder.autoComplete&&top.ICEcoder.codeAssist&&!a.state.completionActive&&(top.ICEcoder.autocompleteSkip?top.ICEcoder.autocompleteSkip=!1:top.ICEcoder.autocomplete())},cMonGutterClick:function(a,b,c,d,e){top.ICEcoder.mouseDownInCM="gutter"},cMonMouseDown:function(a,b){top.ICEcoder.mouseDownInCM="editor"},cMonDragOver:function(a,b,c){top.ICEcoder.setDragCursor(b,"editor")},cMonRenderLine:function(a,b,c,d){for(var e,f=0;f<top.ICEcoder.renderLineStyle.length;f++){e=!1;if("diff"!=
|
||||
top.ICEcoder.renderLineStyle[f][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[f][0]&&-1<b.indexOf("diff"))e=!0;e&&a.lineInfo(c).line+1==top.ICEcoder.renderLineStyle[f][1]&&(d.style[top.ICEcoder.renderLineStyle[f][2]]=top.ICEcoder.renderLineStyle[f][3])}},updateDiffs:function(){var a,b,c,d,e,f;top.ICEcoder.renderLineStyle=[];top.ICEcoder.renderPaneShiftAmount=0;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();c=a?difflib.stringAsLines(a.getValue()):"";d=b?difflib.stringAsLines(b.getValue()):
|
||||
"";c=(new difflib.SequenceMatcher(c,d)).get_opcodes();if(a){e=a.getAllMarks();for(d=0;d<e.length;d++)e[d].clear();e=b.getAllMarks();for(d=0;d<e.length;d++)e[d].clear()}if(a&&""!=b.getValue())for(d=0;d<c.length;d++)if("equal"!==c[d][0]){if("replace"==c[d][0]){f=(c[d][4]-c[d][2]+1+top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)b.getLineHandle(e).height>a.defaultTextHeight()&&(f+=b.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main",
|
||||
c[d][2],"height",f+"px"]);for(e=0;e<c[d][2]-c[d][1];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),a.markText({line:c[d][1]+e,ch:0},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{className:"diffGreyLighter"}),a.markText({line:c[d][1]+e,ch:f[0]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]+f[1]},{className:"diffGrey"}),a.markText({line:c[d][1]+e,ch:f[0]+f[1]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:1E6},{className:"diffGreyLighter"})}else a.markText({line:c[d][1],
|
||||
ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffGreen"});"replace"!=c[d][0]&&c[d][1]==c[d][2]&&(top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",(c[d][4]-c[d][3]+1)*a.defaultTextHeight()+"px"]),a.markText({line:c[d][2]-1,ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffNone"}));if("replace"==c[d][0]){f=(c[d][2]-c[d][4]+1-top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)a.getLineHandle(e).height>a.defaultTextHeight()&&(f+=a.getLineHandle(e).height-a.defaultTextHeight());
|
||||
f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",f+"px"]);for(e=0;e<c[d][4]-c[d][3];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:0},{line:c[d][3]+e,ch:f[0]},{className:"diffGreyLighter"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{line:c[d][3]+e,ch:f[0]+f[2]},{className:"diffGrey"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,
|
||||
ch:f[0]+f[2]},{line:c[d][3]+e,ch:1E6},{className:"diffGreyLighter"})}else b.markText({line:c[d][3],ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffRed"});"replace"!=c[d][0]&&c[d][3]==c[d][4]&&(top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",(c[d][2]-c[d][1]+1)*a.defaultTextHeight()+"px"]),b.markText({line:c[d][4]-1,ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffNone"}));top.ICEcoder.renderPaneShiftAmount=c[d][2]-c[d][4]}},findStringDiffs:function(a,b){"undefined"==typeof a&&(a="");"undefined"==
|
||||
typeof b&&(b="");for(var c=0,d=a.length,e=b.length;a[c]&&a[c]==b[c];c++);for(;d>c&e>c&a[d-1]==b[e-1];d--)e--;return[c,d-c,e-c]},updatePreviewWindow:function(a,b,c,d){top.ICEcoder.previewWindow.location.pathname==b?-1<["htm","html","txt"].indexOf(d)?top.ICEcoder.previewWindow.document.documentElement.innerHTML=a.getValue():-1<["md"].indexOf(d)&&(top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())):-1<["css"].indexOf(d)&&-1<top.ICEcoder.previewWindow.document.documentElement.innerHTML.indexOf(c)&&
|
||||
@@ -108,7 +108,7 @@ c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.get("content").content
|
||||
(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 >" 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 >" 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.onerror=function(){get("floatingContainer").style.visibility="hidden";get("canvasPickerColorInfo").style.display="none";get("canvasPickerCORSInfo").style.display="block"};c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height);
|
||||
get("canvasPickerColorInfo").style.display="block";get("canvasPickerCORSInfo").style.display="none";top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"}};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");
|
||||
top.get("canvasPicker").onmousemove=function(r){c=r.pageX-this.offsetLeft;d=r.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").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",
|
||||
@@ -128,10 +128,10 @@ top.ICEcoder.previousFiles.length&&top.ICEcoder.ask(top.t["Open previous files"]
|
||||
top.ICEcoder.showHide("show",top.get("blackMask"))},goLocalhostRoot:function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/go-localhost-root.php"},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},ftpManager:function(){top.get("mediaContainer").innerHTML=
|
||||
'<iframe src="lib/ftp-manager.php" class="whiteGlow" style="width: 660px; height: 550px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,k,h,l,p,n,m,q,u,w,v,x,y,z,A,B,C,D){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&&
|
||||
'<iframe src="lib/ftp-manager.php" class="whiteGlow" style="width: 660px; height: 550px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,k,h,l,p,n,m,q,r,w,v,x,y,z,A,B,C,D){var t,u=a.slice(0,a.lastIndexOf("?")),u=u.slice(u.lastIndexOf("/")+1,u.lastIndexOf("."));top.ICEcoder.theme!==u&&(top.ICEcoder.theme=u,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),t=document.createElement("link"),t.setAttribute("rel","stylesheet"),t.setAttribute("type",
|
||||
"text/css"),t.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(t),t=-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.lineNumbers=h;top.ICEcoder.showTrailingSpace=l;top.ICEcoder.matchBrackets=p;top.ICEcoder.autoCloseTags=n;top.ICEcoder.autoCloseBrackets=m;top.ICEcoder.indentWithTabs=q;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=u;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("lineWrapping",
|
||||
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: "+t+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=l;top.ICEcoder.matchBrackets=p;top.ICEcoder.autoCloseTags=n;top.ICEcoder.autoCloseBrackets=m;top.ICEcoder.indentWithTabs=q;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=r;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("lineNumbers",top.ICEcoder.lineNumbers),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("showTrailingSpace",top.ICEcoder.showTrailingSpace),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("matchBrackets",top.ICEcoder.matchBrackets),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("autoCloseTags",top.ICEcoder.autoCloseTags),ICEcoder.content.contentWindow["cM"+
|
||||
ICEcoder.cMInstances[f]].setOption("autoCloseBrackets",top.ICEcoder.autoCloseBrackets),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("lineNumbers",top.ICEcoder.lineNumbers),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("showTrailingSpace",top.ICEcoder.showTrailingSpace),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("matchBrackets",top.ICEcoder.matchBrackets),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+
|
||||
|
||||
Reference in New Issue
Block a user