├── .gitignore ├── README.md ├── _config.yml ├── assets └── screenshot.png ├── bower.json ├── languages ├── default.yml └── zh-CN.yml ├── layout ├── _partial │ ├── article.ejs │ ├── comment.ejs │ ├── footer.ejs │ ├── head.ejs │ └── navigation.ejs ├── _widget │ ├── category.ejs │ ├── links.ejs │ ├── recent_posts.ejs │ ├── search.ejs │ └── tagcloud.ejs ├── about.ejs ├── archive.ejs ├── index.ejs ├── layout.ejs └── post.ejs └── source ├── css ├── highlight.css ├── highlight.light.css └── style.css ├── js └── main.js └── libs ├── bs-material ├── css │ ├── material-wfont.css │ ├── material-wfont.min.css │ ├── material.css │ ├── material.min.css │ ├── ripples.css │ └── ripples.min.css ├── fonts │ ├── LICENSE.txt │ ├── Material-Design-Icons.eot │ ├── Material-Design-Icons.svg │ ├── Material-Design-Icons.ttf │ ├── Material-Design-Icons.woff │ ├── Material-Design.eot │ ├── Material-Design.svg │ ├── Material-Design.ttf │ └── Material-Design.woff └── js │ ├── material.js │ ├── material.min.js │ ├── ripples.js │ └── ripples.min.js ├── bs ├── css │ └── bootstrap.min.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── js │ └── bootstrap.min.js ├── jquery-2.0.3.min.js └── tocify ├── jquery-ui.min.js ├── jquery.tocify.css ├── jquery.tocify.custom.js ├── jquery.tocify.js └── jquery.tocify.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | bower_components/ 3 | *.log 4 | build/ 5 | dist/ 6 | .DS_Store 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | a theme for [hexo](http://www.hexo.io) with the [bootstrap material design theme](http://fezvrasta.github.io/bootstrap-material-design/) adapted from [hexo-theme-freemind](https://github.com/wzpan/hexo-theme-freemind) 2 | 3 | it's recommanded to install [hexo-console-optimize](https://github.com/FlashSoft/hexo-console-optimize) to optimize the output files 4 | 5 | to enable duoshuo comment, add the following to config.yml: 6 | ```yml 7 | duoshuo_shortname: your duoshuo shortname 8 | ``` 9 | 10 | **screenshot** 11 | 12 | ![hexo-theme-material](https://raw.githubusercontent.com/wayou/hexo-theme-material/master/assets/screenshot.png) -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | menu: 2 | - title: 首页 3 | url: 4 | intro: "" 5 | icon: "fa fa-home" 6 | - title: 存档 7 | url: archives 8 | intro: "" 9 | icon: "fa fa-list" 10 | - title: 关于 11 | url: about 12 | intro: "" 13 | icon: "fa fa-info-circle" 14 | - title: RSS 15 | url: atom.xml 16 | intro: "这是一个订阅源" 17 | icon: "fa fa-rss" 18 | 19 | links: 20 | - title: "GitHub" 21 | url: http://www.github.com/wayou 22 | intro: "码农之家" 23 | icon: "fa fa-github" 24 | - title: "微博" 25 | url: http://www.weibo.com/liuwayong 26 | intro: "twitter的本地化版本" 27 | icon: "fa fa-weibo" 28 | 29 | widgets: 30 | - recent_posts 31 | - links 32 | 33 | rss: 34 | favicon: favicon.ico 35 | google_analytics: 36 | # baidu_analytics: 392796d51567e848aebf813b65cb8656 37 | footer: "" 38 | -------------------------------------------------------------------------------- /assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/assets/screenshot.png -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "material", 3 | "version": "0.1.0", 4 | "homepage": "https://github.com/wayou/hexo-theme-material", 5 | "authors": [ 6 | "wayou " 7 | ], 8 | "description": "hexo theme with bootstrap material theme", 9 | "keywords": [ 10 | "hexo", 11 | "theme", 12 | "bootstrap", 13 | "material" 14 | ], 15 | "license": "MIT", 16 | "ignore": [ 17 | "**/.*", 18 | "node_modules", 19 | "bower_components", 20 | "test", 21 | "tests" 22 | ], 23 | "dependencies": { 24 | "bootstrap": "~3.3.5", 25 | "bootstrap-material-design": "~0.3.0", 26 | "jquery.tocify.js": "~1.9.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /languages/default.yml: -------------------------------------------------------------------------------- 1 | categories: Categories 2 | links: Links 3 | search: Search 4 | tags: Tags 5 | tagcloud: "Tag Cloud" 6 | tweets: Tweets 7 | prev: Prev 8 | next: Next 9 | comment: Comments 10 | archive_a: Archives 11 | archive_b: "Archives: %s" 12 | page: "Page %d" 13 | recent_posts: "Recent Posts" 14 | description: Description 15 | read_more: "Read More" 16 | home: Home 17 | author: author -------------------------------------------------------------------------------- /languages/zh-CN.yml: -------------------------------------------------------------------------------- 1 | archives: 归档 2 | categories: 分类 3 | links: 链接 4 | search: 搜索 5 | tags: 标签 6 | tagcloud: 标签云 7 | tweets: 推文 8 | prev: 上一页 9 | next: 下一页 10 | comment: 留言 11 | page: "第 %d 页" 12 | recent_posts: 最新文章 13 | description: 摘要 14 | read_more: 阅读此文 15 | home: 首页 16 | author: 作者 17 | -------------------------------------------------------------------------------- /layout/_partial/article.ejs: -------------------------------------------------------------------------------- 1 |
2 | <% if (page.toc || (theme.widgets.length && pageType == 'index')) { %> 3 |
4 | <% }else {%> 5 |
6 | <%}%> 7 | 8 |
9 | 10 | <% if( pageType == 'index') {%> 11 | <% page.posts.each(function(post){ %> 12 |
13 |

14 | <%= post.title %> 15 |

16 | <%= date(post.date) %> 17 |
<%- post.excerpt %>
18 | <% if (post.excerpt){ %> 19 | MORE... 20 | <% } %> 21 |
22 | <% }) %> 23 | 24 | <% } else if( pageType == 'archives') {%> 25 |

<%= __('archives') %>

26 | <% page.posts.each(function(post){ %> 27 |

28 | <%= post.title %><%= date(post.date) %> 29 |

30 | <% }) %> 31 | 32 | <% } else if( pageType == 'post') {%> 33 | 34 |

<%= page.title %>

35 | <% if (page.date) { %> 36 |
37 | <%= page.date.format(config.date_format+' '+config.time_format) %> 38 |
39 | <% } %> 40 | 41 |
42 | <%- page.content %> 43 |
44 | 45 | 46 | <% } else if( pageType == 'about') {%> 47 |

<%= page.title %>

48 | <%- page.content %> 49 | 50 | <% } else {%> 51 | 查无此页 52 | <% } %> 53 |
54 | 55 | 56 | <% if (page.total > 1 ){ %> 57 | 58 |
59 | <% if (page.prev || page.next) { %> 60 | 61 | <%= __('prev') %> 62 | 63 | <%= __('home') %> 64 | 65 | <%= __('next') %> 66 | 67 | <% } %> 68 |
69 | <% } %> 70 | 71 | <%- partial('comment', {page: page}) %> 72 |
73 | 74 | <% if (theme.widgets.length && pageType == 'index') { %> 75 |
76 | 78 | <% theme.widgets.forEach(function(widget){ %> 79 | <%- partial('../_widget/' + widget) %> 80 | <% }); %> 81 |
82 | <% } else if(page.toc){ %> 83 |
84 |
85 |
86 | <% } %> 87 | 88 |
89 | -------------------------------------------------------------------------------- /layout/_partial/comment.ejs: -------------------------------------------------------------------------------- 1 |
2 | <% if (page.comments){ %> 3 | <% if(config.disqus_shortname) { %> 4 |
5 | 6 |
7 | <% } else if(config.duoshuo_shortname) { %> 8 | 9 |
10 | 11 | 12 | 23 | 24 | <% } %> 25 | <% } %> 26 | 27 |
-------------------------------------------------------------------------------- /layout/_partial/footer.ejs: -------------------------------------------------------------------------------- 1 | <% if(theme.footer){ %> 2 |

<%= theme.footer %>

3 | <% } %> 4 | 5 |

6 | 由 hexo 强力驱动 | 搭载 material 主题 7 |

8 |

9 | © <%= new Date().getFullYear() %> <% if (config.author){ %> <%= config.author %> <% } else { %> <%= config.title %> <% } %> 10 |

11 | 12 | -------------------------------------------------------------------------------- /layout/_partial/head.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% 6 | var title = []; 7 | if (page.current > 1) title.push(__('page', page.current)); 8 | if (page.title) title.push(page.title); 9 | if (page.category) title.push(page.category); 10 | if (page.tag) title.push(page.tag); 11 | if (page.archive){ 12 | if (page.year) title.push(__('archive_b', page.year + (page.month ? '/' + page.month : ''))); 13 | else title.push(__('archive_a')); 14 | } 15 | title.push(config.title); 16 | %> 17 | <%= title.join(' | ') %> 18 | <% if (config.author){ %><% } %> 19 | <% if (page.description){ %> 20 | 21 | <% } else if (config.description){ %> 22 | 23 | <% } else if (page.excerpt){ %> 24 | 25 | <% } else if (page.content){ %> 26 | 27 | <% } %> 28 | <% if (page.keywords){ %><% } %> 29 | 30 | 31 | <% if (page.title){ %><% } %> 32 | 33 | 34 | <% if (theme.rss){ %> 35 | 36 | <% } %> 37 | <% if (theme.favicon){ %> 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | <% } %> 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | <% if(theme.baidu_analytics){ %> 75 | 76 | 85 | <% } %> 86 | 87 | <% if(theme.google_analytics){ %> 88 | 89 | 99 | <% } %> 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /layout/_partial/navigation.ejs: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /layout/_widget/category.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.categories.length){ %> 2 |
3 |

<%= __('categories') %>

4 | 11 |
12 | <% } %> -------------------------------------------------------------------------------- /layout/_widget/links.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.links.length){ %> 2 |
3 |

<%= __('links') %>

4 | 9 |
10 | <% } %> 11 | -------------------------------------------------------------------------------- /layout/_widget/recent_posts.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.posts.length){ %> 2 |
3 |

<%= __('recent_posts') %>

4 | 11 |
12 | <% } %> 13 | -------------------------------------------------------------------------------- /layout/_widget/search.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /layout/_widget/tagcloud.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.tags.length){ %> 2 |
3 |

<%= __('tagcloud') %>

4 | 13 |
14 | <% } %> 15 | -------------------------------------------------------------------------------- /layout/about.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/article', {page:page,pageType: 'about'}) %> 2 | -------------------------------------------------------------------------------- /layout/archive.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/article', {page:page, pageType: 'archives'}) %> 2 | -------------------------------------------------------------------------------- /layout/index.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/article', {page:page,pageType: 'index'}) %> 2 | -------------------------------------------------------------------------------- /layout/layout.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/head') %> 2 | 3 | <%- partial('_partial/navigation') %> 4 |
5 | <%- body %> 6 |
7 | <%- partial('_partial/footer') %> 8 |
9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /layout/post.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/article', {page:page, pageType: 'post'}) %> 2 | -------------------------------------------------------------------------------- /source/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Code, Pre [landscape](http://goo.gl/hnwXeD) */ 2 | 3 | /* highlight */ 4 | 5 | pre, .highlight, .gist { 6 | background: #333; 7 | margin: 0.5em 0; 8 | padding: 1em 2%; 9 | overflow: auto; 10 | color: #ccc; 11 | font-size: 14px; 12 | text-shadow: none; 13 | -webkit-border-radius: 4px; 14 | -moz-border-radius: 4px; 15 | border-radius: 4px; 16 | border-style: solid; 17 | border-color: #ddd; 18 | border-width: 1px 0; 19 | line-height: 22.400000000000002px; 20 | } 21 | 22 | code { 23 | background: #eee; 24 | border: 1px solid #d6d6d6; 25 | padding: 0 5px; 26 | margin: 0 2px; 27 | font-size: 90%; 28 | text-shadow: 0 1px #fff; 29 | word-break: break-all; 30 | word-wrap: break-word; 31 | white-space: normal; 32 | } 33 | 34 | .highlight .gutter pre{ 35 | text-align: left; 36 | padding-right: 20px; 37 | width: 100%; 38 | color: #666; 39 | } 40 | 41 | pre, 42 | code { 43 | font-family: Menlo, "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, Consolas, monospace; 44 | } 45 | 46 | pre code { 47 | background: none; 48 | text-shadow: none; 49 | padding: 0; 50 | } 51 | 52 | .highlight pre { 53 | border: none; 54 | margin: 0; 55 | padding: 0; 56 | white-space: pre; 57 | } 58 | 59 | .highlight table { 60 | margin: 0; 61 | width: auto; 62 | } 63 | 64 | .highlight td { 65 | border: none; 66 | padding: 0; 67 | } 68 | 69 | /* gist */ 70 | 71 | .container .gist .gist-file { 72 | border: none; 73 | font-family: Menlo, "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, Consolas, monospace; 74 | margin: 0; 75 | } 76 | .container .gist .gist-file .gist-data { 77 | background: none; 78 | border: none; 79 | } 80 | .container .gist .gist-file .gist-data .line-numbers { 81 | background: none; 82 | border: none; 83 | padding-right: 20px; 84 | color: #666; 85 | text-align: left; 86 | } 87 | .container .gist .gist-file .gist-data .line-data { 88 | padding: 0 !important; 89 | } 90 | .container .gist .gist-file .highlight { 91 | margin: 0; 92 | padding: 0; 93 | border: none; 94 | } 95 | .container .gist .gist-file .gist-meta { 96 | background: #333; 97 | color: #999; 98 | font: 0.85em "Helvetica Neue", Helvetica, Arial, sans-serif; 99 | text-shadow: 0 0; 100 | padding: 0; 101 | margin-top: 1em; 102 | margin-left: 20px; 103 | } 104 | .container .gist .gist-file .gist-meta a { 105 | color: #258fb8; 106 | font-weight: normal; 107 | } 108 | .container .gist .gist-file .gist-meta a:hover { 109 | text-decoration: underline; 110 | } 111 | 112 | /* figcaption */ 113 | 114 | .highlight figcaption { 115 | zoom: 1; 116 | font-size: 0.85em; 117 | color: #999; 118 | line-height: 1em; 119 | margin-bottom: 1em; 120 | } 121 | .highlight figcaption:before, 122 | .highlight figcaption:after { 123 | content: ""; 124 | display: table; 125 | } 126 | .highlight figcaption:after { 127 | clear: both; 128 | } 129 | .highlight figcaption a { 130 | float: right; 131 | } 132 | 133 | pre .comment, 134 | pre .title { 135 | color: #999; 136 | } 137 | pre .variable, 138 | pre .attribute, 139 | pre .tag, 140 | pre .regexp, 141 | pre .ruby .constant, 142 | pre .xml .tag .title, 143 | pre .xml .pi, 144 | pre .xml .doctype, 145 | pre .html .doctype, 146 | pre .css .id, 147 | pre .css .class, 148 | pre .css .pseudo { 149 | color: #f2777a; 150 | } 151 | pre .number, 152 | pre .preprocessor, 153 | pre .built_in, 154 | pre .literal, 155 | pre .params, 156 | pre .constant { 157 | color: #f99157; 158 | } 159 | pre .class, 160 | pre .ruby .class .title, 161 | pre .css .rules .attribute { 162 | color: #9c9; 163 | } 164 | pre .string, 165 | pre .value, 166 | pre .inheritance, 167 | pre .header, 168 | pre .ruby .symbol, 169 | pre .xml .cdata { 170 | color: #9c9; 171 | } 172 | pre .css .hexcolor { 173 | color: #6cc; 174 | } 175 | pre .function, 176 | pre .python .decorator, 177 | pre .python .title, 178 | pre .ruby .function .title, 179 | pre .ruby .title .keyword, 180 | pre .perl .sub, 181 | pre .javascript .title, 182 | pre .coffeescript .title { 183 | color: #69c; 184 | } 185 | pre .keyword, 186 | pre .javascript .function { 187 | color: #c9c; 188 | } 189 | -------------------------------------------------------------------------------- /source/css/highlight.light.css: -------------------------------------------------------------------------------- 1 | .entry .gist { 2 | background: #eee; 3 | border: 1px solid color-border; 4 | margin-top: 15px; 5 | padding: 7px 15px; 6 | border-radius: 2px; 7 | text-shadow: 0 0 1px #fff; 8 | line-height: 1.6; 9 | overflow: auto; 10 | color: #666; 11 | } 12 | .entry .gist .gist-file { 13 | border: none; 14 | font-family: inherit; 15 | margin: 0; 16 | font-size: 0.9em; 17 | } 18 | .entry .gist .gist-file .gist-data { 19 | background: none; 20 | border-bottom: none; 21 | } 22 | .entry .gist .gist-file .gist-data pre { 23 | padding: 0 !important; 24 | font-family: font-mono; 25 | } 26 | .entry .gist .gist-file .gist-meta { 27 | background: none; 28 | color: color-meta; 29 | margin-top: 5px; 30 | padding: 0; 31 | text-shadow: 0 0 1px #fff; 32 | font-size: 100%; 33 | } 34 | .entry .gist .gist-file .gist-meta a { 35 | color: color-link; 36 | } 37 | .entry .gist .gist-file .gist-meta a:visited { 38 | color: color-link; 39 | } 40 | figure.highlight { 41 | background: #f5f5f5; 42 | /*border: 1px solid color-border;*/ 43 | margin-top: 15px; 44 | padding: 7px 15px; 45 | border-radius: 2px; 46 | text-shadow: 0 0 1px #fff; 47 | line-height: 1.6; 48 | overflow: auto; 49 | position: relative; 50 | font-size: 0.9em; 51 | } 52 | figure.highlight figcaption { 53 | color: color-meta; 54 | margin-bottom: 5px; 55 | text-shadow: 0 0 1px #fff; 56 | } 57 | figure.highlight figcaption a { 58 | position: absolute; 59 | right: 15px; 60 | } 61 | figure.highlight pre { 62 | border: none; 63 | padding: 0; 64 | margin: 0; 65 | } 66 | figure.highlight table { 67 | margin-top: 0; 68 | border-spacing: 0; 69 | } 70 | figure.highlight .gutter { 71 | color: color-meta; 72 | padding-right: 15px; 73 | border-right: 1px solid color-border; 74 | text-align: right; 75 | } 76 | figure.highlight .code { 77 | padding-left: 15px; 78 | border-left: 1px solid #eee; 79 | color: #666; 80 | } 81 | figure.highlight .line { 82 | height: 20px; 83 | } 84 | pre .comment, 85 | pre .template_comment, 86 | pre .diff .header, 87 | pre .doctype, 88 | pre .pi, 89 | pre .lisp .string, 90 | pre .javadoc { 91 | color: #93a1a1; 92 | font-style: italic; 93 | } 94 | pre .keyword, 95 | pre .winutils, 96 | pre .method, 97 | pre .addition, 98 | pre .css .tag, 99 | pre .request, 100 | pre .status, 101 | pre .nginx .title { 102 | color: #859900; 103 | } 104 | pre .number, 105 | pre .command, 106 | pre .string, 107 | pre .tag .value, 108 | pre .phpdoc, 109 | pre .tex .formula, 110 | pre .regexp, 111 | pre .hexcolor { 112 | color: #2aa198; 113 | } 114 | pre .title, 115 | pre .localvars, 116 | pre .chunk, 117 | pre .decorator, 118 | pre .built_in, 119 | pre .identifier, 120 | pre .vhdl, 121 | pre .literal, 122 | pre .id { 123 | color: #268bd2; 124 | } 125 | pre .attribute, 126 | pre .variable, 127 | pre .lisp .body, 128 | pre .smalltalk .number, 129 | pre .constant, 130 | pre .class .title, 131 | pre .parent, 132 | pre .haskell .type { 133 | color: #b58900; 134 | } 135 | pre .preprocessor, 136 | pre .preprocessor .keyword, 137 | pre .shebang, 138 | pre .symbol, 139 | pre .symbol .string, 140 | pre .diff .change, 141 | pre .special, 142 | pre .attr_selector, 143 | pre .important, 144 | pre .subst, 145 | pre .cdata, 146 | pre .clojure .title { 147 | color: #cb4b16; 148 | } 149 | pre .deletion { 150 | color: #dc322f; 151 | } -------------------------------------------------------------------------------- /source/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | font-size: 1.5em; 4 | background-color: #fff; 5 | font-family:'Microsoft YaHei',Tahoma,'PT Serif',Georgia,Times,'Times New Roman',Serif; 6 | /*text-shadow: 1px 1px 2px rgba(50,50,50,0.15);*/ 7 | } 8 | 9 | a:hover{ 10 | text-decoration: none; 11 | } 12 | 13 | /*fix icon size*/ 14 | [class^=mdi-], [class*=mdi-]{ 15 | font: normal normal normal 1em 'Material-Design-Icons'; 16 | } 17 | /*enable boxshadow on bootstrap material button group*/ 18 | .btn-default:not(.btn-link):hover, .btn:not(.btn-link):hover{ 19 | box-shadow: 0 3px 6px rgba(0,0,0,.2),0 3px 6px rgba(0,0,0,.28)!important; 20 | } 21 | /*.btn-group .btn:hover{ 22 | box-shadow: 0 3px 6px rgba(0,0,0,.2),0 3px 6px rgba(0,0,0,.28)!important; 23 | }*/ 24 | 25 | /*fix blockquote font size for bs*/ 26 | blockquote{ 27 | font-size: initial; 28 | } 29 | 30 | .article-content{ 31 | margin-top: 15px; 32 | } 33 | 34 | .center-content{ 35 | float: none; 36 | margin: 0 auto; 37 | } 38 | 39 | /*toc*/ 40 | #toc { 41 | top: 150px; 42 | transition: all ease 0.3s; 43 | border: none; 44 | border-radius: 0; 45 | } 46 | #toc.sticky-scroll{ 47 | top:40px; 48 | } 49 | 50 | .tocify .tocify-item { 51 | border-left: 2px solid transparent; 52 | /*truncate text*/ 53 | text-overflow: ellipsis; 54 | white-space: nowrap; 55 | overflow: hidden; 56 | } 57 | 58 | .tocify-item.tocify-focus{ 59 | color: teal; 60 | border-left: 2px solid; 61 | font-weight: bold; 62 | } 63 | 64 | .tocify-item:hover{ 65 | color: teal; 66 | border-left: 2px solid; 67 | } 68 | 69 | @media (min-width: 1200px){ 70 | .container { 71 | width: 970px; 72 | } 73 | } 74 | /*disable toc on small screen*/ 75 | @media screen and (max-width:991px) { 76 | #toc { 77 | display: none; 78 | } 79 | } 80 | 81 | /*post*/ 82 | .content{ 83 | min-height: 300px; 84 | word-wrap: break-word; 85 | } 86 | .comment-section{ 87 | margin-top: 60px; 88 | } 89 | .excerpt,.content{ 90 | margin: 10px 0; 91 | } 92 | .content img { 93 | max-width: 100%; 94 | /*box-shadow: inset 0 0 0 rgba(255,255,255,.9),0 5px 40px 1px rgba(0,0,0,.19),0 0 0 0px rgba(0,0,0,.3);*/ 95 | margin: 20px 0px; 96 | cursor: pointer; 97 | } 98 | .post-time { 99 | color: #aaa; 100 | white-space: nowrap; 101 | } 102 | 103 | .archive-item{ 104 | text-align: right; 105 | } 106 | 107 | .archive-title{ 108 | float: left; 109 | text-align: left; 110 | } 111 | 112 | /*make the date beside title wrap to next line on mobile*/ 113 | 114 | @media screen and (max-width:415px) { 115 | .page h3.title span.date { 116 | position: static; 117 | display: inline-block; 118 | } 119 | } 120 | 121 | /*code*/ 122 | figure.highlight { 123 | margin-bottom: 20px; 124 | } 125 | figure.highlight .gutter .line{ 126 | color: #999; 127 | } 128 | 129 | /*pagination*/ 130 | .pagination-wrapper { 131 | text-align: center; 132 | } 133 | .btn-group{ 134 | box-shadow: none; 135 | } 136 | 137 | footer { 138 | color: #999; 139 | text-align: center; 140 | margin-top: 30px; 141 | } 142 | 143 | /*back to top*/ 144 | 145 | #gotop { 146 | display: block; 147 | width: 36px; 148 | height: 36px; 149 | position: fixed; 150 | bottom: 30px; 151 | right: 25px; 152 | border-radius: 50%; 153 | text-decoration: none; 154 | font-size: 2.2em; 155 | background-color: #fefefe; 156 | } 157 | -------------------------------------------------------------------------------- /source/js/main.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | var $toc = $("#toc"); 3 | if (!!$toc.length && screen.width > 992 && $('.content').find('h2').length != 0) { 4 | $("#toc").tocify({ 5 | context: '.article-content', 6 | theme: 'bootstrap3', 7 | selectors: 'h2,h3,h4' 8 | }); 9 | 10 | //sticky the toc 11 | var $window = $(window), 12 | $stickyEl = $('#toc'), 13 | elTop = $stickyEl.offset().top; 14 | //for page refresh, we can right position the toc 15 | $stickyEl.toggleClass('sticky-scroll', elTop > 155); 16 | 17 | //listen the window scroll 18 | $window.scroll(function() { 19 | elTop = $stickyEl.offset().top; 20 | $stickyEl.toggleClass('sticky-scroll', elTop > 155); 21 | }); 22 | 23 | } 24 | 25 | // image view 26 | $('.content img').on('click',function(){ 27 | window.open($(this).attr('src'),'_blank'); 28 | }); 29 | 30 | // highlight the menu 31 | menuHighlight(); 32 | 33 | $(window).scroll(function() { 34 | if ($(this).scrollTop()) { 35 | $('#gotop:hidden').stop(true, true).fadeIn(); 36 | } else { 37 | $('#gotop').stop(true, true).fadeOut(); 38 | } 39 | }); 40 | 41 | // enable ripple on buttons 42 | $.material.ripples(); 43 | 44 | //this is adapted from http://css-tricks.com/moving-highlight/ 45 | function menuHighlight() { 46 | var originalBG = $(".nav li").css("background-color"), 47 | x, y, xy, bgWebKit, bgMoz, 48 | lightColor = "rgba(1, 164, 149, 1)", 49 | gradientSize = 60; 50 | 51 | $('.nav li') 52 | .mousemove(function(e) { 53 | x = e.pageX - this.offsetLeft; 54 | y = e.pageY - this.offsetTop; 55 | xy = x + " " + y; 56 | 57 | bgWebKit = "-webkit-gradient(radial, " + xy + ", 0, " + xy + ", " + gradientSize + ", from(" + lightColor + "), to(rgba(0, 150, 136, 1.0))), " + originalBG; 58 | bgMoz = "-moz-radial-gradient(" + x + "px " + y + "px 45deg, circle, " + lightColor + " 0%, rgba(0, 150, 136, 1.0) " + gradientSize + "px)"; 59 | 60 | $(this) 61 | .css({ 62 | background: bgWebKit 63 | }) 64 | .css({ 65 | background: bgMoz 66 | }); 67 | 68 | }).mouseleave(function() { 69 | $(this).css({ 70 | background: originalBG 71 | }); 72 | }); 73 | } 74 | }); 75 | -------------------------------------------------------------------------------- /source/libs/bs-material/css/ripples.css: -------------------------------------------------------------------------------- 1 | .withripple { 2 | position: relative; 3 | } 4 | .ripple-wrapper { 5 | position: absolute; 6 | top: 0; 7 | left: 0; 8 | z-index: 1; 9 | width: 100%; 10 | height: 100%; 11 | overflow: hidden; 12 | border-radius: 2px; 13 | } 14 | .ripple { 15 | position: absolute; 16 | width: 20px; 17 | height: 20px; 18 | margin-left: -10px; 19 | margin-top: -10px; 20 | border-radius: 100%; 21 | background-color: rgba(0, 0, 0, 0.05); 22 | -webkit-transform: scale(1); 23 | -ms-transform: scale(1); 24 | transform: scale(1); 25 | -webkit-transform-origin: 50%; 26 | -ms-transform-origin: 50%; 27 | transform-origin: 50%; 28 | opacity: 0; 29 | pointer-events: none; 30 | } 31 | .ripple.ripple-on { 32 | -webkit-transition: opacity 0.15s ease-in 0s, -webkit-transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s; 33 | transition: opacity 0.15s ease-in 0s, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s; 34 | opacity: 1; 35 | } 36 | .ripple.ripple-out { 37 | -webkit-transition: opacity 0.1s linear 0s !important; 38 | transition: opacity 0.1s linear 0s !important; 39 | opacity: 0; 40 | } 41 | -------------------------------------------------------------------------------- /source/libs/bs-material/css/ripples.min.css: -------------------------------------------------------------------------------- 1 | .withripple{position:relative}.ripple-wrapper{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;overflow:hidden;border-radius:2px}.ripple{position:absolute;width:20px;height:20px;margin-left:-10px;margin-top:-10px;border-radius:100%;background-color:rgba(0,0,0,.05);-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-transform-origin:50%;-ms-transform-origin:50%;transform-origin:50%;opacity:0;pointer-events:none}.ripple.ripple-on{-webkit-transition:opacity .15s ease-in 0s,-webkit-transform .5s cubic-bezier(0.4,0,.2,1) .1s;transition:opacity .15s ease-in 0s,transform .5s cubic-bezier(0.4,0,.2,1) .1s;opacity:1}.ripple.ripple-out{-webkit-transition:opacity .1s linear 0s!important;transition:opacity .1s linear 0s!important;opacity:0} -------------------------------------------------------------------------------- /source/libs/bs-material/fonts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | https://github.com/google/material-design-icons/blob/master/LICENSE 2 | 3 | 4 | Attribution-ShareAlike 4.0 International 5 | 6 | ======================================================================= 7 | 8 | Creative Commons Corporation ("Creative Commons") is not a law firm and 9 | does not provide legal services or legal advice. Distribution of 10 | Creative Commons public licenses does not create a lawyer-client or 11 | other relationship. Creative Commons makes its licenses and related 12 | information available on an "as-is" basis. Creative Commons gives no 13 | warranties regarding its licenses, any material licensed under their 14 | terms and conditions, or any related information. Creative Commons 15 | disclaims all liability for damages resulting from their use to the 16 | fullest extent possible. 17 | 18 | Using Creative Commons Public Licenses 19 | 20 | Creative Commons public licenses provide a standard set of terms and 21 | conditions that creators and other rights holders may use to share 22 | original works of authorship and other material subject to copyright 23 | and certain other rights specified in the public license below. The 24 | following considerations are for informational purposes only, are not 25 | exhaustive, and do not form part of our licenses. 26 | 27 | Considerations for licensors: Our public licenses are 28 | intended for use by those authorized to give the public 29 | permission to use material in ways otherwise restricted by 30 | copyright and certain other rights. Our licenses are 31 | irrevocable. Licensors should read and understand the terms 32 | and conditions of the license they choose before applying it. 33 | Licensors should also secure all rights necessary before 34 | applying our licenses so that the public can reuse the 35 | material as expected. Licensors should clearly mark any 36 | material not subject to the license. This includes other CC- 37 | licensed material, or material used under an exception or 38 | limitation to copyright. More considerations for licensors: 39 | wiki.creativecommons.org/Considerations_for_licensors 40 | 41 | Considerations for the public: By using one of our public 42 | licenses, a licensor grants the public permission to use the 43 | licensed material under specified terms and conditions. If 44 | the licensor's permission is not necessary for any reason--for 45 | example, because of any applicable exception or limitation to 46 | copyright--then that use is not regulated by the license. Our 47 | licenses grant only permissions under copyright and certain 48 | other rights that a licensor has authority to grant. Use of 49 | the licensed material may still be restricted for other 50 | reasons, including because others have copyright or other 51 | rights in the material. A licensor may make special requests, 52 | such as asking that all changes be marked or described. 53 | Although not required by our licenses, you are encouraged to 54 | respect those requests where reasonable. More_considerations 55 | for the public: 56 | wiki.creativecommons.org/Considerations_for_licensees 57 | 58 | ======================================================================= 59 | 60 | Creative Commons Attribution-ShareAlike 4.0 International Public 61 | License 62 | 63 | By exercising the Licensed Rights (defined below), You accept and agree 64 | to be bound by the terms and conditions of this Creative Commons 65 | Attribution-ShareAlike 4.0 International Public License ("Public 66 | License"). To the extent this Public License may be interpreted as a 67 | contract, You are granted the Licensed Rights in consideration of Your 68 | acceptance of these terms and conditions, and the Licensor grants You 69 | such rights in consideration of benefits the Licensor receives from 70 | making the Licensed Material available under these terms and 71 | conditions. 72 | 73 | 74 | Section 1 -- Definitions. 75 | 76 | a. Adapted Material means material subject to Copyright and Similar 77 | Rights that is derived from or based upon the Licensed Material 78 | and in which the Licensed Material is translated, altered, 79 | arranged, transformed, or otherwise modified in a manner requiring 80 | permission under the Copyright and Similar Rights held by the 81 | Licensor. For purposes of this Public License, where the Licensed 82 | Material is a musical work, performance, or sound recording, 83 | Adapted Material is always produced where the Licensed Material is 84 | synched in timed relation with a moving image. 85 | 86 | b. Adapter's License means the license You apply to Your Copyright 87 | and Similar Rights in Your contributions to Adapted Material in 88 | accordance with the terms and conditions of this Public License. 89 | 90 | c. BY-SA Compatible License means a license listed at 91 | creativecommons.org/compatiblelicenses, approved by Creative 92 | Commons as essentially the equivalent of this Public License. 93 | 94 | d. Copyright and Similar Rights means copyright and/or similar rights 95 | closely related to copyright including, without limitation, 96 | performance, broadcast, sound recording, and Sui Generis Database 97 | Rights, without regard to how the rights are labeled or 98 | categorized. For purposes of this Public License, the rights 99 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 100 | Rights. 101 | 102 | e. Effective Technological Measures means those measures that, in the 103 | absence of proper authority, may not be circumvented under laws 104 | fulfilling obligations under Article 11 of the WIPO Copyright 105 | Treaty adopted on December 20, 1996, and/or similar international 106 | agreements. 107 | 108 | f. Exceptions and Limitations means fair use, fair dealing, and/or 109 | any other exception or limitation to Copyright and Similar Rights 110 | that applies to Your use of the Licensed Material. 111 | 112 | g. License Elements means the license attributes listed in the name 113 | of a Creative Commons Public License. The License Elements of this 114 | Public License are Attribution and ShareAlike. 115 | 116 | h. Licensed Material means the artistic or literary work, database, 117 | or other material to which the Licensor applied this Public 118 | License. 119 | 120 | i. Licensed Rights means the rights granted to You subject to the 121 | terms and conditions of this Public License, which are limited to 122 | all Copyright and Similar Rights that apply to Your use of the 123 | Licensed Material and that the Licensor has authority to license. 124 | 125 | j. Licensor means the individual(s) or entity(ies) granting rights 126 | under this Public License. 127 | 128 | k. Share means to provide material to the public by any means or 129 | process that requires permission under the Licensed Rights, such 130 | as reproduction, public display, public performance, distribution, 131 | dissemination, communication, or importation, and to make material 132 | available to the public including in ways that members of the 133 | public may access the material from a place and at a time 134 | individually chosen by them. 135 | 136 | l. Sui Generis Database Rights means rights other than copyright 137 | resulting from Directive 96/9/EC of the European Parliament and of 138 | the Council of 11 March 1996 on the legal protection of databases, 139 | as amended and/or succeeded, as well as other essentially 140 | equivalent rights anywhere in the world. 141 | 142 | m. You means the individual or entity exercising the Licensed Rights 143 | under this Public License. Your has a corresponding meaning. 144 | 145 | 146 | Section 2 -- Scope. 147 | 148 | a. License grant. 149 | 150 | 1. Subject to the terms and conditions of this Public License, 151 | the Licensor hereby grants You a worldwide, royalty-free, 152 | non-sublicensable, non-exclusive, irrevocable license to 153 | exercise the Licensed Rights in the Licensed Material to: 154 | 155 | a. reproduce and Share the Licensed Material, in whole or 156 | in part; and 157 | 158 | b. produce, reproduce, and Share Adapted Material. 159 | 160 | 2. Exceptions and Limitations. For the avoidance of doubt, where 161 | Exceptions and Limitations apply to Your use, this Public 162 | License does not apply, and You do not need to comply with 163 | its terms and conditions. 164 | 165 | 3. Term. The term of this Public License is specified in Section 166 | 6(a). 167 | 168 | 4. Media and formats; technical modifications allowed. The 169 | Licensor authorizes You to exercise the Licensed Rights in 170 | all media and formats whether now known or hereafter created, 171 | and to make technical modifications necessary to do so. The 172 | Licensor waives and/or agrees not to assert any right or 173 | authority to forbid You from making technical modifications 174 | necessary to exercise the Licensed Rights, including 175 | technical modifications necessary to circumvent Effective 176 | Technological Measures. For purposes of this Public License, 177 | simply making modifications authorized by this Section 2(a) 178 | (4) never produces Adapted Material. 179 | 180 | 5. Downstream recipients. 181 | 182 | a. Offer from the Licensor -- Licensed Material. Every 183 | recipient of the Licensed Material automatically 184 | receives an offer from the Licensor to exercise the 185 | Licensed Rights under the terms and conditions of this 186 | Public License. 187 | 188 | b. Additional offer from the Licensor -- Adapted Material. 189 | Every recipient of Adapted Material from You 190 | automatically receives an offer from the Licensor to 191 | exercise the Licensed Rights in the Adapted Material 192 | under the conditions of the Adapter's License You apply. 193 | 194 | c. No downstream restrictions. You may not offer or impose 195 | any additional or different terms or conditions on, or 196 | apply any Effective Technological Measures to, the 197 | Licensed Material if doing so restricts exercise of the 198 | Licensed Rights by any recipient of the Licensed 199 | Material. 200 | 201 | 6. No endorsement. Nothing in this Public License constitutes or 202 | may be construed as permission to assert or imply that You 203 | are, or that Your use of the Licensed Material is, connected 204 | with, or sponsored, endorsed, or granted official status by, 205 | the Licensor or others designated to receive attribution as 206 | provided in Section 3(a)(1)(A)(i). 207 | 208 | b. Other rights. 209 | 210 | 1. Moral rights, such as the right of integrity, are not 211 | licensed under this Public License, nor are publicity, 212 | privacy, and/or other similar personality rights; however, to 213 | the extent possible, the Licensor waives and/or agrees not to 214 | assert any such rights held by the Licensor to the limited 215 | extent necessary to allow You to exercise the Licensed 216 | Rights, but not otherwise. 217 | 218 | 2. Patent and trademark rights are not licensed under this 219 | Public License. 220 | 221 | 3. To the extent possible, the Licensor waives any right to 222 | collect royalties from You for the exercise of the Licensed 223 | Rights, whether directly or through a collecting society 224 | under any voluntary or waivable statutory or compulsory 225 | licensing scheme. In all other cases the Licensor expressly 226 | reserves any right to collect such royalties. 227 | 228 | 229 | Section 3 -- License Conditions. 230 | 231 | Your exercise of the Licensed Rights is expressly made subject to the 232 | following conditions. 233 | 234 | a. Attribution. 235 | 236 | 1. If You Share the Licensed Material (including in modified 237 | form), You must: 238 | 239 | a. retain the following if it is supplied by the Licensor 240 | with the Licensed Material: 241 | 242 | i. identification of the creator(s) of the Licensed 243 | Material and any others designated to receive 244 | attribution, in any reasonable manner requested by 245 | the Licensor (including by pseudonym if 246 | designated); 247 | 248 | ii. a copyright notice; 249 | 250 | iii. a notice that refers to this Public License; 251 | 252 | iv. a notice that refers to the disclaimer of 253 | warranties; 254 | 255 | v. a URI or hyperlink to the Licensed Material to the 256 | extent reasonably practicable; 257 | 258 | b. indicate if You modified the Licensed Material and 259 | retain an indication of any previous modifications; and 260 | 261 | c. indicate the Licensed Material is licensed under this 262 | Public License, and include the text of, or the URI or 263 | hyperlink to, this Public License. 264 | 265 | 2. You may satisfy the conditions in Section 3(a)(1) in any 266 | reasonable manner based on the medium, means, and context in 267 | which You Share the Licensed Material. For example, it may be 268 | reasonable to satisfy the conditions by providing a URI or 269 | hyperlink to a resource that includes the required 270 | information. 271 | 272 | 3. If requested by the Licensor, You must remove any of the 273 | information required by Section 3(a)(1)(A) to the extent 274 | reasonably practicable. 275 | 276 | b. ShareAlike. 277 | 278 | In addition to the conditions in Section 3(a), if You Share 279 | Adapted Material You produce, the following conditions also apply. 280 | 281 | 1. The Adapter's License You apply must be a Creative Commons 282 | license with the same License Elements, this version or 283 | later, or a BY-SA Compatible License. 284 | 285 | 2. You must include the text of, or the URI or hyperlink to, the 286 | Adapter's License You apply. You may satisfy this condition 287 | in any reasonable manner based on the medium, means, and 288 | context in which You Share Adapted Material. 289 | 290 | 3. You may not offer or impose any additional or different terms 291 | or conditions on, or apply any Effective Technological 292 | Measures to, Adapted Material that restrict exercise of the 293 | rights granted under the Adapter's License You apply. 294 | 295 | 296 | Section 4 -- Sui Generis Database Rights. 297 | 298 | Where the Licensed Rights include Sui Generis Database Rights that 299 | apply to Your use of the Licensed Material: 300 | 301 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 302 | to extract, reuse, reproduce, and Share all or a substantial 303 | portion of the contents of the database; 304 | 305 | b. if You include all or a substantial portion of the database 306 | contents in a database in which You have Sui Generis Database 307 | Rights, then the database in which You have Sui Generis Database 308 | Rights (but not its individual contents) is Adapted Material, 309 | 310 | including for purposes of Section 3(b); and 311 | c. You must comply with the conditions in Section 3(a) if You Share 312 | all or a substantial portion of the contents of the database. 313 | 314 | For the avoidance of doubt, this Section 4 supplements and does not 315 | replace Your obligations under this Public License where the Licensed 316 | Rights include other Copyright and Similar Rights. 317 | 318 | 319 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 320 | 321 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 322 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 323 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 324 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 325 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 326 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 327 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 328 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 329 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 330 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 331 | 332 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 333 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 334 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 335 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 336 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 337 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 338 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 339 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 340 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 341 | 342 | c. The disclaimer of warranties and limitation of liability provided 343 | above shall be interpreted in a manner that, to the extent 344 | possible, most closely approximates an absolute disclaimer and 345 | waiver of all liability. 346 | 347 | 348 | Section 6 -- Term and Termination. 349 | 350 | a. This Public License applies for the term of the Copyright and 351 | Similar Rights licensed here. However, if You fail to comply with 352 | this Public License, then Your rights under this Public License 353 | terminate automatically. 354 | 355 | b. Where Your right to use the Licensed Material has terminated under 356 | Section 6(a), it reinstates: 357 | 358 | 1. automatically as of the date the violation is cured, provided 359 | it is cured within 30 days of Your discovery of the 360 | violation; or 361 | 362 | 2. upon express reinstatement by the Licensor. 363 | 364 | For the avoidance of doubt, this Section 6(b) does not affect any 365 | right the Licensor may have to seek remedies for Your violations 366 | of this Public License. 367 | 368 | c. For the avoidance of doubt, the Licensor may also offer the 369 | Licensed Material under separate terms or conditions or stop 370 | distributing the Licensed Material at any time; however, doing so 371 | will not terminate this Public License. 372 | 373 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 374 | License. 375 | 376 | 377 | Section 7 -- Other Terms and Conditions. 378 | 379 | a. The Licensor shall not be bound by any additional or different 380 | terms or conditions communicated by You unless expressly agreed. 381 | 382 | b. Any arrangements, understandings, or agreements regarding the 383 | Licensed Material not stated herein are separate from and 384 | independent of the terms and conditions of this Public License. 385 | 386 | 387 | Section 8 -- Interpretation. 388 | 389 | a. For the avoidance of doubt, this Public License does not, and 390 | shall not be interpreted to, reduce, limit, restrict, or impose 391 | conditions on any use of the Licensed Material that could lawfully 392 | be made without permission under this Public License. 393 | 394 | b. To the extent possible, if any provision of this Public License is 395 | deemed unenforceable, it shall be automatically reformed to the 396 | minimum extent necessary to make it enforceable. If the provision 397 | cannot be reformed, it shall be severed from this Public License 398 | without affecting the enforceability of the remaining terms and 399 | conditions. 400 | 401 | c. No term or condition of this Public License will be waived and no 402 | failure to comply consented to unless expressly agreed to by the 403 | Licensor. 404 | 405 | d. Nothing in this Public License constitutes or may be interpreted 406 | as a limitation upon, or waiver of, any privileges and immunities 407 | that apply to the Licensor or You, including from the legal 408 | processes of any jurisdiction or authority. 409 | 410 | 411 | ======================================================================= 412 | 413 | Creative Commons is not a party to its public licenses. 414 | Notwithstanding, Creative Commons may elect to apply one of its public 415 | licenses to material it publishes and in those instances will be 416 | considered the "Licensor." Except for the limited purpose of indicating 417 | that material is shared under a Creative Commons public license or as 418 | otherwise permitted by the Creative Commons policies published at 419 | creativecommons.org/policies, Creative Commons does not authorize the 420 | use of the trademark "Creative Commons" or any other trademark or logo 421 | of Creative Commons without its prior written consent including, 422 | without limitation, in connection with any unauthorized modifications 423 | to any of its public licenses or any other arrangements, 424 | understandings, or agreements concerning use of licensed material. For 425 | the avoidance of doubt, this paragraph does not form part of the public 426 | licenses. 427 | 428 | Creative Commons may be contacted at creativecommons.org. 429 | -------------------------------------------------------------------------------- /source/libs/bs-material/fonts/Material-Design-Icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs-material/fonts/Material-Design-Icons.eot -------------------------------------------------------------------------------- /source/libs/bs-material/fonts/Material-Design-Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs-material/fonts/Material-Design-Icons.ttf -------------------------------------------------------------------------------- /source/libs/bs-material/fonts/Material-Design-Icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs-material/fonts/Material-Design-Icons.woff -------------------------------------------------------------------------------- /source/libs/bs-material/fonts/Material-Design.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs-material/fonts/Material-Design.eot -------------------------------------------------------------------------------- /source/libs/bs-material/fonts/Material-Design.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs-material/fonts/Material-Design.ttf -------------------------------------------------------------------------------- /source/libs/bs-material/fonts/Material-Design.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs-material/fonts/Material-Design.woff -------------------------------------------------------------------------------- /source/libs/bs-material/js/material.js: -------------------------------------------------------------------------------- 1 | /* globals ripples */ 2 | 3 | $(function (){ 4 | 5 | if (typeof ripples == "object") { 6 | ripples.init( ".btn:not(.btn-link)," + 7 | ".card-image," + 8 | ".navbar a:not(.withoutripple)," + 9 | ".nav-tabs a:not(.withoutripple)," + 10 | ".withripple" ); 11 | } 12 | 13 | var initInputs = function() { 14 | // Add fake-checkbox to material checkboxes 15 | $(".checkbox > label > input").not(".bs-material").addClass("bs-material").after(""); 16 | 17 | // Add fake-radio to material radios 18 | $(".radio > label > input").not(".bs-material").addClass("bs-material").after(""); 19 | 20 | // Add elements for material inputs 21 | $("input.form-control, textarea.form-control, select.form-control").not(".bs-material").each( function() { 22 | if ($(this).is(".bs-material")) { return; } 23 | $(this).wrap("
"); 24 | $(this).after(""); 25 | if ($(this).hasClass("floating-label")) { 26 | var placeholder = $(this).attr("placeholder"); 27 | $(this).attr("placeholder", null).removeClass("floating-label"); 28 | $(this).after("
" + placeholder + "
"); 29 | } 30 | if ($(this).is(":empty") || $(this).val() === null || $(this).val() == "undefined" || $(this).val() === "") { 31 | $(this).addClass("empty"); 32 | } 33 | 34 | if ($(this).parent().next().is("[type=file]")) { 35 | $(this).parent().addClass("fileinput"); 36 | var $input = $(this).parent().next().detach(); 37 | $(this).after($input); 38 | } 39 | }); 40 | 41 | }; 42 | initInputs(); 43 | 44 | // Support for "arrive.js" to dynamically detect creation of elements 45 | // include it before this script to take advantage of this feature 46 | // https://github.com/uzairfarooq/arrive/ 47 | if (document.arrive) { 48 | document.arrive("input, textarea, select", function() { 49 | initInputs(); 50 | }); 51 | } 52 | 53 | $(document).on("change", ".checkbox input", function() { 54 | $(this).blur(); 55 | }); 56 | 57 | $(document).on("keyup change", ".form-control", function() { 58 | var self = $(this); 59 | setTimeout(function() { 60 | if (self.val() === "") { 61 | self.addClass("empty"); 62 | } else { 63 | self.removeClass("empty"); 64 | } 65 | }, 1); 66 | }); 67 | $(document) 68 | .on("focus", ".form-control-wrapper.fileinput", function() { 69 | $(this).find("input").addClass("focus"); 70 | }) 71 | .on("blur", ".form-control-wrapper.fileinput", function() { 72 | $(this).find("input").removeClass("focus"); 73 | }) 74 | .on("change", ".form-control-wrapper.fileinput [type=file]", function() { 75 | var value = ""; 76 | $.each($(this)[0].files, function(i, file) { 77 | console.log(file); 78 | value += file.name + ", "; 79 | }); 80 | value = value.substring(0, value.length - 2); 81 | if (value) { 82 | $(this).prev().removeClass("empty"); 83 | } else { 84 | $(this).prev().addClass("empty"); 85 | } 86 | $(this).prev().val(value); 87 | }); 88 | }); 89 | -------------------------------------------------------------------------------- /source/libs/bs-material/js/material.min.js: -------------------------------------------------------------------------------- 1 | $(function(){"object"==typeof ripples&&ripples.init(".btn:not(.btn-link),.card-image,.navbar a:not(.withoutripple),.nav-tabs a:not(.withoutripple),.withripple");var a=function(){$(".checkbox > label > input").not(".bs-material").addClass("bs-material").after(""),$(".radio > label > input").not(".bs-material").addClass("bs-material").after(""),$("input.form-control, textarea.form-control, select.form-control").not(".bs-material").each(function(){if(!$(this).is(".bs-material")){if($(this).wrap("
"),$(this).after(""),$(this).hasClass("floating-label")){var a=$(this).attr("placeholder");$(this).attr("placeholder",null).removeClass("floating-label"),$(this).after("
"+a+"
")}if(($(this).is(":empty")||null===$(this).val()||"undefined"==$(this).val()||""===$(this).val())&&$(this).addClass("empty"),$(this).parent().next().is("[type=file]")){$(this).parent().addClass("fileinput");var b=$(this).parent().next().detach();$(this).after(b)}}})};a(),document.arrive&&document.arrive("input, textarea, select",function(){a()}),$(document).on("change",".checkbox input",function(){$(this).blur()}),$(document).on("keyup change",".form-control",function(){var a=$(this);setTimeout(function(){""===a.val()?a.addClass("empty"):a.removeClass("empty")},1)}),$(document).on("focus",".form-control-wrapper.fileinput",function(){$(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){$(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var a="";$.each($(this)[0].files,function(b,c){console.log(c),a+=c.name+", "}),a=a.substring(0,a.length-2),a?$(this).prev().removeClass("empty"):$(this).prev().addClass("empty"),$(this).prev().val(a)})}); 2 | -------------------------------------------------------------------------------- /source/libs/bs-material/js/ripples.js: -------------------------------------------------------------------------------- 1 | /* Copyright 2014+, Federico Zivolo, LICENSE at https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md */ 2 | /* globals CustomEvent */ 3 | window.ripples = { 4 | init : function(withRipple) { 5 | "use strict"; 6 | 7 | // Cross browser matches function 8 | function matchesSelector(domElement, selector) { 9 | var matches = domElement.matches || 10 | domElement.matchesSelector || 11 | domElement.webkitMatchesSelector || 12 | domElement.mozMatchesSelector || 13 | domElement.msMatchesSelector || 14 | domElement.oMatchesSelector; 15 | return matches.call(domElement, selector); 16 | } 17 | 18 | // animations time 19 | var rippleOutTime = 100, 20 | rippleStartTime = 500; 21 | 22 | // Helper to bind events on dynamically created elements 23 | var bind = function(events, selector, callback) { 24 | if (typeof events === "string") { 25 | events = [events]; 26 | } 27 | events.forEach(function(event) { 28 | document.addEventListener(event, function(e) { 29 | var target = (typeof e.detail !== "number") ? e.detail : e.target; 30 | 31 | if (matchesSelector(target, selector)) { 32 | callback(e, target); 33 | } 34 | }); 35 | }); 36 | }; 37 | 38 | var rippleStart = function(e, target, callback) { 39 | 40 | // Init variables 41 | var $rippleWrapper = target, 42 | $el = $rippleWrapper.parentNode, 43 | $ripple = document.createElement("div"), 44 | elPos = $el.getBoundingClientRect(), 45 | // Mouse pos in most cases 46 | mousePos = {x: e.clientX - elPos.left, y: ((window.ontouchstart) ? e.clientY - window.scrollY: e.clientY) - elPos.top}, 47 | scale = "scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")", 48 | rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}), 49 | _rippleOpacity = 0.1, 50 | refreshElementStyle; 51 | 52 | 53 | // If multitouch is detected or some other black magic suff is happening... 54 | if (e.touches) { 55 | mousePos = {x: e.touches[0].clientX - elPos.left, y: e.touches[0].clientY - elPos.top}; 56 | } 57 | 58 | console.log(mousePos); 59 | 60 | $ripplecache = $ripple; 61 | 62 | // Set ripple class 63 | $ripple.className = "ripple"; 64 | 65 | // Move ripple to the mouse position 66 | $ripple.setAttribute("style", "left:" + mousePos.x + "px; top:" + mousePos.y + "px;"); 67 | 68 | // Get the clicked target's text color, this will be applied to the ripple as background-color. 69 | var targetColor = window.getComputedStyle($el).color; 70 | 71 | // Convert the rgb color to an rgba color with opacity set to __rippleOpacity__ 72 | targetColor = targetColor.replace("rgb", "rgba").replace(")", ", " + _rippleOpacity + ")"); 73 | 74 | // Insert new ripple into ripple wrapper 75 | $rippleWrapper.appendChild($ripple); 76 | 77 | // Make sure the ripple has the class applied (ugly hack but it works) 78 | refreshElementStyle = window.getComputedStyle($ripple).opacity; 79 | 80 | // Let other funtions know that this element is animating 81 | $ripple.dataset.animating = 1; 82 | 83 | // Set scale value, background-color and opacity to ripple and animate it 84 | $ripple.className = "ripple ripple-on"; 85 | 86 | // Prepare the style of the ripple 87 | var rippleStyle = [ 88 | $ripple.getAttribute("style"), 89 | "background-color: " + targetColor, 90 | "-ms-transform: " + scale, 91 | "-moz-transform" + scale, 92 | "-webkit-transform" + scale, 93 | "transform: " + scale 94 | ]; 95 | 96 | // Apply the style 97 | $ripple.setAttribute("style", rippleStyle.join(";")); 98 | 99 | // This function is called when the animation is finished 100 | setTimeout(function() { 101 | 102 | // Let know to other functions that this element has finished the animation 103 | $ripple.dataset.animating = 0; 104 | document.dispatchEvent(rippleEnd); 105 | if (callback) { 106 | callback(); 107 | } 108 | 109 | }, rippleStartTime); 110 | 111 | }; 112 | 113 | var rippleOut = function($ripple) { 114 | // Clear previous animation 115 | $ripple.className = "ripple ripple-on ripple-out"; 116 | 117 | // Let ripple fade out (with CSS) 118 | setTimeout(function() { 119 | $ripple.remove(); 120 | }, rippleOutTime); 121 | }; 122 | 123 | // Helper, need to know if mouse is up or down 124 | var mouseDown = false; 125 | bind(["mousedown", "touchstart"], "*", function() { 126 | mouseDown = true; 127 | }); 128 | bind(["mouseup", "touchend"], "*", function() { 129 | mouseDown = false; 130 | }); 131 | 132 | // Append ripple wrapper if not exists already 133 | var rippleInit = function(e, target) { 134 | if (target.getElementsByClassName("ripple-wrapper").length === 0) { 135 | target.className += " withripple"; 136 | var $rippleWrapper = document.createElement("div"); 137 | $rippleWrapper.className = "ripple-wrapper"; 138 | target.appendChild($rippleWrapper); 139 | if (window.ontouchstart === null) { 140 | rippleStart(e, $rippleWrapper, function() { 141 | // FIXME: ugly fix for first touchstart event on mobile devices... 142 | $rippleWrapper.getElementsByClassName("ripple")[0].remove(); 143 | }); 144 | } 145 | } 146 | }; 147 | 148 | var $ripplecache; 149 | 150 | // Events handler 151 | // init RippleJS and start ripple effect on mousedown 152 | bind(["mouseover", "touchstart"], withRipple, rippleInit); 153 | 154 | // start ripple effect on mousedown 155 | bind(["mousedown", "touchstart"], ".ripple-wrapper", function(e, $ripple) { 156 | // Start ripple only on left or middle mouse click and touch click 157 | if (e.which === 0 || e.which === 1 || e.which === 2) { 158 | rippleStart(e, $ripple); 159 | } 160 | }); 161 | 162 | // if animation ends and user is not holding mouse then destroy the ripple 163 | bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) { 164 | 165 | var $ripples = $ripple.parentNode.getElementsByClassName("ripple"); 166 | 167 | if (!mouseDown || ( $ripples[0] == $ripple && $ripples.length > 1)) { 168 | rippleOut($ripple); 169 | } 170 | }); 171 | 172 | // Destroy ripple when mouse is not holded anymore if the ripple still exists 173 | bind(["mouseup", "touchend"], ".ripple-wrapper", function() { 174 | var $ripple = $ripplecache; 175 | if ($ripple && $ripple.dataset.animating != 1) { 176 | rippleOut($ripple); 177 | } 178 | }); 179 | 180 | } 181 | }; 182 | -------------------------------------------------------------------------------- /source/libs/bs-material/js/ripples.min.js: -------------------------------------------------------------------------------- 1 | window.ripples={init:function(a){"use strict";function b(a,b){var c=a.matches||a.matchesSelector||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;return c.call(a,b)}var c=100,d=500,e=function(a,c,d){"string"==typeof a&&(a=[a]),a.forEach(function(a){document.addEventListener(a,function(a){var e="number"!=typeof a.detail?a.detail:a.target;b(e,c)&&d(a,e)})})},f=function(a,b,c){var e,f=b,g=f.parentNode,h=document.createElement("div"),j=g.getBoundingClientRect(),k={x:a.clientX-j.left,y:(window.ontouchstart?a.clientY-window.scrollY:a.clientY)-j.top},l="scale("+Math.round(f.offsetWidth/5)+")",m=new CustomEvent("rippleEnd",{detail:h}),n=.1;a.touches&&(k={x:a.touches[0].clientX-j.left,y:a.touches[0].clientY-j.top}),console.log(k),i=h,h.className="ripple",h.setAttribute("style","left:"+k.x+"px; top:"+k.y+"px;");var o=window.getComputedStyle(g).color;o=o.replace("rgb","rgba").replace(")",", "+n+")"),f.appendChild(h),e=window.getComputedStyle(h).opacity,h.dataset.animating=1,h.className="ripple ripple-on";var p=[h.getAttribute("style"),"background-color: "+o,"-ms-transform: "+l,"-moz-transform"+l,"-webkit-transform"+l,"transform: "+l];h.setAttribute("style",p.join(";")),setTimeout(function(){h.dataset.animating=0,document.dispatchEvent(m),c&&c()},d)},g=function(a){a.className="ripple ripple-on ripple-out",setTimeout(function(){a.remove()},c)},h=!1;e(["mousedown","touchstart"],"*",function(){h=!0}),e(["mouseup","touchend"],"*",function(){h=!1});var i,j=function(a,b){if(0===b.getElementsByClassName("ripple-wrapper").length){b.className+=" withripple";var c=document.createElement("div");c.className="ripple-wrapper",b.appendChild(c),null===window.ontouchstart&&f(a,c,function(){c.getElementsByClassName("ripple")[0].remove()})}};e(["mouseover","touchstart"],a,j),e(["mousedown","touchstart"],".ripple-wrapper",function(a,b){(0===a.which||1===a.which||2===a.which)&&f(a,b)}),e("rippleEnd",".ripple-wrapper .ripple",function(a,b){var c=b.parentNode.getElementsByClassName("ripple");(!h||c[0]==b&&c.length>1)&&g(b)}),e(["mouseup","touchend"],".ripple-wrapper",function(){var a=i;a&&1!=a.dataset.animating&&g(a)})}}; 2 | -------------------------------------------------------------------------------- /source/libs/bs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /source/libs/bs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /source/libs/bs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /source/libs/bs/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wayou/hexo-theme-material/9165506a898ca7a6b75fcb9074e2c5ecf1f4b915/source/libs/bs/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /source/libs/bs/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /source/libs/tocify/jquery-ui.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.11.4 - 2015-09-13 2 | * http://jqueryui.com 3 | * Includes: widget.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js 4 | * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ 5 | 6 | (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){var t=0,i=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var s,n,a=i.call(arguments,1),o=0,r=a.length;r>o;o++)for(s in a[o])n=a[o][s],a[o].hasOwnProperty(s)&&void 0!==n&&(t[s]=e.isPlainObject(n)?e.isPlainObject(t[s])?e.widget.extend({},t[s],n):e.widget.extend({},n):n);return t},e.widget.bridge=function(t,s){var n=s.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,r=i.call(arguments,1),h=this;return o?this.each(function(){var i,s=e.data(this,n);return"instance"===a?(h=s,!1):s?e.isFunction(s[a])&&"_"!==a.charAt(0)?(i=s[a].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+a+"'")}):(r.length&&(a=e.widget.extend.apply(null,[a].concat(r))),this.each(function(){var t=e.data(this,n);t?(t.option(a||{}),t._init&&t._init()):e.data(this,n,new s(a,this))})),h}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(i,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var s="ui-effects-",n=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("

