Update min.js to match main JS

This commit is contained in:
Matt Pass
2019-08-25 13:24:59 +01:00
committed by GitHub
parent f623303c0b
commit db30685723

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

@@ -28,11 +28,11 @@ c.substr(c.lastIndexOf("/")+1);var t=r.substr(r.lastIndexOf(".")+1)}top.ICEcoder
b,c,d,e){top.ICEcoder.mouseDownInCM="gutter"},cMonMouseDown:function(a,b,c){top.ICEcoder.mouseDownInCM="editor"},cMonContextMenu:function(a,b,c){b=a.coordsChar({left:c.pageX,top:c.pageY});a.setCursor(b);c.ctrlKey&&setTimeout(function(){var b=a,c=b.getRange(b.findWordAt(b.getCursor()).anchor,b.findWordAt(b.getCursor()).head);result=null;numResults=0;var f=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];f=f.substr(f.lastIndexOf(".")+1);for(i in top.ICEcoder.indexData.functions[f])i===c&&(result=
top.ICEcoder.indexData.functions[f][i],numResults++);for(i in top.ICEcoder.indexData.classes[f])i===c&&(result=top.ICEcoder.indexData.classes[f][i],numResults++);1===numResults&&-1===[null,"def"].indexOf(b.getTokenTypeAt(b.getCursor()))&&(top.ICEcoder.openFile(result.filePath.replace(top.docRoot,"")),top.ICEcoder.goFindAfterOpenInt=setInterval(function(){top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]!=result.filePath.replace(top.docRoot,"")||top.ICEcoder.loadingFile||(b=top.ICEcoder.getcMInstance(),
setTimeout(function(){top.ICEcoder.goToLine(result.range.from.line+1);b.setSelection({line:result.range.from.line,ch:result.range.from.ch},{line:result.range.to.line,ch:result.range.to.ch})},20),clearInterval(top.ICEcoder.goFindAfterOpenInt))},20));top.ICEcoder.mouseDownInCM="editor"},0)},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])}},functionClassParamsTooltip:function(a,b){if(top.ICEcoder.indexData){var c,d=top.ICEcoder.getcMInstance(),e=d.coordsChar({left:top.ICEcoder.mouseX-top.ICEcoder.maxFilesW,top:top.ICEcoder.mouseY-72}),f=d.getRange(d.findWordAt(e).anchor,d.findWordAt(e).head);if(""===
f)return get("tooltip").style.display="none",!0;var g=null,m=0,h=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];h=h.substr(h.lastIndexOf(".")+1);for(c in top.ICEcoder.indexData.functions[h])c===f&&(g=top.ICEcoder.indexData.functions[h][c],m++);for(c in top.ICEcoder.indexData.classes[h])c===f&&(g=top.ICEcoder.indexData.classes[h][c],m++);1===m&&-1===[null,"def"].indexOf(d.getTokenTypeAt(e))?(get("tooltip").style.display="block",get("tooltip").style.left=top.ICEcoder.mouseX-top.ICEcoder.maxFilesW+
10+"px",get("tooltip").style.top=top.ICEcoder.mouseY-30+"px",get("tooltip").style.zIndex="1",get("tooltip").innerHTML=g.params):get("tooltip").style.display="none"}},updateDiffs:function(){top.ICEcoder.renderLineStyle=[];top.ICEcoder.renderPaneShiftAmount=0;var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.getcMdiffInstance();var c=a?difflib.stringAsLines(a.getValue()):"";var d=b?difflib.stringAsLines(b.getValue()):"";c=(new difflib.SequenceMatcher(c,d)).get_opcodes();if(a){var 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]){var 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],
-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])}},functionClassParamsTooltip:function(a,b){if(top.ICEcoder.indexData){if(0===top.ICEcoder.openFiles.length)return get("tooltip").style.display="none",!0;var c,d=top.ICEcoder.getcMInstance(),e=d.coordsChar({left:top.ICEcoder.mouseX-top.ICEcoder.maxFilesW,top:top.ICEcoder.mouseY-
72}),f=d.getRange(d.findWordAt(e).anchor,d.findWordAt(e).head);if(""===f)return get("tooltip").style.display="none",!0;var g=null,m=0,h=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];h=h.substr(h.lastIndexOf(".")+1);for(c in top.ICEcoder.indexData.functions[h])c===f&&(g=top.ICEcoder.indexData.functions[h][c],m++);for(c in top.ICEcoder.indexData.classes[h])c===f&&(g=top.ICEcoder.indexData.classes[h][c],m++);1===m&&-1===[null,"def"].indexOf(d.getTokenTypeAt(e))?(get("tooltip").style.display="block",
get("tooltip").style.left=top.ICEcoder.mouseX-top.ICEcoder.maxFilesW+10+"px",get("tooltip").style.top=top.ICEcoder.mouseY-30+"px",get("tooltip").style.zIndex="1",get("tooltip").innerHTML=g.params):get("tooltip").style.display="none"}},updateDiffs:function(){top.ICEcoder.renderLineStyle=[];top.ICEcoder.renderPaneShiftAmount=0;var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.getcMdiffInstance();var c=a?difflib.stringAsLines(a.getValue()):"";var d=b?difflib.stringAsLines(b.getValue()):"";c=(new difflib.SequenceMatcher(c,
d)).get_opcodes();if(a){var 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]){var 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"==