玛氪宕·梦魔(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.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.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",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/