")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(n),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,n,o={};for(s in i)n=i[s],t[s]!==n&&(a[s]||(e.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var s=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(n.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(s+t[i],e[0].style[t[i]])},restore:function(e,t){var i,n;for(n=0;t.length>n;n++)null!==t[n]&&(i=e.data(s+t[n]),void 0===i&&(i=""),e.css(t[n],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("
").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("
").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})}}); -------------------------------------------------------------------------------- /source/libs/tocify/jquery.tocify.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery.tocify.css 1.9.0 3 | * Author: @gregfranko 4 | */ 5 | 6 | /* The Table of Contents container element */ 7 | .tocify { 8 | width: 20%; 9 | max-height: 90%; 10 | overflow: auto; 11 | margin-left: 2%; 12 | position: fixed; 13 | border: 1px solid #ccc; 14 | webkit-border-radius: 6px; 15 | moz-border-radius: 6px; 16 | border-radius: 6px; 17 | } 18 | 19 | /* The Table of Contents is composed of multiple nested unordered lists. These styles remove the default styling of an unordered list because it is ugly. */ 20 | .tocify ul, .tocify li { 21 | list-style: none; 22 | margin: 0; 23 | padding: 0; 24 | border: none; 25 | line-height: 30px; 26 | } 27 | 28 | /* Top level header elements */ 29 | .tocify-header { 30 | text-indent: 10px; 31 | } 32 | 33 | /* Top level subheader elements. These are the first nested items underneath a header element. */ 34 | .tocify-subheader { 35 | text-indent: 20px; 36 | display: none; 37 | } 38 | 39 | /* Makes the font smaller for all subheader elements. */ 40 | .tocify-subheader li { 41 | font-size: 12px; 42 | } 43 | 44 | /* Further indents second level subheader elements. */ 45 | .tocify-subheader .tocify-subheader { 46 | text-indent: 30px; 47 | } 48 | 49 | /* Further indents third level subheader elements. You can continue this pattern if you have more nested elements. */ 50 | .tocify-subheader .tocify-subheader .tocify-subheader { 51 | text-indent: 40px; 52 | } 53 | 54 | /* Twitter Bootstrap Override Style */ 55 | .nav-list > li > a, .nav-list .nav-header { 56 | margin: 0px; 57 | } 58 | 59 | /* Twitter Bootstrap Override Style */ 60 | .nav-list > li > a { 61 | padding: 5px; 62 | } -------------------------------------------------------------------------------- /source/libs/tocify/jquery.tocify.custom.js: -------------------------------------------------------------------------------- 1 | /* jquery Tocify - v1.9.0 - 2013-10-01 2 | * http://www.gregfranko.com/jquery.tocify.js/ 3 | * Copyright (c) 2013 Greg Franko; Licensed MIT */ 4 | 5 | // Immediately-Invoked Function Expression (IIFE) [Ben Alman Blog Post](http://benalman.com/news/2010/11/immediately-invoked-function-expression/) that calls another IIFE that contains all of the plugin logic. I used this pattern so that anyone viewing this code would not have to scroll to the bottom of the page to view the local parameters that were passed to the main IIFE. 6 | (function(tocify) { 7 | 8 | // ECMAScript 5 Strict Mode: [John Resig Blog Post](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/) 9 | "use strict"; 10 | 11 | // Calls the second IIFE and locally passes in the global jQuery, window, and document objects 12 | tocify(window.jQuery, window, document); 13 | 14 | } 15 | 16 | // Locally passes in `jQuery`, the `window` object, the `document` object, and an `undefined` variable. The `jQuery`, `window` and `document` objects are passed in locally, to improve performance, since javascript first searches for a variable match within the local variables set before searching the global variables set. All of the global variables are also passed in locally to be minifier friendly. `undefined` can be passed in locally, because it is not a reserved word in JavaScript. 17 | 18 | // fixed some bug by wayou to fit this blog 19 | 20 | (function($, window, document, undefined) { 21 | 22 | // ECMAScript 5 Strict Mode: [John Resig Blog Post](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/) 23 | "use strict"; 24 | 25 | var tocClassName = "tocify", 26 | tocClass = "." + tocClassName, 27 | tocFocusClassName = "tocify-focus", 28 | tocHoverClassName = "tocify-hover", 29 | hideTocClassName = "tocify-hide", 30 | hideTocClass = "." + hideTocClassName, 31 | headerClassName = "tocify-header", 32 | headerClass = "." + headerClassName, 33 | subheaderClassName = "tocify-subheader", 34 | subheaderClass = "." + subheaderClassName, 35 | itemClassName = "tocify-item", 36 | itemClass = "." + itemClassName, 37 | extendPageClassName = "tocify-extend-page", 38 | extendPageClass = "." + extendPageClassName; 39 | 40 | // Calling the jQueryUI Widget Factory Method 41 | $.widget("toc.tocify", { 42 | 43 | //Plugin version 44 | version: "1.9.0", 45 | 46 | // These options will be used as defaults 47 | options: { 48 | 49 | // **context**: Accepts String: Any jQuery selector 50 | // The container element that holds all of the elements used to generate the table of contents 51 | context: "body", 52 | 53 | // **ignoreSelector**: Accepts String: Any jQuery selector 54 | // A selector to any element that would be matched by selectors that you wish to be ignored 55 | ignoreSelector: null, 56 | 57 | // **selectors**: Accepts an Array of Strings: Any jQuery selectors 58 | // The element's used to generate the table of contents. The order is very important since it will determine the table of content's nesting structure 59 | selectors: "h1, h2, h3", 60 | 61 | // **showAndHide**: Accepts a boolean: true or false 62 | // Used to determine if elements should be shown and hidden 63 | showAndHide: true, 64 | 65 | // **showEffect**: Accepts String: "none", "fadeIn", "show", or "slideDown" 66 | // Used to display any of the table of contents nested items 67 | showEffect: "slideDown", 68 | 69 | // **showEffectSpeed**: Accepts Number (milliseconds) or String: "slow", "medium", or "fast" 70 | // The time duration of the show animation 71 | showEffectSpeed: "medium", 72 | 73 | // **hideEffect**: Accepts String: "none", "fadeOut", "hide", or "slideUp" 74 | // Used to hide any of the table of contents nested items 75 | hideEffect: "slideUp", 76 | 77 | // **hideEffectSpeed**: Accepts Number (milliseconds) or String: "slow", "medium", or "fast" 78 | // The time duration of the hide animation 79 | hideEffectSpeed: "medium", 80 | 81 | // **smoothScroll**: Accepts a boolean: true or false 82 | // Determines if a jQuery animation should be used to scroll to specific table of contents items on the page 83 | smoothScroll: true, 84 | 85 | // **smoothScrollSpeed**: Accepts Number (milliseconds) or String: "slow", "medium", or "fast" 86 | // The time duration of the smoothScroll animation 87 | smoothScrollSpeed: "medium", 88 | 89 | // **scrollTo**: Accepts Number (pixels) 90 | // The amount of space between the top of page and the selected table of contents item after the page has been scrolled 91 | scrollTo: 0, 92 | 93 | // **showAndHideOnScroll**: Accepts a boolean: true or false 94 | // Determines if table of contents nested items should be shown and hidden while scrolling 95 | showAndHideOnScroll: true, 96 | 97 | // **highlightOnScroll**: Accepts a boolean: true or false 98 | // Determines if table of contents nested items should be highlighted (set to a different color) while scrolling 99 | highlightOnScroll: true, 100 | 101 | // **highlightOffset**: Accepts a number 102 | // The offset distance in pixels to trigger the next active table of contents item 103 | highlightOffset: 40, 104 | 105 | // **theme**: Accepts a string: "bootstrap", "jqueryui", or "none" 106 | // Determines if Twitter Bootstrap, jQueryUI, or Tocify classes should be added to the table of contents 107 | theme: "bootstrap", 108 | 109 | // **extendPage**: Accepts a boolean: true or false 110 | // If a user scrolls to the bottom of the page and the page is not tall enough to scroll to the last table of contents item, then the page height is increased 111 | extendPage: true, 112 | 113 | // **extendPageOffset**: Accepts a number: pixels 114 | // How close to the bottom of the page a user must scroll before the page is extended 115 | extendPageOffset: 100, 116 | 117 | // **history**: Accepts a boolean: true or false 118 | // Adds a hash to the page url to maintain history 119 | history: true, 120 | 121 | // **scrollHistory**: Accepts a boolean: true or false 122 | // Adds a hash to the page url, to maintain history, when scrolling to a TOC item 123 | scrollHistory: false, 124 | 125 | // **hashGenerator**: How the hash value (the anchor segment of the URL, following the 126 | // # character) will be generated. 127 | // 128 | // "compact" (default) - #CompressesEverythingTogether 129 | // "pretty" - #looks-like-a-nice-url-and-is-easily-readable 130 | // function(text, element){} - Your own hash generation function that accepts the text as an 131 | // argument, and returns the hash value. 132 | hashGenerator: "compact", 133 | 134 | // **highlightDefault**: Accepts a boolean: true or false 135 | // Set's the first TOC item as active if no other TOC item is active. 136 | highlightDefault: true 137 | 138 | }, 139 | 140 | // _Create 141 | // ------- 142 | // Constructs the plugin. Only called once. 143 | _create: function() { 144 | 145 | var self = this; 146 | 147 | self.extendPageScroll = true; 148 | 149 | // Internal array that keeps track of all TOC items (Helps to recognize if there are duplicate TOC item strings) 150 | self.items = []; 151 | 152 | // Generates the HTML for the dynamic table of contents 153 | self._generateToc(); 154 | 155 | // Adds CSS classes to the newly generated table of contents HTML 156 | self._addCSSClasses(); 157 | 158 | self.webkit = (function() { 159 | 160 | for(var prop in window) { 161 | 162 | if(prop) { 163 | 164 | if(prop.toLowerCase().indexOf("webkit") !== -1) { 165 | 166 | return true; 167 | 168 | } 169 | 170 | } 171 | 172 | } 173 | 174 | return false; 175 | 176 | }()); 177 | 178 | // Adds jQuery event handlers to the newly generated table of contents 179 | self._setEventHandlers(); 180 | 181 | // Binding to the Window load event to make sure the correct scrollTop is calculated 182 | $(window).load(function() { 183 | 184 | // Sets the active TOC item 185 | self._setActiveElement(true); 186 | 187 | // Once all animations on the page are complete, this callback function will be called 188 | $("html, body").promise().done(function() { 189 | 190 | setTimeout(function() { 191 | 192 | self.extendPageScroll = false; 193 | 194 | },0); 195 | 196 | }); 197 | 198 | }); 199 | 200 | }, 201 | 202 | // _generateToc 203 | // ------------ 204 | // Generates the HTML for the dynamic table of contents 205 | _generateToc: function() { 206 | 207 | // _Local variables_ 208 | 209 | // Stores the plugin context in the self variable 210 | var self = this, 211 | 212 | // All of the HTML tags found within the context provided (i.e. body) that match the top level jQuery selector above 213 | firstElem, 214 | 215 | // Instantiated variable that will store the top level newly created unordered list DOM element 216 | ul, 217 | ignoreSelector = self.options.ignoreSelector; 218 | 219 | // If the selectors option has a comma within the string 220 | if(this.options.selectors.indexOf(",") !== -1) { 221 | 222 | // Grabs the first selector from the string 223 | firstElem = $(this.options.context).find(this.options.selectors.replace(/ /g,"").substr(0, this.options.selectors.indexOf(","))); 224 | 225 | } 226 | 227 | // If the selectors option does not have a comman within the string 228 | else { 229 | 230 | // Grabs the first selector from the string and makes sure there are no spaces 231 | firstElem = $(this.options.context).find(this.options.selectors.replace(/ /g,"")); 232 | 233 | } 234 | 235 | if(!firstElem.length) { 236 | 237 | self.element.addClass(hideTocClassName); 238 | 239 | return; 240 | 241 | } 242 | 243 | self.element.addClass(tocClassName); 244 | 245 | // Loops through each top level selector 246 | firstElem.each(function(index) { 247 | 248 | //If the element matches the ignoreSelector then we skip it 249 | if($(this).is(ignoreSelector)) { 250 | return; 251 | } 252 | 253 | // Creates an unordered list HTML element and adds a dynamic ID and standard class name 254 | ul = $("