玛氪宕·梦魔(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

10 years ago
/*! Editor.md v1.4.1 | /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-04-07 */
!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,i,o){o==e.Init&&(o=!1),o&&!i?t.removeOverlay("trailingspace"):!o&&i&&t.addOverlay({token:function(e){for(var t=e.string.length,i=t;i&&/\s/.test(e.string.charAt(i-1));--i);return i>e.pos?(e.pos=i,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,i){var o,n=e.getWrapperElement();return o=n.appendChild(document.createElement("div")),o.className=i?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?o.innerHTML=t:o.appendChild(t),o}function i(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(o,n,r){function a(e){if("string"==typeof e)h.value=e;else{if(c)return;c=!0,l.parentNode.removeChild(l),d.focus(),r.onClose&&r.onClose(l)}}r||(r={}),i(this,null);var s,l=t(this,o,r.bottom),c=!1,d=this,h=l.getElementsByTagName("input")[0];return h?(r.value&&(h.value=r.value,h.select()),r.onInput&&e.on(h,"input",function(e){r.onInput(e,h.value,a)}),r.onKeyUp&&e.on(h,"keyup",function(e){r.onKeyUp(e,h.value,a)}),e.on(h,"keydown",function(t){r&&r.onKeyDown&&r.onKeyDown(t,h.value,a)||((27==t.keyCode||r.closeOnEnter!==!1&&13==t.keyCode)&&(h.blur(),e.e_stop(t),a()),13==t.keyCode&&n(h.value,t))}),r.closeOnBlur!==!1&&e.on(h,"blur",a),h.focus()):(s=l.getElementsByTagName("button")[0])&&(e.on(s,"click",function(){a(),d.focus()}),r.closeOnBlur!==!1&&e.on(s,"blur",a),s.focus()),a}),e.defineExtension("openConfirm",function(o,n,r){function a(){c||(c=!0,s.parentNode.removeChild(s),d.focus())}i(this,null);var s=t(this,o,r&&r.bottom),l=s.getElementsByTagName("button"),c=!1,d=this,h=1;l[0].focus();for(var u=0;u<l.length;++u){var f=l[u];!function(t){e.on(f,"click",function(i){e.e_preventDefault(i),a(),t&&t(d)})}(n[u]),e.on(f,"blur",function(){--h,setTimeout(function(){0>=h&&a()},200)}),e.on(f,"focus",function(){++h})}}),e.defineExtension("openNotification",function(o,n){function r(){l||(l=!0,clearTimeout(a),s.parentNode.removeChild(s))}i(this,r);var a,s=t(this,o,n&&n.bottom),l=!1,c=n&&"undefined"!=typeof n.duration?n.duration:5e3;return e.on(s,"click",function(t){e.e_preventDefault(t),r()}),c&&(a=setTimeout(r,c)),r})}),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,n,r){if(this.atOccurrence=!1,this.doc=e,null==r&&"string"==typeof t&&(r=!1),n=n?e.clipPos(n):o(0,0),this.pos={from:n,to:n},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(i,n){if(i){t.lastIndex=0;for(var r,a,s=e.getLine(n.line).slice(0,n.ch),l=0;;){t.lastIndex=l;var c=t.exec(s);if(!c)break;if(r=c,a=r.index,l=r.index+(r[0].length||1),l==s.length)break}var d=r&&r[0].length||0;d||(0==a&&0==s.length?r=void 0:a!=e.getLine(n.line).length&&d++)}else{t.lastIndex=n.ch;var s=e.getLine(n.line),r=t.exec(s),d=r&&r[0].length||0,a=r&&r.index;a+d==s.length||d||(d=1)}return r&&d?{from:o(n.line,a),to:o(n.line,a+d),match:r}:void 0};else{var a=t;r&&(t=t.toLowerCase());var s=r?function(e){return e.toLowerCase()}:function(e){return e},l=t.split("\n");if(1==l.length)this.matches=t.length?function(n,r){if(n){var l=e.getLine(r.line).slice(0,r.ch),c=s(l),d=c.lastIndexOf(t);if(d>-1)return d=i(l,c,d),{from:o(r.line,d),to:o(r.line,d+a.length)}}else{var l=e.getLine(r.line).slice(r.ch),c=s(l),d=c.indexOf(t);if(d>-1)return d=i(l,c,d)+r.ch,{from:o(r.line,d),to:o(r.line,d+a.length)}}}:function(){};else{var c=a.split("\n");this.matches=function(t,i){var n=l.length-1;if(t){if(i.line-(l.length-1)<e.fi
10 years ago
10 years ago
}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",r),e.removeLineClass(e.state.activeLines[t],"background",a)}function i(e,t){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!=t[i])return!1;return!0}function o(e,o){for(var n=[],s=0;s<o.length;s++){var l=o[s];if(l.empty()){var c=e.getLineHandleVisualStart(l.head.line);n[n.length-1]!=c&&n.push(c)}}i(e.state.activeLines,n)||e.operation(function(){t(e);for(var i=0;i<n.length;i++)e.addLineClass(n[i],"wrap",r),e.addLineClass(n[i],"background",a);e.state.activeLines=n})}function n(e,t){o(e,t.ranges)}var r="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(i,r,a){var s=a&&a!=e.Init;r&&!s?(i.state.activeLines=[],o(i,i.listSelections()),i.on("beforeSelectionChange",n)):!r&&s&&(i.off("beforeSelectionChange",n),t(i),delete i.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 i=e.getRange(c(t.line,t.ch-1),c(t.line,t.ch+1));return 2==i.length?i:null}function i(t,i,o){var n=t.getLine(i.line),r=t.getTokenAt(i);if(/\bstring2?\b/.test(r.type))return!1;var a=new e.StringStream(n.slice(0,i.ch)+o+n.slice(i.ch),4);for(a.pos=a.start=r.start;;){var s=t.getMode().token(a,r.state);if(a.pos>=i.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}function o(o,n){for(var r={name:"autoCloseBrackets",Backspace:function(i){if(i.getOption("disableInput"))return e.Pass;for(var n=i.listSelections(),r=0;r<n.length;r++){if(!n[r].empty())return e.Pass;var a=t(i,n[r].head);if(!a||o.indexOf(a)%2!=0)return e.Pass}for(var r=n.length-1;r>=0;r--){var s=n[r].head;i.replaceRange("",c(s.line,s.ch-1),c(s.line,s.ch+1))}}},a="",s=0;s<o.length;s+=2)(function(t,o){a+=o,r["'"+t+"'"]=function(r){if(r.getOption("disableInput"))return e.Pass;for(var s,d,h=r.listSelections(),u=0;u<h.length;u++){var f,g=h[u],p=g.head,d=r.getRange(p,c(p.line,p.ch+1));if(g.empty())if(t==o&&d==o)f=r.getRange(p,c(p.line,p.ch+3))==t+t+t?"skipThree":"skip";else if(t==o&&p.ch>1&&n.indexOf(t)>=0&&r.getRange(c(p.line,p.ch-2),p)==t+t&&(p.ch<=2||r.getRange(c(p.line,p.ch-3),c(p.line,p.ch-2))!=t))f="addFour";else if('"'==t||"'"==t){if(e.isWordChar(d)||!i(r,p,t))return e.Pass;f="both"}else{if(!(r.getLine(p.line).length==p.ch||a.indexOf(d)>=0||l.test(d)))return e.Pass;f="both"}else f="surround";if(s){if(s!=f)return e.Pass}else s=f}r.operation(function(){if("skip"==s)r.execCommand("goCharRight");else if("skipThree"==s)for(var e=0;3>e;e++)r.execCommand("goCharRight");else if("surround"==s){for(var i=r.getSelections(),e=0;e<i.length;e++)i[e]=t+i[e]+o;r.replaceSelections(i,"around")}else"both"==s?(r.replaceSelection(t+o,null),r.execCommand("goCharLeft")):"addFour"==s&&(r.replaceSelection(t+t+t+t,"before"),r.execCommand("goCharRight"))})},t!=o&&(r["'"+o+"'"]=function(t){for(var i=t.listSelections(),n=0;n<i.length;n++){var r=i[n];if(!r.empty()||t.getRange(r.head,c(r.head.line,r.head.ch+1))!=o)return e.Pass}t.execCommand("goCharRight")})})(o.charAt(s),o.charAt(s+1));return r}function n(i){return function(o){if(o.getOption("disableInput"))return e.Pass;for(var n=o.listSelections(),r=0;r<n.length;r++){if(!n[r].empty())return e.Pass;var a=t(o,n[r].head);if(!a||i.indexOf(a)%2!=0)return e.Pass}o.operation(function(){o.replaceSelection("\n\n",null),o.execCommand("goCharLeft"),n=o.listSelections();for(var e=0;e<n.length;e++){var t=n[e].head.line;o.indentLine(t,null,!0),o.indentLine(t+1,null,!0)}})}}var r="()[]{}''\"\"",a="'\"",s="[]{}",l=/\s/,c=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,i,l){if(l!=e.Init&&l&&t.removeKeyMap("autoCloseBrackets"),i){var c=r,d=a,h=s;"string"==typeof i?c=i:"object"==typeof i&&(null!=i.pairs&&(c=i.pairs),null!=i.triples&&(d=i.triples),null!=i.explode&&(h=i.explode));var u=o(c,d);h&&(u.Enter=n(h)),t.addKeyMap(u)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/