玛氪宕·梦魔(Markdown Memo),使用Markdown的云端备忘录,百度IFE的RIA启航班的不合格的作业,才……才没有什么阴谋呢!
源gitee链接https://gitee.com/arathi/MarkdownMemo?_from=gitee_search
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
29 KiB
2 lines
29 KiB
/*! Editor.md v1.1.9 | addons.min.js | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-04 */
|
|
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineOption("showTrailingSpace",!1,function(t,n,o){o==e.Init&&(o=!1),o&&!n?t.removeOverlay("trailingspace"):!o&&n&&t.addOverlay({token:function(e){for(var t=e.string.length,n=t;n&&/\s/.test(e.string.charAt(n-1));--n);return n>e.pos?(e.pos=n,null):(e.pos=t,"trailingspace")},name:"trailingspace"})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var o,r=e.getWrapperElement();return o=r.appendChild(document.createElement("div")),o.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?o.innerHTML=t:o.appendChild(t),o}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(o,r,i){function a(e){if("string"==typeof e)u.value=e;else{if(c)return;c=!0,l.parentNode.removeChild(l),f.focus(),i.onClose&&i.onClose(l)}}i||(i={}),n(this,null);var s,l=t(this,o,i.bottom),c=!1,f=this,u=l.getElementsByTagName("input")[0];return u?(i.value&&(u.value=i.value,u.select()),i.onInput&&e.on(u,"input",function(e){i.onInput(e,u.value,a)}),i.onKeyUp&&e.on(u,"keyup",function(e){i.onKeyUp(e,u.value,a)}),e.on(u,"keydown",function(t){i&&i.onKeyDown&&i.onKeyDown(t,u.value,a)||((27==t.keyCode||i.closeOnEnter!==!1&&13==t.keyCode)&&(u.blur(),e.e_stop(t),a()),13==t.keyCode&&r(u.value,t))}),i.closeOnBlur!==!1&&e.on(u,"blur",a),u.focus()):(s=l.getElementsByTagName("button")[0])&&(e.on(s,"click",function(){a(),f.focus()}),i.closeOnBlur!==!1&&e.on(s,"blur",a),s.focus()),a}),e.defineExtension("openConfirm",function(o,r,i){function a(){c||(c=!0,s.parentNode.removeChild(s),f.focus())}n(this,null);var s=t(this,o,i&&i.bottom),l=s.getElementsByTagName("button"),c=!1,f=this,u=1;l[0].focus();for(var h=0;h<l.length;++h){var d=l[h];!function(t){e.on(d,"click",function(n){e.e_preventDefault(n),a(),t&&t(f)})}(r[h]),e.on(d,"blur",function(){--u,setTimeout(function(){0>=u&&a()},200)}),e.on(d,"focus",function(){++u})}}),e.defineExtension("openNotification",function(o,r){function i(){l||(l=!0,clearTimeout(a),s.parentNode.removeChild(s))}n(this,i);var a,s=t(this,o,r&&r.bottom),l=!1,c=r&&"undefined"!=typeof r.duration?r.duration:5e3;return e.on(s,"click",function(t){e.e_preventDefault(t),i()}),c&&(a=setTimeout(i,c)),i})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,i){if(this.atOccurrence=!1,this.doc=e,null==i&&"string"==typeof t&&(i=!1),r=r?e.clipPos(r):o(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){t.lastIndex=0;for(var i,a,s=e.getLine(r.line).slice(0,r.ch),l=0;;){t.lastIndex=l;var c=t.exec(s);if(!c)break;if(i=c,a=i.index,l=i.index+(i[0].length||1),l==s.length)break}var f=i&&i[0].length||0;f||(0==a&&0==s.length?i=void 0:a!=e.getLine(r.line).length&&f++)}else{t.lastIndex=r.ch;var s=e.getLine(r.line),i=t.exec(s),f=i&&i[0].length||0,a=i&&i.index;a+f==s.length||f||(f=1)}return i&&f?{from:o(r.line,a),to:o(r.line,a+f),match:i}:void 0};else{var a=t;i&&(t=t.toLowerCase());var s=i?function(e){return e.toLowerCase()}:function(e){return e},l=t.split("\n");if(1==l.length)this.matches=t.length?function(r,i){if(r){var l=e.getLine(i.line).slice(0,i.ch),c=s(l),f=c.lastIndexOf(t);if(f>-1)return f=n(l,c,f),{from:o(i.line,f),to:o(i.line,f+a.length)}}else{var l=e.getLine(i.line).slice(i.ch),c=s(l),f=c.indexOf(t);if(f>-1)return f=n(l,c,f)+i.ch,{from:o(i.line,f),to:o(i.line,f+a.length)}}}:function(){};else{var c=a.split("\n");this.matches=function(t,n){var r=l.length-1;if(t){if(n.line-(l.length-1)<e.firstLine())return;if(s(e.getLine(n.line).slice(0,c[r].length))!=l[l.length-1])return;for(var i=o(n.line,c[r].length),a=n.line-1,f=r-1;f>=1;--f,--a)if(l[f]!=s(e.getLine(a)))return;var u=e.getLine(a),h=u.length-c[0].length;if(s(u.slice(h))!=l[0])return;return{from:o(a,h),to:i}}if(!(n.line+(l.length-1)>e.lastLine())){var u=e.getLine(n.line),h=u.length-c[0].length;if(s(u.slice(h))==l[0]){for(var d=o(n.line,h),a=n.line+1,f=1;r>f;++f,++a)if(l[f]!=s(e.getLine(a)))return;if(s(e.getLine(a).slice(0,c[r].length))==l[r])return{from:d,to:o(a,c[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var o=Math.min(n,e.length);;){var r=e.slice(0,o).toLowerCase().length;if(n>r)++o;else{if(!(r>n))return o;--o}}}var o=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=o(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=o(r.line-1,this.doc.getLine(r.line-1).length)}else{var i=this.doc.lineCount();if(r.line==i-1)return t(i);r=o(r.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){if(this.atOccurrence){var n=e.splitLines(t);this.doc.replaceRange(n,this.pos.from,this.pos.to),this.pos.to=o(this.pos.from.line+n.length-1,n[n.length-1].length+(1==n.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,o){return new t(this.doc,e,n,o)}),e.defineDocExtension("getSearchCursor",function(e,n,o){return new t(this,e,n,o)}),e.defineExtension("selectMatches",function(t,n){for(var o,r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);(o=i.findNext())&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.query=null,this.overlay=null}function o(e){return e.state.search||(e.state.search=new n)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function i(e,t,n){return e.getSearchCursor(t,n,r(t))}function a(e,t,n,o,r){e.openDialog?e.openDialog(t,r,{value:o}):r(prompt(n,o))}function s(e,t,n,o){e.openConfirm?e.openConfirm(t,o):confirm(n)&&o[0]()}function l(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(n){}return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,n){var i=o(e);return i.query?f(e,n):void a(e,d,"Search for:",e.getSelection(),function(o){e.operation(function(){o&&!i.query&&(i.query=l(o),e.removeOverlay(i.overlay,r(i.query)),i.overlay=t(i.query,r(i.query)),e.addOverlay(i.overlay),e.showMatchesOnScrollbar&&(i.annotate&&(i.annotate.clear(),i.annotate=null),i.annotate=e.showMatchesOnScrollbar(i.query,r(i.query))),i.posFrom=i.posTo=e.getCursor(),f(e,n))})})}function f(t,n){t.operation(function(){var r=o(t),a=i(t,r.query,n?r.posFrom:r.posTo);(a.find(n)||(a=i(t,r.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),a.find(n)))&&(t.setSelection(a.from(),a.to()),t.scrollIntoView({from:a.from(),to:a.to()}),r.posFrom=a.from(),r.posTo=a.to())})}function u(e){e.operation(function(){var t=o(e);t.query&&(t.query=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function h(e,t){e.getOption("readOnly")||a(e,p,"Replace:",e.getSelection(),function(n){n&&(n=l(n),a(e,g,"Replace with:","",function(o){if(t)e.operation(function(){for(var t=i(e,n);t.findNext();)if("string"!=typeof n){var r=e.getRange(t.from(),t.to()).match(n);t.replace(o.replace(/\$(\d)/g,function(e,t){return r[t]}))}else t.replace(o)});else{u(e);var r=i(e,n,e.getCursor()),a=function(){var t,o=r.from();!(t=r.findNext())&&(r=i(e,n),!(t=r.findNext())||o&&r.from().line==o.line&&r.from().ch==o.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),s(e,m,"Replace?",[function(){l(t)},a]))},l=function(e){r.replace("string"==typeof n?o:o.replace(/\$(\d)/g,function(t,n){return e[n]})),a()};a()}}))})}var d='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',p='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',g='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',m="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";e.commands.find=function(e){u(e),c(e)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=u,e.commands.replace=h,e.commands.replaceAll=function(e){h(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){this.cm=e,this.className=t,this.annotations=[],this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;e.on("refresh",this.resizeHandler=function(){n.computeScale()&&n.redraw()})}e.defineExtension("annotateScrollbar",function(e){return new t(this,e)}),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight)/e.heightAtLine(e.lastLine()+1,"local");return t!=this.hScale?(this.hScale=t,!0):void 0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(){var e=this.cm,t=this.hScale;if(e.display.barWidth){for(var n,o=document.createDocumentFragment(),r=this.annotations,i=0;i<r.length;i++){for(var a=r[i],s=n||e.charCoords(a.from,"local").top*t,l=e.charCoords(a.to,"local").bottom*t;i<r.length-1&&(n=e.charCoords(r[i+1].from,"local").top*t,!(n>l+.9));)a=r[++i],l=e.charCoords(a.to,"local").bottom*t;var c=Math.max(l-s,3),f=o.appendChild(document.createElement("div"));f.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+s+"px; height: "+c+"px",f.className=this.className}this.div.textContent="",this.div.appendChild(o)}},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,o){this.cm=e,this.annotation=e.annotateScrollbar(o||"CodeMirror-search-match"),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var r=this;e.on("change",this.changeHandler=function(e,t){r.onChange(t)})}function n(e,t,n){return t>=e?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,o){return new t(this,e,n,o)});var o=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length;t++){var n=this.matches[t];if(n.from.line>=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var r=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold);r.findNext();){var n={from:r.from(),to:r.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var o=t.from.line,r=e.changeEnd(t).line,i=r-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,o,i),t.from.line),this.gap.to=Math.max(n(this.gap.to,o,i),t.from.line)):this.gap={from:t.from.line,to:r+1},i)for(var a=0;a<this.matches.length;a++){var s=this.matches[a],l=n(s.from.line,o,i);l!=s.from.line&&(s.from=e.Pos(l,s.from.ch));var c=n(s.to.line,o,i);c!=s.to.line&&(s.to=e.Pos(c,s.to.ch))}clearTimeout(this.update);var f=this;this.update=setTimeout(function(){f.updateAfterChange()},250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder",n.appendChild(document.createTextNode(e.getOption("placeholder"))),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function o(e){i(e)&&n(e)}function r(e){var o=e.getWrapperElement(),r=i(e);o.className=o.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function i(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,i,a){var s=a&&a!=e.Init;if(i&&!s)n.on("blur",o),n.on("change",r),r(n);else if(!i&&s){n.off("blur",o),n.off("change",r),t(n);var l=n.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}i&&!n.hasFocus()&&o(n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),o=[],l=0;l<n.length;l++){if(!n[l].empty())return e.Pass;var c=n[l].head,f=t.getTokenAt(c),u=e.innerMode(t.getMode(),f.state),h=u.state;if("xml"!=u.mode.name||!h.tagName)return e.Pass;var d=t.getOption("autoCloseTags"),p="html"==u.mode.configuration,g="object"==typeof d&&d.dontCloseTags||p&&a,m="object"==typeof d&&d.indentTags||p&&s,v=h.tagName;f.end>c.ch&&(v=v.slice(0,v.length-f.end+c.ch));var y=v.toLowerCase();if(!v||"string"==f.type&&(f.end!=c.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||1==f.string.length)||"tag"==f.type&&"closeTag"==h.type||f.string.indexOf("/")==f.string.length-1||g&&r(g,y)>-1||i(t,v,c,h,!0))return e.Pass;var b=m&&r(m,y)>-1;o[l]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=n.length-1;l>=0;l--){var C=o[l];t.replaceRange(C.text,n[l].head,n[l].anchor,"+insert");var x=t.listSelections().slice(0);x[l]={head:C.newPos,anchor:C.newPos},t.setSelections(x),C.indent&&(t.indentLine(C.newPos.line,null,!0),t.indentLine(C.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],a=n?"/":"</",s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=o[s].head,c=t.getTokenAt(l),f=e.innerMode(t.getMode(),c.state),u=f.state;if(n&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=l.ch-1))return e.Pass;if("xml"!=f.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==f.mode.name)r[s]=a+"script>";else{if("htmlmixed"!=t.getMode().name||"css"!=f.mode.name)return e.Pass;r[s]=a+"style>"}else{if(!u.context||!u.context.tagName||i(t,u.context.tagName,l,u))return e.Pass;r[s]=a+u.context.tagName+">"}}t.replaceSelections(r),o=t.listSelections();for(var s=0;s<o.length;s++)(s==o.length-1||o[s].head.line<o[s+1].head.line)&&t.indentLine(o[s].head.line)}function o(t){return t.getOption("disableInput")?e.Pass:void n(t,!0)}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;o>n;++n)if(e[n]==t)return n;return-1}function i(t,n,o,r,i){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,o.line+500),s=e.scanForClosingTag(t,o,null,a);if(!s||s.tag!=n)return!1;for(var l=r.context,c=i?1:0;l&&l.tagName==n;l=l.prev)++c;o=s.to;for(var f=1;c>f;f++){var u=e.scanForClosingTag(t,o,null,a);if(!u||u.tag!=n)return!1;o=u.to}return!0}e.defineOption("autoCloseTags",!1,function(n,r,i){if(i!=e.Init&&i&&n.removeKeyMap("autoCloseTags"),r){var a={name:"autoCloseTags"};("object"!=typeof r||r.whenClosing)&&(a["'/'"]=function(e){return o(e)}),("object"!=typeof r||r.whenOpening)&&(a["'>'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,o){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=o?o.from:e.firstLine(),this.max=o?o.to-1:e.lastLine()}function o(e,t){var n=e.cm.getTokenTypeAt(h(e.line,t));return n&&/\btag\b/.test(n)}function r(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function i(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(r(e))continue;return}{if(o(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(i(e))continue;return}if(o(e,t+1)){g.lastIndex=t,e.ch=t;var n=g.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function l(e){for(;;){g.lastIndex=e.ch;var t=g.exec(e.text);if(!t){if(r(e))continue;return}{if(o(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(i(e))continue;return}{if(o(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}}function f(e,t){for(var n=[];;){var o,r=l(e),i=e.line,s=e.ch-(r?r[0].length:0);if(!r||!(o=a(e)))return;if("selfClose"!=o)if(r[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==r[2]){n.length=c;break}if(0>c&&(!t||t==r[2]))return{tag:r[2],from:h(i,s),to:h(e.line,e.ch)}}else n.push(r[2])}}function u(e,t){for(var n=[];;){var o=c(e);if(!o)return;if("selfClose"!=o){var r=e.line,i=e.ch,a=s(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(0>l&&(!t||t==a[2]))return{tag:a[2],from:h(e.line,e.ch),to:h(r,i)}}}else s(e)}}var h=e.Pos,d="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var o=new n(e,t.line,0);;){var r,i=l(o);if(!i||o.line!=t.line||!(r=a(o)))return;if(!i[1]&&"selfClose"!=r){var t=h(o.line,o.ch),s=f(o,i[2]);return s&&{from:t,to:s.from}}}}),e.findMatchingTag=function(e,o,r){var i=new n(e,o.line,o.ch,r);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var l=a(i),c=l&&h(i.line,i.ch),d=l&&s(i);if(l&&d&&!(t(i,o)>0)){var p={from:h(i.line,i.ch),to:c,tag:d[2]};return"selfClose"==l?{open:p,close:null,at:"open"}:d[1]?{open:u(i,d[2]),close:p,at:"close"}:(i=new n(e,c.line,c.ch,r),{open:p,close:f(i,d[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,o){for(var r=new n(e,t.line,t.ch,o);;){var i=u(r);if(!i)break;var a=new n(e,t.line,t.ch,o),s=f(a,i.tag);if(s)return{open:i,close:s}}},e.scanForClosingTag=function(e,t,o,r){var i=new n(e,t.line,t.ch,r?{from:0,to:r}:null);return f(i,o)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,o){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(o){return{base:e.copyState(t,o.base),overlay:e.copyState(n,o.overlay),basePos:o.basePos,baseCur:null,overlayPos:o.overlayPos,overlayCur:null}},token:function(e,r){return(e!=r.streamSeen||Math.min(r.basePos,r.overlayPos)<e.start)&&(r.streamSeen=e,r.basePos=r.overlayPos=e.start),e.start==r.basePos&&(r.baseCur=t.token(e,r.base),r.basePos=e.pos),e.start==r.overlayPos&&(e.pos=e.start,r.overlayCur=n.token(e,r.overlay),r.overlayPos=e.pos),e.pos=Math.min(r.basePos,r.overlayPos),null==r.overlayCur?r.baseCur:null!=r.baseCur&&r.overlay.combineTokens||o&&null==r.overlay.combineTokens?r.baseCur+" "+r.overlayCur:r.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",i),e.removeLineClass(e.state.activeLines[t],"background",a)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function o(e,o){for(var r=[],s=0;s<o.length;s++){var l=o[s];if(l.empty()){var c=e.getLineHandleVisualStart(l.head.line);r[r.length-1]!=c&&r.push(c)}}n(e.state.activeLines,r)||e.operation(function(){t(e);for(var n=0;n<r.length;n++)e.addLineClass(r[n],"wrap",i),e.addLineClass(r[n],"background",a);e.state.activeLines=r})}function r(e,t){o(e,t.ranges)}var i="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(n,i,a){var s=a&&a!=e.Init;i&&!s?(n.state.activeLines=[],o(n,n.listSelections()),n.on("beforeSelectionChange",r)):!i&&s&&(n.off("beforeSelectionChange",r),t(n),delete n.state.activeLines)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){var n=e.getRange(l(t.line,t.ch-1),l(t.line,t.ch+1));return 2==n.length?n:null}function n(t,n,o){var r=t.getLine(n.line),i=t.getTokenAt(n);if(/\bstring2?\b/.test(i.type))return!1;var a=new e.StringStream(r.slice(0,n.ch)+o+r.slice(n.ch),4);for(a.pos=a.start=i.start;;){var s=t.getMode().token(a,i.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}function o(o){for(var r={name:"autoCloseBrackets",Backspace:function(n){if(n.getOption("disableInput"))return e.Pass;for(var r=n.listSelections(),i=0;i<r.length;i++){if(!r[i].empty())return e.Pass;var a=t(n,r[i].head);if(!a||o.indexOf(a)%2!=0)return e.Pass}for(var i=r.length-1;i>=0;i--){var s=r[i].head;n.replaceRange("",l(s.line,s.ch-1),l(s.line,s.ch+1))}}},i="",a=0;a<o.length;a+=2)(function(t,o){i+=o,r["'"+t+"'"]=function(r){if(r.getOption("disableInput"))return e.Pass;for(var a,c,f=r.listSelections(),u=0;u<f.length;u++){var h,d=f[u],p=d.head,c=r.getRange(p,l(p.line,p.ch+1));if(d.empty())if(t==o&&c==o)h=r.getRange(p,l(p.line,p.ch+3))==t+t+t?"skipThree":"skip";else if(t==o&&p.ch>1&&r.getRange(l(p.line,p.ch-2),p)==t+t&&(p.ch<=2||r.getRange(l(p.line,p.ch-3),l(p.line,p.ch-2))!=t))h="addFour";else if('"'==t||"'"==t){if(e.isWordChar(c)||!n(r,p,t))return e.Pass;h="both"}else{if(!(r.getLine(p.line).length==p.ch||i.indexOf(c)>=0||s.test(c)))return e.Pass;h="both"}else h="surround";if(a){if(a!=h)return e.Pass}else a=h}r.operation(function(){if("skip"==a)r.execCommand("goCharRight");else if("skipThree"==a)for(var e=0;3>e;e++)r.execCommand("goCharRight");else if("surround"==a){for(var n=r.getSelections(),e=0;e<n.length;e++)n[e]=t+n[e]+o;r.replaceSelections(n,"around")}else"both"==a?(r.replaceSelection(t+o,null),r.execCommand("goCharLeft")):"addFour"==a&&(r.replaceSelection(t+t+t+t,"before"),r.execCommand("goCharRight"))})},t!=o&&(r["'"+o+"'"]=function(t){for(var n=t.listSelections(),r=0;r<n.length;r++){var i=n[r];if(!i.empty()||t.getRange(i.head,l(i.head.line,i.head.ch+1))!=o)return e.Pass}t.execCommand("goCharRight")})})(o.charAt(a),o.charAt(a+1));return r}function r(n){return function(o){if(o.getOption("disableInput"))return e.Pass;for(var r=o.listSelections(),i=0;i<r.length;i++){if(!r[i].empty())return e.Pass;var a=t(o,r[i].head);if(!a||n.indexOf(a)%2!=0)return e.Pass}o.operation(function(){o.replaceSelection("\n\n",null),o.execCommand("goCharLeft"),r=o.listSelections();for(var e=0;e<r.length;e++){var t=r[e].head.line;o.indentLine(t,null,!0),o.indentLine(t+1,null,!0)}})}}var i="()[]{}''\"\"",a="[]{}",s=/\s/,l=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,s){if(s!=e.Init&&s&&t.removeKeyMap("autoCloseBrackets"),n){var l=i,c=a;"string"==typeof n?l=n:"object"==typeof n&&(null!=n.pairs&&(l=n.pairs),null!=n.explode&&(c=n.explode));var f=o(l);c&&(f.Enter=r(c)),t.addKeyMap(f)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(o,r,i){i==e.Init&&(i=!1),!i!=!r&&(r?t(o):n(o))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){"object"==typeof e&&(this.minChars=e.minChars,this.style=e.style,this.showToken=e.showToken,this.delay=e.delay,this.wordsOnly=e.wordsOnly),null==this.style&&(this.style=l),null==this.minChars&&(this.minChars=s),null==this.delay&&(this.delay=c),null==this.wordsOnly&&(this.wordsOnly=f),this.overlay=this.timeout=null}function n(e){var t=e.state.matchHighlighter;clearTimeout(t.timeout),t.timeout=setTimeout(function(){o(e)},t.delay)}function o(e){e.operation(function(){var t=e.state.matchHighlighter;if(t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null),!e.somethingSelected()&&t.showToken){for(var n=t.showToken===!0?/[\w$]/:t.showToken,o=e.getCursor(),i=e.getLine(o.line),s=o.ch,l=s;s&&n.test(i.charAt(s-1));)--s;for(;l<i.length&&n.test(i.charAt(l));)++l;return void(l>s&&e.addOverlay(t.overlay=a(i.slice(s,l),n,t.style)))}var c=e.getCursor("from"),f=e.getCursor("to");if(c.line==f.line&&(!t.wordsOnly||r(e,c,f))){var u=e.getRange(c,f).replace(/^\s+|\s+$/g,"");u.length>=t.minChars&&e.addOverlay(t.overlay=a(u,!1,t.style))}})}function r(e,t,n){var o=e.getRange(t,n);if(null!==o.match(/^\w+$/)){if(t.ch>0){var r={line:t.line,ch:t.ch-1},i=e.getRange(r,t);if(null===i.match(/\W/))return!1}if(n.ch<e.getLine(t.line).length){var r={line:n.line,ch:n.ch+1},i=e.getRange(n,r);if(null===i.match(/\W/))return!1}return!0}return!1}function i(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}function a(e,t,n){return{token:function(o){return!o.match(e)||t&&!i(o,t)?(o.next(),void(o.skipTo(e.charAt(0))||o.skipToEnd())):n}}}var s=2,l="matchhighlight",c=100,f=!1;e.defineOption("highlightSelectionMatches",!1,function(r,i,a){if(a&&a!=e.Init){var s=r.state.matchHighlighter.overlay;s&&r.removeOverlay(s),clearTimeout(r.state.matchHighlighter.timeout),r.state.matchHighlighter=null,r.off("cursorActivity",n)}i&&(r.state.matchHighlighter=new t(i),o(r),r.on("cursorActivity",n))})});
|