├── screenshot1.png ├── screenshot2.png ├── Caddyfile ├── .files ├── google-code-prettify │ ├── lang-rd.js │ ├── lang-go.js │ ├── lang-tex.js │ ├── lang-proto.js │ ├── lang-llvm.js │ ├── lang-yaml.js │ ├── lang-basic.js │ ├── lang-wiki.js │ ├── lang-lua.js │ ├── lang-hs.js │ ├── lang-erlang.js │ ├── lang-tcl.js │ ├── lang-r.js │ ├── lang-pascal.js │ ├── prettify.css │ ├── lang-lisp.js │ ├── lang-css.js │ ├── lang-mumps.js │ ├── lang-scala.js │ ├── lang-dart.js │ ├── lang-apollo.js │ ├── lang-ml.js │ ├── lang-n.js │ ├── lang-vhdl.js │ ├── lang-clj.js │ ├── lang-vb.js │ ├── lang-sql.js │ ├── prettify.js │ ├── run_prettify.js │ ├── lang-matlab.js │ └── lang-xq.js ├── markdown.tpl ├── rebuild.js ├── nprogress.css ├── browse.tpl ├── style.css ├── nprogress.js └── jquery.pjax.js ├── README.md └── LICENSE /screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benzBrake/caddy-browse-template-white/HEAD/screenshot1.png -------------------------------------------------------------------------------- /screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benzBrake/caddy-browse-template-white/HEAD/screenshot2.png -------------------------------------------------------------------------------- /Caddyfile: -------------------------------------------------------------------------------- 1 | :80 { 2 | root /wwwroot 3 | browse / /.files/browse.tpl 4 | markdown / { 5 | ext .md 6 | template /.files/markdown.tpl 7 | } 8 | } -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-rd.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); 2 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); 2 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); 2 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-llvm.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); 2 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-basic.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun", 3 | /^.[^\s\w"$%.]*/,a]]),["basic","cbm"]); 4 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); 2 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 2 | ["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-erlang.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 2 | ["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-tcl.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", 3 | /^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); 4 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-r.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], 2 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-pascal.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], 3 | ["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); 4 | -------------------------------------------------------------------------------- /.files/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | /*! Color themes for Google Code Prettify | MIT License | github.com/jmblog/color-themes-for-google-code-prettify */ 2 | .prettyprint{background:#efecf4;font-family:Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Consolas,monospace;border:0!important}.pln{color:#19171c}ol.linenums{margin-top:0;margin-bottom:0;color:#7e7887}li.L0,li.L1,li.L2,li.L3,li.L4,li.L5,li.L6,li.L7,li.L8,li.L9{padding-left:1em;background-color:#efecf4;list-style-type:decimal}@media screen{.str{color:#2a9292}.kwd{color:#955ae7}.com{color:#7e7887}.typ{color:#576ddb}.lit{color:#aa573c}.pun{color:#19171c}.opn{color:#19171c}.clo{color:#19171c}.tag{color:#be4678}.atn{color:#aa573c}.atv{color:#398bc6}.dec{color:#aa573c}.var{color:#be4678}.fun{color:#576ddb}} 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); 4 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]+)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], 2 | ["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-mumps.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, 2 | null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 2 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Caddy Browse Template White 2 | 3 | 白色的浏览模板。 4 | 5 | 在更新内网yum源的时候,想写个README.md文档让使用源的人方便看,就诞生了写个Caddy浏览模板的想法,花了一点时间弄出来的。 6 | 刚开始弄得时候完全不会语法,所以是看着人家的REPO([caddy-browse-template](https://github.com/genofire/caddy-browse-template))写的。 7 | 8 | ## 特点 Spots 9 | 10 | - 支持 PJAX 11 | - Markdown 预览(支持代码高亮) 12 | - 文件与文件夹图标 13 | - 中国人的时间显示习惯 14 | - 自适应 15 | 16 | ## 预览 Preview 17 | 18 | ### 文件列表 19 | 20 | ![screenshot1](screenshot1.png) 21 | 22 | ### Markdown 文件 23 | 24 | ![screenshot2](screenshot2.png) 25 | 26 | ## 食用方式 Usage 27 | 28 | 下载Repo中的.files目录到需要文件列表的目录中 29 | 30 | 修改Caddyfile,下面是我的Caddyfile示例 31 | 32 | ``` 33 | :80 { 34 | root /wwwroot 35 | browse / /.files/browse.tpl 36 | markdown / { 37 | ext .md 38 | template /.files/markdown.tpl 39 | } 40 | } 41 | ``` 42 | 43 | ## 感谢 Thanks 44 | 45 | [genofire](https://github.com/genofire) 46 | 47 | ## 授权 License 48 | 49 | [Mozilla Public License Version 2.0](LICENSE) -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-dart.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 2 | ["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), 3 | ["dart"]); 4 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 2 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-ml.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 2 | ["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); 3 | -------------------------------------------------------------------------------- /.files/markdown.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 正在查看:{{.Doc.title}}.md 12 | 13 | 14 |
15 |
16 | 21 |
22 |
23 | {{.Doc.body}} 24 |
25 | 28 |
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /.files/rebuild.js: -------------------------------------------------------------------------------- 1 | function addPjaxToMd() { 2 | $('a', $("#browse")).each(function() { 3 | var innerText = $(this).html() + ""; 4 | var _arr = innerText.split('.'); 5 | if (innerText.length > 2 && _arr[_arr.length-1] == "md") { 6 | $(this).addClass('pjax'); 7 | } 8 | }); 9 | } 10 | function breadcrumbs() { 11 | var url = $(location).attr('href').split("?")[0]; 12 | var _arr = url.split("."); 13 | if (url.length > 3 && _arr.length > 1 && _arr[_arr.length - 1] == "md") { 14 | $('a:not(.home)', $("#browse")).remove(); 15 | var url_withoutMethod = url.split("//")[1]; 16 | var uri = url_withoutMethod.substring(url_withoutMethod.indexOf("/") + 1); 17 | console.log(uri); 18 | var path = ""; 19 | uri.split("/").forEach(function(item, index) { 20 | path += "/" + item; 21 | $('#breadcrumbs').append('
  • ' + item +'
  • '); 22 | }); 23 | } 24 | } 25 | $('pre').addClass('prettyprint'); 26 | PR.prettyPrint(); 27 | addPjaxToMd(); 28 | breadcrumbs(); 29 | // PJAX 30 | $(document).pjax('#body a.pjax:not(a[target="_blank"], a[no-pjax])', { 31 | container: '#body', 32 | fragment: '#body', 33 | timeout: 8000 34 | }).on('pjax:send', function() { 35 | NProgress.start(); // 进度条 36 | }).on('pjax:complete', function() { 37 | NProgress.done(); 38 | $('pre').addClass('prettyprint'); // 代码高亮 39 | PR.prettyPrint(); 40 | addPjaxToMd(); 41 | breadcrumbs(); 42 | }); 43 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 2 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], 3 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); 4 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-vb.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, 2 | null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); 3 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-sql.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, 2 | null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); 3 | -------------------------------------------------------------------------------- /.files/nprogress.css: -------------------------------------------------------------------------------- 1 | /* Make clicks pass-through */ 2 | #nprogress { 3 | pointer-events: none; 4 | } 5 | 6 | #nprogress .bar { 7 | background: #29d; 8 | 9 | position: fixed; 10 | z-index: 1031; 11 | top: 0; 12 | left: 0; 13 | 14 | width: 100%; 15 | height: 2px; 16 | } 17 | 18 | /* Fancy blur effect */ 19 | #nprogress .peg { 20 | display: block; 21 | position: absolute; 22 | right: 0px; 23 | width: 100px; 24 | height: 100%; 25 | box-shadow: 0 0 10px #29d, 0 0 5px #29d; 26 | opacity: 1.0; 27 | 28 | -webkit-transform: rotate(3deg) translate(0px, -4px); 29 | -ms-transform: rotate(3deg) translate(0px, -4px); 30 | transform: rotate(3deg) translate(0px, -4px); 31 | } 32 | 33 | /* Remove these to get rid of the spinner */ 34 | #nprogress .spinner { 35 | display: block; 36 | position: fixed; 37 | z-index: 1031; 38 | top: 15px; 39 | right: 15px; 40 | } 41 | 42 | #nprogress .spinner-icon { 43 | width: 18px; 44 | height: 18px; 45 | box-sizing: border-box; 46 | 47 | border: solid 2px transparent; 48 | border-top-color: #29d; 49 | border-left-color: #29d; 50 | border-radius: 50%; 51 | 52 | -webkit-animation: nprogress-spinner 400ms linear infinite; 53 | animation: nprogress-spinner 400ms linear infinite; 54 | } 55 | 56 | .nprogress-custom-parent { 57 | overflow: hidden; 58 | position: relative; 59 | } 60 | 61 | .nprogress-custom-parent #nprogress .spinner, 62 | .nprogress-custom-parent #nprogress .bar { 63 | position: absolute; 64 | } 65 | 66 | @-webkit-keyframes nprogress-spinner { 67 | 0% { -webkit-transform: rotate(0deg); } 68 | 100% { -webkit-transform: rotate(360deg); } 69 | } 70 | @keyframes nprogress-spinner { 71 | 0% { transform: rotate(0deg); } 72 | 100% { transform: rotate(360deg); } 73 | } 74 | 75 | -------------------------------------------------------------------------------- /.files/browse.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {{.Name}} 12 | 13 | 14 |
    15 |
    16 | 25 |
    26 |
    27 | 28 | 29 | 30 | 39 | 48 | 57 | 58 | {{if .CanGoUp}} 59 | 60 | 63 | 66 | 67 | 68 | 69 | {{end}} 70 | {{range .Items}} 71 | 72 | 76 | 79 | 80 | 81 | 82 | {{end}} 83 |
    31 | {{if and (eq .Sort "name") (ne .Order "desc")}} 32 | 文件名 ▲ 33 | {{else if and (eq .Sort "name") (ne .Order "asc")}} 34 | 文件名 ▼ 35 | {{else}} 36 | 文件名 37 | {{end}} 38 | 40 | {{if and (eq .Sort "size") (ne .Order "desc")}} 41 | 大小 ▲ 42 | {{else if and (eq .Sort "size") (ne .Order "asc")}} 43 | 大小 ▼ 44 | {{else}} 45 | 大小 46 | {{end}} 47 | 49 | {{if and (eq .Sort "time") (ne .Order "desc")}} 50 | 修改时间 ▲ 51 | {{else if and (eq .Sort "time") (ne .Order "asc")}} 52 | 修改时间 ▼ 53 | {{else}} 54 | 修改时间 55 | {{end}} 56 |
    61 | 62 | 64 | .. 65 |
    73 | {{if .IsDir}} 74 | {{else}}{{end}} 75 | 77 | {{.Name}} 78 | {{if not .IsDir}}{{.HumanSize}}{{end}}{{.HumanModTime "2006.02.01 15:04:05"}}
    84 |
    85 | 88 |
    89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /.files/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | outline: 0 4 | } 5 | 6 | a { 7 | color: #333; 8 | text-decoration: none; 9 | } 10 | 11 | a:hover { 12 | color: #0078e7; 13 | } 14 | 15 | html,body { 16 | margin: 0; 17 | padding: 0; 18 | background-color: #f5f5f5 19 | } 20 | 21 | body { 22 | overflow-y: scroll; 23 | } 24 | 25 | #body { 26 | width: 100%; 27 | display: flex; 28 | flex-direction: column; 29 | align-items: center; 30 | } 31 | 32 | header,section,footer { 33 | display: block; 34 | width: 100% 35 | } 36 | 37 | #breadcrumbs { 38 | list-style: none; 39 | margin: .5em 0 0 0; 40 | padding: 0; 41 | display: flex; 42 | flex-wrap: wrap; 43 | } 44 | 45 | #breadcrumbs li { 46 | margin-right: .25em; 47 | display: flex; 48 | align-items: center 49 | } 50 | 51 | #breadcrumbs li:last-child { 52 | margin-right: 0 53 | } 54 | 55 | #breadcrumbs a { 56 | padding: 1em; 57 | background-color: #fff; 58 | color: #333; 59 | transition: color .2s,background-color .2s; 60 | text-decoration: none; 61 | position: relative 62 | } 63 | 64 | #breadcrumbs a:hover { 65 | color: #fff; 66 | background-color: #0078e7 67 | } 68 | 69 | #browse,#markdown { 70 | background-color: #fff; 71 | padding: .75em 1em; 72 | margin: .5em 0; 73 | -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.04); 74 | box-shadow: 0 1px 4px rgba(0,0,0,.04); 75 | } 76 | 77 | #browse table { 78 | width: 100%; 79 | border-collapse: collapse; 80 | table-layout: fixed; 81 | } 82 | 83 | #browse tr { 84 | outline: 0; 85 | border: 0; 86 | } 87 | 88 | #browse tr:hover td { 89 | background: #f6f6f6; 90 | } 91 | 92 | #browse th { 93 | text-align: left; 94 | padding-right: 20px; 95 | padding-bottom: .5em; 96 | } 97 | 98 | #browse .col-icon { 99 | width: 1em; 100 | } 101 | 102 | #browse .col-name { 103 | width: 50%; 104 | } 105 | 106 | #browse tr td:nth-child(2) { 107 | padding-right: 2px; 108 | } 109 | 110 | #browse tr th:nth-child(4), 111 | tr td:nth-child(4) { 112 | display: none; 113 | } 114 | 115 | #browse tr td:first-of-type { 116 | padding-right: 10px; 117 | } 118 | 119 | #browse td { 120 | cursor: pointer; 121 | padding: 10px 0; 122 | outline: 0; 123 | border: 0; 124 | border-bottom: 1px solid #edf1f5; 125 | vertical-align: middle; 126 | text-align: left; 127 | transition: background 300ms ease; 128 | } 129 | 130 | #browse td a { 131 | display: block; 132 | word-wrap: break-word; 133 | } 134 | 135 | #markdown >:first-child { 136 | margin-top: -.3em 137 | } 138 | 139 | #markdown p { 140 | margin: 0 0 1em 141 | } 142 | 143 | #markdown a { 144 | color: #0078e7 145 | } 146 | 147 | #markdown a:hover { 148 | border-bottom: 1px dotted #0078e7; 149 | color: #0078e7 150 | } 151 | 152 | #markdown img { 153 | max-width: 100%; 154 | height: auto 155 | } 156 | 157 | #markdown blockquote { 158 | margin-left: 0; 159 | padding-left: 1em; 160 | border-left: 4px solid #ddd 161 | } 162 | 163 | #markdown pre { 164 | padding: 2em; 165 | background: #f7f7f7; 166 | white-space: pre-wrap; 167 | word-wrap: break-word; 168 | } 169 | 170 | #markdown code { 171 | padding: .2em; 172 | background: #f7f7f7; 173 | } 174 | 175 | #markdown pre code { 176 | padding: 0; 177 | background: 0 178 | } 179 | 180 | #markdown li { 181 | margin: .5em; 182 | } 183 | 184 | #markdown th { 185 | background: #f7f7f7 186 | } 187 | 188 | #markdown td,#markdown th { 189 | padding: .2em .5em; 190 | border: 1px solid #eee 191 | } 192 | 193 | footer { 194 | margin-bottom: .5em; 195 | } 196 | 197 | @media screen and (min-width: 48em) { 198 | tr th:nth-child(4), 199 | tr td:nth-child(4) { 200 | display: table-cell; 201 | } 202 | #breadcrumbs { 203 | margin: 2em 0 0; 204 | } 205 | 206 | header,section,footer { 207 | width: 80%; 208 | } 209 | 210 | #browse,#markdown { 211 | margin: 2em 0; 212 | padding: 2em; 213 | } 214 | 215 | footer { 216 | margin-bottom: 2em; 217 | } 218 | } 219 | @media screen and (min-width: 60em) { 220 | header,section,footer { 221 | width: 75%; 222 | max-width: 1280px 223 | } 224 | } -------------------------------------------------------------------------------- /.files/nprogress.js: -------------------------------------------------------------------------------- 1 | /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress 2 | * @license MIT */ 3 | 4 | ;(function(root, factory) { 5 | 6 | if (typeof define === 'function' && define.amd) { 7 | define(factory); 8 | } else if (typeof exports === 'object') { 9 | module.exports = factory(); 10 | } else { 11 | root.NProgress = factory(); 12 | } 13 | 14 | })(this, function() { 15 | var NProgress = {}; 16 | 17 | NProgress.version = '0.2.0'; 18 | 19 | var Settings = NProgress.settings = { 20 | minimum: 0.08, 21 | easing: 'ease', 22 | positionUsing: '', 23 | speed: 200, 24 | trickle: true, 25 | trickleRate: 0.02, 26 | trickleSpeed: 800, 27 | showSpinner: true, 28 | barSelector: '[role="bar"]', 29 | spinnerSelector: '[role="spinner"]', 30 | parent: 'body', 31 | template: '
    ' 32 | }; 33 | 34 | /** 35 | * Updates configuration. 36 | * 37 | * NProgress.configure({ 38 | * minimum: 0.1 39 | * }); 40 | */ 41 | NProgress.configure = function(options) { 42 | var key, value; 43 | for (key in options) { 44 | value = options[key]; 45 | if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; 46 | } 47 | 48 | return this; 49 | }; 50 | 51 | /** 52 | * Last number. 53 | */ 54 | 55 | NProgress.status = null; 56 | 57 | /** 58 | * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. 59 | * 60 | * NProgress.set(0.4); 61 | * NProgress.set(1.0); 62 | */ 63 | 64 | NProgress.set = function(n) { 65 | var started = NProgress.isStarted(); 66 | 67 | n = clamp(n, Settings.minimum, 1); 68 | NProgress.status = (n === 1 ? null : n); 69 | 70 | var progress = NProgress.render(!started), 71 | bar = progress.querySelector(Settings.barSelector), 72 | speed = Settings.speed, 73 | ease = Settings.easing; 74 | 75 | progress.offsetWidth; /* Repaint */ 76 | 77 | queue(function(next) { 78 | // Set positionUsing if it hasn't already been set 79 | if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); 80 | 81 | // Add transition 82 | css(bar, barPositionCSS(n, speed, ease)); 83 | 84 | if (n === 1) { 85 | // Fade out 86 | css(progress, { 87 | transition: 'none', 88 | opacity: 1 89 | }); 90 | progress.offsetWidth; /* Repaint */ 91 | 92 | setTimeout(function() { 93 | css(progress, { 94 | transition: 'all ' + speed + 'ms linear', 95 | opacity: 0 96 | }); 97 | setTimeout(function() { 98 | NProgress.remove(); 99 | next(); 100 | }, speed); 101 | }, speed); 102 | } else { 103 | setTimeout(next, speed); 104 | } 105 | }); 106 | 107 | return this; 108 | }; 109 | 110 | NProgress.isStarted = function() { 111 | return typeof NProgress.status === 'number'; 112 | }; 113 | 114 | /** 115 | * Shows the progress bar. 116 | * This is the same as setting the status to 0%, except that it doesn't go backwards. 117 | * 118 | * NProgress.start(); 119 | * 120 | */ 121 | NProgress.start = function() { 122 | if (!NProgress.status) NProgress.set(0); 123 | 124 | var work = function() { 125 | setTimeout(function() { 126 | if (!NProgress.status) return; 127 | NProgress.trickle(); 128 | work(); 129 | }, Settings.trickleSpeed); 130 | }; 131 | 132 | if (Settings.trickle) work(); 133 | 134 | return this; 135 | }; 136 | 137 | /** 138 | * Hides the progress bar. 139 | * This is the *sort of* the same as setting the status to 100%, with the 140 | * difference being `done()` makes some placebo effect of some realistic motion. 141 | * 142 | * NProgress.done(); 143 | * 144 | * If `true` is passed, it will show the progress bar even if its hidden. 145 | * 146 | * NProgress.done(true); 147 | */ 148 | 149 | NProgress.done = function(force) { 150 | if (!force && !NProgress.status) return this; 151 | 152 | return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); 153 | }; 154 | 155 | /** 156 | * Increments by a random amount. 157 | */ 158 | 159 | NProgress.inc = function(amount) { 160 | var n = NProgress.status; 161 | 162 | if (!n) { 163 | return NProgress.start(); 164 | } else { 165 | if (typeof amount !== 'number') { 166 | amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); 167 | } 168 | 169 | n = clamp(n + amount, 0, 0.994); 170 | return NProgress.set(n); 171 | } 172 | }; 173 | 174 | NProgress.trickle = function() { 175 | return NProgress.inc(Math.random() * Settings.trickleRate); 176 | }; 177 | 178 | /** 179 | * Waits for all supplied jQuery promises and 180 | * increases the progress as the promises resolve. 181 | * 182 | * @param $promise jQUery Promise 183 | */ 184 | (function() { 185 | var initial = 0, current = 0; 186 | 187 | NProgress.promise = function($promise) { 188 | if (!$promise || $promise.state() === "resolved") { 189 | return this; 190 | } 191 | 192 | if (current === 0) { 193 | NProgress.start(); 194 | } 195 | 196 | initial++; 197 | current++; 198 | 199 | $promise.always(function() { 200 | current--; 201 | if (current === 0) { 202 | initial = 0; 203 | NProgress.done(); 204 | } else { 205 | NProgress.set((initial - current) / initial); 206 | } 207 | }); 208 | 209 | return this; 210 | }; 211 | 212 | })(); 213 | 214 | /** 215 | * (Internal) renders the progress bar markup based on the `template` 216 | * setting. 217 | */ 218 | 219 | NProgress.render = function(fromStart) { 220 | if (NProgress.isRendered()) return document.getElementById('nprogress'); 221 | 222 | addClass(document.documentElement, 'nprogress-busy'); 223 | 224 | var progress = document.createElement('div'); 225 | progress.id = 'nprogress'; 226 | progress.innerHTML = Settings.template; 227 | 228 | var bar = progress.querySelector(Settings.barSelector), 229 | perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), 230 | parent = document.querySelector(Settings.parent), 231 | spinner; 232 | 233 | css(bar, { 234 | transition: 'all 0 linear', 235 | transform: 'translate3d(' + perc + '%,0,0)' 236 | }); 237 | 238 | if (!Settings.showSpinner) { 239 | spinner = progress.querySelector(Settings.spinnerSelector); 240 | spinner && removeElement(spinner); 241 | } 242 | 243 | if (parent != document.body) { 244 | addClass(parent, 'nprogress-custom-parent'); 245 | } 246 | 247 | parent.appendChild(progress); 248 | return progress; 249 | }; 250 | 251 | /** 252 | * Removes the element. Opposite of render(). 253 | */ 254 | 255 | NProgress.remove = function() { 256 | removeClass(document.documentElement, 'nprogress-busy'); 257 | removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent'); 258 | var progress = document.getElementById('nprogress'); 259 | progress && removeElement(progress); 260 | }; 261 | 262 | /** 263 | * Checks if the progress bar is rendered. 264 | */ 265 | 266 | NProgress.isRendered = function() { 267 | return !!document.getElementById('nprogress'); 268 | }; 269 | 270 | /** 271 | * Determine which positioning CSS rule to use. 272 | */ 273 | 274 | NProgress.getPositioningCSS = function() { 275 | // Sniff on document.body.style 276 | var bodyStyle = document.body.style; 277 | 278 | // Sniff prefixes 279 | var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : 280 | ('MozTransform' in bodyStyle) ? 'Moz' : 281 | ('msTransform' in bodyStyle) ? 'ms' : 282 | ('OTransform' in bodyStyle) ? 'O' : ''; 283 | 284 | if (vendorPrefix + 'Perspective' in bodyStyle) { 285 | // Modern browsers with 3D support, e.g. Webkit, IE10 286 | return 'translate3d'; 287 | } else if (vendorPrefix + 'Transform' in bodyStyle) { 288 | // Browsers without 3D support, e.g. IE9 289 | return 'translate'; 290 | } else { 291 | // Browsers without translate() support, e.g. IE7-8 292 | return 'margin'; 293 | } 294 | }; 295 | 296 | /** 297 | * Helpers 298 | */ 299 | 300 | function clamp(n, min, max) { 301 | if (n < min) return min; 302 | if (n > max) return max; 303 | return n; 304 | } 305 | 306 | /** 307 | * (Internal) converts a percentage (`0..1`) to a bar translateX 308 | * percentage (`-100%..0%`). 309 | */ 310 | 311 | function toBarPerc(n) { 312 | return (-1 + n) * 100; 313 | } 314 | 315 | 316 | /** 317 | * (Internal) returns the correct CSS for changing the bar's 318 | * position given an n percentage, and speed and ease from Settings 319 | */ 320 | 321 | function barPositionCSS(n, speed, ease) { 322 | var barCSS; 323 | 324 | if (Settings.positionUsing === 'translate3d') { 325 | barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; 326 | } else if (Settings.positionUsing === 'translate') { 327 | barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; 328 | } else { 329 | barCSS = { 'margin-left': toBarPerc(n)+'%' }; 330 | } 331 | 332 | barCSS.transition = 'all '+speed+'ms '+ease; 333 | 334 | return barCSS; 335 | } 336 | 337 | /** 338 | * (Internal) Queues a function to be executed. 339 | */ 340 | 341 | var queue = (function() { 342 | var pending = []; 343 | 344 | function next() { 345 | var fn = pending.shift(); 346 | if (fn) { 347 | fn(next); 348 | } 349 | } 350 | 351 | return function(fn) { 352 | pending.push(fn); 353 | if (pending.length == 1) next(); 354 | }; 355 | })(); 356 | 357 | /** 358 | * (Internal) Applies css properties to an element, similar to the jQuery 359 | * css method. 360 | * 361 | * While this helper does assist with vendor prefixed property names, it 362 | * does not perform any manipulation of values prior to setting styles. 363 | */ 364 | 365 | var css = (function() { 366 | var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ], 367 | cssProps = {}; 368 | 369 | function camelCase(string) { 370 | return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) { 371 | return letter.toUpperCase(); 372 | }); 373 | } 374 | 375 | function getVendorProp(name) { 376 | var style = document.body.style; 377 | if (name in style) return name; 378 | 379 | var i = cssPrefixes.length, 380 | capName = name.charAt(0).toUpperCase() + name.slice(1), 381 | vendorName; 382 | while (i--) { 383 | vendorName = cssPrefixes[i] + capName; 384 | if (vendorName in style) return vendorName; 385 | } 386 | 387 | return name; 388 | } 389 | 390 | function getStyleProp(name) { 391 | name = camelCase(name); 392 | return cssProps[name] || (cssProps[name] = getVendorProp(name)); 393 | } 394 | 395 | function applyCss(element, prop, value) { 396 | prop = getStyleProp(prop); 397 | element.style[prop] = value; 398 | } 399 | 400 | return function(element, properties) { 401 | var args = arguments, 402 | prop, 403 | value; 404 | 405 | if (args.length == 2) { 406 | for (prop in properties) { 407 | value = properties[prop]; 408 | if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); 409 | } 410 | } else { 411 | applyCss(element, args[1], args[2]); 412 | } 413 | } 414 | })(); 415 | 416 | /** 417 | * (Internal) Determines if an element or space separated list of class names contains a class name. 418 | */ 419 | 420 | function hasClass(element, name) { 421 | var list = typeof element == 'string' ? element : classList(element); 422 | return list.indexOf(' ' + name + ' ') >= 0; 423 | } 424 | 425 | /** 426 | * (Internal) Adds a class to an element. 427 | */ 428 | 429 | function addClass(element, name) { 430 | var oldList = classList(element), 431 | newList = oldList + name; 432 | 433 | if (hasClass(oldList, name)) return; 434 | 435 | // Trim the opening space. 436 | element.className = newList.substring(1); 437 | } 438 | 439 | /** 440 | * (Internal) Removes a class from an element. 441 | */ 442 | 443 | function removeClass(element, name) { 444 | var oldList = classList(element), 445 | newList; 446 | 447 | if (!hasClass(element, name)) return; 448 | 449 | // Replace the class name. 450 | newList = oldList.replace(' ' + name + ' ', ' '); 451 | 452 | // Trim the opening and closing spaces. 453 | element.className = newList.substring(1, newList.length - 1); 454 | } 455 | 456 | /** 457 | * (Internal) Gets a space separated list of the class names on the element. 458 | * The list is wrapped with a single space on each end to facilitate finding 459 | * matches within the list. 460 | */ 461 | 462 | function classList(element) { 463 | return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); 464 | } 465 | 466 | /** 467 | * (Internal) Removes an element from the DOM. 468 | */ 469 | 470 | function removeElement(element) { 471 | element && element.parentNode && element.parentNode.removeChild(element); 472 | } 473 | 474 | return NProgress; 475 | }); 476 | 477 | -------------------------------------------------------------------------------- /.files/google-code-prettify/prettify.js: -------------------------------------------------------------------------------- 1 | !function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= 3 | b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", 11 | /^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ 12 | s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, 13 | q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= 14 | c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"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"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"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"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | O=[N,"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"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"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"], 20 | Q=[y,"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"],W=[y,"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"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 21 | V=/\S/,X=v({keywords:[M,O,E,"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",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 22 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 23 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), 24 | ["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"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",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, 25 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 26 | p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
    "+a+"
    ";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); 27 | return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i=0;){var M=A[m],T=M.src.match(/^[^#?]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D= 4 | [],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]- 8 | a[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y, 13 | g),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\S\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, 14 | r,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,r,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,r,"\"'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/, 15 | r,"#"]),h.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,r])):d.push(["com",/^#[^\n\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\/\/[^\n\r]*/,r]),h.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\n\r")?".":"[\\S\\s]";h.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ 16 | ("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+e+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+e+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),r]);d.push(["pln",/^\s+/,r," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,r],["pln",/^[$_a-z][\w$@]*/i,r],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, 17 | r,"0123456789"],["pln",/^\\[\S\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}} 18 | function e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"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"], 22 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"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"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 23 | L=[K,"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"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"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"], 24 | N=[G,"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"],R=[G,"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"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 25 | S=/\S/,T=t({keywords:[J,L,O,"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",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 26 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\s+/,r," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,r,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 27 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}), 28 | ["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"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",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N, 29 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 30 | i(C([],[["str",/^[\S\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
    "+a+"
    ";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML}, 31 | prettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p>\s+/,a],["codeoutput",/^octave:\d+>\s+/,a],["lang-matlab-operators",/^((?:[A-Za-z]\w*(?:\.[A-Za-z]\w*)*|[).\]}])')/,a],["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)(?!')/,a], 2 | [b.PR_STRING,/^'(?:[^']|'')*'/,a],[b.PR_LITERAL,/^[+-]?\.?\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?[ij]?/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a]],e=[["lang-matlab-identifiers",/^([A-Za-z]\w*(?:\.[A-Za-z]\w*)*)/,a],[b.PR_TAG,/^[()[\]{}]/,a],[b.PR_PUNCTUATION,/^[!&*-/:->@\\^|~]/,a],["transpose",/^'/,a]]; 3 | b.registerLangHandler(b.createSimpleLexer([],[[b.PR_KEYWORD,/^\b(?:break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while)\b/,a],["const",/^\b(?:true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout)\b/,a],[b.PR_TYPE,/^\b(?:cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse)\b/,a],["fun",/^\b(?:abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan[2dh]?|audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|bessel[h-ky]|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:.(?:close|closeVar|computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers.Map|contour(?:[3cf]|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab.io.MatFile|matlab.mixin.(?:Copyable|Heterogeneous(?:.getDefaultScalarElement)?)|matlabrc|matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta.(?:class(?:.fromName)?|DynamicProperty|EnumeratedValue|event|MetaData|method|package(?:.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|ncwriteschema|ndgrid|ndims|ne|NET(?:.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|NetException|setStaticProperty))?|netcdf.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:.(?:create|getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:.isPlatformSupported)?|VideoWriter(?:.getProfiles)?|view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|ylabel|ylim|zeros|zip|zlabel|zlim|zoom)\b/, 4 | a],["fun_tbx",/^\b(?:addedvarplot|andrewsplot|anova[12n]|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|cholcov|Classification(?:BaggedEnsemble|Discriminant(?:.(?:fit|make|template))?|Ensemble|KNN(?:.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:.fit)?|geo(?:cdf|inv|mean|pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|LinearModel(?:.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:.fit)?|nan(?:cov|max|mean|median|min|std|sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:.(?:fit|template))?)|regstats|relieff|ridge|robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest)\b/, 5 | a],["fun_tbx",/^\b(?:adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|reflect|regionprops|registration.metric.(?:MattesMutualInformation|MeanSquares)|registration.optimizer.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb)\b/, 6 | a],["fun_tbx",/^\b(?:bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog)\b/,a],["ident",/^[A-Za-z]\w*(?:\.[A-Za-z]\w*)*/,a]]),["matlab-identifiers"]);b.registerLangHandler(b.createSimpleLexer([],e),["matlab-operators"]);b.registerLangHandler(b.createSimpleLexer(c,d),["matlab"]); 7 | -------------------------------------------------------------------------------- /.files/google-code-prettify/lang-xq.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], 2 | ["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], 3 | ["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); 4 | -------------------------------------------------------------------------------- /.files/jquery.pjax.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2012, Chris Wanstrath 3 | * Released under the MIT License 4 | * https://github.com/defunkt/jquery-pjax 5 | */ 6 | 7 | (function($){ 8 | 9 | // When called on a container with a selector, fetches the href with 10 | // ajax into the container or with the data-pjax attribute on the link 11 | // itself. 12 | // 13 | // Tries to make sure the back button and ctrl+click work the way 14 | // you'd expect. 15 | // 16 | // Exported as $.fn.pjax 17 | // 18 | // Accepts a jQuery ajax options object that may include these 19 | // pjax specific options: 20 | // 21 | // 22 | // container - String selector for the element where to place the response body. 23 | // push - Whether to pushState the URL. Defaults to true (of course). 24 | // replace - Want to use replaceState instead? That's cool. 25 | // 26 | // For convenience the second parameter can be either the container or 27 | // the options object. 28 | // 29 | // Returns the jQuery object 30 | function fnPjax(selector, container, options) { 31 | options = optionsFor(container, options) 32 | return this.on('click.pjax', selector, function(event) { 33 | var opts = options 34 | if (!opts.container) { 35 | opts = $.extend({}, options) 36 | opts.container = $(this).attr('data-pjax') 37 | } 38 | handleClick(event, opts) 39 | }) 40 | } 41 | 42 | // Public: pjax on click handler 43 | // 44 | // Exported as $.pjax.click. 45 | // 46 | // event - "click" jQuery.Event 47 | // options - pjax options 48 | // 49 | // Examples 50 | // 51 | // $(document).on('click', 'a', $.pjax.click) 52 | // // is the same as 53 | // $(document).pjax('a') 54 | // 55 | // Returns nothing. 56 | function handleClick(event, container, options) { 57 | options = optionsFor(container, options) 58 | 59 | var link = event.currentTarget 60 | var $link = $(link) 61 | 62 | if (link.tagName.toUpperCase() !== 'A') 63 | throw "$.fn.pjax or $.pjax.click requires an anchor element" 64 | 65 | // Middle click, cmd click, and ctrl click should open 66 | // links in a new tab as normal. 67 | if ( event.which > 1 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey ) 68 | return 69 | 70 | // Ignore cross origin links 71 | if ( location.protocol !== link.protocol || location.hostname !== link.hostname ) 72 | return 73 | 74 | // Ignore case when a hash is being tacked on the current URL 75 | if ( link.href.indexOf('#') > -1 && stripHash(link) == stripHash(location) ) 76 | return 77 | 78 | // Ignore event with default prevented 79 | if (event.isDefaultPrevented()) 80 | return 81 | 82 | var defaults = { 83 | url: link.href, 84 | container: $link.attr('data-pjax'), 85 | target: link 86 | } 87 | 88 | var opts = $.extend({}, defaults, options) 89 | var clickEvent = $.Event('pjax:click') 90 | $link.trigger(clickEvent, [opts]) 91 | 92 | if (!clickEvent.isDefaultPrevented()) { 93 | pjax(opts) 94 | event.preventDefault() 95 | $link.trigger('pjax:clicked', [opts]) 96 | } 97 | } 98 | 99 | // Public: pjax on form submit handler 100 | // 101 | // Exported as $.pjax.submit 102 | // 103 | // event - "click" jQuery.Event 104 | // options - pjax options 105 | // 106 | // Examples 107 | // 108 | // $(document).on('submit', 'form', function(event) { 109 | // $.pjax.submit(event, '[data-pjax-container]') 110 | // }) 111 | // 112 | // Returns nothing. 113 | function handleSubmit(event, container, options) { 114 | options = optionsFor(container, options) 115 | 116 | var form = event.currentTarget 117 | var $form = $(form) 118 | 119 | if (form.tagName.toUpperCase() !== 'FORM') 120 | throw "$.pjax.submit requires a form element" 121 | 122 | var defaults = { 123 | type: ($form.attr('method') || 'GET').toUpperCase(), 124 | url: $form.attr('action'), 125 | container: $form.attr('data-pjax'), 126 | target: form 127 | } 128 | 129 | if (defaults.type !== 'GET' && window.FormData !== undefined) { 130 | defaults.data = new FormData(form) 131 | defaults.processData = false 132 | defaults.contentType = false 133 | } else { 134 | // Can't handle file uploads, exit 135 | if ($form.find(':file').length) { 136 | return 137 | } 138 | 139 | // Fallback to manually serializing the fields 140 | defaults.data = $form.serializeArray() 141 | } 142 | 143 | pjax($.extend({}, defaults, options)) 144 | 145 | event.preventDefault() 146 | } 147 | 148 | // Loads a URL with ajax, puts the response body inside a container, 149 | // then pushState()'s the loaded URL. 150 | // 151 | // Works just like $.ajax in that it accepts a jQuery ajax 152 | // settings object (with keys like url, type, data, etc). 153 | // 154 | // Accepts these extra keys: 155 | // 156 | // container - String selector for where to stick the response body. 157 | // push - Whether to pushState the URL. Defaults to true (of course). 158 | // replace - Want to use replaceState instead? That's cool. 159 | // 160 | // Use it just like $.ajax: 161 | // 162 | // var xhr = $.pjax({ url: this.href, container: '#main' }) 163 | // console.log( xhr.readyState ) 164 | // 165 | // Returns whatever $.ajax returns. 166 | function pjax(options) { 167 | options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options) 168 | 169 | if ($.isFunction(options.url)) { 170 | options.url = options.url() 171 | } 172 | 173 | var hash = parseURL(options.url).hash 174 | 175 | var containerType = $.type(options.container) 176 | if (containerType !== 'string') { 177 | throw "expected string value for 'container' option; got " + containerType 178 | } 179 | var context = options.context = $(options.container) 180 | if (!context.length) { 181 | throw "the container selector '" + options.container + "' did not match anything" 182 | } 183 | 184 | // We want the browser to maintain two separate internal caches: one 185 | // for pjax'd partial page loads and one for normal page loads. 186 | // Without adding this secret parameter, some browsers will often 187 | // confuse the two. 188 | if (!options.data) options.data = {} 189 | if ($.isArray(options.data)) { 190 | options.data.push({name: '_pjax', value: options.container}) 191 | } else { 192 | options.data._pjax = options.container 193 | } 194 | 195 | function fire(type, args, props) { 196 | if (!props) props = {} 197 | props.relatedTarget = options.target 198 | var event = $.Event(type, props) 199 | context.trigger(event, args) 200 | return !event.isDefaultPrevented() 201 | } 202 | 203 | var timeoutTimer 204 | 205 | options.beforeSend = function(xhr, settings) { 206 | // No timeout for non-GET requests 207 | // Its not safe to request the resource again with a fallback method. 208 | if (settings.type !== 'GET') { 209 | settings.timeout = 0 210 | } 211 | 212 | xhr.setRequestHeader('X-PJAX', 'true') 213 | xhr.setRequestHeader('X-PJAX-Container', options.container) 214 | 215 | if (!fire('pjax:beforeSend', [xhr, settings])) 216 | return false 217 | 218 | if (settings.timeout > 0) { 219 | timeoutTimer = setTimeout(function() { 220 | if (fire('pjax:timeout', [xhr, options])) 221 | xhr.abort('timeout') 222 | }, settings.timeout) 223 | 224 | // Clear timeout setting so jquerys internal timeout isn't invoked 225 | settings.timeout = 0 226 | } 227 | 228 | var url = parseURL(settings.url) 229 | if (hash) url.hash = hash 230 | options.requestUrl = stripInternalParams(url) 231 | } 232 | 233 | options.complete = function(xhr, textStatus) { 234 | if (timeoutTimer) 235 | clearTimeout(timeoutTimer) 236 | 237 | fire('pjax:complete', [xhr, textStatus, options]) 238 | 239 | fire('pjax:end', [xhr, options]) 240 | } 241 | 242 | options.error = function(xhr, textStatus, errorThrown) { 243 | var container = extractContainer("", xhr, options) 244 | 245 | var allowed = fire('pjax:error', [xhr, textStatus, errorThrown, options]) 246 | if (options.type == 'GET' && textStatus !== 'abort' && allowed) { 247 | locationReplace(container.url) 248 | } 249 | } 250 | 251 | options.success = function(data, status, xhr) { 252 | var previousState = pjax.state 253 | 254 | // If $.pjax.defaults.version is a function, invoke it first. 255 | // Otherwise it can be a static string. 256 | var currentVersion = typeof $.pjax.defaults.version === 'function' ? 257 | $.pjax.defaults.version() : 258 | $.pjax.defaults.version 259 | 260 | var latestVersion = xhr.getResponseHeader('X-PJAX-Version') 261 | 262 | var container = extractContainer(data, xhr, options) 263 | 264 | var url = parseURL(container.url) 265 | if (hash) { 266 | url.hash = hash 267 | container.url = url.href 268 | } 269 | 270 | // If there is a layout version mismatch, hard load the new url 271 | if (currentVersion && latestVersion && currentVersion !== latestVersion) { 272 | locationReplace(container.url) 273 | return 274 | } 275 | 276 | // If the new response is missing a body, hard load the page 277 | if (!container.contents) { 278 | locationReplace(container.url) 279 | return 280 | } 281 | 282 | pjax.state = { 283 | id: options.id || uniqueId(), 284 | url: container.url, 285 | title: container.title, 286 | container: options.container, 287 | fragment: options.fragment, 288 | timeout: options.timeout 289 | } 290 | 291 | if (options.push || options.replace) { 292 | window.history.replaceState(pjax.state, container.title, container.url) 293 | } 294 | 295 | // Only blur the focus if the focused element is within the container. 296 | var blurFocus = $.contains(context, document.activeElement) 297 | 298 | // Clear out any focused controls before inserting new page contents. 299 | if (blurFocus) { 300 | try { 301 | document.activeElement.blur() 302 | } catch (e) { /* ignore */ } 303 | } 304 | 305 | if (container.title) document.title = container.title 306 | 307 | fire('pjax:beforeReplace', [container.contents, options], { 308 | state: pjax.state, 309 | previousState: previousState 310 | }) 311 | context.html(container.contents) 312 | 313 | // FF bug: Won't autofocus fields that are inserted via JS. 314 | // This behavior is incorrect. So if theres no current focus, autofocus 315 | // the last field. 316 | // 317 | // http://www.w3.org/html/wg/drafts/html/master/forms.html 318 | var autofocusEl = context.find('input[autofocus], textarea[autofocus]').last()[0] 319 | if (autofocusEl && document.activeElement !== autofocusEl) { 320 | autofocusEl.focus() 321 | } 322 | 323 | executeScriptTags(container.scripts) 324 | 325 | var scrollTo = options.scrollTo 326 | 327 | // Ensure browser scrolls to the element referenced by the URL anchor 328 | if (hash) { 329 | var name = decodeURIComponent(hash.slice(1)) 330 | var target = document.getElementById(name) || document.getElementsByName(name)[0] 331 | if (target) scrollTo = $(target).offset().top 332 | } 333 | 334 | if (typeof scrollTo == 'number') $(window).scrollTop(scrollTo) 335 | 336 | fire('pjax:success', [data, status, xhr, options]) 337 | } 338 | 339 | 340 | // Initialize pjax.state for the initial page load. Assume we're 341 | // using the container and options of the link we're loading for the 342 | // back button to the initial page. This ensures good back button 343 | // behavior. 344 | if (!pjax.state) { 345 | pjax.state = { 346 | id: uniqueId(), 347 | url: window.location.href, 348 | title: document.title, 349 | container: options.container, 350 | fragment: options.fragment, 351 | timeout: options.timeout 352 | } 353 | window.history.replaceState(pjax.state, document.title) 354 | } 355 | 356 | // Cancel the current request if we're already pjaxing 357 | abortXHR(pjax.xhr) 358 | 359 | pjax.options = options 360 | var xhr = pjax.xhr = $.ajax(options) 361 | 362 | if (xhr.readyState > 0) { 363 | if (options.push && !options.replace) { 364 | // Cache current container element before replacing it 365 | cachePush(pjax.state.id, [options.container, cloneContents(context)]) 366 | 367 | window.history.pushState(null, "", options.requestUrl) 368 | } 369 | 370 | fire('pjax:start', [xhr, options]) 371 | fire('pjax:send', [xhr, options]) 372 | } 373 | 374 | return pjax.xhr 375 | } 376 | 377 | // Public: Reload current page with pjax. 378 | // 379 | // Returns whatever $.pjax returns. 380 | function pjaxReload(container, options) { 381 | var defaults = { 382 | url: window.location.href, 383 | push: false, 384 | replace: true, 385 | scrollTo: false 386 | } 387 | 388 | return pjax($.extend(defaults, optionsFor(container, options))) 389 | } 390 | 391 | // Internal: Hard replace current state with url. 392 | // 393 | // Work for around WebKit 394 | // https://bugs.webkit.org/show_bug.cgi?id=93506 395 | // 396 | // Returns nothing. 397 | function locationReplace(url) { 398 | window.history.replaceState(null, "", pjax.state.url) 399 | window.location.replace(url) 400 | } 401 | 402 | 403 | var initialPop = true 404 | var initialURL = window.location.href 405 | var initialState = window.history.state 406 | 407 | // Initialize $.pjax.state if possible 408 | // Happens when reloading a page and coming forward from a different 409 | // session history. 410 | if (initialState && initialState.container) { 411 | pjax.state = initialState 412 | } 413 | 414 | // Non-webkit browsers don't fire an initial popstate event 415 | if ('state' in window.history) { 416 | initialPop = false 417 | } 418 | 419 | // popstate handler takes care of the back and forward buttons 420 | // 421 | // You probably shouldn't use pjax on pages with other pushState 422 | // stuff yet. 423 | function onPjaxPopstate(event) { 424 | 425 | // Hitting back or forward should override any pending PJAX request. 426 | if (!initialPop) { 427 | abortXHR(pjax.xhr) 428 | } 429 | 430 | var previousState = pjax.state 431 | var state = event.state 432 | var direction 433 | 434 | if (state && state.container) { 435 | // When coming forward from a separate history session, will get an 436 | // initial pop with a state we are already at. Skip reloading the current 437 | // page. 438 | if (initialPop && initialURL == state.url) return 439 | 440 | if (previousState) { 441 | // If popping back to the same state, just skip. 442 | // Could be clicking back from hashchange rather than a pushState. 443 | if (previousState.id === state.id) return 444 | 445 | // Since state IDs always increase, we can deduce the navigation direction 446 | direction = previousState.id < state.id ? 'forward' : 'back' 447 | } 448 | 449 | var cache = cacheMapping[state.id] || [] 450 | var containerSelector = cache[0] || state.container 451 | var container = $(containerSelector), contents = cache[1] 452 | 453 | if (container.length) { 454 | if (previousState) { 455 | // Cache current container before replacement and inform the 456 | // cache which direction the history shifted. 457 | cachePop(direction, previousState.id, [containerSelector, cloneContents(container)]) 458 | } 459 | 460 | var popstateEvent = $.Event('pjax:popstate', { 461 | state: state, 462 | direction: direction 463 | }) 464 | container.trigger(popstateEvent) 465 | 466 | var options = { 467 | id: state.id, 468 | url: state.url, 469 | container: containerSelector, 470 | push: false, 471 | fragment: state.fragment, 472 | timeout: state.timeout, 473 | scrollTo: false 474 | } 475 | 476 | if (contents) { 477 | container.trigger('pjax:start', [null, options]) 478 | 479 | pjax.state = state 480 | if (state.title) document.title = state.title 481 | var beforeReplaceEvent = $.Event('pjax:beforeReplace', { 482 | state: state, 483 | previousState: previousState 484 | }) 485 | container.trigger(beforeReplaceEvent, [contents, options]) 486 | container.html(contents) 487 | 488 | container.trigger('pjax:end', [null, options]) 489 | } else { 490 | pjax(options) 491 | } 492 | 493 | // Force reflow/relayout before the browser tries to restore the 494 | // scroll position. 495 | container[0].offsetHeight // eslint-disable-line no-unused-expressions 496 | } else { 497 | locationReplace(location.href) 498 | } 499 | } 500 | initialPop = false 501 | } 502 | 503 | // Fallback version of main pjax function for browsers that don't 504 | // support pushState. 505 | // 506 | // Returns nothing since it retriggers a hard form submission. 507 | function fallbackPjax(options) { 508 | var url = $.isFunction(options.url) ? options.url() : options.url, 509 | method = options.type ? options.type.toUpperCase() : 'GET' 510 | 511 | var form = $('
    ', { 512 | method: method === 'GET' ? 'GET' : 'POST', 513 | action: url, 514 | style: 'display:none' 515 | }) 516 | 517 | if (method !== 'GET' && method !== 'POST') { 518 | form.append($('', { 519 | type: 'hidden', 520 | name: '_method', 521 | value: method.toLowerCase() 522 | })) 523 | } 524 | 525 | var data = options.data 526 | if (typeof data === 'string') { 527 | $.each(data.split('&'), function(index, value) { 528 | var pair = value.split('=') 529 | form.append($('', {type: 'hidden', name: pair[0], value: pair[1]})) 530 | }) 531 | } else if ($.isArray(data)) { 532 | $.each(data, function(index, value) { 533 | form.append($('', {type: 'hidden', name: value.name, value: value.value})) 534 | }) 535 | } else if (typeof data === 'object') { 536 | var key 537 | for (key in data) 538 | form.append($('', {type: 'hidden', name: key, value: data[key]})) 539 | } 540 | 541 | $(document.body).append(form) 542 | form.submit() 543 | } 544 | 545 | // Internal: Abort an XmlHttpRequest if it hasn't been completed, 546 | // also removing its event handlers. 547 | function abortXHR(xhr) { 548 | if ( xhr && xhr.readyState < 4) { 549 | xhr.onreadystatechange = $.noop 550 | xhr.abort() 551 | } 552 | } 553 | 554 | // Internal: Generate unique id for state object. 555 | // 556 | // Use a timestamp instead of a counter since ids should still be 557 | // unique across page loads. 558 | // 559 | // Returns Number. 560 | function uniqueId() { 561 | return (new Date).getTime() 562 | } 563 | 564 | function cloneContents(container) { 565 | var cloned = container.clone() 566 | // Unmark script tags as already being eval'd so they can get executed again 567 | // when restored from cache. HAXX: Uses jQuery internal method. 568 | cloned.find('script').each(function(){ 569 | if (!this.src) $._data(this, 'globalEval', false) 570 | }) 571 | return cloned.contents() 572 | } 573 | 574 | // Internal: Strip internal query params from parsed URL. 575 | // 576 | // Returns sanitized url.href String. 577 | function stripInternalParams(url) { 578 | url.search = url.search.replace(/([?&])(_pjax|_)=[^&]*/g, '').replace(/^&/, '') 579 | return url.href.replace(/\?($|#)/, '$1') 580 | } 581 | 582 | // Internal: Parse URL components and returns a Locationish object. 583 | // 584 | // url - String URL 585 | // 586 | // Returns HTMLAnchorElement that acts like Location. 587 | function parseURL(url) { 588 | var a = document.createElement('a') 589 | a.href = url 590 | return a 591 | } 592 | 593 | // Internal: Return the `href` component of given URL object with the hash 594 | // portion removed. 595 | // 596 | // location - Location or HTMLAnchorElement 597 | // 598 | // Returns String 599 | function stripHash(location) { 600 | return location.href.replace(/#.*/, '') 601 | } 602 | 603 | // Internal: Build options Object for arguments. 604 | // 605 | // For convenience the first parameter can be either the container or 606 | // the options object. 607 | // 608 | // Examples 609 | // 610 | // optionsFor('#container') 611 | // // => {container: '#container'} 612 | // 613 | // optionsFor('#container', {push: true}) 614 | // // => {container: '#container', push: true} 615 | // 616 | // optionsFor({container: '#container', push: true}) 617 | // // => {container: '#container', push: true} 618 | // 619 | // Returns options Object. 620 | function optionsFor(container, options) { 621 | if (container && options) { 622 | options = $.extend({}, options) 623 | options.container = container 624 | return options 625 | } else if ($.isPlainObject(container)) { 626 | return container 627 | } else { 628 | return {container: container} 629 | } 630 | } 631 | 632 | // Internal: Filter and find all elements matching the selector. 633 | // 634 | // Where $.fn.find only matches descendants, findAll will test all the 635 | // top level elements in the jQuery object as well. 636 | // 637 | // elems - jQuery object of Elements 638 | // selector - String selector to match 639 | // 640 | // Returns a jQuery object. 641 | function findAll(elems, selector) { 642 | return elems.filter(selector).add(elems.find(selector)) 643 | } 644 | 645 | function parseHTML(html) { 646 | return $.parseHTML(html, document, true) 647 | } 648 | 649 | // Internal: Extracts container and metadata from response. 650 | // 651 | // 1. Extracts X-PJAX-URL header if set 652 | // 2. Extracts inline tags 653 | // 3. Builds response Element and extracts fragment if set 654 | // 655 | // data - String response data 656 | // xhr - XHR response 657 | // options - pjax options Object 658 | // 659 | // Returns an Object with url, title, and contents keys. 660 | function extractContainer(data, xhr, options) { 661 | var obj = {}, fullDocument = /<html/i.test(data) 662 | 663 | // Prefer X-PJAX-URL header if it was set, otherwise fallback to 664 | // using the original requested url. 665 | var serverUrl = xhr.getResponseHeader('X-PJAX-URL') 666 | obj.url = serverUrl ? stripInternalParams(parseURL(serverUrl)) : options.requestUrl 667 | 668 | var $head, $body 669 | // Attempt to parse response html into elements 670 | if (fullDocument) { 671 | $body = $(parseHTML(data.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0])) 672 | var head = data.match(/<head[^>]*>([\s\S.]*)<\/head>/i) 673 | $head = head != null ? $(parseHTML(head[0])) : $body 674 | } else { 675 | $head = $body = $(parseHTML(data)) 676 | } 677 | 678 | // If response data is empty, return fast 679 | if ($body.length === 0) 680 | return obj 681 | 682 | // If there's a <title> tag in the header, use it as 683 | // the page's title. 684 | obj.title = findAll($head, 'title').last().text() 685 | 686 | if (options.fragment) { 687 | var $fragment = $body 688 | // If they specified a fragment, look for it in the response 689 | // and pull it out. 690 | if (options.fragment !== 'body') { 691 | $fragment = findAll($fragment, options.fragment).first() 692 | } 693 | 694 | if ($fragment.length) { 695 | obj.contents = options.fragment === 'body' ? $fragment : $fragment.contents() 696 | 697 | // If there's no title, look for data-title and title attributes 698 | // on the fragment 699 | if (!obj.title) 700 | obj.title = $fragment.attr('title') || $fragment.data('title') 701 | } 702 | 703 | } else if (!fullDocument) { 704 | obj.contents = $body 705 | } 706 | 707 | // Clean up any <title> tags 708 | if (obj.contents) { 709 | // Remove any parent title elements 710 | obj.contents = obj.contents.not(function() { return $(this).is('title') }) 711 | 712 | // Then scrub any titles from their descendants 713 | obj.contents.find('title').remove() 714 | 715 | // Gather all script[src] elements 716 | obj.scripts = findAll(obj.contents, 'script[src]').remove() 717 | obj.contents = obj.contents.not(obj.scripts) 718 | } 719 | 720 | // Trim any whitespace off the title 721 | if (obj.title) obj.title = $.trim(obj.title) 722 | 723 | return obj 724 | } 725 | 726 | // Load an execute scripts using standard script request. 727 | // 728 | // Avoids jQuery's traditional $.getScript which does a XHR request and 729 | // globalEval. 730 | // 731 | // scripts - jQuery object of script Elements 732 | // 733 | // Returns nothing. 734 | function executeScriptTags(scripts) { 735 | if (!scripts) return 736 | 737 | var existingScripts = $('script[src]') 738 | 739 | scripts.each(function() { 740 | var src = this.src 741 | var matchedScripts = existingScripts.filter(function() { 742 | return this.src === src 743 | }) 744 | if (matchedScripts.length) return 745 | 746 | var script = document.createElement('script') 747 | var type = $(this).attr('type') 748 | if (type) script.type = type 749 | script.src = $(this).attr('src') 750 | document.head.appendChild(script) 751 | }) 752 | } 753 | 754 | // Internal: History DOM caching class. 755 | var cacheMapping = {} 756 | var cacheForwardStack = [] 757 | var cacheBackStack = [] 758 | 759 | // Push previous state id and container contents into the history 760 | // cache. Should be called in conjunction with `pushState` to save the 761 | // previous container contents. 762 | // 763 | // id - State ID Number 764 | // value - DOM Element to cache 765 | // 766 | // Returns nothing. 767 | function cachePush(id, value) { 768 | cacheMapping[id] = value 769 | cacheBackStack.push(id) 770 | 771 | // Remove all entries in forward history stack after pushing a new page. 772 | trimCacheStack(cacheForwardStack, 0) 773 | 774 | // Trim back history stack to max cache length. 775 | trimCacheStack(cacheBackStack, pjax.defaults.maxCacheLength) 776 | } 777 | 778 | // Shifts cache from directional history cache. Should be 779 | // called on `popstate` with the previous state id and container 780 | // contents. 781 | // 782 | // direction - "forward" or "back" String 783 | // id - State ID Number 784 | // value - DOM Element to cache 785 | // 786 | // Returns nothing. 787 | function cachePop(direction, id, value) { 788 | var pushStack, popStack 789 | cacheMapping[id] = value 790 | 791 | if (direction === 'forward') { 792 | pushStack = cacheBackStack 793 | popStack = cacheForwardStack 794 | } else { 795 | pushStack = cacheForwardStack 796 | popStack = cacheBackStack 797 | } 798 | 799 | pushStack.push(id) 800 | id = popStack.pop() 801 | if (id) delete cacheMapping[id] 802 | 803 | // Trim whichever stack we just pushed to to max cache length. 804 | trimCacheStack(pushStack, pjax.defaults.maxCacheLength) 805 | } 806 | 807 | // Trim a cache stack (either cacheBackStack or cacheForwardStack) to be no 808 | // longer than the specified length, deleting cached DOM elements as necessary. 809 | // 810 | // stack - Array of state IDs 811 | // length - Maximum length to trim to 812 | // 813 | // Returns nothing. 814 | function trimCacheStack(stack, length) { 815 | while (stack.length > length) 816 | delete cacheMapping[stack.shift()] 817 | } 818 | 819 | // Public: Find version identifier for the initial page load. 820 | // 821 | // Returns String version or undefined. 822 | function findVersion() { 823 | return $('meta').filter(function() { 824 | var name = $(this).attr('http-equiv') 825 | return name && name.toUpperCase() === 'X-PJAX-VERSION' 826 | }).attr('content') 827 | } 828 | 829 | // Install pjax functions on $.pjax to enable pushState behavior. 830 | // 831 | // Does nothing if already enabled. 832 | // 833 | // Examples 834 | // 835 | // $.pjax.enable() 836 | // 837 | // Returns nothing. 838 | function enable() { 839 | $.fn.pjax = fnPjax 840 | $.pjax = pjax 841 | $.pjax.enable = $.noop 842 | $.pjax.disable = disable 843 | $.pjax.click = handleClick 844 | $.pjax.submit = handleSubmit 845 | $.pjax.reload = pjaxReload 846 | $.pjax.defaults = { 847 | timeout: 650, 848 | push: true, 849 | replace: false, 850 | type: 'GET', 851 | dataType: 'html', 852 | scrollTo: 0, 853 | maxCacheLength: 20, 854 | version: findVersion 855 | } 856 | $(window).on('popstate.pjax', onPjaxPopstate) 857 | } 858 | 859 | // Disable pushState behavior. 860 | // 861 | // This is the case when a browser doesn't support pushState. It is 862 | // sometimes useful to disable pushState for debugging on a modern 863 | // browser. 864 | // 865 | // Examples 866 | // 867 | // $.pjax.disable() 868 | // 869 | // Returns nothing. 870 | function disable() { 871 | $.fn.pjax = function() { return this } 872 | $.pjax = fallbackPjax 873 | $.pjax.enable = enable 874 | $.pjax.disable = $.noop 875 | $.pjax.click = $.noop 876 | $.pjax.submit = $.noop 877 | $.pjax.reload = function() { window.location.reload() } 878 | 879 | $(window).off('popstate.pjax', onPjaxPopstate) 880 | } 881 | 882 | 883 | // Add the state property to jQuery's event object so we can use it in 884 | // $(window).bind('popstate') 885 | if ($.event.props && $.inArray('state', $.event.props) < 0) { 886 | $.event.props.push('state') 887 | } else if (!('state' in $.Event.prototype)) { 888 | $.event.addProp('state') 889 | } 890 | 891 | // Is pjax supported by this browser? 892 | $.support.pjax = 893 | window.history && window.history.pushState && window.history.replaceState && 894 | // pushState isn't reliable on iOS until 5. 895 | !navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/) 896 | 897 | if ($.support.pjax) { 898 | enable() 899 | } else { 900 | disable() 901 | } 902 | 903 | })(jQuery) 904 | --------------------------------------------------------------------------------