-
Notifications
You must be signed in to change notification settings - Fork 7
/
LanEditor.min.js
241 lines (241 loc) · 65.4 KB
/
LanEditor.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
var LanEditor={init:function(b){if("undefined"==typeof(b)||"undefined"==typeof(b.textelem)){return{status:false,message:"你至少需要指定LanEditor使用的textelem"};
}if("function"!=typeof($)){return{status:false,message:"LanEditor使用$符访问jQuery,而在此页面没有检测到jQuery"};}var a=b;hljs.initHighlightingOnLoad();this.converter=new Showdown.converter();
this.textelem=a.textelem;this.showelem="undefined"==typeof(a.showelem)?null:a.showelem;this.TextElem=$("#"+this.textelem);$("body").append('<div class="_Keyword" id="_Keyword"><ul id="_KeywordLi"></ul></div><div class="_LanEditorBg" id="_LanEditorBg"></div><div class="_LEBorder" id="_LEBorder"><ul class="_LEMenuList"><li class="_MenuListSe">文件列表</li><li class="_MenuListSet">选项设置</li></ul><div class="_LEContent"><div id="_LEFilelist"><p><input type="text" id="_LENName"><span id="_LEFNB">新建</span></p><ul></ul></div><div id="_LESetting"><ul><li id="OpenSKL"><span class="_LESName">开启关键字提示</span><span class="_LESCon"><span></span></span></li><li id="OpenSKLAni"><span class="_LESName">开启提示框动画</span><span class="_LESCon"><span></span></span></li><li id="OpenMenuAni"><span class="_LESName">开启菜单动画</span><span class="_LESCon"><span></span></span></li><li id="OpenAutoSymbol"><span class="_LESName">开启符号补全</span><span class="_LESCon"><span></span></span></li></ul></div></div></div>');
this.Menu.MenuObj=$("#_LEBorder");this.Background.BackObj=$("#_LanEditorBg");this.SKLelem=$("#_Keyword");this._timer={};(function(d){d.css({"box-sizing":"border-box",overflow:"auto","font-size":"16px","font-family":"Menlo, Monaco, Consolas, Courier New, monospace","font-weight":1.3,outline:"none","background-color":"#23241f",color:"#f8f8f2"});
})(this.TextElem);var c=document.getElementById(this.textelem);if("undefined"!=typeof c.addEventListener){window.addEventListener("keydown",function(e){var f=LanEditor.TextElem;
LanEditor.Menu.Toggle.call(LanEditor.Menu,e);LanEditor.KeyRewrite(e,f);for(var d=0;d<LanEditor.Fn.FnSet.keydown.length;d++){LanEditor.Fn.FnSet.keydown[d](e,f);
}},true);c.addEventListener("keyup",function(e){var f=LanEditor.TextElem;LanEditor.AutoCompleteSymbol(e,f);LanEditor.AutoCompleteKeyword(e,f);for(var d=0;
d<LanEditor.Fn.FnSet.keyup.length;d++){LanEditor.Fn.FnSet.keyup[d](e,f);}if(LanEditor.SetPara.PluginsMode==false){LanEditor.File.SaveFile();}LanEditor.DelayTillLast.call(LanEditor,"RenderHTML",LanEditor.RenderHTML,300);
},false);document.getElementById("_LEFNB").addEventListener("click",function(){LanEditor.File.NewFile($("#_LENName").val());LanEditor.File.Refresh($("#_LEFilelist ul"));
},false);document.getElementById("_LENName").addEventListener("keyup",function(d){if(d.which==13){LanEditor.File.NewFile($("#_LENName").val());$("#_LENName").val("");
LanEditor.File.Refresh($("#_LEFilelist ul"));}},false);}else{if("undefined"!=typeof c.attachEvent){window.attachEvent("keydown",function(e){var f=LanEditor.TextElem;
LanEditor.Menu.Toggle.call(LanEditor.Menu,e);LanEditor.KeyRewrite(e,f);for(var d=0;d<LanEditor.Fn.FnSet.keydown.length;d++){LanEditor.Fn.FnSet.keydown[d](e,f);
}});c.attachEvent("keyup",function(e){var f=LanEditor.TextElem;LanEditor.AutoCompleteSymbol(e,f);LanEditor.AutoCompleteKeyword(e,f);for(var d=0;d<LanEditor.Fn.FnSet.keyup.length;
d++){LanEditor.Fn.FnSet.keyup[d](e,f);}if(LanEditor.SetPara.PluginsMode==false){LanEditor.File.SaveFile();}LanEditor.DelayTillLast.call(LanEditor,"RenderHTML",LanEditor.RenderHTML);
},300);document.getElementById("_LEFNB").attachEvent("click",function(){LanEditor.File.NewFile($("#_LENName").val());LanEditor.File.Refresh($("#_LEFilelist ul"));
});document.getElementById("_LENName").attachEvent("click",function(d){LanEditor.File.NewFile($("#_LENName").val());$("#_LENName").val("");LanEditor.File.Refresh($("#_LEFilelist ul"));
});}else{alert("此浏览器太老,建议用chrome浏览器");}}this.SKLPara.Set(false,0,0);c.focus();$("#_LEFilelist ul").delegate("span","click",function(h){if($(h.target).hasClass("_LEFName")){var d=$(h.target).text();
var f=LanEditor.File.GetFileContent(d);var g;for(varname in localStorage){if(varname.split("$")[0].length==10&&varname.split("$")[1]==d){g=varname.split("$")[0];
break;}}LanEditor.TextElem.val(f);LanEditor.File.CurOpenFile.name=d;LanEditor.File.CurOpenFile.content=f;LanEditor.File.CurOpenFile.time=g;LanEditor.RenderHTML();
}else{if($(h.target).hasClass("_LEFM")){var d=$(h.target).prev().text();var f=LanEditor.File.GetFileContent(d);LanEditor.File.ExportMD(f);}else{if($(h.target).hasClass("_LEFH")){var d=$(h.target).prev().prev().text();
var f=LanEditor.File.GetFileContent(d);LanEditor.File.ExportHTML(f);}else{if($(h.target).hasClass("_LEFD")){var d=$(h.target).prev().prev().prev().text();
if(d==LanEditor.File.CurOpenFile.name){LanEditor.File.CurOpenFile.name=null;LanEditor.File.CurOpenFile.content=null;LanEditor.File.CurOpenFile.time=null;
}LanEditor.File.DeleteFileFromLocal(d);LanEditor.File.Refresh($("#_LEFilelist ul"));}}}}});$("._MenuListSe").click(function(d){$(this).css("background-color","#948266");
$("._MenuListSet").css("background-color","#aa9b83");$("#_LEFilelist").css("display","block");$("#_LESetting").css("display","none");});$("._MenuListSet").click(function(d){$(this).css("background-color","#948266");
$("._MenuListSe").css("background-color","#aa9b83");$("#_LEFilelist").css("display","none");$("#_LESetting").css("display","block");});$("#_LESetting ul").delegate("li","click",function(f){var d=$(this).attr("id");
switch(d){case"OpenSKL":if(LanEditor.SetPara.OpenSKL==1){LanEditor.SetPara.OpenSKL=0;$("._LESCon",$(this)).css("background-color","#dcdada").children().css("left","1px");
}else{LanEditor.SetPara.OpenSKL=1;$("._LESCon",$(this)).css("background-color","#4dc4f5").children().css("left","21px");}break;case"OpenSKLAni":if(LanEditor.SetPara.OpenSKLAni==1){LanEditor.SetPara.OpenSKLAni=0;
$("._LESCon",$(this)).css("background-color","#dcdada").children().css("left","1px");$("#_Keyword").css("transition","0s");}else{LanEditor.SetPara.OpenSKLAni=1;
$("._LESCon",$(this)).css("background-color","#4dc4f5").children().css("left","21px");$("#_Keyword").css("transition","0.3s");}break;case"OpenMenuAni":if(LanEditor.SetPara.OpenMenuAni==1){LanEditor.SetPara.OpenMenuAni=0;
$("._LESCon",$(this)).css("background-color","#dcdada").children().css("left","1px");$("#_LEBorder").css("transition","0s");$("#_LanEditorBg").css("transition","0s");
}else{LanEditor.SetPara.OpenMenuAni=1;$("._LESCon",$(this)).css("background-color","#4dc4f5").children().css("left","21px");$("#_LEBorder").css("transition","1s");
$("#_LanEditorBg").css("transition","0.8s");}break;case"OpenAutoSymbol":if(LanEditor.SetPara.OpenAutoSymbol==1){LanEditor.SetPara.OpenAutoSymbol=0;$("._LESCon",$(this)).css("background-color","#dcdada").children().css("left","1px");
}else{LanEditor.SetPara.OpenAutoSymbol=1;$("._LESCon",$(this)).css("background-color","#4dc4f5").children().css("left","21px");}break;}LanEditor.SetPara.Save();
});this.SetPara.Load();this.SetPara.PluginsMode="undefined"==typeof(a.PluginsMode)?false:a.PluginsMode;this.SetPara.OpenSKL="undefined"==typeof(a.OpenSKL)?this.SetPara.OpenSKL:a.OpenSKL;
this.SetPara.OpenSKLAni="undefined"==typeof(a.OpenSKLAni)?this.SetPara.OpenSKLAni:a.OpenSKLAni;this.SetPara.OpenAutoSymbol="undefined"==typeof(a.OpenAutoSymbol)?this.SetPara.OpenAutoSymbol:a.OpenAutoSymbol;
this.SetPara.OpenMenuAni="undefined"==typeof(a.OpenMenuAni)?this.SetPara.OpenMenuAni:a.OpenMenuAni;this.SetPara.Apply();return{status:true};},DelayTillLast:function(c,a,b){if(this._timer[c]){window.clearTimeout(this._timer[c]);
delete this._timer[c];}return this._timer[c]=window.setTimeout(function(){a.call(LanEditor);delete LanEditor._timer[c];},b);},RenderHTML:function(){if(this.showelem==null){return false;
}var b=this.converter.makeHtml(this.TextElem.val());for(var a=0;a<this.Fn.FnSet.render.length;a++){b=this.Fn.FnSet.render[a](b)||b;}$("#"+this.showelem).html(b);
$("pre code",$("#"+this.showelem)).each(function(c,d){hljs.highlightBlock(d);});return true;},GetRenderHTML:function(){var c=this.converter.makeHtml(this.TextElem.val());
for(var b=0;b<this.Fn.FnSet.render.length;b++){c=this.Fn.FnSet.render[b](c)||c;}var a=$("<div></div>");a.html(c);$("pre code",a).each(function(d,e){hljs.highlightBlock(e);
});c=a.html();return c;},SKLPara:{show:null,count:null,cs:null,SWL:0,ResultSet:[],Set:function(a,c,b){this.show=a;this.count=c;this.cs=b;$("._SKLi"+b).addClass("_limatch");
},Get:function(){return LanEditor.SKLPara;},SetShow:function(a){this.show=a;},SetCount:function(a){this.count=a;},SetCS:function(c,a){$("._SKLi"+this.cs).removeClass("_limatch");
this.cs=c;$("._SKLi"+c).addClass("_limatch");var f=parseInt($("#_Keyword").css("height"));var d=$("#_Keyword")[0].scrollHeight;var b=$("#_Keyword").scrollTop();
if(c==0){$("#_Keyword").scrollTop(0);}else{if(c==this.count-1){$("#_Keyword").scrollTop(d);}else{if(a==true){if(c*18<b){var e=b-c*18;$("#_Keyword").scrollTop(b-e);
}}else{if("undefined"==typeof a){if((c+1)*18>b+f){var e=(c+1)*18-(b+f);$("#_Keyword").scrollTop(b+e);}}}}}}},AutoCompleteKeyword:function(c,h){if(LanEditor.SetPara.OpenSKL==0){return;
}var g=c;var d=$("#_Keyword");if(g.which==38||g.which==40){return;}if(g.which!=8&&g.which!=189&&(g.which<65&&g.which>57||g.which>90||g.which<48)){d.css({opacity:0,"z-index":-20});
LanEditor.SKLPara.SetShow(false);return;}var f="";var a=1;var b=h.iGetPosStr(-a).charAt(0);while(b!=""&&b!="("&&b!=")"&&b!=";"){if(a>h.val().length){break;
}if(b>="a"&&b<="z"||b>="A"&&b<="Z"||b=="_"||b=="-"){a++;}else{break;}b=h.iGetPosStr(-a).charAt(0);}if(a>1){f=h.iGetPosStr(-(a-1));LanEditor.ShowKeywordList(f);
}else{d.css({opacity:0,"z-index":-20});LanEditor.SKLPara.SetShow(false);}},ShowKeywordList:function(b){var a=this.TextElem;var o=this.SKLelem;var g=CursorPos.GetCursorPos(document.getElementById(this.textelem));
var c=a.scrollTop();var e=g.left+2;var q=g.top-c+18;var p=this.SearchKeyword(b);if(p.length<=0){o.css({opacity:0,"z-index":-20});LanEditor.SKLPara.SetShow(false);
return;}var r=0;var l="";for(key in p){if(!isNaN(key)){continue;}for(var h=0;h<p[key].length;++h){l+='<li class="_SKLi'+r+'">'+p[key][h]+"</li>";r++;}}$("#_KeywordLi").html(l);
LanEditor.SKLPara.Set(true,r,0);var k=(r>10?180:r*18);var d=parseInt(o.css("width"));var n=CursorPos._offset(document.getElementById(LanEditor.textelem)).top;
var m=CursorPos._offset(document.getElementById(LanEditor.textelem)).left;var f=parseInt(a.css("height"));var j=parseInt(a.css("width"));if(q+k>n+f){q=q-k-18;
}if(e+d>m+j){e=e-d;}o.css({opacity:1,"z-index":20,left:e,top:q,height:k});},SearchKeyword:function(e){var a=false;var f=new Array();this.SKLPara.ResultSet=new Array();
this.SKLPara.SWL=e.length;var c=this.Keyword.Set;for(key in c){f.push(key);f[key]=new Array();for(var b=0;b<c[key].length;++b){var d=new RegExp("("+e+")","gi");
if(c[key][b].search(d)>-1){this.SKLPara.ResultSet.push(c[key][b]);f[key].push(c[key][b].replace(d,'<span class="_KeyHL">$1</span>'));a=true;}}}return a?f:[];
},AutoCompleteSymbol:function(c,a){if(LanEditor.SetPara.OpenAutoSymbol==0){return;}var k=c;if(k.which==13){if(LanEditor.SKLPara.show==true){return;}var b=a.iGetSpaceNum();
var h=false;var d=a.iGetPosStr(-2);if(d=="{\n"){b+=4;h=true;}for(var f=0;f<b;++f){a.iAddField(" ");}var l=a.iGetFieldPos();var j="";if(h){a.iAddField("\n");
for(var f=0;f<b-4;++f){j+=" ";}}a.iAddField(j);a.iSelectField(l);}else{if(k.shiftKey&&k.which==57){if(a.iGetPosStr(-1)=="("){a.iAddField(")");}else{a.iAddField(")");
}a.iSelectField(a.iGetFieldPos()-1);}else{if(k.shiftKey&&k.which==48){var d=a.iGetPosStr(-2);var g=a.iGetPosStr(1);if(d=="()"&&g==")"||d=="()"&&g==")"){a.iDelField(1);
a.iSelectField(a.iGetFieldPos()+1);}}else{if(k.shiftKey&&k.which==219){a.iAddField("}");a.iSelectField(a.iGetFieldPos()-1);}else{if(k.shiftKey&&k.which==221){var d=a.iGetPosStr(-2);
var g=a.iGetPosStr(1);if(d=="{}"&&g=="}"){a.iDelField(-1);}}else{if(k.which==219){if(a.iGetPosStr(-1)=="["){a.iAddField("]");}else{a.iAddField("】");}a.iSelectField(a.iGetFieldPos()-1);
}else{if(k.which==221){var d=a.iGetPosStr(-2);var g=a.iGetPosStr(1);if((d=="[]"||d=="【】")&&(g=="]"||g=="】")){a.iDelField(-1);}}else{if(k.shiftKey&&k.which==188){if(a.iGetPosStr(-1)=="<"){a.iAddField(">");
}else{a.iAddField("》");}a.iSelectField(a.iGetFieldPos()-1);}else{if(k.shiftKey&&k.which==190){var d=a.iGetPosStr(-2);var g=a.iGetPosStr(1);if((d=="<>"||d=="《》")&&(g==">"||g=="》")){a.iDelField(-1);
}}else{if(!k.shiftKey&&k.which==222){if(a.iGetPosStr(-1)=="'"){a.iAddField("'");}else{a.iAddField("’");}a.iSelectField(a.iGetFieldPos()-1);}else{if(k.shiftKey&&k.which==222){if(a.iGetPosStr(-1)=='"'){a.iAddField('"');
}else{a.iAddField("”");}a.iSelectField(a.iGetFieldPos()-1);}}}}}}}}}}}},KeyRewrite:function(c,f){var d=c;if(d.which==9){d.preventDefault();f.iAddField(" ");
}else{if(d.which==8){if(f.iGetPosStr(-1)==" "){d.preventDefault();var b=1;while(f.iGetPosStr(-b).charAt(0)==" "&&f.iGetPosStr(-b).charAt(0)!="\n"&&f.iGetPosStr(-b).charAt(0)!="\r\n"&&f.iGetPosStr(-b).charAt(0)!=""){b++;
if(b>f.val().length){break;}}if(b-1<4){f.iDelField(1);}else{if((b-1)%4==0){for(var b=0;b<4;++b){f.iDelField(1);}}else{var a=(b-1)%4;for(var b=0;b<a;++b){f.iDelField(1);
}}}}}else{if(d.which==38){if(LanEditor.SKLPara.show==true){d.preventDefault();if(LanEditor.SKLPara.cs==0){LanEditor.SKLPara.SetCS(LanEditor.SKLPara.count-1);
}else{if(LanEditor.SKLPara.cs>0){LanEditor.SKLPara.SetCS(LanEditor.SKLPara.cs-1,true);}}}}else{if(d.which==40){if(LanEditor.SKLPara.show==true){d.preventDefault();
if(LanEditor.SKLPara.cs==LanEditor.SKLPara.count-1){LanEditor.SKLPara.SetCS(0);}else{if(LanEditor.SKLPara.cs<LanEditor.SKLPara.count-1){LanEditor.SKLPara.SetCS(LanEditor.SKLPara.cs+1);
}}}}else{if(d.which==13){if(LanEditor.SKLPara.show==true){d.preventDefault();f.iDelField(LanEditor.SKLPara.SWL);f.iAddField(LanEditor.SKLPara.ResultSet[LanEditor.SKLPara.cs]);
}}}}}}},File:{CurOpenFile:{name:null,time:null,content:null},ExportMD:function(b){var c=prompt("保存为Markdown文件,请输入文件名","新建Markdown文件");if(c==null||c==""){return;
}for(var a=0;a<LanEditor.Fn.FnSet.expertmd.length;a++){b=LanEditor.Fn.FnSet.expertmd[a](b)||b;}this.ExportFile(c+".md",b);},ExportHTML:function(d){var e=prompt("保存为HTML文件,请输入文件名","新建HTML文件");
if(e==null||e==""){return;}var c='<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><style type="text/css">h1,h2,h3,h4,h5,h6,p,blockquote{margin:0;padding:0}body{font-family:"Helvetica Neue",Helvetica,"Hiragino Sans GB",Arial,sans-serif;font-size:13px;line-height:18px;color:#737373;margin:10px 13px 10px 13px}a{color:#0069d6}a:hover{color:#0050a3;text-decoration:none}a img{border:0}p{margin-bottom:9px}h1,h2,h3,h4,h5,h6{color:#404040;line-height:36px}h1{margin-bottom:18px;font-size:30px}h2{font-size:24px}h3{font-size:18px}h4{font-size:16px}h5{font-size:14px}h6{font-size:13px}hr{margin:0 0 19px;border:0;border-bottom:1px solid #ccc}blockquote{padding:13px 13px 21px 15px;margin-bottom:18px;font-family:georgia,serif;font-style:italic}blockquote:before{content:"C";font-size:40px;margin-left:-10px;font-family:georgia,serif;color:#eee}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;font-style:italic}code,pre{font-family:Monaco,Andale Mono,Courier New,monospace}code{background-color:#fee9cc;color:rgba(0,0,0,0.75);padding:1px 3px;font-size:12px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}pre{display:block;padding:14px;margin:0 0 18px;line-height:16px;font-size:11px;border:1px solid #d9d9d9;white-space:pre-wrap;word-wrap:break-word}pre code{background-color:#fff;color:#737373;font-size:11px;padding:0}@media screen and (min-width:768px){body{width:748px;margin:10px auto}}</style>';
c+="<title>"+e+"</title>";var b=LanEditor.converter.makeHtml(d);for(var a=0;a<LanEditor.Fn.FnSet.render.length;a++){b=LanEditor.Fn.FnSet.render[a](b)||b;
}c+="</head><body>"+b+"</body></html>";this.ExportFile(e+".html",c);},ExportFile:function(e,d){var c=document.createElement("a");var b=new Blob([d]);var a=document.createEvent("HTMLEvents");
a.initEvent("click",false,false);c.download=e;c.href=URL.createObjectURL(b);c.dispatchEvent(a);},SaveFileToLocal:function(c,b){if("undefined"==localStorage){return"LocalStorage not support";
}if(c==null||b==null){return"param wrong";}var a=LanEditor.Time.GetTimestamp()+"$"+c;for(varname in localStorage){if(varname.split("$")[0].length==10&&varname.split("$")[1]==c){a=varname.split("$")[0]+"$"+c;
}}localStorage.setItem(a,b);return"OK";},DeleteFileFromLocal:function(a){for(varname in localStorage){if(varname.split("$")[0].length==10&&varname.split("$")[1]==a){localStorage.removeItem(varname);
return true;}}return false;},GetFileList:function(){var b=new Array();var a;for(varname in localStorage){a=varname.split("$")[0];if(a.length==10&&!isNaN(a)){b.push({name:varname.split("$")[1],time:a});
}else{continue;}}return b;},GetFileContent:function(a){for(varname in localStorage){if(varname.split("$")[0].length==10&&varname.split("$")[1]==a){return localStorage.getItem(varname);
}}return false;},NewFile:function(b){if(b==""||b==null){alert("无效的文件名");return false;}var a=this.SaveFileToLocal(b,"");if(a=="OK"){return true;}else{if(a=="LocalStorage not support"){alert("您的浏览器不支持永久存储,请使用chrome以获得最佳体验");
return false;}else{if(a=="param wrong"){alert("无效的文件名,请尝试更换文件名");return false;}}}},SaveFile:function(){var c=LanEditor.TextElem.val();if(c==""){return;
}if(LanEditor.File.CurOpenFile.name==null){var a=confirm("当前文件未保存,是否保存?");if(a){var b=prompt("请输入文件名","新建MD文件");if(b==null||b==""){return;}LanEditor.File.CurOpenFile.name=b;
LanEditor.File.CurOpenFile.time=LanEditor.Time.GetTimestamp();LanEditor.File.CurOpenFile.content=c;LanEditor.File.SaveFileToLocal(b,c);}return;}LanEditor.File.CurOpenFile.content=c;
LanEditor.File.SaveFileToLocal(LanEditor.File.CurOpenFile.name,c);},ShowFileList:function(c){var d=this.GetFileList();var b="";for(var a=0;a<d.length;++a){b+="<li>";
b+='<span class="_LEFName" title="'+d[a].name+'">'+d[a].name+"</span>";b+='<span class="_LEFM" title="导出Markdown文件到本地">MD</span>';b+='<span class="_LEFH" title="导出HTML文件到本地">HTML</span>';
b+='<span class="_LEFD" title="删除文件">删除</span>';b+='<span class="_LEFT" title="创建日期: '+LanEditor.Time.GetTimeString(d[a].time)+'">'+LanEditor.Time.GetTimeString(d[a].time).substr(5,5)+"</span>";
b+="</li>";}c.html(b);},Refresh:function(a){this.ShowFileList(a);}},Menu:{IsShow:false,MenuObj:null,Toggle:function(a){if(LanEditor.SetPara.PluginsMode==true){return;
}if(a.which==27){a.preventDefault();if(this.IsShow){LanEditor.Background.Show(false);this.Show(false);}else{LanEditor.Background.Show(true);this.Show(true);
LanEditor.File.ShowFileList($("#_LEFilelist ul"));}}},Show:function(a){this.MenuObj.queue([]);if(a){this.MenuObj.queue(function(){LanEditor.Menu.IsShow=true;
$(this).css("display","block");$(this).delay(1).dequeue();});this.MenuObj.queue(function(){$(this).css("height","320px");$(this).dequeue();});}else{if(LanEditor.SetPara.OpenMenuAni){this.MenuObj.queue(function(){LanEditor.Menu.IsShow=false;
$(this).css("height","30px");$(this).delay(900).dequeue();});this.MenuObj.queue(function(){$(this).css("display","none");$(this).dequeue();});}else{this.MenuObj.queue(function(){LanEditor.Menu.IsShow=false;
$(this).css({height:"30px",display:"none"});$(this).delay(900).dequeue();});}}}},Background:{IsShow:false,BackObj:null,Toggle:function(){this.BackObj.queue([]);
if(this.IsShow){this.BackObj.queue(function(){LanEditor.Background.IsShow=false;$(this).css("opacity",0);$(this).delay(800).dequeue();});this.BackObj.queue(function(){$(this).css("display","none");
$(this).dequeue();});}else{this.BackObj.queue(function(){LanEditor.Background.IsShow=true;$(this).css("display","block");$(this).delay(1).dequeue();});
this.BackObj.queue(function(){$(this).css("opacity",0.8);$(this).dequeue();});}},Show:function(a){if(a){this.IsShow=false;}else{this.IsShow=true;}this.Toggle();
}},Time:{GetTimestamp:function(){return Math.round(new Date().getTime()/1000);},GetTimeString:function(a){var a=new Date(a*1000);return a.toLocaleString();
}},SetPara:{OpenSKL:null,OpenSKLAni:null,OpenMenuAni:null,OpenAutoSymbol:null,PluginsMode:false,Load:function(){this.OpenSKL=parseInt(localStorage.OpenSKL||1);
this.OpenSKLAni=parseInt(localStorage.OpenSKLAni||1);this.OpenMenuAni=parseInt(localStorage.OpenMenuAni||1);this.OpenAutoSymbol=parseInt(localStorage.OpenAutoSymbol||1);
},Save:function(){localStorage.OpenSKL=this.OpenSKL;localStorage.OpenSKLAni=this.OpenSKLAni;localStorage.OpenMenuAni=this.OpenMenuAni;localStorage.OpenAutoSymbol=this.OpenAutoSymbol;
},Apply:function(){$("#OpenSKL ._LESCon",$("#_LESetting")).css(function(a){if(a==1){$("#OpenSKL ._LESCon",$("#_LESetting")).children().css("left","21px");
return{"background-color":"#4dc4f5"};}return{"background-color":"#dcdada"};}(this.OpenSKL));$("#OpenSKLAni ._LESCon",$("#_LESetting")).css(function(a){if(a==1){$("#OpenSKLAni ._LESCon",$("#_LESetting")).children().css("left","21px");
return{"background-color":"#4dc4f5"};}return{"background-color":"#dcdada"};}(this.OpenSKLAni));$("#OpenMenuAni ._LESCon",$("#_LESetting")).css(function(a){if(a==1){$("#OpenMenuAni ._LESCon",$("#_LESetting")).children().css("left","21px");
return{"background-color":"#4dc4f5"};}$("#_LEBorder").css("transition","0s");return{"background-color":"#dcdada"};}(this.OpenMenuAni));$("#OpenAutoSymbol ._LESCon",$("#_LESetting")).css(function(a){if(a==1){$("#OpenAutoSymbol ._LESCon",$("#_LESetting")).children().css("left","21px");
return{"background-color":"#4dc4f5"};}return{"background-color":"#dcdada"};}(this.OpenAutoSymbol));}},Fn:{FnSet:{keydown:[],keyup:[],render:[],expertmd:[]},register:function(b,a){for(FnName in a){if(b=="keydown"){this.FnSet.keydown.push(a[FnName]);
}else{if(b=="keyup"){this.FnSet.keyup.push(a[FnName]);}else{if(b=="render"){this.FnSet.render.push(a[FnName]);}else{if(b=="expertmd"){this.FnSet.expertmd.push(a[FnName]);
}else{console.log("function "+FnName+"() not extend");}}}}}}},Keyword:{Set:{},extend:function(a){for(KeyName in a){if("undefined"==typeof(this.Set[KeyName])){this.Set[KeyName]=new Array();
}this.Set[KeyName]=this.Set[KeyName].concat(a[KeyName]);}}}};var CursorPos={GetCursorPos:function(f){if(document.selection){f.focus();var d=document.selection.createRange();
return{left:d.boundingLeft,top:d.boundingTop,bottom:d.boundingTop+d.boundingHeight};}else{var i=this;var b="{$clone_div}",c="{$cloneLeft}",m="{$cloneFocus}",l="{$cloneRight}";
var n='<span style="white-space:pre-wrap;"> </span>';var a=f[b]||document.createElement("div"),q=f[m]||document.createElement("span");var p=f[c]||document.createElement("span");
var g=i._offset(f),h=this._getFocus(f),k={left:0,top:0};if(!f[b]){f[b]=a,f[m]=q;f[c]=p;a.appendChild(p);a.appendChild(q);document.body.appendChild(a);q.innerHTML="|";
q.style.cssText="display:inline-block;width:0px;overflow:hidden;z-index:-100;word-wrap:break-word;word-break:break-all;";a.className=this._cloneStyle(f);
a.style.cssText="visibility:hidden;display:inline-block;position:absolute;z-index:-100;word-wrap:break-word;word-break:break-all;overflow:hidden;";}a.style.left=this._offset(f).left+"px";
a.style.top=this._offset(f).top+"px";var o=f.value.substring(0,h).replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br/>").replace(/\s/g,n);p.innerHTML=o;
q.style.display="inline-block";try{k=this._offset(q);}catch(j){}q.style.display="none";return{left:k.left,top:k.top,bottom:k.bottom};}},_cloneStyle:function(g,a){if(!a&&g["${cloneName}"]){return g["${cloneName}"];
}var f,c,b=/^(number|string)$/;var e=/^(content|outline|outlineWidth)$/;var d=[],h=g.style;for(c in h){if(!e.test(c)){val=this._getStyle(g,c);if(val!==""&&b.test(typeof val)){c=c.replace(/([A-Z])/g,"-$1").toLowerCase();
d.push(c);d.push(":");d.push(val);d.push(";");}}}d=d.join("");g["${cloneName}"]=f="clone"+(new Date).getTime();this._addHeadStyle("."+f+"{"+d+"}");return f;
},_addHeadStyle:function(b){var a=this._style[document];if(!a){a=this._style[document]=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(a);
}a.styleSheet&&(a.styleSheet.cssText+=b)||a.appendChild(document.createTextNode(b));},_style:{},_getStyle:"getComputedStyle" in window?function(b,a){return getComputedStyle(b,null)[a];
}:function(b,a){return b.currentStyle[a];},_getFocus:function(c){var b=0;if(document.selection){c.focus();var a=document.selection.createRange();if(c.nodeName==="TEXTAREA"){var d=a.duplicate();
d.moveToElementText(c);var b=-1;while(d.inRange(a)){d.moveStart("character");b++;}}else{if(c.nodeName==="INPUT"){a.moveStart("character",-c.value.length);
b=a.text.length;}}}else{if(c.selectionStart||c.selectionStart=="0"){b=c.selectionStart;}}return(b);},_offset:function(c){var e=c.getBoundingClientRect(),i=c.ownerDocument,f=i.body,a=i.documentElement;
var d=a.clientTop||f.clientTop||0,g=a.clientLeft||f.clientLeft||0;var h=e.top+(self.pageYOffset||a.scrollTop)-d,b=e.left+(self.pageXOffset||a.scrollLeft)-g;
return{left:b,top:h,right:b+e.width,bottom:h+e.height};}};(function(a){a.fn.extend({iGetFieldPos:function(){var e=this.get(0);if(document.selection){a(this).focus();
var d=document.selection;var b=d.createRange();var c=b.duplicate();c.moveToElementText(e);c.setEndPoint("EndToEnd",b);e.selectionStart=c.text.length-b.text.length;
e.selectionEnd=e.selectionStart+b.text.length;}return e.selectionStart;},iSelectField:function(e,b){var d=this.get(0);if(arguments[1]==undefined){b=e;}if(document.selection){var c=d.createTextRange();
c.moveEnd("character",-a(this).val().length);c.moveEnd("character",b);c.moveStart("character",e);c.select();}else{d.setSelectionRange(e,b);a(this).focus();
}},iSelectStr:function(d){var c=this.get(0);var b=a(this).val().indexOf(d);b!=-1?a(this).iSelectField(b,b+d.length):false;},iAddField:function(e){var d=this.get(0);
var c=a(this).val();var b=a(this).val().length;if(document.selection){a(this).focus();document.selection.createRange().text=e;}else{var f=d.selectionStart;
a(this).val(a(this).val().slice(0,d.selectionStart)+e+a(this).val().slice(d.selectionStart,b));this.iSelectField(f+e.length);}},iDelField:function(e){var c=this.get(0);
var d=a(this).iGetFieldPos();var b=a(this).val();a(this).val(e>0?b.slice(0,d-e)+b.slice(d):b.slice(0,d)+b.slice(d-e));a(this).iSelectField(d-(e<0?0:e));
},iGetPosStr:function(e){var c=this.get(0);var d=a(this).iGetFieldPos();var b=a(this).val();return(e>0?b.slice(d,d+e):b.slice(d+e,d));},iGetSpaceNum:function(){var d=a(this);
var c=0;var b=1;if(d.iGetPosStr(-1)=="\n"||d.iGetPosStr(-1)=="\r\n"){b=2;}while(d.iGetPosStr(-b).charAt(0)!="\n"&&d.iGetPosStr(-b).charAt(0)!="\r\n"&&d.iGetPosStr(-b).charAt(0)!=""){if(d.iGetPosStr(-b).charAt(0)==" "){c++;
}else{if(d.iGetPosStr(-b).charAt(0)=="\t"){c+=4;}else{c=0;}}++b;if(b>d.val().length){break;}}return c;}});})(jQuery);var Showdown={extensions:{}},forEach=Showdown.forEach=function(f,e){if("function"==typeof f.forEach){f.forEach(e);
}else{var h,g=f.length;for(h=0;g>h;h++){e(f[h],h,f);}}},stdExtName=function(b){return b.replace(/[_-]||\s/g,"").toLowerCase();};Showdown.converter=function(aE){var aD,aC,aB,aA=0,az=[],ay=[];
if("undefined"!=typeof module&&"undefined"!=typeof exports&&"undefined"!=typeof require){var ax=require("fs");if(ax){var aw=ax.readdirSync((__dirname||".")+"/extensions").filter(function(b){return ~b.indexOf(".js");
}).map(function(b){return b.replace(/\.js$/,"");});Showdown.forEach(aw,function(d){var c=stdExtName(d);Showdown.extensions[c]=require("./extensions/"+d);
});}}if(this.makeHtml=function(b){return aD={},aC={},aB=[],b=b.replace(/~/g,"~T"),b=b.replace(/\$/g,"~D"),b=b.replace(/\r\n/g,"\n"),b=b.replace(/\r/g,"\n"),b="\n\n"+b+"\n\n",b=R(b),b=b.replace(/^[ \t]+$/gm,""),Showdown.forEach(az,function(a){b=at(a,b);
}),b=ae(b),b=aq(b),b=ar(b),b=ao(b),b=T(b),b=b.replace(/~D/g,"$$"),b=b.replace(/~T/g,"~"),Showdown.forEach(ay,function(a){b=at(a,b);}),b;},aE&&aE.extensions){var av=this;
Showdown.forEach(aE.extensions,function(b){if("string"==typeof b&&(b=Showdown.extensions[stdExtName(b)]),"function"!=typeof b){throw"Extension '"+b+"' could not be loaded. It was either not found or is not a valid extension.";
}Showdown.forEach(b(av),function(c){c.type?"language"===c.type||"lang"===c.type?az.push(c):("output"===c.type||"html"===c.type)&&ay.push(c):ay.push(c);
});});}var au,at=function(e,d){if(e.regex){var f=new RegExp(e.regex,"g");return d.replace(f,e.replace);}return e.filter?e.filter(d):void 0;},ar=function(b){return b+="~0",b=b.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|(?=~0))/gm,function(c,k,j,i,h){return k=k.toLowerCase(),aD[k]=X(j),i?i+h:(h&&(aC[k]=h.replace(/"/g,""")),"");
}),b=b.replace(/~0/,"");},aq=function(b){b=b.replace(/\n/g,"\n\n");return b=b.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,ap),b=b.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,ap),b=b.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,ap),b=b.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,ap),b=b.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,ap),b=b.replace(/\n\n/g,"\n");
},ap=function(e,d){var f=d;return f=f.replace(/\n\n/g,"\n"),f=f.replace(/^\n/,""),f=f.replace(/\n+$/g,""),f="\n\n~K"+(aB.push(f)-1)+"K\n\n";},ao=function(d){d=ah(d);
var c=ad("<hr />");return d=d.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,c),d=d.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,c),d=d.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,c),d=ag(d),d=af(d),d=Z(d),d=aq(d),d=Y(d);
},an=function(b){return b=ac(b),b=am(b),b=W(b),b=aj(b),b=al(b),b=V(b),b=X(b),b=aa(b),b=b.replace(/ +\n/g," <br />\n");},am=function(d){var c=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;
return d=d.replace(c,function(f){var e=f.replace(/(.)<\/?code>(?=.)/g,"$1`");return e=Q(e,"\\`*_");});},al=function(b){return b=b.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,ak),b=b.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,ak),b=b.replace(/(\[([^\[\]]+)\])()()()()()/g,ak);
},ak=function(B,A,z,y,x,w,v,u){void 0==u&&(u="");var t=A,s=z,r=y.toLowerCase(),q=x,c=u;if(""==q){if(""==r&&(r=s.toLowerCase().replace(/ ?\n/g," ")),q="#"+r,void 0!=aD[r]){q=aD[r],void 0!=aC[r]&&(c=aC[r]);
}else{if(!(t.search(/\(\s*\)$/m)>-1)){return t;}q="";}}q=Q(q,"*_");var b='<a href="'+q+'"';return""!=c&&(c=c.replace(/"/g,"""),c=Q(c,"*_"),b+=' title="'+c+'"'),b+=">"+s+"</a>";
},aj=function(b){return b=b.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,ai),b=b.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,ai);
},ai=function(B,A,z,y,x,w,v,u){var t=A,s=z,r=y.toLowerCase(),q=x,c=u;if(c||(c=""),""==q){if(""==r&&(r=s.toLowerCase().replace(/ ?\n/g," ")),q="#"+r,void 0==aD[r]){return t;
}q=aD[r],void 0!=aC[r]&&(c=aC[r]);}s=s.replace(/"/g,"""),q=Q(q,"*_");var b='<img src="'+q+'" alt="'+s+'"';return c=c.replace(/"/g,"""),c=Q(c,"*_"),b+=' title="'+c+'"',b+=" />";
},ah=function(d){function c(b){return b.replace(/[^\w]/g,"").toLowerCase();}return d=d.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(b,e){return ad('<h1 id="'+c(e)+'">'+an(e)+"</h1>");
}),d=d.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(b,e){return ad('<h2 id="'+c(e)+'">'+an(e)+"</h2>");}),d=d.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(b,h,g){var f=h.length;
return ad("<h"+f+' id="'+c(g)+'">'+an(g)+"</h"+f+">");});},ag=function(d){d+="~0";var c=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
return aA?d=d.replace(c,function(h,g,l){var k=g,j=l.search(/[*+-]/g)>-1?"ul":"ol";k=k.replace(/\n{2,}/g,"\n\n\n");var i=au(k);return i=i.replace(/\s+$/,""),i="<"+j+">"+i+"</"+j+">\n";
}):(c=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,d=d.replace(c,function(j,i,p,o){var n=i,m=p,l=o.search(/[*+-]/g)>-1?"ul":"ol",m=m.replace(/\n{2,}/g,"\n\n\n"),k=au(m);
return k=n+"<"+l+">\n"+k+"</"+l+">\n";})),d=d.replace(/~0/,"");};au=function(b){return aA++,b=b.replace(/\n{2,}$/,"\n"),b+="~0",b=b.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(i,h,n,m,l){var k=l,j=h;
return j||k.search(/\n{2,}/)>-1?k=ao(S(k)):(k=ag(S(k)),k=k.replace(/\n$/,""),k=an(k)),"<li>"+k+"</li>\n";}),b=b.replace(/~0/g,""),aA--,b;};var af=function(b){return b+="~0",b=b.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(g,f,j){var i=f,h=j;
return i=ab(S(i)),i=R(i),i=i.replace(/^\n+/g,""),i=i.replace(/\n+$/g,""),i="<pre><code>"+i+"\n</code></pre>",ad(i)+h;}),b=b.replace(/~0/,"");},ae=function(b){return b+="~0",b=b.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(g,f,j){var i=f,h=j;
return h=ab(h),h=R(h),h=h.replace(/^\n+/g,""),h=h.replace(/\n+$/g,""),h="<pre><code"+(i?' class="'+i+'"':"")+">"+h+"\n</code></pre>",ad(h);}),b=b.replace(/~0/,"");
},ad=function(b){return b=b.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(aB.push(b)-1)+"K\n\n";},ac=function(b){return b=b.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(g,f,j,i){var h=i;
return h=h.replace(/^([ \t]*)/g,""),h=h.replace(/[ \t]*$/g,""),h=ab(h),f+"<code>"+h+"</code>";});},ab=function(b){return b=b.replace(/&/g,"&"),b=b.replace(/</g,"<"),b=b.replace(/>/g,">"),b=Q(b,"*_{}[]\\",!1);
},aa=function(b){return b=b.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>"),b=b.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");
},Z=function(b){return b=b.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,d){var f=d;return f=f.replace(/^[ \t]*>[ \t]?/gm,"~0"),f=f.replace(/~0/g,""),f=f.replace(/^[ \t]+$/gm,""),f=ao(f),f=f.replace(/(^|\n)/g,"$1 "),f=f.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(h,g){var i=g;
return i=i.replace(/^ /gm,"~0"),i=i.replace(/~0/g,"");}),ad("<blockquote>\n"+f+"\n</blockquote>");});},Y=function(i){i=i.replace(/^\n+/g,""),i=i.replace(/\n+$/g,"");
for(var d=i.split(/\n{2,}/g),n=[],m=d.length,l=0;m>l;l++){var k=d[l];k.search(/~K(\d+)K/g)>=0?n.push(k):k.search(/\S/)>=0&&(k=an(k),k=k.replace(/^([ \t]*)/g,"<p>"),k+="</p>",n.push(k));
}m=n.length;for(var l=0;m>l;l++){for(;n[l].search(/~K(\d+)K/)>=0;){var j=aB[RegExp.$1];j=j.replace(/\$/g,"$$$$"),n[l]=n[l].replace(/~K\d+K/,j);}}return n.join("\n\n");
},X=function(b){return b=b.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),b=b.replace(/<(?![a-z\/?\$!])/gi,"<");},W=function(b){return b=b.replace(/\\(\\)/g,P),b=b.replace(/\\([`*_{}\[\]()>#+-.!])/g,P);
},V=function(b){return b=b.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'<a href="$1">$1</a>'),b=b.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(d,c){return U(T(c));
});},U=function(d){var c=[function(b){return"&#"+b.charCodeAt(0)+";";},function(b){return"&#x"+b.charCodeAt(0).toString(16)+";";},function(b){return b;
}];return d="mailto:"+d,d=d.replace(/./g,function(b){if("@"==b){b=c[Math.floor(2*Math.random())](b);}else{if(":"!=b){var e=Math.random();b=e>0.9?c[2](b):e>0.45?c[1](b):c[0](b);
}}return b;}),d='<a href="'+d+'">'+d+"</a>",d=d.replace(/">.+:/g,'">');},T=function(b){return b=b.replace(/~E(\d+)E/g,function(e,d){var f=parseInt(d);return String.fromCharCode(f);
});},S=function(b){return b=b.replace(/^(\t|[ ]{1,4})/gm,"~0"),b=b.replace(/~0/g,"");},R=function(b){return b=b.replace(/\t(?=\t)/g," "),b=b.replace(/\t/g,"~A~B"),b=b.replace(/~B(.+?)~A/g,function(g,f){for(var j=f,i=4-j.length%4,h=0;
i>h;h++){j+=" ";}return j;}),b=b.replace(/~A/g," "),b=b.replace(/~B/g,"");},Q=function(g,f,j){var i="(["+f.replace(/([\[\]\\])/g,"\\$1")+"])";j&&(i="\\\\"+i);
var h=new RegExp(i,"g");return g=g.replace(h,P);},P=function(e,d){var f=d.charCodeAt(0);return"~E"+f+"E";};},"undefined"!=typeof module&&(module.exports=Showdown),"function"==typeof define&&define.amd&&define("showdown",function(){return Showdown;
}),"undefined"!=typeof angular&&"undefined"!=typeof Showdown&&!function(g,f){function j(){function b(){var c=new f.converter(d);this.makeHtml=function(a){return c.makeHtml(a);
},this.stripHtml=function(e){return String(e).replace(/<[^>]+>/gm,"");};}var d={extensions:[],stripHtml:!0};this.setOption=function(e,c){return d.key=c,this;
},this.getOption=function(c){return d.hasOwnProperty(c)?d.key:null;},this.loadExtension=function(c){return d.extensions.push(c),this;},this.$get=function(){return new b;
};}function i(d){var c=function(a,e){a.$watch("model",function(k){var l;l="string"==typeof k?d.makeHtml(k):typeof k,e.html(l);});};return{restrict:"A",link:c,scope:{model:"=sdModelToHtml"}};
}function h(){return function(b){return String(b).replace(/<[^>]+>/gm,"");};}g.provider("$Showdown",j).directive("sdModelToHtml",["$Showdown",i]).filter("sdStripHtml",h);
}(angular.module("Showdown",[]),Showdown);!function(a){"undefined"!=typeof exports?a(exports):(window.hljs=a({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return window.hljs;
}));}(function(Q){function I(a){return a.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">");}function C(a){return a.nodeName.toLowerCase();
}function F(b,c){var a=b&&b.exec(c);return a&&0==a.index;}function V(a){return/no-?highlight|plain|text/.test(a);}function L(d){var f,b,c,a=d.className+" ";
if(a+=d.parentNode?d.parentNode.className:"",b=/\blang(?:uage)?-([\w-]+)\b/.exec(a)){return B(b[1])?b[1]:"no-highlight";}for(a=a.split(/\s+/),f=0,c=a.length;
c>f;f++){if(B(a[f])||V(a[f])){return a[f];}}}function H(c,d){var a,b={};for(a in c){b[a]=c[a];}if(d){for(a in d){b[a]=d[a];}}return b;}function A(b){var c=[];
return function a(g,d){for(var f=g.firstChild;f;f=f.nextSibling){3==f.nodeType?d+=f.nodeValue.length:1==f.nodeType&&(c.push({event:"start",offset:d,node:f}),d=a(f,d),C(f).match(/br|hr|img|input/)||c.push({event:"stop",offset:d,node:f}));
}return d;}(b,0),c;}function T(t,b,w){function m(){return t.length&&b.length?t[0].offset!=b[0].offset?t[0].offset<b[0].offset?t:b:"start"==b[0].event?t:b:t.length?t:b;
}function d(c){function a(f){return" "+f.nodeName+'="'+I(f.value)+'"';}p+="<"+C(c)+Array.prototype.map.call(c.attributes,a).join("")+">";}function x(a){p+="</"+C(a)+">";
}function v(a){("start"==a.event?d:x)(a.node);}for(var E=0,p="",h=[];t.length||b.length;){var n=m();if(p+=I(w.substr(E,n[0].offset-E)),E=n[0].offset,n==t){h.reverse().forEach(x);
do{v(n.splice(0,1)[0]),n=m();}while(n==t&&n.length&&n[0].offset==E);h.reverse().forEach(d);}else{"start"==n[0].event?h.push(n[0].node):h.pop(),v(n.splice(0,1)[0]);
}}return p+I(w.substr(E));}function D(c){function d(f){return f&&f.source||f;}function a(e,f){return new RegExp(d(e),"m"+(c.cI?"i":"")+(f?"g":""));}function b(e,h){if(!e.compiled){if(e.compiled=!0,e.k=e.k||e.bK,e.k){var g={},n=function(i,f){c.cI&&(f=f.toLowerCase()),f.split(" ").forEach(function(p){var o=p.split("|");
g[o[0]]=[i,o[1]?Number(o[1]):1];});};"string"==typeof e.k?n("keyword",e.k):Object.keys(e.k).forEach(function(f){n(f,e.k[f]);}),e.k=g;}e.lR=a(e.l||/\b\w+\b/,!0),h&&(e.bK&&(e.b="\\b("+e.bK.split(" ").join("|")+")\\b"),e.b||(e.b=/\B|\b/),e.bR=a(e.b),e.e||e.eW||(e.e=/\B|\b/),e.e&&(e.eR=a(e.e)),e.tE=d(e.e)||"",e.eW&&h.tE&&(e.tE+=(e.e?"|":"")+h.tE)),e.i&&(e.iR=a(e.i)),void 0===e.r&&(e.r=1),e.c||(e.c=[]);
var l=[];e.c.forEach(function(f){f.v?f.v.forEach(function(i){l.push(H(f,i));}):l.push("self"==f?e:f);}),e.c=l,e.c.forEach(function(f){b(f,e);}),e.starts&&b(e.starts,h);
var m=e.c.map(function(f){return f.bK?"\\.?("+f.b+")\\.?":f.b;}).concat([e.tE,e.i]).map(d).filter(Boolean);e.t=m.length?a(m.join("|"),!0):{exec:function(){return null;
}};}}b(c);}function P(ai,X,am,af){function ab(b,c){for(var a=0;a<c.c.length;a++){if(F(c.c[a].bR,b)){return c.c[a];}}}function W(a,b){if(F(a.eR,b)){for(;
a.endsParent&&a.parent;){a=a.parent;}return a;}return a.eW?W(a.parent,b):void 0;}function ak(a,b){return !am&&F(b.iR,a);}function ah(b,c){var a=n.cI?c[0].toLowerCase():c[0];
return b.k.hasOwnProperty(a)&&b.k[a];}function ag(h,p,d,g){var b=g?"":y.classPrefix,c='<span class="'+b,m=d?"":"</span>";return c+=h+'">',c+p+m;}function aa(){if(!s.k){return I(Z);
}var g="",c=0;s.lR.lastIndex=0;for(var d=s.lR.exec(Z);d;){g+=I(Z.substr(c,d.index-c));var b=ah(s,d);b?(w+=b[1],g+=ag(b[0],I(d[0]))):g+=I(d[0]),c=s.lR.lastIndex,d=s.lR.exec(Z);
}return g+I(Z.substr(c));}function aj(){if(s.sL&&!q[s.sL]){return I(Z);}var a=s.sL?P(s.sL,Z,!0,r[s.sL]):K(Z);return s.r>0&&(w+=a.r),"continuous"==s.subLanguageMode&&(r[s.sL]=a.top),ag(a.language,a.value,!1,!0);
}function al(){return void 0!==s.sL?aj():aa();}function E(c,a){var b=c.cN?ag(c.cN,"",!0):"";c.rB?(ad+=b,Z=""):c.eB?(ad+=I(a)+b,Z=""):(ad+=b,Z=a),s=Object.create(c,{parent:{value:s}});
}function ac(h,d){if(Z+=h,void 0===d){return ad+=al(),0;}var g=ab(d,s);if(g){return ad+=al(),E(g,d),g.rB?0:d.length;}var b=W(s,d);if(b){var c=s;c.rE||c.eE||(Z+=d),ad+=al();
do{s.cN&&(ad+="</span>"),w+=s.r,s=s.parent;}while(s!=b.parent);return c.eE&&(ad+=I(d)),Z="",b.starts&&E(b.starts,""),c.rE?0:d.length;}if(ak(d,s)){throw new Error('Illegal lexeme "'+d+'" for mode "'+(s.cN||"<unnamed>")+'"');
}return Z+=d,d.length||1;}var n=B(ai);if(!n){throw new Error('Unknown language: "'+ai+'"');}D(n);var f,s=af||n,r={},ad="";for(f=s;f!=n;f=f.parent){f.cN&&(ad=ag(f.cN,"",!0)+ad);
}var Z="",w=0;try{for(var Y,ae,x=0;;){if(s.t.lastIndex=x,Y=s.t.exec(X),!Y){break;}ae=ac(X.substr(x,Y.index-x),Y[0]),x=Y.index+ae;}for(ac(X.substr(x)),f=s;
f.parent;f=f.parent){f.cN&&(ad+="</span>");}return{r:w,value:ad,language:ai,top:s};}catch(l){if(-1!=l.message.indexOf("Illegal")){return{r:0,value:I(X)};
}throw l;}}function K(f,c){c=c||y.languages||Object.keys(q);var d={r:0,value:I(f)},b=d;return c.forEach(function(e){if(B(e)){var a=P(e,f,!1);a.language=e,a.r>b.r&&(b=a),a.r>d.r&&(b=d,d=a);
}}),b.language&&(d.second_best=b),d;}function O(a){return y.tabReplace&&(a=a.replace(/^((<[^>]+>|\t)+)/gm,function(b,c){return c.replace(/\t/g,y.tabReplace);
})),y.useBR&&(a=a.replace(/\n/g,"<br>")),a;}function M(f,g,c){var d=g?j[g]:c,b=[f.trim()];return f.match(/\bhljs\b/)||b.push("hljs"),-1===f.indexOf(d)&&b.push(d),b.join(" ").trim();
}function G(f){var h=L(f);if(!V(h)){var a;y.useBR?(a=document.createElementNS("http://www.w3.org/1999/xhtml","div"),a.innerHTML=f.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):a=f;
var c=a.textContent,g=h?P(h,c,!0):K(c),b=A(a);if(b.length){var d=document.createElementNS("http://www.w3.org/1999/xhtml","div");d.innerHTML=g.value,g.value=T(b,A(d),c);
}g.value=O(g.value),f.innerHTML=g.value,f.className=M(f.className,h,g.language),f.result={language:g.language,re:g.r},g.second_best&&(f.second_best={language:g.second_best.language,re:g.second_best.r});
}}function S(a){y=H(y,a);}function U(){if(!U.called){U.called=!0;var a=document.querySelectorAll("pre code");Array.prototype.forEach.call(a,G);}}function z(){addEventListener("DOMContentLoaded",U,!1),addEventListener("load",U,!1);
}function J(c,a){var b=q[c]=a(Q);b.aliases&&b.aliases.forEach(function(d){j[d]=c;});}function k(){return Object.keys(q);}function B(a){return q[a]||q[j[a]];
}var y={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},q={},j={};return Q.highlight=P,Q.highlightAuto=K,Q.fixMarkup=O,Q.highlightBlock=G,Q.configure=S,Q.initHighlighting=U,Q.initHighlightingOnLoad=z,Q.registerLanguage=J,Q.listLanguages=k,Q.getLanguage=B,Q.inherit=H,Q.IR="[a-zA-Z]\\w*",Q.UIR="[a-zA-Z_]\\w*",Q.NR="\\b\\d+(\\.\\d+)?",Q.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Q.BNR="\\b(0b[01]+)",Q.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Q.BE={b:"\\\\[\\s\\S]",r:0},Q.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[Q.BE]},Q.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[Q.BE]},Q.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},Q.C=function(e,c,d){var b=Q.inherit({cN:"comment",b:e,e:c,c:[]},d||{});
return b.c.push(Q.PWM),b.c.push({cN:"doctag",bK:"TODO FIXME NOTE BUG XXX",r:0}),b;},Q.CLCM=Q.C("//","$"),Q.CBCM=Q.C("/\\*","\\*/"),Q.HCM=Q.C("#","$"),Q.NM={cN:"number",b:Q.NR,r:0},Q.CNM={cN:"number",b:Q.CNR,r:0},Q.BNM={cN:"number",b:Q.BNR,r:0},Q.CSSNM={cN:"number",b:Q.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},Q.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[Q.BE,{b:/\[/,e:/\]/,r:0,c:[Q.BE]}]},Q.TM={cN:"title",b:Q.IR,r:0},Q.UTM={cN:"title",b:Q.UIR,r:0},Q;
});hljs.registerLanguage("javascript",function(a){return{aliases:["js"],k:{keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},c:[{cN:"pi",r:10,b:/^\s*['"]use (strict|asm)['"]/},a.ASM,a.QSM,{cN:"string",b:"`",e:"`",c:[a.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},a.CLCM,a.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:a.CNR}],r:0},{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBCM,a.RM,{b:/</,e:/>\s*[);\]]/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:[a.CLCM,a.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+a.IR,r:0},{bK:"import",e:"[;$]",k:"import from as",c:[a.ASM,a.QSM]},{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},a.UTM]}]};
});hljs.registerLanguage("http",function(a){return{aliases:["https"],i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]};
});hljs.registerLanguage("css",function(f){var g="[a-zA-Z-][a-zA-Z0-9_-]*",b={cN:"function",b:g+"\\(",rB:!0,eE:!0,e:"\\("},d={cN:"rule",b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{cN:"value",eW:!0,eE:!0,c:[b,f.CSSNM,f.QSM,f.ASM,f.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]};
return{cI:!0,i:/[=\/|'\$]/,c:[f.CBCM,d,{cN:"id",b:/\#[A-Za-z0-9_-]+/},{cN:"class",b:/\.[A-Za-z0-9_-]+/},{cN:"attr_selector",b:/\[/,e:/\]/,i:"$"},{cN:"pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"']+/},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[b,f.ASM,f.QSM,f.CSSNM]}]},{cN:"tag",b:g,r:0},{cN:"rules",b:"{",e:"}",i:/\S/,c:[f.CBCM,d]}]};
});hljs.registerLanguage("cpp",function(a){var c={cN:"keyword",b:"[a-z\\d_]*_t"},b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};
return{aliases:["c","cc","h","c++","h++","hpp"],k:b,i:"</",c:[c,a.CLCM,a.CBCM,{cN:"string",v:[a.inherit(a.QSM,{b:'((u8?|U)|L)?"'}),{b:'(u8?|U)?R"',e:'"',c:[a.BE]},{b:"'\\\\?.",e:"'",i:"."}]},{cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},a.CNM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line pragma",c:[{b:/\\\n/,r:0},{b:'include\\s*[<"]',e:'[>"]',k:"include",i:"\\n"},a.CLCM]},{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,c:["self",c]},{b:a.IR+"::",k:b},{bK:"new throw return else",r:0},{cN:"function",b:"("+a.IR+"\\s+)+"+a.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:b,c:[{b:a.IR+"\\s*\\(",rB:!0,c:[a.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:b,r:0,c:[a.CBCM]},a.CLCM,a.CBCM]}]};
});hljs.registerLanguage("makefile",function(c){var b={cN:"variable",b:/\$\(/,e:/\)/,c:[c.BE]};return{aliases:["mk","mak"],c:[c.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[b]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[c.QSM,b]}]};
});hljs.registerLanguage("nginx",function(d){var c={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+d.UIR}]},a={eW:!0,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[d.HCM,{cN:"string",c:[d.BE,c],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[c]},{cN:"regexp",c:[d.BE,c],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},c]};
return{aliases:["nginxconf"],c:[d.HCM,{b:d.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"title",b:d.UIR,starts:a}],r:0}],i:"[^\\s\\}]"};});hljs.registerLanguage("python",function(g){var f={cN:"prompt",b:/^(>>>|\.\.\.) /},a={cN:"string",c:[g.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},g.ASM,g.QSM]},d={cN:"number",r:0,v:[{b:g.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:g.CNR+"[lLjJ]?"}]},h={cN:"params",b:/\(/,e:/\)/,c:["self",f,d,a]};
return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[f,d,a,g.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[g.UTM,h]},{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]};
});hljs.registerLanguage("markdown",function(a){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]};
});hljs.registerLanguage("xml",function(a){var d="[A-Za-z0-9\\._:-]+",b={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},f={eW:!0,i:/</,r:0,c:[b,{cN:"attribute",b:d,r:0},{b:"=",r:0,c:[{cN:"value",c:[b],v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};
return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},a.C("<!--","-->",{r:10}),{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[f],starts:{e:"</style>",rE:!0,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[f],starts:{e:"<\/script>",rE:!0,sL:""}},b,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},f]}]};
});hljs.registerLanguage("java",function(g){var b=g.UIR+"(<"+g.UIR+">)?",d="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",h="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",f={cN:"number",b:h,r:0};
return{aliases:["jsp"],k:d,i:/<\//,c:[g.C("/\\*\\*","\\*/",{r:0,c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),g.CLCM,g.CBCM,g.ASM,g.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},g.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+b+"\\s+)+"+g.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:d,c:[{b:g.UIR+"\\s*\\(",rB:!0,r:0,c:[g.UTM]},{cN:"params",b:/\(/,e:/\)/,k:d,r:0,c:[g.ASM,g.QSM,g.CNM,g.CBCM]},g.CLCM,g.CBCM]},f,{cN:"annotation",b:"@[A-Za-z]+"}]};
});hljs.registerLanguage("sql",function(b){var a=b.C("--","$");return{cI:!0,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke",e:/;/,eW:!0,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[b.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[b.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[b.BE]},b.CNM,b.CBCM,a]},b.CBCM,a]};
});hljs.registerLanguage("json",function(f){var d={literal:"true false null"},b=[f.QSM,f.CNM],a={cN:"value",e:",",eW:!0,eE:!0,c:b,k:d},h={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[f.BE],i:"\\n",starts:a}],i:"\\S"},g={b:"\\[",e:"\\]",c:[f.inherit(a,{cN:null})],i:"\\S"};
return b.splice(b.length,0,h,g),{c:b,k:d,i:"\\S"};});hljs.registerLanguage("bash",function(f){var c={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},d={cN:"string",b:/"/,e:/"/,c:[f.BE,c,{cN:"variable",b:/\$\(/,e:/\)/,c:[f.BE]}]},b={cN:"string",b:/'/,e:/'/};
return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[f.inherit(f.TM,{b:/\w[\w\d_]*/})],r:0},f.HCM,f.NM,d,b,c]};
});hljs.registerLanguage("php",function(f){var h={cN:"variable",b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},b={cN:"preprocessor",b:/<\?(php)?|\?>/},d={cN:"string",c:[f.BE,b],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},f.inherit(f.ASM,{i:null}),f.inherit(f.QSM,{i:null})]},g={v:[f.BNM,f.CNM]};
return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[f.CLCM,f.HCM,f.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"},b]}),f.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:f.UIR}),{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[f.BE]},b,h,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[f.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",h,f.CBCM,d,g]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},f.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[f.UTM]},{bK:"use",e:";",c:[f.UTM]},{b:"=>"},d,g]};
});hljs.registerLanguage("perl",function(h){var d="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",g={cN:"subst",b:"[$@]\\{",e:"\\}",k:d},f={b:"->{",e:"}"},k={cN:"variable",v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},c=h.C("^(__END__|__DATA__)","\\n$",{r:5}),j=[h.BE,g,k],b=[k,h.HCM,c,h.C("^\\=\\w","\\=cut",{eW:!0}),f,{cN:"string",c:j,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[h.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[h.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+h.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[h.HCM,c,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[h.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];
return g.c=b,f.c=b,{aliases:["pl"],k:d,c:b};});LanEditor.Keyword.extend({js:["var","function","break","delete","return","typeof","case","do","if","switch","catch","else","in","this","void","continue","false","instanceof","throw","while","debugger","finally","new","true","with","default","for","null","try"],css:["position","relative","absolute","margin","margin-left","margin-top","margin-right","margin-bottom","padding","padding-top","padding-bottom","padding-left","padding-right","border","border-top","border-bottom","border-left","border-right","width","min-width","max-width","height","min-height","max-height","line-height","font","font-size","font-face","font-family","font-style","font-weight","color","background-color","background-image","box-sizing","border-box","content-box","box-shadow","text-shadow","list","list-style","li","text-decoration"]});