6 lines
202 KiB
JavaScript
6 lines
202 KiB
JavaScript
![]() |
(function(){var e=this,n=e._,t={},r=Array.prototype,a=Object.prototype,i=Function.prototype,o=r.push,s=r.slice,l=r.concat,c=a.toString,u=a.hasOwnProperty,p=r.forEach,d=r.map,f=r.reduce,m=r.reduceRight,g=r.filter,h=r.every,v=r.some,b=r.indexOf,w=r.lastIndexOf,x=Array.isArray,y=Object.keys,C=i.bind,k=function(e){return e instanceof k?e:this instanceof k?void(this._wrapped=e):new k(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports._=k):e._=k,k.VERSION="1.5.1";var S=k.each=k.forEach=function(e,n,r){if(null!=e)if(p&&e.forEach===p)e.forEach(n,r);else if(e.length===+e.length){for(var a=0,i=e.length;i>a;a++)if(n.call(r,e[a],a,e)===t)return}else for(var o in e)if(k.has(e,o)&&n.call(r,e[o],o,e)===t)return};k.map=k.collect=function(e,n,t){var r=[];return null==e?r:d&&e.map===d?e.map(n,t):(S(e,function(e,a,i){r.push(n.call(t,e,a,i))}),r)};var _="Reduce of empty array with no initial value";k.reduce=k.foldl=k.inject=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),f&&e.reduce===f)return r&&(n=k.bind(n,r)),a?e.reduce(n,t):e.reduce(n);if(S(e,function(e,i,o){a?t=n.call(r,t,e,i,o):(t=e,a=!0)}),!a)throw new TypeError(_);return t},k.reduceRight=k.foldr=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),m&&e.reduceRight===m)return r&&(n=k.bind(n,r)),a?e.reduceRight(n,t):e.reduceRight(n);var i=e.length;if(i!==+i){var o=k.keys(e);i=o.length}if(S(e,function(s,l,c){l=o?o[--i]:--i,a?t=n.call(r,t,e[l],l,c):(t=e[l],a=!0)}),!a)throw new TypeError(_);return t},k.find=k.detect=function(e,n,t){var r;return E(e,function(e,a,i){return n.call(t,e,a,i)?(r=e,!0):void 0}),r},k.filter=k.select=function(e,n,t){var r=[];return null==e?r:g&&e.filter===g?e.filter(n,t):(S(e,function(e,a,i){n.call(t,e,a,i)&&r.push(e)}),r)},k.reject=function(e,n,t){return k.filter(e,function(e,r,a){return!n.call(t,e,r,a)},t)},k.every=k.all=function(e,n,r){n||(n=k.identity);var a=!0;return null==e?a:h&&e.every===h?e.every(n,r):(S(e,function(e,i,o){return(a=a&&n.call(r,e,i,o))?void 0:t}),!!a)};var E=k.some=k.any=function(e,n,r){n||(n=k.identity);var a=!1;return null==e?a:v&&e.some===v?e.some(n,r):(S(e,function(e,i,o){return a||(a=n.call(r,e,i,o))?t:void 0}),!!a)};k.contains=k.include=function(e,n){return null==e?!1:b&&e.indexOf===b?-1!=e.indexOf(n):E(e,function(e){return e===n})},k.invoke=function(e,n){var t=s.call(arguments,2),r=k.isFunction(n);return k.map(e,function(e){return(r?n:e[n]).apply(e,t)})},k.pluck=function(e,n){return k.map(e,function(e){return e[n]})},k.where=function(e,n,t){return k.isEmpty(n)?t?void 0:[]:k[t?"find":"filter"](e,function(e){for(var t in n)if(n[t]!==e[t])return!1;return!0})},k.findWhere=function(e,n){return k.where(e,n,!0)},k.max=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!n&&k.isEmpty(e))return-1/0;var r={computed:-1/0,value:-1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o>r.computed&&(r={value:e,computed:o})}),r.value},k.min=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!n&&k.isEmpty(e))return 1/0;var r={computed:1/0,value:1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o<r.computed&&(r={value:e,computed:o})}),r.value},k.shuffle=function(e){var n,t=0,r=[];return S(e,function(e){n=k.random(t++),r[t-1]=r[n],r[n]=e}),r};var I=function(e){return k.isFunction(e)?e:function(n){return n[e]}};k.sortBy=function(e,n,t){var r=I(n);return k.pluck(k.map(e,function(e,n,a){return{value:e,index:n,criteria:r.call(t,e,n,a)}}).sort(function(e,n){var t=e.criteria,r=n.criteria;if(t!==r){if(t>r||void 0===t)return 1;if(r>t||void 0===r)return-1}return e.index<n.index?-1:1}),"value")};var T=function(e,n,t,r){var a={},i=I(null==n?k.identity:n);return S(e,function(n,o){var s=i.call(t,n,o,e);r(a,s,n)}),a};k.groupBy=function(e,n,t){return T(e,n,t,function(e,n,t){(k.has(e,n)?e[n]:e[n]=[]).push(t)})},k.countBy=function(e,n,t){return T(e,n,t,function(e,n){k.has(e,n)||(e[n]=0),e[n]++})},k.sortedIndex=function(e,n,t,r){t=null==t?k.identity:I(t);for(var a=t.call(r,n),i=0,o
|
|||
|
}(e),function(e){if(!e.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Categories");e.addUnicodeData([{name:"C",alias:"Other",isBmpLast:!0,bmp:"\x00--Ϳ-Ԩ-ՠֈ-֎--ׯ-؝--߿-࢟ࢡࢭ-ࣣࣿॸঀ---ৼ------੶----୕------------ఀఄఴ-఼-ౚ--౷ಀಁ಄--ೝೳ-ഁഄ഻഼൏-ൖ൘-ൟ൶-൸ඁ-------ຆຉຌຎ-ຓຘຠຨຩຬ຺໎------Ᏽ--ᛱ-ᜍ᜕-ᜟ-----᠏-ᡸ---ᤝ-----------ᭌ-᭽----ᲀ-Ჿ-᳷-ᷧ-᷻----₻--↊-⏴-⏿--✀⭍-⭏⭚-⯿Ⱟⱟ-----⸼-----ㄮ-ㆻ-ㆿ-㋿䶶-䶿鿍-鿿---Ꚙ-ꚞ-ꞏꞔ-ꞟꞫ-ꟷ꠬---ꣅ--꣼-ꣿ---ꧠ--ꩼ-ꩿ----ꮿ-------﯂-﵀-﵏-﷾﷿-︧-︯-----",astral:"<22>[<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D>]|<7C>[<5B><><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D>]|<7C>[<5B>-<2D>]|[<5B><><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D>][<5B>-<2D>]|<7C>[<5B><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D><><EFBFBD>-<2D><>-<2D>]|<7C>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]|<7C>[<5B>-<2D>]|<7C>[<5B>-<2D><><EFBFBD><EFBFBD>-<2D><>-<2D><>-<2D><>-<2D><>-<2D>]|<7C>[<5B><><EFBFBD>-<2D>]|<7C>[<5B>-<2D><>-<2D><>-<2D>]|<7C>[<5B>-<2D>]"},{name:"Cc",alias:"Control",bmp:"\x00--"},{name:"Cf",alias:"Format",bmp:"------",astral:"<22>[<5B><>-<2D>]|<7C>[<5B>-<2D>]|"},{name:"Cn",alias:"Unassigned",bmp:"Ϳ-Ԩ-ՠֈ-֎--ׯ-؝--߿-࢟ࢡࢭ-ࣣࣿॸঀ---ৼ------੶----୕------------ఀఄఴ-఼-ౚ--౷ಀಁ಄--ೝ<EFBFBD><EFBFBD>
|
|||
|
var M;!T&&(M=r(t))&&C.test(M.tagName)&&(T=M.className.match(b)),T&&(T=T[1])}var $;if(y.test(t.tagName))$=1;else{var L=t.currentStyle,A=s.defaultView,R=L?L.whiteSpace:A&&A.getComputedStyle?A.getComputedStyle(t,null).getPropertyValue("white-space"):0;$=R&&"pre"===R.substring(0,3)}var N=i.linenums;(N="true"===N||+N)||(N=m.match(/\blinenums\b(?::(\d+))?/),N=N?N[1]&&N[1].length?+N[1]:!0:!1),N&&o(t,N,$),h={langExtension:T,sourceNode:t,numberLines:N,pre:$},u(h)}}}v<c.length?setTimeout(a,250):"function"==typeof e&&e()}for(var i=n||document.body,s=i.ownerDocument||document,l=[t("pre"),t("code"),t("xmp")],c=[],p=0;p<l.length;++p)for(var d=0,m=l[p].length;m>d;++d)c.push(l[p][d]);l=null;var g=Date;g.now||(g={now:function(){return+new Date}});var h,v=0,b=/\blang(?:uage)?-([\w.]+)(?!\S)/,w=/\bprettyprint\b/,x=/\bprettyprinted\b/,y=/pre|xmp/i,C=/^code$/i,k=/^(?:pre|code|xmp)$/i,S={};a()}var f=window,m=["break,continue,do,else,for,if,return,while"],g=[m,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],h=[g,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[h,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],b=[h,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[b,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],x="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[h,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],C="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",k=[m,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],S=[m,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],_=[m,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],E=[m,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],I=[v,w,y,C,k,S,E],T=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,M="str",$="kwd",L="com",A="typ",R="lit",N="pun",P="pln",B="tag",D="dec",O="src",H="atn",F="atv",j="nocode",q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",U=/\S/,K=i({keywords:I,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),z={};l(K,["default-code"]),l(a([],[[P,/^[^<?]+/],[D,/^<!\w[^>]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[N,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),l(a([[P,/^[\s]+/,null," \r\n"],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[B,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[H,/^(?!style[\s=]|on)[a
|
|||
|
},w.insertLink=function(e,n,t,r,a){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var s=function(t){i.parentNode.removeChild(i),null!==t&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=a?"+")",e.selection=r),n()};return i=c.createBackground(),s(t),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doLinkOrImage=function(e,n,t){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\(.*?\))?/);var r;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var a=this,i=function(i,s){if(r.parentNode.removeChild(r),null!==i&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=t?"+")",!e.selection)){var l="";l=s?s:a.getString(t?"imagedescription":"linkdescription"),e.selection=l}n()};return r=c.createBackground(),t?this.hooks.insertImageDialog(i)||c.prompt(this.getString("imagedialog"),v,i):this.hooks.insertLinkDialog(i)||c.prompt(this.getString("linkdialog"),b,i),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doAutoindent=function(e){var n=this,t=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,function(n){return e.selection=n,""}),t=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),t&&(e.after=e.selection+e.after,e.selection="")},w.doBlockquote=function(e){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(n,t,r,a){return e.before+=t,e.after=a+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(n,t){return e.selection=t+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n,t="",r="";if(e.before){for(var a=e.before.replace(/\n$/,"").split("\n"),i=!1,o=0;o<a.length;o++){var s=!1;n=a[o],i=i&&n.length>0,/^>/.test(n)?(s=!0,!i&&n.length>1&&(i=!0)):s=/^[ \t]*$/.test(n)?!0:i,s?t+=n+"\n":(r+=t+n,t="\n")}/(^|\n)>/.test(t)||(r+=t,t="")}e.startTag=t,e.before=r;var l=function(n){var t=n?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,f.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(n,t){return e.startTag+=t,""}))},w.doCode=function(e){var n=/\S[ ]*$/.test(e.before),t=/^[ ]*\S/.test(e.after);if(!t&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(n){return e.selection=n+e.selection,""});var r=1,a=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(r=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(a=0),e.skipLines(r,a),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=
|
|||
|
});var h=e.last(d).endOffset,v=s[0].scrollHeight,b=v/h;d=e.map(d,function(e){return{startOffset:e.startOffset*b,endOffset:e.endOffset*b,height:e.height*b}})}else e.each(i,function(e){t+=e.text.length+m,m=0;var n=r.session.doc.indexToPosition(t),i=r.session.documentToScreenPosition(n.row,n.column),o=i.row*r.renderer.lineHeight,s=o-a;d.push({startOffset:a,endOffset:o,height:s}),a=o});f=[];var w,y=c.scrollTop();c.find(".preview-content > .se-section-delimiter").each(function(){if(void 0===w)return void(w=0);var e=$(this),n=e.position().top+y;f.push({startOffset:w,endOffset:n,height:n-w}),w=n});var C=c.prop("scrollHeight");f.push({startOffset:w,endOffset:C,height:C-w}),u=-10,p=-10,x()},500),g=!1,h=!1,v=!1,b=!1,w=$("<div>"),x=e.throttle(function(){if(0===d.length||d.length!==f.length)return void x();var n=window.lightMode?s.scrollTop():r.renderer.getScrollTop();0>n&&(n=0);var a,i=c.scrollTop();if(g===!0){if(Math.abs(n-u)<=9)return;if(g=!1,u=n,a=t(n,d,f),a=e.min([a,c.prop("scrollHeight")-c.outerHeight()]),Math.abs(a-i)<=9)return void(p=i);w.stop("scrollLinkFx",!0).css("value",0).animate({value:a-i},{easing:"linear",duration:200,queue:"scrollLinkFx",step:function(e){b=!0,p=i+e,c.scrollTop(p)},done:function(){e.defer(function(){b=!1})}}).dequeue("scrollLinkFx")}else if(h===!0){if(Math.abs(i-p)<=9)return;if(h=!1,p=i,a=t(i,f,d),window.lightMode?a=e.min([a,s.prop("scrollHeight")-s.outerHeight()]):(a=e.min([a,r.session.getScreenLength()*r.renderer.lineHeight+r.renderer.scrollMargin.bottom-r.renderer.$size.scrollerHeight]),0>a&&(a=0)),Math.abs(a-n)<=9)return void(u=n);w.stop("scrollLinkFx",!0).css("value",0).animate({value:a-n},{easing:"linear",duration:200,queue:"scrollLinkFx",step:function(e){v=!0,u=n+e,window.lightMode||r.session.setScrollTop(u),window.lightMode&&s.scrollTop(u)},done:function(){e.defer(function(){v=!1})}}).dequeue("scrollLinkFx")}},100);a.onLayoutResize=function(){g=!0,m()},a.onFileClosed=function(){d=[]};var y=!1;a.onReady=function(){c=$(".preview-container"),s=$("#wmd-input"),l=$(".textarea-helper"),c.scroll(function(){b===!1&&y===!1&&(h=!0,g=!1,x()),y=!1});var e=function(){v===!1&&(g=!0,h=!1,x())};window.lightMode?s.scroll(e):r.session.on("changeScrollTop",e),$(".extension-preview-buttons .table-of-contents, #preview-contents").on("click","a",function(e){var n=this.hash;if(n){e.preventDefault();var a=$("#preview-contents "+n);if(a.length){var i=a[0].getBoundingClientRect().top-c.get(0).getBoundingClientRect().top+c.scrollTop(),o=t(i,f,d);c.scrollTop(i),window.lightMode||r.session.setScrollTop(o),window.lightMode&&s.scrollTop(o)}}})};var C;return a.onPagedownConfigure=function(e){C=$("#preview-contents"),e.getConverter().hooks.chain("postConversion",function(e){return C.height(C.height()),e})},a.onPreviewFinished=function(){var e=C.height();C.height("auto");var n=C.height();g=!0,e>n&&(y=!0),m()},a}),function(e){var n="waitForImages";e.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage"]},e.expr[":"].uncached=function(n){if(!e(n).is('img[src!=""]'))return!1;var t=new Image;return t.src=n.src,!t.complete},e.fn.waitForImages=function(t,r,a){var i=0,o=0;if(e.isPlainObject(arguments[0])&&(a=arguments[0].waitForAll,r=arguments[0].each,t=arguments[0].finished),t=t||e.noop,r=r||e.noop,a=!!a,!e.isFunction(t)||!e.isFunction(r))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var s=e(this),l=[],c=e.waitForImages.hasImageProperties||[],u=/url\(\s*(['"]?)(.*?)\1\s*\)/g;a?s.find("*").andSelf().each(function(){var n=e(this);n.is("img:uncached")&&l.push({src:n.attr("src"),element:n[0]}),e.each(c,function(e,t){var r,a=n.css(t);if(!a)return!0;for(;r=u.exec(a);)l.push({src:r[2],element:n[0]})})}):s.find("img:uncached").each(function(){l.push({src:this.src,element:this})}),i=l.length,o=0,0===i&&t.call(s[0]),e.each(l,function(a,l){var c=new Image;e(c).bind("load."+n+" error."+n,function(e){return o++,r.call(l.element,o,i,"load"==e.type),o==i?(t.call(s[0]),!1):void 0}),c.src=l.src})})}}(jQuery),define("jquery-waitforimages",function(){}),define("
|
|||
|
}),t=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),t&&(e.after=e.selection+e.after,e.selection="")},w.doBlockquote=function(e){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(n,t,r,a){return e.before+=t,e.after=a+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(n,t){return e.selection=t+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n,t="",r="";if(e.before){for(var a=e.before.replace(/\n$/,"").split("\n"),i=!1,o=0;o<a.length;o++){var s=!1;n=a[o],i=i&&n.length>0,/^>/.test(n)?(s=!0,!i&&n.length>1&&(i=!0)):s=/^[ \t]*$/.test(n)?!0:i,s?t+=n+"\n":(r+=t+n,t="\n")}/(^|\n)>/.test(t)||(r+=t,t="")}e.startTag=t,e.before=r,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(n){return e.endTag=n,""});var l=function(n){var t=n?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,m.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(n,t){return e.startTag+=t,""}))},w.doCode=function(e){var n=/\S[ ]*$/.test(e.before),t=/^[ ]*\S/.test(e.after);if(!t&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(n){return e.selection=n+e.selection,""});var r=1,a=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(r=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(a=0),e.skipLines(r,a),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample")))},w.doList=function(e,n,t){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,a=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,i="-",o=1,s=function(){var e;return t?(e=" "+o+". ",o++):e=" "+i+" ",e},l=function(e){return void 0===t&&(t=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(){return s()})};if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),e.startTag){var c=/\d+[.]/.test(e.startTag);if(e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),c&&(e.after=e.after.replace(a,l)),t==c)return}var u=1;e.before=e.before.replace(r,function(e){return/^\s*([*+-])/.test(e)&&(i=d.$1),u=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.selection||(e.selection=this.getString("litem"));var p=s(),f=1;e.after=e.after.replace(a,function(e){return f=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.trimWhitespace(!0),e.skipLines(u,f,!0),e.startTag=p;var g=p.replace(/./g," ");this.wrap(e,m.lineLength-g.length),e.selection=e.selection.replace(/\n/g,"\n"+g)},w.doHeading=function(e){if(e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,""),!e.selection)return e.before&&"\n"!=e.before[e.before.length
|