├── README.md ├── .gitignore ├── favicon.ico ├── theme ├── favicon.ico ├── assets │ ├── icons │ │ ├── favicon.ico │ │ ├── origin.png │ │ ├── apple-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── ms-icon-70x70.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── apple-icon-precomposed.png │ │ ├── browserconfig.xml │ │ └── manifest.json │ ├── fonts │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ └── iconfont.svg │ ├── js │ │ ├── social-share.min.js │ │ └── app.js │ └── css │ │ └── app.min.css.map ├── foot.template ├── hero.template ├── favicon.template ├── pre-next.template ├── breadcrumb.template ├── page.template ├── main.template ├── nav.template ├── chapters.template └── script.template ├── index.js ├── scripts ├── hashChange.js ├── support.js ├── insertArticleToc.js ├── goTop.js ├── tocHide.js ├── navbarHandler.js ├── index.js ├── setMinHeight.js ├── menuHandler.js └── social-share.js ├── postcss.config.js ├── package.json └── sass ├── highlight.sass.vs2015 ├── generic.scss ├── highlight.sass ├── wangdoc.sass └── social.scss /README.md: -------------------------------------------------------------------------------- 1 | Wangdoc 文档页面的默认主题。 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | package-lock.json 4 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/favicon.ico -------------------------------------------------------------------------------- /theme/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/favicon.ico -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = path.resolve(__dirname, `theme`); 4 | -------------------------------------------------------------------------------- /theme/assets/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/favicon.ico -------------------------------------------------------------------------------- /theme/assets/icons/origin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/origin.png -------------------------------------------------------------------------------- /theme/assets/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/fonts/iconfont.eot -------------------------------------------------------------------------------- /theme/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /theme/assets/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/fonts/iconfont.woff -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon.png -------------------------------------------------------------------------------- /theme/assets/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/favicon-16x16.png -------------------------------------------------------------------------------- /theme/assets/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/favicon-32x32.png -------------------------------------------------------------------------------- /theme/assets/icons/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/favicon-96x96.png -------------------------------------------------------------------------------- /theme/assets/icons/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/ms-icon-70x70.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-57x57.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-60x60.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-72x72.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-76x76.png -------------------------------------------------------------------------------- /theme/assets/icons/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/ms-icon-144x144.png -------------------------------------------------------------------------------- /theme/assets/icons/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/ms-icon-150x150.png -------------------------------------------------------------------------------- /theme/assets/icons/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/ms-icon-310x310.png -------------------------------------------------------------------------------- /theme/assets/icons/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/android-icon-36x36.png -------------------------------------------------------------------------------- /theme/assets/icons/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/android-icon-48x48.png -------------------------------------------------------------------------------- /theme/assets/icons/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/android-icon-72x72.png -------------------------------------------------------------------------------- /theme/assets/icons/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/android-icon-96x96.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-114x114.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-120x120.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-144x144.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-152x152.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-180x180.png -------------------------------------------------------------------------------- /theme/assets/icons/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/android-icon-144x144.png -------------------------------------------------------------------------------- /theme/assets/icons/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/android-icon-192x192.png -------------------------------------------------------------------------------- /theme/assets/icons/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangdoc/loppo-theme-wangdoc/HEAD/theme/assets/icons/apple-icon-precomposed.png -------------------------------------------------------------------------------- /theme/foot.template: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /theme/assets/icons/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /scripts/hashChange.js: -------------------------------------------------------------------------------- 1 | /* hashchange handler */ 2 | function hashChange() { 3 | var hash = location.hash; 4 | if (!hash) return; 5 | var nav = document.querySelector('.navbar'); 6 | var navHeight = nav.getBoundingClientRect().height; 7 | window.scrollBy(0, -1 * navHeight); 8 | }; 9 | 10 | module.exports = hashChange; 11 | -------------------------------------------------------------------------------- /theme/hero.template: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /scripts/support.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { 2 | fetch('/assets/js/s.js') 3 | .then(response => { 4 | if (response.status !== 200) throw new Error('load support script failed'); 5 | return response.text(); 6 | }) 7 | .then(data => { 8 | var s = new Function(data); 9 | s(); 10 | }) 11 | .catch(e => console.log(e)); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /scripts/insertArticleToc.js: -------------------------------------------------------------------------------- 1 | /* insert article's toc */ 2 | function insertArticleToc() { 3 | var article = document.querySelector('article.content'); 4 | var firstH2Title = article.querySelector('h2'); 5 | var h2TitleNumber = article.querySelectorAll('h2'); 6 | 7 | if (firstH2Title && LOPPO.article_toc && h2TitleNumber.length >= 2) { 8 | var toc_div = document.createElement('div'); 9 | toc_div.setAttribute('class', 'article-toc'); 10 | toc_div.innerHTML = '
目录 [隐藏]
' + LOPPO.article_toc; 11 | article.insertBefore(toc_div, firstH2Title); 12 | } 13 | } 14 | 15 | module.exports = insertArticleToc; 16 | -------------------------------------------------------------------------------- /theme/favicon.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /scripts/goTop.js: -------------------------------------------------------------------------------- 1 | function addTopElement(title) { 2 | const text = document.createTextNode(' '); 3 | title.appendChild(text); 4 | 5 | const fa = document.createElement('i'); 6 | fa.setAttribute('class', 'fa fa-angle-up'); 7 | const icon = document.createElement('span'); 8 | icon.setAttribute('class', 'icon'); 9 | icon.appendChild(fa); 10 | const link = document.createElement('a'); 11 | link.setAttribute('href', '#navbar'); 12 | link.appendChild(icon); 13 | 14 | title.appendChild(link); 15 | } 16 | 17 | function goTop() { 18 | const article = document.querySelector('article.content'); 19 | const h2s = article.querySelectorAll('h2'); 20 | const h3s = article.querySelectorAll('h3'); 21 | h2s.forEach(addTopElement); 22 | h3s.forEach(addTopElement); 23 | } 24 | 25 | module.exports = goTop; 26 | -------------------------------------------------------------------------------- /scripts/tocHide.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var controller = document.querySelector('.toc-controller'); 3 | var toc = document.querySelector('.article-toc .markdownIt-TOC'); 4 | if (!controller || !toc) return; 5 | controller.addEventListener('click', (e) => { 6 | e.preventDefault(); 7 | if (controller.classList.contains('toc-controller-show')) { 8 | controller.classList.remove('toc-controller-show'); 9 | controller.classList.add('toc-controller-hide'); 10 | controller.innerHTML = '显示'; 11 | toc.style.display = 'none'; 12 | } else { 13 | controller.classList.remove('toc-controller-hide'); 14 | controller.classList.add('toc-controller-show'); 15 | controller.innerHTML = '隐藏'; 16 | toc.style.display = 'block'; 17 | } 18 | }, true); 19 | })() 20 | -------------------------------------------------------------------------------- /theme/pre-next.template: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /scripts/navbarHandler.js: -------------------------------------------------------------------------------- 1 | function navbarHandler() { 2 | // Get all "navbar-burger" elements 3 | const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); 4 | 5 | // Check if there are any navbar burgers 6 | if ($navbarBurgers.length > 0) { 7 | 8 | // Add a click event on each of them 9 | $navbarBurgers.forEach( el => { 10 | el.addEventListener('click', () => { 11 | 12 | // Get the target from the "data-target" attribute 13 | const target = el.dataset.target; 14 | const $target = document.getElementById(target); 15 | 16 | // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" 17 | el.classList.toggle('is-active'); 18 | $target.classList.toggle('is-active'); 19 | 20 | }); 21 | }); 22 | } 23 | } 24 | 25 | module.exports = navbarHandler; 26 | -------------------------------------------------------------------------------- /theme/breadcrumb.template: -------------------------------------------------------------------------------- 1 | 28 | -------------------------------------------------------------------------------- /theme/assets/icons/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /scripts/index.js: -------------------------------------------------------------------------------- 1 | var setMinHeight = require('./setMinHeight'); 2 | var insertArticleToc = require('./insertArticleToc'); 3 | var hashChange = require('./hashChange'); 4 | var navbarHandler = require('./navbarHandler'); 5 | var menuHandler = require('./menuHandler'); 6 | var goTop = require('./goTop'); 7 | var support = require('./support'); 8 | 9 | /* set content's min-height */ 10 | setMinHeight(); 11 | 12 | /* add goTop */ 13 | goTop(); 14 | 15 | /* insert article's toc */ 16 | insertArticleToc(); 17 | 18 | /* hashchange handler */ 19 | window.onhashchange = hashChange; 20 | 21 | /* navabar handler */ 22 | navbarHandler(); 23 | 24 | /* menu handler */ 25 | menuHandler(); 26 | 27 | /* toc controller */ 28 | require('./tocHide'); 29 | 30 | /* social share utilities */ 31 | require('./social-share'); 32 | 33 | /* loading support script */ 34 | support(); 35 | 36 | // 重要! 37 | // 每次更新此脚本,可以打开或关闭下面这行注释,使得脚本长度发生变化 38 | // console.log(); 39 | -------------------------------------------------------------------------------- /scripts/setMinHeight.js: -------------------------------------------------------------------------------- 1 | /* set content's min-height */ 2 | function setMinHeight() { 3 | var content = document.querySelector('.article'); 4 | if (!content) { 5 | content = document.querySelector('.homepage'); 6 | } 7 | 8 | var navbarHeight = 9 | window.getComputedStyle(document.querySelector('.navbar')) 10 | .getPropertyValue('height'); 11 | 12 | var heroHeight = 0; 13 | if (document.querySelector('.hero')) { 14 | var heroHeight = 15 | window.getComputedStyle(document.querySelector('.hero')) 16 | .getPropertyValue('height'); 17 | } 18 | 19 | var footHeight = 20 | window.getComputedStyle(document.querySelector('.footer')) 21 | .getPropertyValue('height'); 22 | 23 | var minHeight = document.documentElement.clientHeight 24 | - parseInt(navbarHeight) 25 | - parseInt(heroHeight) 26 | - parseInt(footHeight); 27 | 28 | content.style.minHeight = minHeight + 'px'; 29 | } 30 | 31 | module.exports = setMinHeight; 32 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | const purgecss = require('@fullhuman/postcss-purgecss'); 2 | const cssnano = require('cssnano'); 3 | const pruneVar = require('postcss-prune-var'); 4 | const varCompress = require('postcss-variable-compress'); 5 | 6 | module.exports = { 7 | map: true, 8 | plugins: [ 9 | purgecss({ 10 | // file paths to your contents to remove unused styles. 11 | // content: ['js/my.js','*.php'], 12 | // other wise our aria-selected is removed (like with purgecss online) 13 | content : [ './theme/*.template' ], 14 | safelist: ['main', 'container', 'article', 'nav', 'navbar', 'a', 'hljs', 'pre', 'code', 'h1', 'h2', 'h3', 'has-dropdown', 'is-hoverable', /^article-/, /^page-/, /^menu-/, /^nav-/, /^navbar-/, /^icon-/, /^hljs-/, /^social-/, /^share-/, /^wechat-/], 15 | }), 16 | pruneVar(), // remove unused css variables 17 | varCompress(), // compress css variables 18 | cssnano({ 19 | preset: 'default', 20 | }), 21 | ], 22 | } 23 | -------------------------------------------------------------------------------- /theme/page.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= current_path === '/' ? '' : page_title + ' - ' %><%= site %> - 网道 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% include favicon %> 16 | 17 | 18 | <% include nav %> 19 | <% /* include hero */ %> 20 | <% include main %> 21 | <% include foot %> 22 | <% include script %> 23 | 24 | 25 | -------------------------------------------------------------------------------- /theme/main.template: -------------------------------------------------------------------------------- 1 | <% if (current_path !== '/') { %> 2 |
3 | <% } else { %> 4 |
5 | <% } %> 6 |
7 | 8 |
9 |
10 | <% if (!isHomepage) { %> 11 | <% include breadcrumb %> 12 | <% include pre-next %> 13 | <% } %> 14 |
15 | <% if (isHomepage) { %> 16 |

<%= site %>

17 | <% } else { %> 18 |

<%= page_title %>

19 | <% } %> 20 |
21 |

网道(WangDoc.com),互联网文档计划

22 |
23 | <%= content %> 24 |
25 | <% include pre-next %> 26 |
27 |

本教程采用知识共享 署名-相同方式共享 3.0协议

28 |

分享本文

29 |
30 |
31 | 32 |
33 | <% include chapters %> 34 |
35 |
36 | 37 | <% if (typeof hasComments === 'undefined' || !hasComments) { %> 38 | <% } else { %> 39 |
40 |
41 |
42 |
43 |
44 | <% } %> 45 | 46 |
47 |
48 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "loppo-theme-wangdoc", 3 | "version": "0.7.3", 4 | "description": "a theme of Loppo used by Wangdoc", 5 | "main": "index.js", 6 | "scripts": { 7 | "clean-css": "rm -rf ./theme/assets/css/*", 8 | "build-css": "npm run clean-css && npm run build-sass && npm run build-postcss", 9 | "build-postcss": "postcss --output theme/assets/css/app.min.css theme/assets/css/app.css", 10 | "build-sass": "sass --style expanded --load-path=node_modules sass/wangdoc.sass theme/assets/css/app.css", 11 | "build-js": "mkdir -p theme/assets/js && browserify -g uglifyify scripts/index.js > theme/assets/js/app.js", 12 | "build": "npm run build-css && npm run build-js", 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "keywords": [ 16 | "loppo", 17 | "theme", 18 | "template" 19 | ], 20 | "homepage": "https://github.com/wangdoc/loppo-theme-wangdoc", 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/wangdoc/loppo-theme-wangdoc.git" 24 | }, 25 | "author": "Ruan Yifeng", 26 | "license": "MIT", 27 | "devDependencies": { 28 | "@fullhuman/postcss-purgecss": "^6.0.0", 29 | "browserify": "17.x", 30 | "bulma": "1.x", 31 | "cssnano": "^7.0.1", 32 | "postcss": "^8.3.6", 33 | "postcss-cli": "11.x", 34 | "postcss-prune-var": "^1.1.2", 35 | "postcss-variable-compress": "^3.0.0", 36 | "sass": "1.x", 37 | "uglifyify": "^5.0.1" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sass/highlight.sass.vs2015: -------------------------------------------------------------------------------- 1 | /* 2 | * Visual Studio 2015 dark style 3 | * Author: Nicolas LLOBERA 4 | */ 5 | 6 | .hljs 7 | background: #1E1E1E 8 | color: #DCDCDC 9 | 10 | 11 | .hljs-keyword, 12 | .hljs-literal, 13 | .hljs-symbol, 14 | .hljs-name 15 | color: #569CD6 16 | 17 | .hljs-link 18 | color: #569CD6 19 | text-decoration: underline 20 | 21 | .hljs-built_in, 22 | .hljs-type 23 | color: #4EC9B0 24 | 25 | .hljs-number, 26 | .hljs-class 27 | color: #B8D7A3 28 | 29 | .hljs-string, 30 | .hljs-meta .hljs-string 31 | color: #D69D85 32 | 33 | .hljs-regexp, 34 | .hljs-template-tag 35 | color: #9A5334 36 | 37 | .hljs-subst, 38 | .hljs-function, 39 | .hljs-title, 40 | .hljs-params, 41 | .hljs-formula 42 | color: #DCDCDC 43 | 44 | .hljs-comment, 45 | .hljs-quote 46 | color: #57A64A 47 | font-style: italic 48 | 49 | .hljs-doctag 50 | color: #608B4E 51 | 52 | .hljs-meta, 53 | .hljs-meta .hljs-keyword, 54 | .hljs-tag 55 | color: #9B9B9B 56 | 57 | .hljs-variable, 58 | .hljs-template-variable 59 | color: #BD63C5 60 | 61 | .hljs-attr, 62 | .hljs-attribute 63 | color: #9CDCFE 64 | 65 | .hljs-section 66 | color: gold 67 | 68 | .hljs-emphasis 69 | font-style: italic 70 | 71 | .hljs-strong 72 | font-weight: bold 73 | 74 | .hljs-bullet, 75 | .hljs-selector-tag, 76 | .hljs-selector-id, 77 | .hljs-selector-class, 78 | .hljs-selector-attr, 79 | .hljs-selector-pseudo 80 | color: #D7BA7D 81 | 82 | .hljs-addition 83 | background-color: #144212 84 | display: inline-block 85 | width: 100% 86 | 87 | .hljs-deletion 88 | background-color: #600 89 | display: inline-block 90 | width: 100% 91 | 92 | -------------------------------------------------------------------------------- /theme/nav.template: -------------------------------------------------------------------------------- 1 | 38 | -------------------------------------------------------------------------------- /scripts/menuHandler.js: -------------------------------------------------------------------------------- 1 | function menuHandler(e) { 2 | // menu initializing 3 | const items = [].slice.call(document.querySelectorAll('.menu-list li')); 4 | const firstLevel = [].slice.call(document.querySelectorAll('.menu-list > li')); 5 | items.forEach(i => { 6 | if (i.querySelector('ul')) { 7 | i.querySelector('ul').style.display = 'none'; 8 | i.querySelector('.icon i').classList.remove('fa-caret-down'); 9 | i.querySelector('.icon i').classList.add('fa-caret-right'); 10 | } 11 | }); 12 | 13 | let active = null; 14 | for (let i = 0; i < items.length; i++) { 15 | const item = items[i]; 16 | if (item.querySelector('a').classList.contains('is-active')) { 17 | active = item; 18 | break; 19 | } 20 | } 21 | 22 | if (active) { 23 | let activeLi = active; 24 | while (activeLi) { 25 | if (activeLi.querySelector('ul')) { 26 | activeLi.querySelector('.icon i').classList.remove('fa-caret-right'); 27 | activeLi.querySelector('.icon i').classList.add('fa-caret-down'); 28 | activeLi.querySelector('.folder').classList.remove('fa-folder-o'); 29 | activeLi.querySelector('.folder').classList.add('fa-folder-open-o'); 30 | activeLi.querySelector('ul').style.display = 'block'; 31 | } 32 | if (firstLevel.indexOf(activeLi) < 0) { 33 | activeLi = activeLi.parentNode.parentNode; 34 | } else { 35 | break; 36 | } 37 | } 38 | } 39 | 40 | // icon listener 41 | const icons = [].slice.call(document.querySelectorAll('.menu li a .icon i')); 42 | for (let i = 0; i < icons.length; i++) { 43 | let icon = icons[i]; 44 | const icon_container = icon.parentNode; 45 | icon_container.addEventListener('click', (e) => { 46 | e.preventDefault(); 47 | const icon = e.target.querySelector('i') || e.target; 48 | const childList = icon.parentNode.parentNode.nextElementSibling; 49 | const folderIcon = icon.parentNode.nextElementSibling; 50 | if (icon.classList.contains('fa-caret-right')) { 51 | icon.classList.remove('fa-caret-right'); 52 | icon.classList.add('fa-caret-down'); 53 | folderIcon.classList.remove('fa-folder-o'); 54 | folderIcon.classList.add('fa-folder-open-o'); 55 | childList.style.display = 'block'; 56 | } else { 57 | icon.classList.add('fa-caret-right'); 58 | icon.classList.remove('fa-caret-down'); 59 | folderIcon.classList.remove('fa-folder-open-o'); 60 | folderIcon.classList.add('fa-folder-o'); 61 | childList.style.display = 'none'; 62 | } 63 | }, true); 64 | } 65 | } 66 | 67 | module.exports = menuHandler; 68 | -------------------------------------------------------------------------------- /theme/chapters.template: -------------------------------------------------------------------------------- 1 | 44 | 45 | 75 | -------------------------------------------------------------------------------- /sass/generic.scss: -------------------------------------------------------------------------------- 1 | html { 2 | background-color: hsl(0, 0%, 100%); 3 | font-size: 16px; 4 | -moz-osx-font-smoothing: grayscale; 5 | -webkit-font-smoothing: antialiased; 6 | min-width: 300px; 7 | overflow-x: hidden; 8 | overflow-y: scroll; 9 | text-rendering: optimizeLegibility; 10 | -webkit-text-size-adjust: 100%; 11 | -moz-text-size-adjust: 100%; 12 | text-size-adjust: 100%; 13 | } 14 | 15 | article, 16 | aside, 17 | figure, 18 | footer, 19 | header, 20 | hgroup, 21 | section { 22 | display: block; 23 | } 24 | 25 | body, 26 | button, 27 | input, 28 | optgroup, 29 | select, 30 | textarea { 31 | font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; 32 | } 33 | 34 | code, 35 | pre { 36 | -moz-osx-font-smoothing: auto; 37 | -webkit-font-smoothing: auto; 38 | font-family: monospace; 39 | } 40 | 41 | body { 42 | color: hsl(0, 0%, 29%); 43 | font-size: 1em; 44 | font-weight: 400; 45 | line-height: 1.5; 46 | } 47 | 48 | a { 49 | color: hsl(229, 53%, 53%); 50 | cursor: pointer; 51 | text-decoration: none; 52 | } 53 | a strong { 54 | color: currentColor; 55 | } 56 | a:hover { 57 | color: hsl(0, 0%, 21%); 58 | } 59 | 60 | code { 61 | background-color: hsl(0, 0%, 96%); 62 | color: #da1039; 63 | font-size: 0.875em; 64 | font-weight: normal; 65 | padding: 0.25em 0.5em 0.25em; 66 | } 67 | 68 | hr { 69 | background-color: hsl(0, 0%, 96%); 70 | border: none; 71 | display: block; 72 | height: 2px; 73 | margin: 1.5rem 0; 74 | } 75 | 76 | img { 77 | height: auto; 78 | max-width: 100%; 79 | } 80 | 81 | input[type=checkbox], 82 | input[type=radio] { 83 | vertical-align: baseline; 84 | } 85 | 86 | small { 87 | font-size: 0.875em; 88 | } 89 | 90 | span { 91 | font-style: inherit; 92 | font-weight: inherit; 93 | } 94 | 95 | strong { 96 | color: hsl(0, 0%, 21%); 97 | font-weight: 700; 98 | } 99 | 100 | fieldset { 101 | border: none; 102 | } 103 | 104 | pre { 105 | -webkit-overflow-scrolling: touch; 106 | background-color: hsl(0, 0%, 96%); 107 | color: hsl(0, 0%, 29%); 108 | font-size: 0.875em; 109 | overflow-x: auto; 110 | padding: 1.25rem 1.5rem; 111 | white-space: pre; 112 | word-wrap: normal; 113 | } 114 | pre code { 115 | background-color: transparent; 116 | color: currentColor; 117 | font-size: 1em; 118 | padding: 0; 119 | } 120 | 121 | table td, 122 | table th { 123 | vertical-align: top; 124 | } 125 | table td:not([align]), 126 | table th:not([align]) { 127 | text-align: inherit; 128 | } 129 | table th { 130 | color: hsl(0, 0%, 21%); 131 | } 132 | 133 | @keyframes spinAround { 134 | from { 135 | transform: rotate(0deg); 136 | } 137 | to { 138 | transform: rotate(359deg); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /theme/script.template: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 18 | 19 | 28 | 29 | <% if (typeof hasComments === 'undefined' || !hasComments) { %> 30 | <% } else { %> 31 | 51 | <% } %> 52 | 53 | 54 | 72 | -------------------------------------------------------------------------------- /sass/highlight.sass: -------------------------------------------------------------------------------- 1 | .hljs 2 | margin-bottom: 1rem 3 | border-radius: 0.5rem 4 | overflow: auto 5 | display: block 6 | overflow-x: auto 7 | padding: 0.5em 8 | background: #23241f 9 | code 10 | background: #23241f 11 | color: #f8f8f2 12 | direction: ltr 13 | font-family: Consolas,"Courier New",Courier,FreeMono,monospace 14 | 15 | .hljs, 16 | .hljs-tag, 17 | .hljs-subst 18 | color: #f8f8f2 19 | 20 | .hljs-strong, 21 | .hljs-emphasis 22 | color: #a8a8a2 23 | 24 | .hljs-bullet, 25 | .hljs-quote, 26 | .hljs-number, 27 | .hljs-regexp, 28 | .hljs-literal, 29 | .hljs-link 30 | color: #ae81ff 31 | 32 | .hljs-code, 33 | .hljs-title, 34 | .hljs-section, 35 | .hljs-selector-class 36 | color: #a6e22e 37 | 38 | .hljs-strong 39 | font-weight: bold 40 | 41 | .hljs-emphasis 42 | font-style: italic 43 | 44 | .hljs-keyword, 45 | .hljs-selector-tag, 46 | .hljs-name, 47 | .hljs-attr 48 | color: #f92672 49 | 50 | .hljs-symbol, 51 | .hljs-attribute 52 | color: #66d9ef 53 | 54 | .hljs-params, 55 | .hljs-class .hljs-title 56 | color: #f8f8f2 57 | 58 | .hljs-string, 59 | .hljs-type, 60 | .hljs-built_in, 61 | .hljs-builtin-name, 62 | .hljs-selector-id, 63 | .hljs-selector-attr, 64 | .hljs-selector-pseudo, 65 | .hljs-addition, 66 | .hljs-variable, 67 | .hljs-template-variable 68 | color: #e6db74 69 | 70 | .hljs-comment, 71 | .hljs-deletion, 72 | .hljs-meta 73 | color: #57A64A 74 | 75 | .hljs 76 | background-color: #23241f 77 | color: #586e75 78 | .c 79 | color: #93a1a1 80 | .err, 81 | .g 82 | color: #586e75 83 | .k 84 | color: #859900 85 | .l, 86 | .n 87 | color: #586e75 88 | .o 89 | color: #859900 90 | .x 91 | color: #cb4b16 92 | .p 93 | color: #586e75 94 | .cm 95 | color: #93a1a1 96 | .cp 97 | color: #859900 98 | .c1 99 | color: #93a1a1 100 | .cs 101 | color: #859900 102 | .gd 103 | color: #2aa198 104 | .ge 105 | color: #586e75 106 | font-style: italic 107 | .gr 108 | color: #dc322f 109 | .gh 110 | color: #cb4b16 111 | .gi 112 | color: #859900 113 | .go, 114 | .gp 115 | color: #586e75 116 | .gs 117 | color: #586e75 118 | font-weight: bold 119 | .gu 120 | color: #cb4b16 121 | .gt 122 | color: #586e75 123 | .kc 124 | color: #cb4b16 125 | .kd 126 | color: #268bd2 127 | .kn, 128 | .kp 129 | color: #859900 130 | .kr 131 | color: #268bd2 132 | .kt 133 | color: #dc322f 134 | .ld 135 | color: #586e75 136 | .m, 137 | .s 138 | color: #2aa198 139 | .na 140 | color: #B58900 141 | .nb 142 | color: #586e75 143 | .nc 144 | color: #268bd2 145 | .no 146 | color: #cb4b16 147 | .nd 148 | color: #268bd2 149 | .ni, 150 | .ne 151 | color: #cb4b16 152 | .nf 153 | color: #268bd2 154 | .nl, 155 | .nn, 156 | .nx, 157 | .py 158 | color: #586e75 159 | .nt, 160 | .nv 161 | color: #268bd2 162 | .ow 163 | color: #859900 164 | .w 165 | color: #586e75 166 | .mf, 167 | .mh, 168 | .mi, 169 | .mo 170 | color: #2aa198 171 | .sb 172 | color: #93a1a1 173 | .sc 174 | color: #2aa198 175 | .sd 176 | color: #586e75 177 | .s2 178 | color: #2aa198 179 | .se 180 | color: #cb4b16 181 | .sh 182 | color: #586e75 183 | .si, 184 | .sx 185 | color: #2aa198 186 | .sr 187 | color: #dc322f 188 | .s1, 189 | .ss 190 | color: #2aa198 191 | .bp, 192 | .vc, 193 | .vg, 194 | .vi 195 | color: #268bd2 196 | .il 197 | color: #2aa198 198 | 199 | -------------------------------------------------------------------------------- /sass/wangdoc.sass: -------------------------------------------------------------------------------- 1 | // 1. Import the initial variables 2 | @use "bulma/sass" 3 | @use "./generic.scss" 4 | @use "./highlight.sass" 5 | 6 | /* social-share */ 7 | @use "./social.scss" 8 | 9 | /* 10 | * main titles 11 | */ 12 | .main 13 | h1 14 | font-size: sass.$size-1 15 | h2 16 | font-size: sass.$size-2 17 | h3 18 | font-size: sass.$size-3 19 | 20 | /* 21 | * navbar 22 | */ 23 | .navbar-brand .title 24 | margin-bottom: 0 25 | 26 | 27 | /* 28 | * article font 29 | */ 30 | .article 31 | line-height: 1.6 32 | letter-spacing: 0.04rem 33 | 34 | 35 | /* 36 | * article title counter 37 | */ 38 | .article .content 39 | counter-reset: firstLevelTitle 40 | 41 | .article .content > h2::before 42 | counter-increment: firstLevelTitle 43 | content: counter(firstLevelTitle) '. ' 44 | 45 | .article .content > h2:only-of-type::before 46 | content: '' 47 | 48 | .article .content > h2 49 | counter-reset: secondLevelTitle 50 | 51 | .article .content > h3::before 52 | counter-increment: secondLevelTitle 53 | content: counter(firstLevelTitle) '.' counter(secondLevelTitle) ' ' 54 | 55 | .article .content .first-level-collapse 56 | display: none 57 | 58 | /* 59 | * article-title 60 | */ 61 | 62 | article.content h2 a, 63 | article.content h3 a 64 | display: none 65 | 66 | article.content h2:hover a, 67 | article.content h3:hover a 68 | display: inline 69 | 70 | article .page-meta 71 | margin: 1em auto 72 | p 73 | color: var(--bulma-grey-light) 74 | text-align: right 75 | font-size: 85% 76 | a, 77 | a:hover 78 | color: var(--bulma-grey-light) 79 | cursor: default 80 | 81 | /* page info */ 82 | .page-info 83 | border-top: 1px solid var(--bulma-grey-light) 84 | padding-top: 1em 85 | p 86 | color: var(--bulma-grey-light) 87 | line-height: 2 88 | 89 | /* 90 | * breadcrumb icon 91 | */ 92 | 93 | .breadcrumb .icon:last-child, 94 | .breadcrumb .icon:first-child 95 | margin-left: 0px 96 | margin-right: 0px 97 | 98 | /* 99 | * previous-next nav 100 | */ 101 | .level-previous-next 102 | padding: 1em 103 | background: var(--bulma-light) 104 | .level-left, .level-right 105 | width: 48% 106 | overflow: hidden 107 | text-overflow: ellipsis 108 | 109 | /* 110 | * article-toc 111 | */ 112 | .article-toc 113 | border: 1px solid #aaa 114 | background-color: #f9f9f9 115 | display: table 116 | padding: 1rem 117 | 118 | .article-toc ul 119 | margin-left: 0.5rem 120 | margin-right: 0.5rem 121 | 122 | .article-toc > ul 123 | counter-reset: articleTOCFirstLevel 124 | 125 | .article-toc > ul > li 126 | list-style-type: none 127 | counter-reset: articleTOCSecondLevel 128 | 129 | .article-toc > ul > li::before 130 | counter-increment: articleTOCFirstLevel 131 | content: counter(articleTOCFirstLevel) '. ' 132 | 133 | .article-toc > ul > li > ul > li 134 | list-style-type: none 135 | 136 | .article-toc > ul > li > ul > li::before 137 | counter-increment: articleTOCSecondLevel 138 | content: counter(articleTOCFirstLevel) '.' counter(articleTOCSecondLevel) ' ' 139 | 140 | .toc-controller 141 | font-size: 80% 142 | a 143 | display: inline-block!important 144 | 145 | .markdownIt-TOC 146 | animation: fadein 1s 147 | 148 | @keyframes fadein 149 | from 150 | opacity: 0 151 | to 152 | opacity: 1 153 | 154 | /* comments */ 155 | #disqus_thread 156 | border-top: 1px solid sass.$grey-light 157 | padding-top: 1em 158 | 159 | /* menu */ 160 | .panel-menu .panel-block, 161 | .panel-info .panel-block 162 | padding: 0.5em 0.75em 0.5em 0em 163 | padding-left: 0em 164 | .menu 165 | font-size: 95% 166 | width: 100% 167 | .menu-list 168 | a 169 | padding-left: 0em 170 | display: flex 171 | word-break: break-all 172 | .menu-list-title 173 | width: calc(100% - 1.5rem - 14px - 8px) 174 | a.is-active 175 | color: sass.$grey-dark 176 | background-color: sass.$white-ter 177 | li 178 | .icon 179 | margin-top: -4px 180 | 181 | /* menu counter */ 182 | .menu-list 183 | counter-reset: chapter section 184 | > li 185 | counter-increment: chapter 186 | > a .menu-list-title:before 187 | font-weight: 700 188 | content: ' ' counter(chapter) '. ' 189 | > ul 190 | counter-reset: section 191 | > li 192 | counter-increment: section 193 | > a .menu-list-title:before 194 | font-weight: 700 195 | content: ' ' counter(chapter) '.' counter(section) ' ' 196 | 197 | 198 | -------------------------------------------------------------------------------- /sass/social.scss: -------------------------------------------------------------------------------- 1 | /* purgecss start ignore */ 2 | @font-face {font-family: "socialshare"; 3 | src: url('../fonts/iconfont.eot'); /* IE9*/ 4 | src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('../fonts/iconfont.woff') format('woff'), /* chrome, firefox */ 6 | url('../fonts/iconfont.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('../fonts/iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .social-share { 11 | font-family:"socialshare" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -webkit-text-stroke-width: 0.2px; 16 | -moz-osx-font-smoothing: grayscale; 17 | * { 18 | font-family:"socialshare" !important; 19 | } 20 | .icon-tencent:before { content: "\f07a"; } 21 | .icon-qq:before { content: "\f11a"; } 22 | .icon-weibo:before { content: "\f12a"; } 23 | .icon-wechat:before { content: "\f09a"; } 24 | .icon-douban:before { content: "\f10a"; } 25 | .icon-heart:before { content: "\f20a"; } 26 | .icon-like:before { content: "\f00a"; } 27 | .icon-qzone:before { content: "\f08a"; } 28 | .icon-linkedin:before { content: "\f01a"; } 29 | .icon-diandian:before { content: "\f05a"; } 30 | .icon-facebook:before { content: "\f03a"; } 31 | .icon-google:before { content: "\f04a"; } 32 | .icon-twitter:before { content: "\f06a"; } 33 | 34 | a { 35 | position:relative; 36 | text-decoration:none; 37 | margin: 4px; 38 | display:inline-block; 39 | outline: none; 40 | cursor: pointer !important; 41 | } 42 | 43 | .social-share-icon { 44 | position:relative; 45 | display:inline-block; 46 | width: 32px; 47 | height: 32px; 48 | font-size: 20px; 49 | border-radius: 50%; 50 | line-height: 32px; 51 | border:1px solid #666; 52 | color: #666; 53 | text-align: center; 54 | vertical-align: middle; 55 | transition: background 0.6s ease-out 0s; 56 | 57 | &:hover{ 58 | background: #666; 59 | color: #fff; 60 | } 61 | } 62 | 63 | .icon-weibo{ 64 | color:#ff763b;border-color:#ff763b; 65 | &:hover{ 66 | background:#ff763b; 67 | } 68 | } 69 | .icon-tencent{ 70 | color:#56b6e7;border-color:#56b6e7; 71 | &:hover{ 72 | background:#56b6e7; 73 | } 74 | } 75 | .icon-qq{ 76 | color:#56b6e7;border-color:#56b6e7; 77 | &:hover{ 78 | background:#56b6e7; 79 | } 80 | } 81 | .icon-qzone{ 82 | color:#FDBE3D;border-color:#FDBE3D; 83 | &:hover{ 84 | background:#FDBE3D; 85 | } 86 | } 87 | .icon-douban{ 88 | color:#33b045;border-color:#33b045; 89 | &:hover{ 90 | background:#33b045; 91 | } 92 | } 93 | .icon-linkedin{ 94 | color:#0077B5;border-color:#0077B5; 95 | &:hover{ 96 | background:#0077B5; 97 | } 98 | } 99 | .icon-facebook { 100 | color:#44619D;border-color:#44619D; 101 | &:hover{ 102 | background:#44619D; 103 | } 104 | } 105 | .icon-google { 106 | color:#db4437;border-color:#db4437; 107 | &:hover{ 108 | background:#db4437; 109 | } 110 | } 111 | .icon-twitter { 112 | color:#55acee;border-color:#55acee; 113 | &:hover{ 114 | background:#55acee; 115 | } 116 | } 117 | .icon-diandian {color:#307DCA; border-color:#307DCA; 118 | 119 | &:hover{ 120 | background:#307DCA; 121 | } 122 | } 123 | .icon-wechat{ 124 | position:relative;color:#7bc549;border-color:#7bc549; 125 | &:hover{ 126 | background:#7bc549; 127 | } 128 | } 129 | .icon-wechat .wechat-qrcode{display: none;border: 1px solid #eee;position:absolute;z-index:9;top:-205px;left:-84px;width:200px;height:192px;color:#666;font-size:12px;text-align:center;background-color:#fff;box-shadow:0 2px 10px #aaa;transition:all 200ms;-webkit-tansition:all 350ms;-moz-transition:all 350ms; } 130 | .icon-wechat .wechat-qrcode.bottom { 131 | top:40px; 132 | left:-84px; 133 | &:after { 134 | display:none; 135 | } 136 | } 137 | .icon-wechat .wechat-qrcode h4{font-weight:normal;height:26px;line-height:26px;font-size:12px; background-color:#f3f3f3; margin:0;padding:0;color: #777; } 138 | .icon-wechat .wechat-qrcode .qrcode{width:105px; margin:10px auto;} 139 | .icon-wechat .wechat-qrcode .qrcode table{margin:0!important;} 140 | .icon-wechat .wechat-qrcode .help p{font-weight:normal;line-height:16px;padding:0;margin:0;} 141 | .icon-wechat .wechat-qrcode:after{content:'';position:absolute;left:50%;margin-left:-6px;bottom:-13px;width:0;height:0;border-width:8px 6px 6px 6px;border-style:solid;border-color:#fff transparent transparent transparent} 142 | .icon-wechat:hover .wechat-qrcode{display: block;} 143 | } 144 | /* purgecss end ignore */ 145 | -------------------------------------------------------------------------------- /theme/assets/fonts/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Created by FontForge 20120731 at Sat Nov 28 22:48:50 2015 6 | By Ads 7 | 8 | 9 | 10 | 24 | 26 | 28 | 30 | 32 | 36 | 39 | 42 | 44 | 50 | 53 | 57 | 61 | 65 | 71 | 73 | 78 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /theme/assets/js/social-share.min.js: -------------------------------------------------------------------------------- 1 | var QRCode;!function(){function t(t){this.mode=s.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(i[0]=240|(1835008&n)>>>18,i[1]=128|(258048&n)>>>12,i[2]=128|(4032&n)>>>6,i[3]=128|63&n):n>2048?(i[0]=224|(61440&n)>>>12,i[1]=128|(4032&n)>>>6,i[2]=128|63&n):n>128?(i[0]=192|(1984&n)>>>6,i[1]=128|63&n):i[0]=n,this.parsedData.push(i)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function r(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);for(var r=0;rd.length)throw new Error("Too long data");return r}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(this.modules[t+r][e+i]=0<=r&&r<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=i&&i<=4)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var i=u.getLostPoint(this);(0==r||t>i)&&(t=i,e=r)}return e},createMovieClip:function(t,e,r){var i=t.createEmptyMovieClip(e,r);this.make();for(var n=0;n>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=i}for(r=0;r<18;r++){var i=!t&&1==(e>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=i}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,i=u.getBCHTypeInfo(r),n=0;n<15;n++){o=!t&&1==(i>>n&1);n<6?this.modules[n][8]=o:n<8?this.modules[n+1][8]=o:this.modules[this.moduleCount-15+n][8]=o}for(n=0;n<15;n++){var o=!t&&1==(i>>n&1);n<8?this.modules[8][this.moduleCount-n-1]=o:n<9?this.modules[8][15-n-1+1]=o:this.modules[8][15-n-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,i=this.moduleCount-1,n=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[i][a-s]){var h=!1;o>>n&1));u.getMask(e,i,a-s)&&(h=!h),this.modules[i][a-s]=h,-1==--n&&(o++,n=7)}if((i+=r)<0||this.moduleCount<=i){i-=r,r=-r;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,r,o){for(var a=i.getRSBlocks(t,r),s=new n,h=0;h8*c)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*c+")");for(s.getLengthInBits()+4<=8*c&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;;){if(s.getLengthInBits()>=8*c)break;if(s.put(e.PAD0,8),s.getLengthInBits()>=8*c)break;s.put(e.PAD1,8)}return e.createBytes(s,a)},e.createBytes=function(t,e){for(var i=0,n=0,o=0,a=new Array(e.length),s=new Array(e.length),h=0;h=0?d.get(g):0}}for(var p=0,m=0;m=0;)e^=u.G15<=0;)e^=u.G18<>>=1;return e},getPatternPosition:function(t){return u.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case l.PATTERN000:return(e+r)%2==0;case l.PATTERN001:return e%2==0;case l.PATTERN010:return r%3==0;case l.PATTERN011:return(e+r)%3==0;case l.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case l.PATTERN101:return e*r%2+e*r%3==0;case l.PATTERN110:return(e*r%2+e*r%3)%2==0;case l.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new r([1],0),i=0;i5&&(r+=3+n-5)}for(i=0;i=256;)t-=255;return c.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},f=0;f<8;f++)c.EXP_TABLE[f]=1<>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var d=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],g=function(){var t=function(t,e){this._el=t,this._htOption=e};return t.prototype.draw=function(t){function e(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e)e.hasOwnProperty(i)&&r.setAttribute(i,e[i]);return r}var r=this._htOption,i=this._el,n=t.getModuleCount();Math.floor(r.width/n),Math.floor(r.height/n);this.clear();var o=e("svg",{viewBox:"0 0 "+String(n)+" "+String(n),width:"100%",height:"100%",fill:r.colorLight});o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),i.appendChild(o),o.appendChild(e("rect",{fill:r.colorLight,width:"100%",height:"100%"})),o.appendChild(e("rect",{fill:r.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a'],s=0;s");for(var h=0;h');a.push("")}a.push(""),r.innerHTML=a.join("");var l=r.childNodes[0],u=(e.width-l.offsetWidth)/2,c=(e.height-l.offsetHeight)/2;u>0&&c>0&&(l.style.margin=c+"px "+u+"px")},t.prototype.clear=function(){this._el.innerHTML=""},t}():function(){function t(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}if(this._android&&this._android<=2.1){var e=1/window.devicePixelRatio,r=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(t,i,n,o,a,s,h,l,u){if("nodeName"in t&&/img/i.test(t.nodeName))for(var c=arguments.length-1;c>=1;c--)arguments[c]=arguments[c]*e;else void 0===l&&(arguments[1]*=e,arguments[2]*=e,arguments[3]*=e,arguments[4]*=e);r.apply(this,arguments)}}var i=function(t,e){this._bIsPainted=!1,this._android=o(),this._htOption=e,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=e.width,this._elCanvas.height=e.height,t.appendChild(this._elCanvas),this._el=t,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return i.prototype.draw=function(t){var e=this._elImage,r=this._oContext,i=this._htOption,n=t.getModuleCount(),o=i.width/n,a=i.height/n,s=Math.round(o),h=Math.round(a);e.style.display="none",this.clear();for(var l=0;l=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=h}(),function(t,e,r){function i(t,e){var i=function(){var t=arguments;if(u)return u.apply(null,t);var e={};return h(t,function(t){h(t,function(t,r){e[r]=t})}),t[0]=e}({},v,e||{},function(t){if(t.dataset)return JSON.parse(JSON.stringify(t.dataset));var e={};if(t.hasAttributes())return h(t.attributes,function(t){var r=t.name;if(0!==r.indexOf("data-"))return!0;r=r.replace(/^data-/i,"").replace(/-(\w)/g,function(t,e){return e.toUpperCase()}),e[r]=t.value}),e;return{}}(t));i.imageSelector&&(i.image=n(i.imageSelector).map(function(t){return t.src}).join("||")),function(t,e){if(e&&"string"==typeof e){var r=" ";h((t.className+" "+e).split(/\s+/),function(t){r.indexOf(" "+t+" ")<0&&(r+=t+" ")}),t.className=r.slice(1,-1)}}(t,"share-component social-share"),function(t,e){var i=function(t){t.mobileSites.length||(t.mobileSites=t.sites);var e=(f?t.mobileSites:t.sites).slice(0),r=t.disabled;"string"==typeof e&&(e=e.split(/\s*,\s*/));"string"==typeof r&&(r=r.split(/\s*,\s*/));c&&r.push("wechat");return r.length&&h(r,function(t){e.splice(function(t,e,r){var i;if(e){if(l)return l.call(e,t,r);for(i=e.length,r=r?r<0?Math.max(0,i+r):r:0;r