diff --git a/dist/js/editormd.js b/dist/js/editormd.js index 1bb2227..34d48c7 100644 --- a/dist/js/editormd.js +++ b/dist/js/editormd.js @@ -6,7 +6,7 @@ * @license MIT License * @author Pandao * {@link https://github.com/pandao/editor.md} - * @updateTime 2015-02-07 + * @updateTime 2015-02-08 */ /** @@ -751,7 +751,7 @@ */ hideInfoDialog : function() { - $("html,body").css("overflow-x", null); + $("html,body").css("overflow-x", ""); this.editor.find("." + this.classPrefix + "dialog-info").fadeOut(); return this; @@ -1329,7 +1329,7 @@ this.toolbar.find(".fa[name=fullscreen]").parent().removeClass("active"); - $("html,body").css("overflow", null); + $("html,body").css("overflow", ""); editor.css({ position : "", diff --git a/dist/js/editormd.min.js b/dist/js/editormd.min.js index aca8b5a..06242af 100644 --- a/dist/js/editormd.min.js +++ b/dist/js/editormd.min.js @@ -1,2 +1,2 @@ -/*! Editor.md v1.0.0 | editormd.min.js | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-02-07 */ -!function(e){"use strict";"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define?define(["jquery"],e):window.editormd=e()}(function(){"use strict";var e=jQuery,t=function(e,i){return new t.fn.init(e,i)};return t.title="Editor.md",t.version="1.0.0",t.homePage="https://github.com/pandao/editor.md",t.description="A simple markdown doucment online editor.",t.classPrefix="editormd-",t.defaults={mode:"gfm",markdown:"",width:"100%",height:"100%",path:"./lib/",watch:!0,onload:function(){},onchange:function(){},toc:!0,tocStartLevel:2,fontSize:"13px",flowChart:!1,mathjax:!1,sequenceDiagram:!1,previewCodeHighlight:!0,inRequirejs:!1,toolbar:!0,toolbarIcons:["undo","redo","|","bold","del","italic","quote","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","picture","code","code-block-tab","code-block","datetime","|","watch","preview","fullscreen","|","info"],toolbarIconsClass:{undo:"fa-undo",redo:"fa-repeat",bold:"fa-bold",del:"fa-strikethrough",italic:"fa-italic",quote:"fa-quote-left",h1:t.classPrefix+"bold",h2:t.classPrefix+"bold",h3:t.classPrefix+"bold",h4:t.classPrefix+"bold",h5:t.classPrefix+"bold",h6:t.classPrefix+"bold","list-ul":"fa-list-ul","list-ol":"fa-list-ol",hr:"fa-minus",link:"fa-link",picture:"fa-picture-o",code:"fa-code","code-block-tab":"fa-file-code-o","code-block":"fa-file-code-o",datetime:"fa-clock-o",watch:"fa-eye-slash",unwatch:"fa-eye",preview:"fa-search",fullscreen:"fa-arrows-alt",info:"fa-info-circle"},lang:{toolbar:{undo:"撤销",redo:"重做",bold:"粗体",del:"删除线",italic:"斜体",quote:"引用",h1:"标题1",h2:"标题2",h3:"标题3",h4:"标题4",h5:"标题5",h6:"标题6","list-ul":"无序列表","list-ol":"有序列表",hr:"横线",link:"链接",picture:"图片",code:"行内代码","code-block-tab":"代码块(缩进风格)","code-block":"代码块(多语言风格)",datetime:"日期时间",watch:"关闭实时预览",unwatch:"开启实时预览",preview:"预览HTML(按ESC还原)",fullscreen:"全屏(按ESC还原)",info:"关于"+t.title}},codemirror:{modes:["css","sass","shell","sql","clike","php","xml","markdown","javascript","htmlmixed","gfm","http","go","dart","coffeescript","nginx","python","perl","lua","ruby","rst","smartymixed","yaml"],addons:["edit/trailingspace","dialog/dialog","search/searchcursor","search/search","scroll/annotatescrollbar","search/matchesonscrollbar","display/placeholder","edit/closetag","fold/xml-fold","mode/overlay","selection/active-line","edit/closebrackets","display/fullscreen","search/searchcursor","search/match-highlighter"]}},t.$marked=null,t.$CodeMirror=null,t.$prettyPrint=null,t.prototype=t.fn={state:{preview:!1,fullscreen:!1},init:function(i,r){r=r||{};var o=this,a=this.classPrefix=t.classPrefix,n=this.editor=e("#"+i),s=this.settings=e.extend(!0,t.defaults,r),l=""===s.markdown?n.children('[type="text/markdown"]').html():s.markdown;this.id=i,this.classNames={textarea:{html:this.classPrefix+"html-textarea",markdown:this.classPrefix+"markdown-textarea"}},n.css({width:"number"==typeof s.width?s.width+"px":s.width,height:"number"==typeof s.height?s.height+"px":s.height}),n.children('[type="text/markdown"]').remove();var c=['
','','
','

'+t.title+"v"+t.version+"

","

"+t.description+"

",'

Home page: '+t.homePage+"

","

License: MIT

","
","
"].join("\n"),d=['
','",'','
',"
"].join("\n");return n.append(c).append(d),this.preview=n.find("."+a+"preview"),this.toolbar=n.find("."+a+"toolbar"),this.previewContainer=this.preview.children("."+a+"preview-container"),this.infoDialog=n.find("."+a+"dialog-info"),this.toolbarIconHandlers={},n.addClass(a+"vertical"),s.inRequirejs?(o.setCodeEditor(),o.setToolbar(),o.toolbarHandler(),o.setMarked().loadedDisplay()):this.loadQueues(),this},loadQueues:function(){var e=this,i=this.settings,r=0,o=i.codemirror.modes.length,a=0,n=i.codemirror.addons.length,s=i.path,l=function(){i.flowChart||i.sequenceDiagram?t.loadScript(s+"raphael.min",function(){t.loadScript(s+"underscore.min",function(){!i.flowChart&&i.sequenceDiagram?t.loadScript(s+"sequence-diagram.min",function(){e.setMarked().loadedDisplay()}):i.flowChart&&!i.sequenceDiagram?t.loadScript(s+"flowchart.min",function(){t.loadScript(s+"jquery.flowchart.min",function(){e.setMarked().loadedDisplay()})}):i.flowChart&&i.sequenceDiagram&&t.loadScript(s+"flowchart.min",function(){t.loadScript(s+"jquery.flowchart.min",function(){t.loadScript(s+"sequence-diagram.min",function(){e.setMarked().loadedDisplay()})})})})}):e.setMarked().loadedDisplay()},c=function(){var r=i.codemirror.addons[a];t.loadScript(s+"codemirror/addon/"+r,function(){n-1>a?(a++,c()):(e.setCodeEditor(),e.setToolbar(),e.toolbarHandler(),t.loadScript(s+"marked.min",function(){t.$marked=marked,i.previewCodeHighlight?t.loadScript(s+"prettify.min",function(){l()}):l()}))})},d=function(){var e=i.codemirror.modes[r];t.loadScript(s+"codemirror/mode/"+e+"/"+e,function(){o-1>r?(r++,d()):c()})};return t.loadCSS(s+"codemirror/lib/codemirror.min"),t.loadScript(s+"codemirror/lib/codemirror.min",function(){t.$CodeMirror=CodeMirror,d()}),this},setCodeEditor:function(){var e=(this.settings,{mode:this.settings.mode,theme:"default",tabSize:4,dragDrop:!1,autofocus:!0,indentUnit:4,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,indentWithTabs:!0,styleActiveLine:!0,styleSelectedText:!0,autoCloseBrackets:!0,showTrailingSpace:!0,highlightSelectionMatches:{showToken:/\w/}});return this.codeEditor=t.$CodeMirror.fromTextArea(this.editor.find("."+this.classNames.textarea.markdown)[0],e),this.codeMirror=this.editor.find(".CodeMirror"),this.codeMirror.css("font-size",this.settings.fontSize),this},showToolbar:function(){return this.settings.toolbar=!0,this.toolbar.show(),this.resize(),this},hideToolbar:function(){return this.settings.toolbar=!1,this.toolbar.hide(),this.resize(),this},setToolbar:function(){var e=this.settings,t=(this.editor,this.preview,this.toolbar);if(!e.toolbar)return void t.hide();t.show();for(var i=t.find("."+this.classPrefix+"menu"),r="",o=0,a=e.toolbarIcons.length;a>o;o++){var n=e.toolbarIcons[o];if("|"!==n){var s=/h(\d)/.test(n);r+='
  • '+(s?n:"")+"
  • "}else r+='
  • |
  • '}return i.append(r),this},toolbarHandler:function(){var i=this.settings;if(i.toolbar){var r=this,o=(this.editor,this.preview,this.toolbar),a=this.codeEditor,n=(this.codeMirror,this.previewContainer,this.toolbarIcons=o.find("."+this.classPrefix+"menu .fa"));return n.bind(t.mouseOrTouch("click","touchend"),function(i){var o=e(this),n=o.attr("name"),s=a.getCursor(),l=a.getSelection();if(""!==n){var c=r.toolbarIconHandlers={undo:function(){a.undo()},redo:function(){a.redo()},bold:function(){a.replaceSelection("**"+l+"**"),""===l&&a.setCursor(s.line,s.ch+2)},del:function(){a.replaceSelection("~~"+l+"~~"),""===l&&a.setCursor(s.line,s.ch+2)},italic:function(){a.replaceSelection("*"+l+"*"),""===l&&a.setCursor(s.line,s.ch+1)},quote:function(){a.replaceSelection(""===l?["> "+l,""].join("\n"):"> "+l),a.setCursor(s.line,""===l?s.ch+2:s.ch+l.length+2)},h1:function(){a.replaceSelection("#"+l)},h2:function(){a.replaceSelection("##"+l)},h3:function(){a.replaceSelection("###"+l)},h4:function(){a.replaceSelection("####"+l)},h5:function(){a.replaceSelection("#####"+l)},h6:function(){a.replaceSelection("######"+l)},"list-ul":function(){if(""===l)a.replaceSelection("- "+l);else{for(var e=l.split("\n"),t=0,i=e.length;i>t;t++)e[t]=""===e[t]?"":"- "+e[t];a.replaceSelection(e.join("\n"))}},"list-ol":function(){if(""===l)a.replaceSelection("1. "+l);else{for(var e=l.split("\n"),t=0,i=e.length;i>t;t++)e[t]=""===e[t]?"":t+1+". "+e[t];a.replaceSelection(e.join("\n"))}},hr:function(){a.replaceSelection("------------")},link:function(){a.replaceSelection("["+l+"]("+l+' "'+l+'")')},picture:function(){a.replaceSelection("!["+l+"]("+l+' "'+l+'")')},code:function(){a.replaceSelection("`"+l+"`"),""===l&&a.setCursor(s.line,s.ch+1)},"code-block-tab":function(){a.replaceSelection(" "+l)},"code-block":function(){a.replaceSelection(["```",l,"```"].join("\n")),""===l&&a.setCursor(s.line,s.ch+3)},datetime:function(){new Date;a.replaceSelection(t.dateFormat()+" "+t.dateFormat("cn-week-day"))},watch:function(){return r.settings.watch?r.unwatch():r.watch(),i.preventDefault(),!1},preview:function(){return r.previewing(),i.preventDefault(),!1},fullscreen:function(){return r.fullscreen(),i.preventDefault(),!1},info:function(){return r.showInfoDialog(),i.preventDefault(),!1}};return c[n](),a.focus(),i.preventDefault(),!1}}),this}},showInfoDialog:function(){return e("html,body").css("overflow-x","hidden"),this.editor.find("."+this.classPrefix+"dialog-info").fadeIn(),this},hideInfoDialog:function(){return e("html,body").css("overflow-x",null),this.editor.find("."+this.classPrefix+"dialog-info").fadeOut(),this},setMarked:function(){var e=t.$marked,i=this.markdownToC=[];return e.setOptions({renderer:t.markedRenderer(i),gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!0,smartLists:!0,smartypants:!0}),this},loadedDisplay:function(){this.state.loaded=!0;{var i=this,r=this.editor,o=this.preview,a=(this.toolbar,this.settings),n=this.codeEditor,s=this.codeMirror,l=this.previewContainer,c=t.mouseOrTouch;this.htmlTextarea=r.find("."+this.classNames.textarea.html),this.markdownTextarea=r.find("."+this.classNames.textarea.markdown)}r.css("background","none"),this.saveToTextareas(),o.show(),a.previewCodeHighlight&&(l.find("pre").addClass("prettyprint linenums"),prettyPrint()),a.flowChart&&l.find(".flowchart").flowChart(),a.sequenceDiagram&&l.find(".sequence-diagram").sequenceDiagram({theme:"simple"}),a.mathjax&&t.setMathJaxConfig(function(){t.loadMathJax()}),r.data({oldWidth:r.outerWidth(),oldHeight:r.outerHeight()}),this.resize(),e(window).resize(function(){i.resize()}),e.proxy(this.settings.onload,this)(),r.find("."+this.classPrefix+"dialog-close").bind(c("click","touchend"),function(){i.hideInfoDialog()});var d=function(){s.find(".CodeMirror-scroll").bind(c("scroll","touchmove"),function(){var t=e(this).outerHeight(),i=e(this).scrollTop(),r=i/e(this)[0].scrollHeight;o.scrollTop(0===i?0:i+t>=e(this)[0].scrollHeight?o[0].scrollHeight:o[0].scrollHeight*r)})},h=function(){s.find(".CodeMirror-scroll").unbind(c("scroll","touchmove"))},u=function(){o.bind(c("scroll","touchmove"),function(){var t=e(this).outerHeight(),i=e(this).scrollTop(),r=i/e(this)[0].scrollHeight,o=s.find(".CodeMirror-scroll");o.scrollTop(0===i?0:i+t>=e(this)[0].scrollHeight?o[0].scrollHeight:o[0].scrollHeight*r)})},f=function(){o.unbind(c("scroll","touchmove"))};return s.hover(d,h).bind("touchstart",d).bind("touchend",h),o.hover(u,f).bind("touchstart",u).bind("touchend",f),n.on("change",function(){a.watch&&(i.saveToTextareas(),a.previewCodeHighlight&&(o.find("pre").addClass("prettyprint linenums"),prettyPrint()),a.flowChart&&l.find(".flowchart").flowChart(),a.sequenceDiagram&&l.find(".sequence-diagram").sequenceDiagram({theme:"simple"}),a.mathjax&&MathJax.Hub.Queue(function(){l.find(".mathjax-code").each(function(){var t=e(this).html().replace(/\$\$(.*)\$\$/,function(e,t){return t}),i='";e(this).html(e(i)),MathJax.Hub.Queue(["Typeset",MathJax.Hub,e(this)[0]])})}),e.proxy(a.onchange,i)())}),this},width:function(e){return this.editor.css({width:"number"==typeof e?e+"px":e}),this.resize(),this},height:function(e){return this.editor.css({height:"number"==typeof e?e+"px":e}),this.resize(),this},resize:function(e,t){e=e||null,t=t||null;var i=this.editor,r=this.preview,o=this.toolbar,a=this.settings,n=this.infoDialog,s=(this.codeEditor,this.codeMirror);return e&&t&&i.css({width:"number"==typeof e?e+"px":e,height:"number"==typeof t?t+"px":t}),n.css({top:(i.height()-n.height())/2,left:(i.width()-n.width())/2}),a.toolbar?s.css("margin-top",o.outerHeight()).outerHeight(i.height()-o.outerHeight()):s.css("margin-top",0).outerHeight(i.height()),this.settings.watch?(s.outerWidth(i.width()/2),r.outerWidth(i.width()/2),a.toolbar?r.css("top",o.outerHeight()).outerHeight(i.height()-o.outerHeight()):r.css("top",0).outerHeight(i.height())):(s.outerWidth(i.width()),r.hide()),this},saveToTextareas:function(){var e=this.settings,i=this.codeEditor,r=this.previewContainer;i.save();var o=this.markdownToC=[],a=t.$marked(i.getValue(),{renderer:t.markedRenderer(o)});return this.markdownTextarea.html(i.getValue()),this.htmlTextarea.html(a),r.html(a),e.toc&&t.markdownToCRenderer(o,r,e.tocStartLevel),this},setMarkdown:function(e){return this.codeEditor.setValue(e),this.saveToTextareas(),this},getMarkdown:function(){return this.codeEditor.getValue()},getHTML:function(){return this.editor.find("."+this.classNames.textarea.html).val()},watch:function(t){t=t||function(){},this.settings.watch=!0,this.preview.show();var i=this.settings.toolbarIconsClass.watch,r=this.settings.toolbarIconsClass.unwatch,o=this.toolbar.find(".fa[name=watch]");return o.parent().attr("title",this.settings.lang.toolbar.watch),o.removeClass(r).addClass(i),this.codeMirror.css("border-right","1px solid #ddd").outerWidth(this.editor.width()/2),this.saveToTextareas().resize(),e.proxy(t,this)(),this},unwatch:function(t){t=t||function(){},this.settings.watch=!1,this.preview.hide();var i=this.settings.toolbarIconsClass.watch,r=this.settings.toolbarIconsClass.unwatch,o=this.toolbar.find(".fa[name=watch]");return o.parent().attr("title",this.settings.lang.toolbar.unwatch),o.removeClass(i).addClass(r),this.codeMirror.css("border-right","none").outerWidth(this.editor.width()),this.resize(),e.proxy(t,this)(),this},show:function(t){t=t||function(){};var i=this;return this.editor.show(function(){e.proxy(t,i)()}),this},hide:function(t){t=t||function(){};var i=this;return this.editor.hide(function(){e.proxy(t,i)()}),this},previewing:function(){var t=this,i=this.editor,r=this.preview,o=this.toolbar,a=this.settings,n=this.codeMirror;a.toolbar&&o.toggle(),o.find(".fa[name=preview]").toggleClass("active"),n.toggle(),n.is(":hidden")?(this.state.preview=!0,this.state.fullscreen&&r.css("background","#fff"),r.show().css({top:0,width:i.width(),height:i.height()})):this.previewed(),e(window).keyup(function(e){27===e.keyCode&&t.previewed()})},previewed:function(){var e=this.editor,t=this.preview,i=this.toolbar,r=this.settings,o=this.codeMirror;return this.state.preview=!1,o.show(),r.toolbar&&i.show(),this.settings.watch?t.show():t.hide(),t.css({background:null,width:e.width()/2,height:e.height()-i.outerHeight(),top:r.toolbar?i.outerHeight():0}),this},fullscreen:function(){var t=this,i=this.editor,r=(this.preview,this.toolbar),o=this.classPrefix+"fullscreen";return r.find(".fa[name=fullscreen]").parent().toggleClass("active"),i.hasClass(o)?this.fullscreenExit():(this.state.fullscreen=!0,e("html,body").css("overflow","hidden"),i.css({position:"fixed",top:0,left:0,margin:0,border:"none",width:e(window).width(),height:e(window).height()}).addClass(o)),this.resize(),e(window).keyup(function(e){t.state.preview||27===e.keyCode&&t.fullscreenExit()}),this},fullscreenExit:function(){var t=this.editor,i=this.classPrefix+"fullscreen";return this.state.fullscreen=!1,this.toolbar.find(".fa[name=fullscreen]").parent().removeClass("active"),e("html,body").css("overflow",null),t.css({position:"",top:"",left:"",margin:"0 auto",width:t.data("oldWidth"),height:t.data("oldHeight"),border:"1px solid #ddd"}).removeClass(i),this.resize(),this}},t.fn.init.prototype=t.fn,t.markedRenderer=function(e){var i=t.$marked,r=new i.Renderer;e=e||[],r.heading=function(t,i,r){var o=t.toLowerCase().replace(/[^\w]+/g,"-"),a={text:t,level:i,slug:o};return e.push(a),"'+t+""};var o=[];return r.paragraph=function(e){var t=/\$\$(.*)\$\$/.test(e),i=t?' class="mathjax-code"':"",r=/^\[TOC\]$/.test(e);return t&&o.push(e),r?'
    ":""+e+"

    \n"},r.code=function(e,t){return"seq"===t?'
    '+e+"
    ":"flow"===t?'
    '+e+"
    ":i.Renderer.prototype.code.apply(this,arguments)},r},t.markdownToCRenderer=function(e,t,i){var r="",o=0;i=i||2;for(var a=0,n=e.length;n>a;a++){var s=e[a].text,l=e[a].level;i>l||(r+=l>o?"":o>l?new Array(o-l+2).join(""):"",r+='
  • '+s+"
      ",o=l)}t.find(".markdown-toc-list").html("").html(r)},t.markdownToHTML=function(i,r){r=r||{};var o={toc:!0,tocStartLevel:2,markdown:"",mathjax:!1,previewCodeHighlight:!0,flowChart:!1,sequenceDiagram:!1};t.$marked=marked;var a=e.extend(!0,o,r),n=e("#"+i),s=n.find('[type="text/markdown"]'),l=""===a.markdown?s.html():a.markdown,c=[],d={renderer:t.markedRenderer(c),gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!0,smartLists:!0,smartypants:!0},h=marked(l,d);s.html(l),n.addClass("markdown-body").append(h),a.toc&&t.markdownToCRenderer(c,n,a.tocStartLevel),a.previewCodeHighlight&&(n.find("pre").addClass("prettyprint linenums"),prettyPrint()),a.flowChart&&n.find(".flowchart").flowChart(),a.sequenceDiagram&&n.find(".sequence-diagram").sequenceDiagram({theme:"simple"}),a.mathjax&&t.setMathJaxConfig(function(){t.loadMathJax()})},t.requirejsInit=function(e,i,r){t.$CodeMirror=e,t.$marked=i,t.$prettyPrint=r},t.requireModules=function(e){e=e||"";var i=t.defaults,r=[];r.push(e+"codemirror/lib/codemirror.min");for(var o=0,a=i.codemirror.modes.length;a>o;o++){var n=i.codemirror.modes[o];r.push(e+"codemirror/mode/"+n+"/"+n)}for(var o=0,a=i.codemirror.addons.length;a>o;o++){var s=i.codemirror.addons[o];r.push(e+"codemirror/addon/"+s)}return r},t.loadCSS=function(e,t,i){i=i||"head",t=t||function(){};var r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.onload=r.onreadystatechange=function(){t()},r.href=e+".css","head"===i?document.getElementsByTagName("head")[0].appendChild(r):document.body.appendChild(r)},t.loadScript=function(e,t,i){i=i||"head",t=t||function(){};var r=document.createElement("script");r.type="text/javascript",r.onload=r.onreadystatechange=function(){r.readyState?("loaded"===r.readyState||"complete"===r.readyState)&&(r.onreadystatechange=null,t()):t()},r.src=e+".js","head"===i?document.getElementsByTagName("head")[0].appendChild(r):document.body.appendChild(r)},t.setMathJaxConfig=function(e){e=e||function(){};var t=document.createElement("script");t.className="mathjax-config",t.type="text/x-mathjax-config",t.text='MathJax.Hub.Config({extensions: ["tex2jax.js"],jax: ["input/TeX","output/HTML-CSS"],tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}});',document.getElementsByTagName("head")[0].appendChild(t),e()},t.mathjaxURL="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML",t.loadMathJax=function(e){e=e||function(){};var i=document.createElement("script");i.type="text/javascript",i.className="mathjax-script",i.onload=i.onreadystatechange=function(){i.readyState?("loaded"===i.readyState||"complete"===i.readyState)&&(i.onreadystatechange=null,e()):e()},i.src=t.mathjaxURL,document.getElementsByTagName("head")[0].appendChild(i)},t.mouseOrTouch=function(e,t){e=e||"click",t=t||"touchend";var i=e;try{document.createEvent("TouchEvent"),i=t}catch(r){}return i},t.dateFormat=function(e){e=e||"";var t=function(e){return 10>e?"0"+e:e},i=new Date,r=i.getFullYear(),o=r.toString().slice(2,4),a=t(i.getMonth()+1),n=t(i.getDate()),s=i.getDay(),l=t(i.getHours()),c=t(i.getMinutes()),d=t(i.getSeconds()),h=t(i.getMilliseconds()),u="",f=o+"-"+a+"-"+n,m=r+"-"+a+"-"+n,p=l+":"+c+":"+d;switch(e){case"UNIX Time":u=i.getTime();break;case"UTC":u=i.toUTCString();break;case"yy":u=o;break;case"year":case"yyyy":u=r;break;case"month":case"mm":u=a;break;case"cn-week-day":case"cn-wd":var g=["日","一","二","三","四","五","六"];u="星期"+g[s];break;case"week-day":case"wd":u=s;break;case"day":case"dd":u=n;break;case"hour":case"hh":u=l;break;case"min":case"ii":u=c;break;case"second":case"ss":u=d;break;case"ms":u=h;break;case"yy-mm-dd":u=f;break;case"yyyy-mm-dd":u=m;break;case"yyyy-mm-dd h:i:s ms":case"full + ms":u=m+" "+p+" "+h;break;case"full":case"yyyy-mm-dd h:i:s":default:u=m+" "+p}return u},t}); \ No newline at end of file +/*! Editor.md v1.0.0 | editormd.min.js | A simple online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-02-08 */ +!function(e){"use strict";"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define?define(["jquery"],e):window.editormd=e()}(function(){"use strict";var e=jQuery,t=function(e,i){return new t.fn.init(e,i)};return t.title="Editor.md",t.version="1.0.0",t.homePage="https://github.com/pandao/editor.md",t.description="A simple markdown doucment online editor.",t.classPrefix="editormd-",t.defaults={mode:"gfm",markdown:"",width:"100%",height:"100%",path:"./lib/",watch:!0,onload:function(){},onchange:function(){},toc:!0,tocStartLevel:2,fontSize:"13px",flowChart:!1,mathjax:!1,sequenceDiagram:!1,previewCodeHighlight:!0,inRequirejs:!1,toolbar:!0,toolbarIcons:["undo","redo","|","bold","del","italic","quote","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","picture","code","code-block-tab","code-block","datetime","|","watch","preview","fullscreen","|","info"],toolbarIconsClass:{undo:"fa-undo",redo:"fa-repeat",bold:"fa-bold",del:"fa-strikethrough",italic:"fa-italic",quote:"fa-quote-left",h1:t.classPrefix+"bold",h2:t.classPrefix+"bold",h3:t.classPrefix+"bold",h4:t.classPrefix+"bold",h5:t.classPrefix+"bold",h6:t.classPrefix+"bold","list-ul":"fa-list-ul","list-ol":"fa-list-ol",hr:"fa-minus",link:"fa-link",picture:"fa-picture-o",code:"fa-code","code-block-tab":"fa-file-code-o","code-block":"fa-file-code-o",datetime:"fa-clock-o",watch:"fa-eye-slash",unwatch:"fa-eye",preview:"fa-search",fullscreen:"fa-arrows-alt",info:"fa-info-circle"},lang:{toolbar:{undo:"撤销",redo:"重做",bold:"粗体",del:"删除线",italic:"斜体",quote:"引用",h1:"标题1",h2:"标题2",h3:"标题3",h4:"标题4",h5:"标题5",h6:"标题6","list-ul":"无序列表","list-ol":"有序列表",hr:"横线",link:"链接",picture:"图片",code:"行内代码","code-block-tab":"代码块(缩进风格)","code-block":"代码块(多语言风格)",datetime:"日期时间",watch:"关闭实时预览",unwatch:"开启实时预览",preview:"预览HTML(按ESC还原)",fullscreen:"全屏(按ESC还原)",info:"关于"+t.title}},codemirror:{modes:["css","sass","shell","sql","clike","php","xml","markdown","javascript","htmlmixed","gfm","http","go","dart","coffeescript","nginx","python","perl","lua","ruby","rst","smartymixed","yaml"],addons:["edit/trailingspace","dialog/dialog","search/searchcursor","search/search","scroll/annotatescrollbar","search/matchesonscrollbar","display/placeholder","edit/closetag","fold/xml-fold","mode/overlay","selection/active-line","edit/closebrackets","display/fullscreen","search/searchcursor","search/match-highlighter"]}},t.$marked=null,t.$CodeMirror=null,t.$prettyPrint=null,t.prototype=t.fn={state:{preview:!1,fullscreen:!1},init:function(i,r){r=r||{};var o=this,a=this.classPrefix=t.classPrefix,n=this.editor=e("#"+i),s=this.settings=e.extend(!0,t.defaults,r),l=""===s.markdown?n.children('[type="text/markdown"]').html():s.markdown;this.id=i,this.classNames={textarea:{html:this.classPrefix+"html-textarea",markdown:this.classPrefix+"markdown-textarea"}},n.css({width:"number"==typeof s.width?s.width+"px":s.width,height:"number"==typeof s.height?s.height+"px":s.height}),n.children('[type="text/markdown"]').remove();var c=['
      ','','
      ','

      '+t.title+"v"+t.version+"

      ","

      "+t.description+"

      ",'

      Home page: '+t.homePage+"

      ","

      License: MIT

      ","
      ","
      "].join("\n"),d=['
        ','",'','
        ',"
        "].join("\n");return n.append(c).append(d),this.preview=n.find("."+a+"preview"),this.toolbar=n.find("."+a+"toolbar"),this.previewContainer=this.preview.children("."+a+"preview-container"),this.infoDialog=n.find("."+a+"dialog-info"),this.toolbarIconHandlers={},n.addClass(a+"vertical"),s.inRequirejs?(o.setCodeEditor(),o.setToolbar(),o.toolbarHandler(),o.setMarked().loadedDisplay()):this.loadQueues(),this},loadQueues:function(){var e=this,i=this.settings,r=0,o=i.codemirror.modes.length,a=0,n=i.codemirror.addons.length,s=i.path,l=function(){i.flowChart||i.sequenceDiagram?t.loadScript(s+"raphael.min",function(){t.loadScript(s+"underscore.min",function(){!i.flowChart&&i.sequenceDiagram?t.loadScript(s+"sequence-diagram.min",function(){e.setMarked().loadedDisplay()}):i.flowChart&&!i.sequenceDiagram?t.loadScript(s+"flowchart.min",function(){t.loadScript(s+"jquery.flowchart.min",function(){e.setMarked().loadedDisplay()})}):i.flowChart&&i.sequenceDiagram&&t.loadScript(s+"flowchart.min",function(){t.loadScript(s+"jquery.flowchart.min",function(){t.loadScript(s+"sequence-diagram.min",function(){e.setMarked().loadedDisplay()})})})})}):e.setMarked().loadedDisplay()},c=function(){var r=i.codemirror.addons[a];t.loadScript(s+"codemirror/addon/"+r,function(){n-1>a?(a++,c()):(e.setCodeEditor(),e.setToolbar(),e.toolbarHandler(),t.loadScript(s+"marked.min",function(){t.$marked=marked,i.previewCodeHighlight?t.loadScript(s+"prettify.min",function(){l()}):l()}))})},d=function(){var e=i.codemirror.modes[r];t.loadScript(s+"codemirror/mode/"+e+"/"+e,function(){o-1>r?(r++,d()):c()})};return t.loadCSS(s+"codemirror/lib/codemirror.min"),t.loadScript(s+"codemirror/lib/codemirror.min",function(){t.$CodeMirror=CodeMirror,d()}),this},setCodeEditor:function(){var e=(this.settings,{mode:this.settings.mode,theme:"default",tabSize:4,dragDrop:!1,autofocus:!0,indentUnit:4,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,indentWithTabs:!0,styleActiveLine:!0,styleSelectedText:!0,autoCloseBrackets:!0,showTrailingSpace:!0,highlightSelectionMatches:{showToken:/\w/}});return this.codeEditor=t.$CodeMirror.fromTextArea(this.editor.find("."+this.classNames.textarea.markdown)[0],e),this.codeMirror=this.editor.find(".CodeMirror"),this.codeMirror.css("font-size",this.settings.fontSize),this},showToolbar:function(){return this.settings.toolbar=!0,this.toolbar.show(),this.resize(),this},hideToolbar:function(){return this.settings.toolbar=!1,this.toolbar.hide(),this.resize(),this},setToolbar:function(){var e=this.settings,t=(this.editor,this.preview,this.toolbar);if(!e.toolbar)return void t.hide();t.show();for(var i=t.find("."+this.classPrefix+"menu"),r="",o=0,a=e.toolbarIcons.length;a>o;o++){var n=e.toolbarIcons[o];if("|"!==n){var s=/h(\d)/.test(n);r+='
      • '+(s?n:"")+"
      • "}else r+='
      • |
      • '}return i.append(r),this},toolbarHandler:function(){var i=this.settings;if(i.toolbar){var r=this,o=(this.editor,this.preview,this.toolbar),a=this.codeEditor,n=(this.codeMirror,this.previewContainer,this.toolbarIcons=o.find("."+this.classPrefix+"menu .fa"));return n.bind(t.mouseOrTouch("click","touchend"),function(i){var o=e(this),n=o.attr("name"),s=a.getCursor(),l=a.getSelection();if(""!==n){var c=r.toolbarIconHandlers={undo:function(){a.undo()},redo:function(){a.redo()},bold:function(){a.replaceSelection("**"+l+"**"),""===l&&a.setCursor(s.line,s.ch+2)},del:function(){a.replaceSelection("~~"+l+"~~"),""===l&&a.setCursor(s.line,s.ch+2)},italic:function(){a.replaceSelection("*"+l+"*"),""===l&&a.setCursor(s.line,s.ch+1)},quote:function(){a.replaceSelection(""===l?["> "+l,""].join("\n"):"> "+l),a.setCursor(s.line,""===l?s.ch+2:s.ch+l.length+2)},h1:function(){a.replaceSelection("#"+l)},h2:function(){a.replaceSelection("##"+l)},h3:function(){a.replaceSelection("###"+l)},h4:function(){a.replaceSelection("####"+l)},h5:function(){a.replaceSelection("#####"+l)},h6:function(){a.replaceSelection("######"+l)},"list-ul":function(){if(""===l)a.replaceSelection("- "+l);else{for(var e=l.split("\n"),t=0,i=e.length;i>t;t++)e[t]=""===e[t]?"":"- "+e[t];a.replaceSelection(e.join("\n"))}},"list-ol":function(){if(""===l)a.replaceSelection("1. "+l);else{for(var e=l.split("\n"),t=0,i=e.length;i>t;t++)e[t]=""===e[t]?"":t+1+". "+e[t];a.replaceSelection(e.join("\n"))}},hr:function(){a.replaceSelection("------------")},link:function(){a.replaceSelection("["+l+"]("+l+' "'+l+'")')},picture:function(){a.replaceSelection("!["+l+"]("+l+' "'+l+'")')},code:function(){a.replaceSelection("`"+l+"`"),""===l&&a.setCursor(s.line,s.ch+1)},"code-block-tab":function(){a.replaceSelection(" "+l)},"code-block":function(){a.replaceSelection(["```",l,"```"].join("\n")),""===l&&a.setCursor(s.line,s.ch+3)},datetime:function(){new Date;a.replaceSelection(t.dateFormat()+" "+t.dateFormat("cn-week-day"))},watch:function(){return r.settings.watch?r.unwatch():r.watch(),i.preventDefault(),!1},preview:function(){return r.previewing(),i.preventDefault(),!1},fullscreen:function(){return r.fullscreen(),i.preventDefault(),!1},info:function(){return r.showInfoDialog(),i.preventDefault(),!1}};return c[n](),a.focus(),i.preventDefault(),!1}}),this}},showInfoDialog:function(){return e("html,body").css("overflow-x","hidden"),this.editor.find("."+this.classPrefix+"dialog-info").fadeIn(),this},hideInfoDialog:function(){return e("html,body").css("overflow-x",""),this.editor.find("."+this.classPrefix+"dialog-info").fadeOut(),this},setMarked:function(){var e=t.$marked,i=this.markdownToC=[];return e.setOptions({renderer:t.markedRenderer(i),gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!0,smartLists:!0,smartypants:!0}),this},loadedDisplay:function(){this.state.loaded=!0;{var i=this,r=this.editor,o=this.preview,a=(this.toolbar,this.settings),n=this.codeEditor,s=this.codeMirror,l=this.previewContainer,c=t.mouseOrTouch;this.htmlTextarea=r.find("."+this.classNames.textarea.html),this.markdownTextarea=r.find("."+this.classNames.textarea.markdown)}r.css("background","none"),this.saveToTextareas(),o.show(),a.previewCodeHighlight&&(l.find("pre").addClass("prettyprint linenums"),prettyPrint()),a.flowChart&&l.find(".flowchart").flowChart(),a.sequenceDiagram&&l.find(".sequence-diagram").sequenceDiagram({theme:"simple"}),a.mathjax&&t.setMathJaxConfig(function(){t.loadMathJax()}),r.data({oldWidth:r.outerWidth(),oldHeight:r.outerHeight()}),this.resize(),e(window).resize(function(){i.resize()}),e.proxy(this.settings.onload,this)(),r.find("."+this.classPrefix+"dialog-close").bind(c("click","touchend"),function(){i.hideInfoDialog()});var d=function(){s.find(".CodeMirror-scroll").bind(c("scroll","touchmove"),function(){var t=e(this).outerHeight(),i=e(this).scrollTop(),r=i/e(this)[0].scrollHeight;o.scrollTop(0===i?0:i+t>=e(this)[0].scrollHeight?o[0].scrollHeight:o[0].scrollHeight*r)})},h=function(){s.find(".CodeMirror-scroll").unbind(c("scroll","touchmove"))},u=function(){o.bind(c("scroll","touchmove"),function(){var t=e(this).outerHeight(),i=e(this).scrollTop(),r=i/e(this)[0].scrollHeight,o=s.find(".CodeMirror-scroll");o.scrollTop(0===i?0:i+t>=e(this)[0].scrollHeight?o[0].scrollHeight:o[0].scrollHeight*r)})},f=function(){o.unbind(c("scroll","touchmove"))};return s.hover(d,h).bind("touchstart",d).bind("touchend",h),o.hover(u,f).bind("touchstart",u).bind("touchend",f),n.on("change",function(){a.watch&&(i.saveToTextareas(),a.previewCodeHighlight&&(o.find("pre").addClass("prettyprint linenums"),prettyPrint()),a.flowChart&&l.find(".flowchart").flowChart(),a.sequenceDiagram&&l.find(".sequence-diagram").sequenceDiagram({theme:"simple"}),a.mathjax&&MathJax.Hub.Queue(function(){l.find(".mathjax-code").each(function(){var t=e(this).html().replace(/\$\$(.*)\$\$/,function(e,t){return t}),i='";e(this).html(e(i)),MathJax.Hub.Queue(["Typeset",MathJax.Hub,e(this)[0]])})}),e.proxy(a.onchange,i)())}),this},width:function(e){return this.editor.css({width:"number"==typeof e?e+"px":e}),this.resize(),this},height:function(e){return this.editor.css({height:"number"==typeof e?e+"px":e}),this.resize(),this},resize:function(e,t){e=e||null,t=t||null;var i=this.editor,r=this.preview,o=this.toolbar,a=this.settings,n=this.infoDialog,s=(this.codeEditor,this.codeMirror);return e&&t&&i.css({width:"number"==typeof e?e+"px":e,height:"number"==typeof t?t+"px":t}),n.css({top:(i.height()-n.height())/2,left:(i.width()-n.width())/2}),a.toolbar?s.css("margin-top",o.outerHeight()).outerHeight(i.height()-o.outerHeight()):s.css("margin-top",0).outerHeight(i.height()),this.settings.watch?(s.outerWidth(i.width()/2),r.outerWidth(i.width()/2),a.toolbar?r.css("top",o.outerHeight()).outerHeight(i.height()-o.outerHeight()):r.css("top",0).outerHeight(i.height())):(s.outerWidth(i.width()),r.hide()),this},saveToTextareas:function(){var e=this.settings,i=this.codeEditor,r=this.previewContainer;i.save();var o=this.markdownToC=[],a=t.$marked(i.getValue(),{renderer:t.markedRenderer(o)});return this.markdownTextarea.html(i.getValue()),this.htmlTextarea.html(a),r.html(a),e.toc&&t.markdownToCRenderer(o,r,e.tocStartLevel),this},setMarkdown:function(e){return this.codeEditor.setValue(e),this.saveToTextareas(),this},getMarkdown:function(){return this.codeEditor.getValue()},getHTML:function(){return this.editor.find("."+this.classNames.textarea.html).val()},watch:function(t){t=t||function(){},this.settings.watch=!0,this.preview.show();var i=this.settings.toolbarIconsClass.watch,r=this.settings.toolbarIconsClass.unwatch,o=this.toolbar.find(".fa[name=watch]");return o.parent().attr("title",this.settings.lang.toolbar.watch),o.removeClass(r).addClass(i),this.codeMirror.css("border-right","1px solid #ddd").outerWidth(this.editor.width()/2),this.saveToTextareas().resize(),e.proxy(t,this)(),this},unwatch:function(t){t=t||function(){},this.settings.watch=!1,this.preview.hide();var i=this.settings.toolbarIconsClass.watch,r=this.settings.toolbarIconsClass.unwatch,o=this.toolbar.find(".fa[name=watch]");return o.parent().attr("title",this.settings.lang.toolbar.unwatch),o.removeClass(i).addClass(r),this.codeMirror.css("border-right","none").outerWidth(this.editor.width()),this.resize(),e.proxy(t,this)(),this},show:function(t){t=t||function(){};var i=this;return this.editor.show(function(){e.proxy(t,i)()}),this},hide:function(t){t=t||function(){};var i=this;return this.editor.hide(function(){e.proxy(t,i)()}),this},previewing:function(){var t=this,i=this.editor,r=this.preview,o=this.toolbar,a=this.settings,n=this.codeMirror;a.toolbar&&o.toggle(),o.find(".fa[name=preview]").toggleClass("active"),n.toggle(),n.is(":hidden")?(this.state.preview=!0,this.state.fullscreen&&r.css("background","#fff"),r.show().css({top:0,width:i.width(),height:i.height()})):this.previewed(),e(window).keyup(function(e){27===e.keyCode&&t.previewed()})},previewed:function(){var e=this.editor,t=this.preview,i=this.toolbar,r=this.settings,o=this.codeMirror;return this.state.preview=!1,o.show(),r.toolbar&&i.show(),this.settings.watch?t.show():t.hide(),t.css({background:null,width:e.width()/2,height:e.height()-i.outerHeight(),top:r.toolbar?i.outerHeight():0}),this},fullscreen:function(){var t=this,i=this.editor,r=(this.preview,this.toolbar),o=this.classPrefix+"fullscreen";return r.find(".fa[name=fullscreen]").parent().toggleClass("active"),i.hasClass(o)?this.fullscreenExit():(this.state.fullscreen=!0,e("html,body").css("overflow","hidden"),i.css({position:"fixed",top:0,left:0,margin:0,border:"none",width:e(window).width(),height:e(window).height()}).addClass(o)),this.resize(),e(window).keyup(function(e){t.state.preview||27===e.keyCode&&t.fullscreenExit()}),this},fullscreenExit:function(){var t=this.editor,i=this.classPrefix+"fullscreen";return this.state.fullscreen=!1,this.toolbar.find(".fa[name=fullscreen]").parent().removeClass("active"),e("html,body").css("overflow",""),t.css({position:"",top:"",left:"",margin:"0 auto",width:t.data("oldWidth"),height:t.data("oldHeight"),border:"1px solid #ddd"}).removeClass(i),this.resize(),this}},t.fn.init.prototype=t.fn,t.markedRenderer=function(e){var i=t.$marked,r=new i.Renderer;e=e||[],r.heading=function(t,i,r){var o=t.toLowerCase().replace(/[^\w]+/g,"-"),a={text:t,level:i,slug:o};return e.push(a),"'+t+""};var o=[];return r.paragraph=function(e){var t=/\$\$(.*)\$\$/.test(e),i=t?' class="mathjax-code"':"",r=/^\[TOC\]$/.test(e);return t&&o.push(e),r?'
          '+e+"
        ":""+e+"

        \n"},r.code=function(e,t){return"seq"===t?'
        '+e+"
        ":"flow"===t?'
        '+e+"
        ":i.Renderer.prototype.code.apply(this,arguments)},r},t.markdownToCRenderer=function(e,t,i){var r="",o=0;i=i||2;for(var a=0,n=e.length;n>a;a++){var s=e[a].text,l=e[a].level;i>l||(r+=l>o?"":o>l?new Array(o-l+2).join("
    • "):"",r+='
    • '+s+"
        ",o=l)}t.find(".markdown-toc-list").html("").html(r)},t.markdownToHTML=function(i,r){r=r||{};var o={toc:!0,tocStartLevel:2,markdown:"",mathjax:!1,previewCodeHighlight:!0,flowChart:!1,sequenceDiagram:!1};t.$marked=marked;var a=e.extend(!0,o,r),n=e("#"+i),s=n.find('[type="text/markdown"]'),l=""===a.markdown?s.html():a.markdown,c=[],d={renderer:t.markedRenderer(c),gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!0,smartLists:!0,smartypants:!0},h=marked(l,d);s.html(l),n.addClass("markdown-body").append(h),a.toc&&t.markdownToCRenderer(c,n,a.tocStartLevel),a.previewCodeHighlight&&(n.find("pre").addClass("prettyprint linenums"),prettyPrint()),a.flowChart&&n.find(".flowchart").flowChart(),a.sequenceDiagram&&n.find(".sequence-diagram").sequenceDiagram({theme:"simple"}),a.mathjax&&t.setMathJaxConfig(function(){t.loadMathJax()})},t.requirejsInit=function(e,i,r){t.$CodeMirror=e,t.$marked=i,t.$prettyPrint=r},t.requireModules=function(e){e=e||"";var i=t.defaults,r=[];r.push(e+"codemirror/lib/codemirror.min");for(var o=0,a=i.codemirror.modes.length;a>o;o++){var n=i.codemirror.modes[o];r.push(e+"codemirror/mode/"+n+"/"+n)}for(var o=0,a=i.codemirror.addons.length;a>o;o++){var s=i.codemirror.addons[o];r.push(e+"codemirror/addon/"+s)}return r},t.loadCSS=function(e,t,i){i=i||"head",t=t||function(){};var r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.onload=r.onreadystatechange=function(){t()},r.href=e+".css","head"===i?document.getElementsByTagName("head")[0].appendChild(r):document.body.appendChild(r)},t.loadScript=function(e,t,i){i=i||"head",t=t||function(){};var r=document.createElement("script");r.type="text/javascript",r.onload=r.onreadystatechange=function(){r.readyState?("loaded"===r.readyState||"complete"===r.readyState)&&(r.onreadystatechange=null,t()):t()},r.src=e+".js","head"===i?document.getElementsByTagName("head")[0].appendChild(r):document.body.appendChild(r)},t.setMathJaxConfig=function(e){e=e||function(){};var t=document.createElement("script");t.className="mathjax-config",t.type="text/x-mathjax-config",t.text='MathJax.Hub.Config({extensions: ["tex2jax.js"],jax: ["input/TeX","output/HTML-CSS"],tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}});',document.getElementsByTagName("head")[0].appendChild(t),e()},t.mathjaxURL="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML",t.loadMathJax=function(e){e=e||function(){};var i=document.createElement("script");i.type="text/javascript",i.className="mathjax-script",i.onload=i.onreadystatechange=function(){i.readyState?("loaded"===i.readyState||"complete"===i.readyState)&&(i.onreadystatechange=null,e()):e()},i.src=t.mathjaxURL,document.getElementsByTagName("head")[0].appendChild(i)},t.mouseOrTouch=function(e,t){e=e||"click",t=t||"touchend";var i=e;try{document.createEvent("TouchEvent"),i=t}catch(r){}return i},t.dateFormat=function(e){e=e||"";var t=function(e){return 10>e?"0"+e:e},i=new Date,r=i.getFullYear(),o=r.toString().slice(2,4),a=t(i.getMonth()+1),n=t(i.getDate()),s=i.getDay(),l=t(i.getHours()),c=t(i.getMinutes()),d=t(i.getSeconds()),h=t(i.getMilliseconds()),u="",f=o+"-"+a+"-"+n,m=r+"-"+a+"-"+n,p=l+":"+c+":"+d;switch(e){case"UNIX Time":u=i.getTime();break;case"UTC":u=i.toUTCString();break;case"yy":u=o;break;case"year":case"yyyy":u=r;break;case"month":case"mm":u=a;break;case"cn-week-day":case"cn-wd":var g=["日","一","二","三","四","五","六"];u="星期"+g[s];break;case"week-day":case"wd":u=s;break;case"day":case"dd":u=n;break;case"hour":case"hh":u=l;break;case"min":case"ii":u=c;break;case"second":case"ss":u=d;break;case"ms":u=h;break;case"yy-mm-dd":u=f;break;case"yyyy-mm-dd":u=m;break;case"yyyy-mm-dd h:i:s ms":case"full + ms":u=m+" "+p+" "+h;break;case"full":case"yyyy-mm-dd h:i:s":default:u=m+" "+p}return u},t}); \ No newline at end of file