玛氪宕·梦魔(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.
4 lines
38 KiB
4 lines
38 KiB
/*! Editor.md v1.4.0 | /var/www/html/editor.md/lib/codemirror/addons.min.js | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-03-23 */
|
|
!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(f)return;f=!0,s.parentNode.removeChild(s),c.focus(),i.onClose&&i.onClose(s)}}i||(i={}),n(this,null);var l,s=t(this,o,i.bottom),f=!1,c=this,u=s.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()):(l=s.getElementsByTagName("button")[0])&&(e.on(l,"click",function(){a(),c.focus()}),i.closeOnBlur!==!1&&e.on(l,"blur",a),l.focus()),a}),e.defineExtension("openConfirm",function(o,r,i){function a(){f||(f=!0,l.parentNode.removeChild(l),c.focus())}n(this,null);var l=t(this,o,i&&i.bottom),s=l.getElementsByTagName("button"),f=!1,c=this,u=1;s[0].focus();for(var d=0;d<s.length;++d){var h=s[d];!function(t){e.on(h,"click",function(n){e.e_preventDefault(n),a(),t&&t(c)})}(r[d]),e.on(h,"blur",function(){--u,setTimeout(function(){0>=u&&a()},200)}),e.on(h,"focus",function(){++u})}}),e.defineExtension("openNotification",function(o,r){function i(){s||(s=!0,clearTimeout(a),l.parentNode.removeChild(l))}n(this,i);var a,l=t(this,o,r&&r.bottom),s=!1,f=r&&"undefined"!=typeof r.duration?r.duration:5e3;return e.on(l,"click",function(t){e.e_preventDefault(t),i()}),f&&(a=setTimeout(i,f)),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,l=e.getLine(r.line).slice(0,r.ch),s=0;;){t.lastIndex=s;var f=t.exec(l);if(!f)break;if(i=f,a=i.index,s=i.index+(i[0].length||1),s==l.length)break}var c=i&&i[0].length||0;c||(0==a&&0==l.length?i=void 0:a!=e.getLine(r.line).length&&c++)}else{t.lastIndex=r.ch;var l=e.getLine(r.line),i=t.exec(l),c=i&&i[0].length||0,a=i&&i.index;a+c==l.length||c||(c=1)}return i&&c?{from:o(r.line,a),to:o(r.line,a+c),match:i}:void 0};else{var a=t;i&&(t=t.toLowerCase());var l=i?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");if(1==s.length)this.matches=t.length?function(r,i){if(r){var s=e.getLine(i.line).slice(0,i.ch),f=l(s),c=f.lastIndexOf(t);if(c>-1)return c=n(s,f,c),{from:o(i.line,c),to:o(i.line,c+a.length)}}else{var s=e.getLine(i.line).slice(i.ch),f=l(s),c=f.indexOf(t);if(c>-1)return c=n(s,f,c)+i.ch,{from:o(i.line,c),to:o(i.line,c+a.length)}}}:function(){};else{var f=a.split("\n");this.matches=function(t,n){var r=s.length-1;if(t){if(n.line-(s.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,f[r].length))!=s[s.length-1])return;for(var i=o(n.line,f[r].length),a=n.line-1,c=r-1;c>=1;--c,--a)if(s[c]!=l(e.getLine(a)))return;var u=e.getLine(a),d=u.length-f[0].length;if(l(u.slice(d))!=s[0])return;return{from:o(a,d),to:i}}if(!(n.line+(s.length-1)>e.lastLine())){var u=e.getLine(n.line),d=u.length-f[0].length;if(l(u.slice(d))==s[0]){for(var h=o(n.line,d),a=n.line+1,c=1;r>c;++c,++a)if(s[c]!=l(e.getLine(a)))return;if(l(e.getLine(a).slice(0,f[r].length))==s[r])return{from:h,to:o(a,f[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 l(e,t,n,o){e.openConfirm?e.openConfirm(t,o):confirm(n)&&o[0]()}function s(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 f(e,n){var i=o(e);return i.query?c(e,n):void a(e,h,"Search for:",e.getSelection(),function(o){e.operation(function(){o&&!i.query&&(i.query=s(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(),c(e,n))})})}function c(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 d(e,t){e.getOption("readOnly")||a(e,p,"Replace:",e.getSelection(),function(n){n&&(n=s(n),a(e,m,"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()}),l(e,g,"Replace?",[function(){s(t)},a]))},s=function(e){r.replace("string"==typeof n?o:o.replace(/\$(\d)/g,function(t,n){return e[n]})),a()};a()}}))})}var h='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>',m='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',g="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";e.commands.find=function(e){u(e),f(e)},e.commands.findNext=f,e.commands.findPrev=function(e){f(e,!0)},e.commands.clearSearch=u,e.commands.replace=d,e.commands.replaceAll=function(e){d(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){function n(e){clearTimeout(o.doRedraw),o.doRedraw=setTimeout(function(){o.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,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 o=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(o.doUpdate),o.doUpdate=setTimeout(function(){o.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/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(e){e!==!1&&this.computeScale();var t=this.cm,n=this.hScale,o=document.createDocumentFragment(),r=this.annotations;if(t.display.barWidth)for(var i,a=0;a<r.length;a++){for(var l=r[a],s=i||t.charCoords(l.from,"local").top*n,f=t.charCoords(l.to,"local").bottom*n;a<r.length-1&&(i=t.charCoords(r[a+1].from,"local").top*n,!(i>f+.9));)l=r[++a],f=t.charCoords(l.to,"local").bottom*n;if(f!=s){var c=Math.max(f-s,3),u=o.appendChild(document.createElement("div"));u.style.cssText="position: absolute; right: 0px; width: "+Math.max(t.display.barWidth-1,2)+"px; top: "+(s+this.buttonHeight)+"px; height: "+c+"px",u.className=this.options.className}}this.div.textContent="",this.div.appendChild(o)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),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;var r={listenForChanges:!1};for(var i in o)r[i]=o[i];r.className||(r.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(r),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 a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return t>=e?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,o){return"string"==typeof o&&(o={className:o}),o||(o={}),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 l=this.matches[a],s=n(l.from.line,o,i);s!=l.from.line&&(l.from=e.Pos(s,l.from.ch));var f=n(l.to.line,o,i);f!=l.to.line&&(l.to=e.Pos(f,l.to.ch))}clearTimeout(this.update);var c=this;this.update=setTimeout(function(){c.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 l=a&&a!=e.Init;if(i&&!l)n.on("blur",o),n.on("change",r),r(n);else if(!i&&l){n.off("blur",o),n.off("change",r),t(n);var s=n.getWrapperElement();s.className=s.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=[],s=0;s<n.length;s++){if(!n[s].empty())return e.Pass;var f=n[s].head,c=t.getTokenAt(f),u=e.innerMode(t.getMode(),c.state),d=u.state;if("xml"!=u.mode.name||!d.tagName)return e.Pass;var h=t.getOption("autoCloseTags"),p="html"==u.mode.configuration,m="object"==typeof h&&h.dontCloseTags||p&&a,g="object"==typeof h&&h.indentTags||p&&l,v=d.tagName;c.end>f.ch&&(v=v.slice(0,v.length-c.end+f.ch));var y=v.toLowerCase();if(!v||"string"==c.type&&(c.end!=f.ch||!/[\"\']/.test(c.string.charAt(c.string.length-1))||1==c.string.length)||"tag"==c.type&&"closeTag"==d.type||c.string.indexOf("/")==c.string.length-1||m&&r(m,y)>-1||i(t,v,f,d,!0))return e.Pass;var b=g&&r(g,y)>-1;o[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(f.line+1,0):e.Pos(f.line,f.ch+1)}}for(var s=n.length-1;s>=0;s--){var C=o[s];t.replaceRange(C.text,n[s].head,n[s].anchor,"+insert");var x=t.listSelections().slice(0);x[s]={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?"/":"</",l=0;l<o.length;l++){if(!o[l].empty())return e.Pass;var s=o[l].head,f=t.getTokenAt(s),c=e.innerMode(t.getMode(),f.state),u=c.state;if(n&&("string"==f.type||"<"!=f.string.charAt(0)||f.start!=s.ch-1))return e.Pass;if("xml"!=c.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==c.mode.name)r[l]=a+"script>";else{if("htmlmixed"!=t.getMode().name||"css"!=c.mode.name)return e.Pass;r[l]=a+"style>"}else{if(!u.context||!u.context.tagName||i(t,u.context.tagName,s,u))return e.Pass;r[l]=a+u.context.tagName+">"}}t.replaceSelections(r),o=t.listSelections();for(var l=0;l<o.length;l++)(l==o.length-1||o[l].head.line<o[l+1].head.line)&&t.indentLine(o[l].head.line)}function o(t){return t.getOption("disableInput")?e.Pass: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),l=e.scanForClosingTag(t,o,null,a);if(!l||l.tag!=n)return!1;for(var s=r.context,f=i?1:0;s&&s.tagName==n;s=s.prev)++f;o=l.to;for(var c=1;f>c;c++){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"],l=["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(t,r,i,a){function l(e){var n=s(t,r);if(!n||n.to.line-n.from.line<f)return null;for(var o=t.findMarksAt(n.from),i=0;i<o.length;++i)if(o[i].__isFold&&"fold"!==a){if(!e)return null;n.cleared=!0,o[i].clear()}return n}if(i&&i.call){var s=i;i=null}else var s=o(t,i,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var f=o(t,i,"minFoldSize"),c=l(!0);if(o(t,i,"scanUp"))for(;!c&&r.line>t.firstLine();)r=e.Pos(r.line-1,0),c=l(!1);if(c&&!c.cleared&&"unfold"!==a){var u=n(t,i);e.on(u,"mousedown",function(t){d.clear(),e.e_preventDefault(t)});var d=t.markText(c.from,c.to,{replacedWith:u,clearOnEnter:!0,__isFold:!0});d.on("clear",function(n,o){e.signal(t,"unfold",t,n,o)}),e.signal(t,"fold",t,c.from,c.to)}}function n(e,t){var n=o(e,t,"widget");if("string"==typeof n){var r=document.createTextNode(n);n=document.createElement("span"),n.appendChild(r),n.className="CodeMirror-foldmarker"}return n}function o(e,t,n){if(t&&void 0!==t[n])return t[n];var o=e.options.foldOptions;return o&&void 0!==o[n]?o[n]:r[n]}e.newFoldFunction=function(e,n){return function(o,r){t(o,r,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,o){t(this,e,n,o)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),o=t.lastLine();o>=n;n++)t.foldCode(e.Pos(n,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),o=t.lastLine();o>=n;n++)t.foldCode(e.Pos(n,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var o=0;o<e.length;++o){var r=e[o](t,n);if(r)return r}}}),e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),o=0;o<n.length;o++){var r=n[o](e,t);if(r)return r}});var r={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return o(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return e===!0&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function o(e,t){for(var n=e.findMarksAt(u(t)),o=0;o<n.length;++o)if(n[o].__isFold&&n[o].find().from.line==t)return!0}function r(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function i(e,t,n){var i=e.state.foldGutter.options,a=t,l=e.foldOption(i,"minFoldSize"),s=e.foldOption(i,"rangeFinder");e.eachLine(t,n,function(t){var n=null;if(o(e,a))n=r(i.indicatorFolded);else{var f=u(a,0),c=s&&s(e,f);c&&c.to.line-c.from.line>=l&&(n=r(i.indicatorOpen))}e.setGutterMarker(t,i.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){i(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var o=e.state.foldGutter;if(o){var r=o.options;n==r.gutter&&e.foldCode(u(t,0),r.rangeFinder)}}function s(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function f(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.from<t.from&&(i(e,n.from,t.from),t.from=n.from),n.to>t.to&&(i(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function c(e,t){var n=e.state.foldGutter;if(n){var o=t.line;o>=n.from&&o<n.to&&i(e,o,o+1)}}e.defineOption("foldGutter",!1,function(o,r,i){i&&i!=e.Init&&(o.clearGutter(o.state.foldGutter.options.gutter),o.state.foldGutter=null,o.off("gutterClick",l),o.off("change",s),o.off("viewportChange",f),o.off("fold",c),o.off("unfold",c),o.off("swapDoc",a)),r&&(o.state.foldGutter=new t(n(r)),a(o),o.on("gutterClick",l),o.on("change",s),o.on("viewportChange",f),o.on("fold",c),o.on("unfold",c),o.on("swapDoc",a))});var u=e.Pos}),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.registerHelper("fold","indent",function(t,n){var o=t.getOption("tabSize"),r=t.getLine(n.line);if(/\S/.test(r)){for(var i=function(t){return e.countColumn(t,null,o)},a=i(r),l=null,s=n.line+1,f=t.lastLine();f>=s;++s){var c=t.getLine(s),u=i(c);if(u>a)l=s;else if(/\S/.test(c))break}return l?{from:e.Pos(n.line,r.length),to:e.Pos(l,t.getLine(l).length)}:void 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";e.registerHelper("fold","brace",function(t,n){function o(o){for(var r=n.ch,s=0;;){var f=0>=r?-1:l.lastIndexOf(o,r-1);if(-1!=f){if(1==s&&f<n.ch)break;if(i=t.getTokenTypeAt(e.Pos(a,f+1)),!/^(comment|string)/.test(i))return f+1;r=f-1}else{if(1==s)break;s=1,r=l.length}}}var r,i,a=n.line,l=t.getLine(a),s="{",f="}",r=o("{");if(null==r&&(s="[",f="]",r=o("[")),null!=r){var c,u,d=1,h=t.lastLine();e:for(var p=a;h>=p;++p)for(var m=t.getLine(p),g=p==a?r:0;;){var v=m.indexOf(s,g),y=m.indexOf(f,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(p,g+1))==i)if(g==v)++d;else if(!--d){c=p,u=g;break e}++g}if(null!=c&&(a!=c||u!=r))return{from:e.Pos(a,r),to:e.Pos(c,u)}}}),e.registerHelper("fold","import",function(t,n){function o(n){if(n<t.firstLine()||n>t.lastLine())return null;var o=t.getTokenAt(e.Pos(n,1));if(/\S/.test(o.string)||(o=t.getTokenAt(e.Pos(n,o.end+1))),"keyword"!=o.type||"import"!=o.string)return null;for(var r=n,i=Math.min(t.lastLine(),n+10);i>=r;++r){var a=t.getLine(r),l=a.indexOf(";");if(-1!=l)return{startCh:o.end,end:e.Pos(r,l)}}}var r,n=n.line,i=o(n);if(!i||o(n-1)||(r=o(n-2))&&r.end.line==n-1)return null;for(var a=i.end;;){var l=o(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(n,i.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,n){function o(n){if(n<t.firstLine()||n>t.lastLine())return null;var o=t.getTokenAt(e.Pos(n,1));return/\S/.test(o.string)||(o=t.getTokenAt(e.Pos(n,o.end+1))),"meta"==o.type&&"#include"==o.string.slice(0,8)?o.start+8:void 0}var n=n.line,r=o(n);if(null==r||null!=o(n-1))return null;for(var i=n;;){var a=o(i+1);if(null==a)break;++i}return{from:e.Pos(n,r+1),to:t.clipPos(e.Pos(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){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(d(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 l(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)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function s(e){for(;;){m.lastIndex=e.ch;var t=m.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 f(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 c(e,t){for(var n=[];;){var o,r=s(e),i=e.line,l=e.ch-(r?r[0].length:0);if(!r||!(o=a(e)))return;if("selfClose"!=o)if(r[1]){for(var f=n.length-1;f>=0;--f)if(n[f]==r[2]){n.length=f;break}if(0>f&&(!t||t==r[2]))return{tag:r[2],from:d(i,l),to:d(e.line,e.ch)}}else n.push(r[2])}}function u(e,t){for(var n=[];;){var o=f(e);if(!o)return;if("selfClose"!=o){var r=e.line,i=e.ch,a=l(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==a[2]){n.length=s;break}if(0>s&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(r,i)}}}else l(e)}}var d=e.Pos,h="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=h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+h+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var o=new n(e,t.line,0);;){var r,i=s(o);if(!i||o.line!=t.line||!(r=a(o)))return;if(!i[1]&&"selfClose"!=r){var t=d(o.line,o.ch),l=c(o,i[2]);return l&&{from:t,to:l.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 s=a(i),f=s&&d(i.line,i.ch),h=s&&l(i);if(s&&h&&!(t(i,o)>0)){var p={from:d(i.line,i.ch),to:f,tag:h[2]};return"selfClose"==s?{open:p,close:null,at:"open"}:h[1]?{open:u(i,h[2]),close:p,at:"close"}:(i=new n(e,f.line,f.ch,r),{open:p,close:c(i,h[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),l=c(a,i.tag);if(l)return{open:i,close:l}}},e.scanForClosingTag=function(e,t,o,r){var i=new n(e,t.line,t.ch,r?{from:0,to:r}:null);return c(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.registerHelper("fold","markdown",function(t,n){function o(n){var o=t.getTokenTypeAt(e.Pos(n,0));return o&&/\bheader\b/.test(o)}function r(e,t,n){var r=t&&t.match(/^#+/);return r&&o(e)?r[0].length:(r=n&&n.match(/^[=\-]+\s*$/),r&&o(e+1)?"="==n[0]?1:2:i)}var i=100,a=t.getLine(n.line),l=t.getLine(n.line+1),s=r(n.line,a,l);if(s===i)return void 0;for(var f=t.lastLine(),c=n.line,u=t.getLine(c+2);f>c&&!(r(c+1,l,u)<=s);)++c,l=u,u=t.getLine(c+2);return{from:e.Pos(n.line,a.length),to:e.Pos(c,t.getLine(c).length)}})}),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.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,i=o.blockCommentEnd;if(r&&i){for(var a,l=n.line,s=t.getLine(l),f=n.ch,c=0;;){var u=0>=f?-1:s.lastIndexOf(r,f-1);if(-1!=u){if(1==c&&u<n.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(l,u+1)))){a=u+r.length;break}f=u-1}else{if(1==c)return;c=1,f=s.length}}var d,h,p=1,m=t.lastLine();e:for(var g=l;m>=g;++g)for(var v=t.getLine(g),y=g==l?a:0;;){var b=v.indexOf(r,y),C=v.indexOf(i,y);if(0>b&&(b=v.length),0>C&&(C=v.length),y=Math.min(b,C),y==v.length)break;if(y==b)++p;else if(!--p){d=g,h=y;break e}++y}if(null!=d&&(l!=d||h!=a))return{from:e.Pos(l,a),to:e.Pos(d,h)}}})}),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=[],l=0;l<o.length;l++){var s=o[l];if(s.empty()){var f=e.getLineHandleVisualStart(s.head.line);r[r.length-1]!=f&&r.push(f)}}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 l=a&&a!=e.Init;i&&!l?(n.state.activeLines=[],o(n,n.listSelections()),n.on("beforeSelectionChange",r)):!i&&l&&(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(f(t.line,t.ch-1),f(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 l=t.getMode().token(a,i.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(l);a.start=a.pos}}function o(o,r){for(var i={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 l=r[i].head;n.replaceRange("",f(l.line,l.ch-1),f(l.line,l.ch+1))}}},a="",l=0;l<o.length;l+=2)(function(t,o){a+=o,i["'"+t+"'"]=function(i){if(i.getOption("disableInput"))return e.Pass;for(var l,c,u=i.listSelections(),d=0;d<u.length;d++){var h,p=u[d],m=p.head,c=i.getRange(m,f(m.line,m.ch+1));if(p.empty())if(t==o&&c==o)h=i.getRange(m,f(m.line,m.ch+3))==t+t+t?"skipThree":"skip";else if(t==o&&m.ch>1&&r.indexOf(t)>=0&&i.getRange(f(m.line,m.ch-2),m)==t+t&&(m.ch<=2||i.getRange(f(m.line,m.ch-3),f(m.line,m.ch-2))!=t))h="addFour";else if('"'==t||"'"==t){if(e.isWordChar(c)||!n(i,m,t))return e.Pass;h="both"}else{if(!(i.getLine(m.line).length==m.ch||a.indexOf(c)>=0||s.test(c)))return e.Pass;h="both"}else h="surround";if(l){if(l!=h)return e.Pass}else l=h}i.operation(function(){if("skip"==l)i.execCommand("goCharRight");else if("skipThree"==l)for(var e=0;3>e;e++)i.execCommand("goCharRight");else if("surround"==l){for(var n=i.getSelections(),e=0;e<n.length;e++)n[e]=t+n[e]+o;i.replaceSelections(n,"around")}else"both"==l?(i.replaceSelection(t+o,null),i.execCommand("goCharLeft")):"addFour"==l&&(i.replaceSelection(t+t+t+t,"before"),i.execCommand("goCharRight"))})},t!=o&&(i["'"+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,f(i.head.line,i.head.ch+1))!=o)return e.Pass}t.execCommand("goCharRight")})})(o.charAt(l),o.charAt(l+1));return i}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="'\"",l="[]{}",s=/\s/,f=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,s){if(s!=e.Init&&s&&t.removeKeyMap("autoCloseBrackets"),n){var f=i,c=a,u=l;"string"==typeof n?f=n:"object"==typeof n&&(null!=n.pairs&&(f=n.pairs),null!=n.triples&&(c=n.triples),null!=n.explode&&(u=n.explode));var d=o(f,c);u&&(d.Enter=r(u)),t.addKeyMap(d)}})}),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=s),null==this.minChars&&(this.minChars=l),null==this.delay&&(this.delay=f),null==this.wordsOnly&&(this.wordsOnly=c),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),l=o.ch,s=l;l&&n.test(i.charAt(l-1));)--l;for(;s<i.length&&n.test(i.charAt(s));)++s;return void(s>l&&e.addOverlay(t.overlay=a(i.slice(l,s),n,t.style)))}var f=e.getCursor("from"),c=e.getCursor("to");if(f.line==c.line&&(!t.wordsOnly||r(e,f,c))){var u=e.getRange(f,c).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 l=2,s="matchhighlight",f=100,c=!1;e.defineOption("highlightSelectionMatches",!1,function(r,i,a){if(a&&a!=e.Init){var l=r.state.matchHighlighter.overlay;l&&r.removeOverlay(l),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))})});
|