├── bin ├── yon.1800281736 ├── index.js ├── index.js.2823554546 ├── index.js.3183120076 ├── yon └── yon.3955132297 ├── .idea ├── .gitignore ├── misc.xml ├── vcs.xml ├── inspectionProfiles │ └── Project_Default.xml ├── modules.xml └── ynpm-tool.iml ├── .DS_Store ├── _docs ├── source │ ├── ZeroClipboard.swf │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── patch.css │ ├── shBrush-js.js │ ├── highlight.min.css │ ├── shBrush-css.js │ ├── shBrush-sass.js │ ├── shCoreDefault.css │ ├── shCore.js │ ├── docs.min.css │ ├── app.css │ └── bootstrap.min.js ├── release.html ├── index.html └── progress.html ├── README_CN.md ├── src ├── sync.js ├── global.js ├── npm.js ├── update.js ├── updateInfo.js ├── reinstall.js ├── help.js ├── reportInfo │ └── index.js ├── publish.js ├── index.js ├── install.js └── utils.js ├── CHANGELOG.md ├── .gitignore ├── TodoList.md ├── tdoc.config ├── package.json └── README.md /bin/yon.1800281736: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iuap-design/ynpm-tool/HEAD/.DS_Store -------------------------------------------------------------------------------- /_docs/source/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iuap-design/ynpm-tool/HEAD/_docs/source/ZeroClipboard.swf -------------------------------------------------------------------------------- /_docs/source/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iuap-design/ynpm-tool/HEAD/_docs/source/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /_docs/source/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iuap-design/ynpm-tool/HEAD/_docs/source/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /_docs/source/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iuap-design/ynpm-tool/HEAD/_docs/source/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /_docs/source/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iuap-design/ynpm-tool/HEAD/_docs/source/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # ynpm - 内部镜像 2 | 3 | 设置用户名 4 | $ ynpm set user="ahua" 5 | 设置email 6 | $ ynpm set email=yon@yonyou.com 7 | 生成key 8 | $ ynpm sshk 9 | 10 | //发内网包 11 | ynpmdev publish inner @yonyou/ac-pagination 12 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bin/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | let {userInfo} = require('../src/reportInfo/index'); 6 | // var argv = require('minimist')(process.argv.slice(2)); 7 | // var commands = argv._; 8 | 9 | // userInfo(); 10 | 11 | let global = require('../src/utils'); 12 | 13 | var opts = { 14 | cmd: process.argv[2], 15 | // argv: argv, 16 | name: "init" 17 | }; 18 | 19 | require("../src").plugin(opts, global); 20 | -------------------------------------------------------------------------------- /bin/index.js.2823554546: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | let {userInfo} = require('../src/reportInfo/index'); 6 | // var argv = require('minimist')(process.argv.slice(2)); 7 | // var commands = argv._; 8 | 9 | // userInfo(); 10 | 11 | let global = require('../src/utils'); 12 | 13 | var opts = { 14 | cmd: process.argv[2], 15 | // argv: argv, 16 | name: "init" 17 | }; 18 | 19 | require("../src").plugin(opts, global); 20 | -------------------------------------------------------------------------------- /bin/index.js.3183120076: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | let {userInfo} = require('../src/reportInfo/index'); 6 | // var argv = require('minimist')(process.argv.slice(2)); 7 | // var commands = argv._; 8 | 9 | // userInfo(); 10 | 11 | let global = require('../src/utils'); 12 | 13 | var opts = { 14 | cmd: process.argv[2], 15 | // argv: argv, 16 | name: "init" 17 | }; 18 | 19 | require("../src").plugin(opts, global); 20 | -------------------------------------------------------------------------------- /.idea/ynpm-tool.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /_docs/source/patch.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Helvetica Neue", Helvetica, Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif; 3 | } 4 | 5 | .bs-example:after { 6 | content: "实例:" !important; 7 | } 8 | 9 | .bs-docs-section > p, .bs-docs-section > ul, 10 | .bs-docs-section > ol, .bs-callout > p, 11 | .bs-callout > ol, .bs-callout > ul { 12 | font-size: 16px; 13 | line-height: 1.75; 14 | margin-bottom: 1em; 15 | } 16 | 17 | .bs-callout *:last-child { 18 | margin-bottom: 0; 19 | } -------------------------------------------------------------------------------- /src/sync.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const ora = require('ora'); 4 | const co = require('co'); 5 | const chalk = require('chalk'); 6 | const {sync} = require('./utils'); 7 | module.exports = () => { 8 | const spinner = ora().start(); 9 | spinner.color = 'green'; 10 | co(function* () { 11 | const argvs = process.argv; 12 | const name = argvs.slice(3); 13 | if(name[0]) { 14 | yield sync(name[0]); 15 | spinner.stop(); 16 | } else { 17 | console.error(chalk.red('\n' + 'Please enter the package name')); 18 | } 19 | process.exit(0); 20 | }).catch(err => { 21 | spinner.stop(); 22 | console.error(chalk.red('\n' + err)); 23 | process.exit(0); 24 | }); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.2.2(2017-12-15) 2 | 3 | ### Fixs 4 | 5 | * Finsh Install or Publish, Process exit status from 1 to 0 6 | 7 | 8 | ## 0.2.1(2017-12-14) 9 | 10 | ### Fixs 11 | 12 | * `ini` module cant find 13 | 14 | 15 | ## 0.2.0(2017-12-13) 16 | 17 | ###Features 18 | 19 | * `ynpm publish` 20 | * `ynpm publish inner` 21 | * Auth management 22 | 23 | 24 | 25 | ## 0.1.0(2017-11-30) 26 | 27 | ### Fixs 28 | 29 | * install package very slow bug (ip error) 30 | 31 | 32 | 33 | ## 0.0.8(2017-10-23) 34 | 35 | ### Features 36 | 37 | Release NPM Mirror Command Tool 38 | 39 | * `ynpm install` : Install package automatic to change npm mirror registry 40 | * `ynpm --help`: The comand tool info -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | node_modules 40 | 41 | package-lock.json 42 | .vscode 43 | -------------------------------------------------------------------------------- /src/global.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var Global = function () { 4 | console.log(" Global "); 5 | }; 6 | 7 | Global.prototype = { 8 | registry: '', 9 | /** 10 | * 存储活动信息 11 | */ 12 | actInfo: {}, 13 | 14 | 15 | getPing: function () { 16 | 17 | this.registry = "www"; 18 | }, 19 | /** 20 | * 获取当前用户信息 21 | */ 22 | getUserInfo: function () { 23 | var promise = http.fetch({ 24 | url: api.getUserInfo(), 25 | data: { 26 | activityId: this.getAcid(), 27 | userToken: this.getUserToken() 28 | } 29 | }); 30 | 31 | promise.done((res) => { 32 | if (res.errcode == 0) { 33 | if (res.data.host == 1) { 34 | this.userInfo = res.data; 35 | } else { 36 | this.hostUserInfo = res.data; 37 | } 38 | } 39 | 40 | }); 41 | return promise; 42 | } 43 | } 44 | 45 | module.exports = new Global(); 46 | -------------------------------------------------------------------------------- /src/npm.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const chalk = require('chalk'); 3 | const spawn = require('cross-spawn'); 4 | const npmBin = path.join(__dirname, '..', 'node_modules', '.bin', 'npm'); 5 | const argvs = process.argv; 6 | const env = Object.assign({}, process.env); 7 | const CWD = process.cwd(); 8 | const {YON_INNER_MIRROR} = require('./utils'); 9 | const co = require('co'); 10 | const stdio = [ 11 | process.stdin, 12 | process.stdout, 13 | process.stderr, 14 | ]; 15 | 16 | module.exports = () => { 17 | co(function* () { 18 | const argv = argvs.slice(2); 19 | argv.push(`--registry=${YON_INNER_MIRROR}`); 20 | const child = spawn(npmBin, argv, { 21 | env, 22 | cwd: CWD, 23 | stdio, 24 | }); 25 | child.on('exit', code => { 26 | process.exit(code); 27 | }); 28 | }).catch(err => { 29 | console.error(chalk.red('\n' + err)); 30 | }); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /TodoList.md: -------------------------------------------------------------------------------- 1 | 2 | #### Todo 3 | 4 | - 增加自定义镜像选择 5 | - 增加内部发包功能`ynpm publish`✅ 6 | - 内部发包权限管理✅ 7 | - 实现npm私有镜像镜像`@`下载 ✅ 8 | - 给出下载进度 9 | - 去除`If happen error, call me, my mobile is 186`✅ 10 | 11 | 12 | - ynpm-tools 部分 13 | 14 | 1. sshk 的时候,npmrc文件中 _auth 没写进去。 15 | 2. sshk 提示信息不全。完整提示网站地址。 16 | 3. set email的时候,直接生成sshk,且提示出来。 17 | 4. 增加ynpm sshk 只是获取sshk的提示,进行展示。 18 | 5. publish 19 | 6. install 需测试npm包是否冲突问题。安装到本地是否可用。 20 | 7. 尝试npm register 方式调用 install,去掉npminstall 包的依赖。 21 | 22 | 23 | - npm publish 部分 24 | 25 | 1. uiser_id 未存进去数据库。 26 | 2. 根据auth查询改成根据user_id 查询。 27 | 28 | 29 | - web 部分 30 | 31 | 1. 新手指南、安装使用教程 32 | 2. 我发布的页面,要根据user_id 33 | 3. 组件详情页面,为显示问题。 34 | 4. 热门包,过滤不对。 35 | 36 | 37 | - Nexus 38 | 39 | 1. Nexus账户同步到我们自己的数据库。 40 | 41 | 42 | - bug 43 | 44 | 1. npm install 包数量显示。 45 | 2. 界面UI,热门包显示问题。 46 | 3. 界面问题。setting不能点击。 47 | 4. 界面问题。刷新丢失数据问题。 48 | 5. 界面问题。刷新丢失数据问题。 49 | 6. publish 包的时候,错误提示不够明确。 50 | 7. install 包的时候,参数错误的提示要详细 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /tdoc.config: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Yon", 3 | "common": { 4 | "title": "Yon", 5 | "footer": "Made By YonYouFED. © 2014 - 2016", 6 | "home": "tinper", 7 | "homeUrl": "http://tinper.org/", 8 | "navbars": [] 9 | }, 10 | "options": { 11 | "markdown": { 12 | "menuLevel": 2 13 | } 14 | }, 15 | "pages": [{ 16 | "name": "index", 17 | "title": "开始", 18 | "banner": { 19 | "title": "Yon", 20 | "description": "开始" 21 | }, 22 | "content": "./README.md" 23 | }, { 24 | "name": "progress", 25 | "title": "进度", 26 | "banner": { 27 | "title": "Yon", 28 | "description": "进度" 29 | }, 30 | "content": "./progress.md" 31 | }, { 32 | "name": "release", 33 | "title": "版本", 34 | "banner": { 35 | "title": "Yon", 36 | "description": "版本" 37 | }, 38 | "content": "./release.md" 39 | }] 40 | } 41 | -------------------------------------------------------------------------------- /src/update.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const chalk = require('chalk'); 3 | const spawn = require('cross-spawn'); 4 | const ora = require('ora'); 5 | const co = require('co'); 6 | const npmBin = path.join(__dirname, '..', 'node_modules', '.bin', 'npm'); 7 | const argvs = process.argv; 8 | const env = Object.assign({}, process.env); 9 | const CWD = process.cwd(); 10 | 11 | const stdio = [ 12 | process.stdin, 13 | process.stdout, 14 | process.stderr, 15 | ]; 16 | 17 | module.exports = (registry) => { 18 | const spinner = ora().start(); 19 | spinner.color = 'green'; 20 | co(function* () { 21 | const argv = argvs.slice(2); 22 | argv.push(`--registry=${registry}`); 23 | if (!~argv.indexOf('--save') && !~argv.indexOf('--save-dev')) { 24 | argv.push('--no-save'); 25 | } 26 | const child = spawn(npmBin, argv, { 27 | env, 28 | cwd: CWD, 29 | stdio, 30 | }); 31 | child.on('exit', code => { 32 | if(code === 0) { 33 | console.log(chalk.green('Update Success!')) 34 | } 35 | process.exit(code); 36 | }); 37 | }).catch(err => { 38 | console.error(chalk.red('\n' + err)); 39 | }); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /_docs/source/shBrush-js.js: -------------------------------------------------------------------------------- 1 | ;(function () { 2 | // CommonJS 3 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined' ? require('shCore').SyntaxHighlighter : null); 4 | 5 | function Brush() { 6 | var keywords = 'break case catch class continue ' + 7 | 'default delete do else enum export extends false ' + 8 | 'for function if implements import in instanceof ' + 9 | 'interface let new null package private protected ' + 10 | 'static return super switch ' + 11 | 'this throw true try typeof var while with yield'; 12 | 13 | var r = SyntaxHighlighter.regexLib; 14 | 15 | this.regexList = [ 16 | {regex: r.multiLineDoubleQuotedString, css: 'string'}, // double quoted strings 17 | {regex: r.multiLineSingleQuotedString, css: 'string'}, // single quoted strings 18 | {regex: r.singleLineCComments, css: 'comments'}, // one line comments 19 | {regex: r.multiLineCComments, css: 'comments'}, // multiline comments 20 | {regex: /\s*#.*/gm, css: 'preprocessor'}, // preprocessor tags like #region and #endregion 21 | {regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword'} // keywords 22 | ]; 23 | 24 | this.forHtmlScript(r.scriptScriptTags); 25 | }; 26 | 27 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 28 | Brush.aliases = ['js', 'jscript', 'javascript', 'json']; 29 | 30 | SyntaxHighlighter.brushes.JScript = Brush; 31 | 32 | // CommonJS 33 | typeof (exports) != 'undefined' ? exports.Brush = Brush : null; 34 | })(); 35 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ynpm-tool", 3 | "version": "3.2.10", 4 | "description": "yonyou FED large front end technology department, an enterprise internal contracting tool.", 5 | "main": "lib/index.js", 6 | "bin": { 7 | "ynpmold": "bin/yon", 8 | "ynpm": "bin/index.js" 9 | }, 10 | "scripts": { 11 | "docs": "tdoc build" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/iuap-design/yon.git" 16 | }, 17 | "keywords": [], 18 | "author": "jonyshi@126.com", 19 | "license": "ISC", 20 | "dependencies": { 21 | "btoa": "^1.2.1", 22 | "chalk": "^1.1.3", 23 | "child-process-promise": "^2.2.1", 24 | "co": "^4.6.0", 25 | "ini": "^1.3.5", 26 | "moment": "^2.24.0", 27 | "node-fetch": "^2.1.2", 28 | "npm": "^6.11.3", 29 | "object-assign": "^4.1.1", 30 | "ora": "^1.1.0", 31 | "properties-parser": "^0.3.1", 32 | "request": "^2.81.0", 33 | "tcp-ping": "^0.1.1", 34 | "tdoc": "0.0.1", 35 | "thunkify": "^2.1.2" 36 | }, 37 | "devDependencies": { 38 | "autod": "2", 39 | "coffee": "3", 40 | "eslint": "3", 41 | "eslint-config-egg": "3", 42 | "intelli-espower-loader": "1", 43 | "istanbul": "*", 44 | "mm": "2", 45 | "mocha": "3", 46 | "power-assert": "1", 47 | "thunk-mocha": "1" 48 | }, 49 | "__npminstall_done": "Mon Sep 16 2019 15:02:31 GMT+0800 (GMT+08:00)", 50 | "_from": "ynpm-tool@3.1.3", 51 | "_resolved": "https://registry.npm.taobao.org/ynpm-tool/download/ynpm-tool-3.1.3.tgz" 52 | } 53 | -------------------------------------------------------------------------------- /_docs/source/highlight.min.css: -------------------------------------------------------------------------------- 1 | .hljs{display:block;overflow-x:auto;padding:0.5em;background:#f0f0f0;-webkit-text-size-adjust:none}.hljs,.hljs-subst,.hljs-tag .hljs-title,.nginx .hljs-title{color:black}.hljs-string,.hljs-title,.hljs-constant,.hljs-parent,.hljs-tag .hljs-value,.hljs-rule .hljs-value,.hljs-preprocessor,.hljs-pragma,.hljs-name,.haml .hljs-symbol,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.hljs-addition,.hljs-flow,.hljs-stream,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.tex .hljs-special,.erlang_repl .hljs-function_or_atom,.asciidoc .hljs-header,.markdown .hljs-header,.coffeescript .hljs-attribute,.tp .hljs-variable{color:#800}.smartquote,.hljs-comment,.hljs-annotation,.diff .hljs-header,.hljs-chunk,.asciidoc .hljs-blockquote,.markdown .hljs-blockquote{color:#888}.hljs-number,.hljs-date,.hljs-regexp,.hljs-literal,.hljs-hexcolor,.smalltalk .hljs-symbol,.smalltalk .hljs-char,.go .hljs-constant,.hljs-change,.lasso .hljs-variable,.makefile .hljs-variable,.asciidoc .hljs-bullet,.markdown .hljs-bullet,.asciidoc .hljs-link_url,.markdown .hljs-link_url{color:#080}.hljs-label,.ruby .hljs-string,.hljs-decorator,.hljs-filter .hljs-argument,.hljs-localvars,.hljs-array,.hljs-attr_selector,.hljs-important,.hljs-pseudo,.hljs-pi,.haml .hljs-bullet,.hljs-doctype,.hljs-deletion,.hljs-envvar,.hljs-shebang,.apache .hljs-sqbracket,.nginx .hljs-built_in,.tex .hljs-formula,.erlang_repl .hljs-reserved,.hljs-prompt,.asciidoc .hljs-link_label,.markdown .hljs-link_label,.vhdl .hljs-attribute,.clojure .hljs-attribute,.asciidoc .hljs-attribute,.lasso .hljs-attribute,.coffeescript .hljs-property,.hljs-phony{color:#88f}.hljs-keyword,.hljs-id,.hljs-title,.hljs-built_in,.css .hljs-tag,.hljs-doctag,.smalltalk .hljs-class,.hljs-winutils,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.hljs-type,.hljs-typename,.tex .hljs-command,.asciidoc .hljs-strong,.markdown .hljs-strong,.hljs-request,.hljs-status,.tp .hljs-data,.tp .hljs-io{font-weight:bold}.asciidoc .hljs-emphasis,.markdown .hljs-emphasis,.tp .hljs-units{font-style:italic}.nginx .hljs-built_in{font-weight:normal}.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5} -------------------------------------------------------------------------------- /src/updateInfo.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const moment = require('moment'); 6 | const ora = require('ora'); 7 | const co = require('co'); 8 | const chalk = require('chalk'); 9 | const {userInfo, setPackage} = require('./reportInfo/index'); 10 | const {getRc, HOST_REGISTRY, getPckParams, replaceErrMsg, getIPAdress, uploadReadme} = require('./utils'); 11 | const help = require('./help'); 12 | 13 | 14 | module.exports = (registry) => { 15 | const argvs = process.argv; 16 | const ip = getIPAdress(); 17 | const spinner = ora().start(); 18 | spinner.color = 'green'; 19 | co(function* () { 20 | if (argvs[2] == 'updateInfo') { 21 | var ynpmConfig = getRc("ynpm"); 22 | ynpmConfig.sshk = ynpmConfig._auth; 23 | var packOrigin = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'))); 24 | //validate user rolse 25 | let data = yield userInfo(packOrigin.name); 26 | if (!data) { 27 | help.setConfig(); 28 | spinner.stop(); 29 | process.exit(0); 30 | } else if (data === 'NO PERMISSION') { 31 | console.log('\n'); 32 | console.log(chalk.red('[ERROR] NO PERMISSION!')); 33 | console.log(chalk.red('[ERROR] Please contact the package administrator!')); 34 | spinner.stop(); 35 | process.exit(0); 36 | } 37 | 38 | if (ynpmConfig.user && ynpmConfig.sshk && data) { 39 | spinner.text = 'Update package information...'; 40 | let params = getPckParams(packOrigin); 41 | let pckMsg = yield setPackage({ 42 | ip, 43 | userId: data.user_id, 44 | name: params.name, 45 | author: ynpmConfig.user, 46 | version: params.version, 47 | last_auth: ynpmConfig.user, 48 | last_time: moment().format('YYYY-MM-DD hh:mm:ss'), 49 | packageInfo: escape(JSON.stringify(params)) 50 | }); 51 | try { 52 | let result = yield uploadReadme(params.name); 53 | } catch (e) { 54 | console.log('\n'); 55 | console.log(chalk.yellow(`[WARN]Update success, but upload README.md file fail`)); 56 | } 57 | console.log(chalk.green(`√ Finish, Thanks for the update !`)); 58 | } else { 59 | console.error("Error: Cant Find User, Please Use `npm set user=xxx && npm set email=xxx` or Contact Admin to Create User!"); 60 | } 61 | } 62 | spinner.stop(); 63 | process.exit(0); 64 | }).catch(err => { 65 | console.error(chalk.red('\n' + replaceErrMsg(err, HOST_REGISTRY))); 66 | }); 67 | }; 68 | 69 | -------------------------------------------------------------------------------- /src/reinstall.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const chalk = require('chalk'); 3 | const spawn = require('cross-spawn'); 4 | const ora = require('ora'); 5 | const argvs = process.argv; 6 | const fs = require('fs'); 7 | const env = Object.assign({}, process.env); 8 | const CWD = process.cwd(); 9 | const {YON_INNER_MIRROR} = require('./utils'); 10 | const co = require('co'); 11 | const stdio = [ 12 | process.stdin, 13 | process.stdout, 14 | process.stderr, 15 | ]; 16 | 17 | function deleteFolder(path) { 18 | let files = []; 19 | if (fs.existsSync(path)) { 20 | files = fs.readdirSync(path); 21 | files.forEach(function (file, index) { 22 | let curPath = path + "/" + file; 23 | if (fs.statSync(curPath).isDirectory()) { 24 | deleteFolder(curPath); 25 | } else { 26 | fs.unlinkSync(curPath); 27 | } 28 | }); 29 | fs.rmdirSync(path); 30 | } 31 | } 32 | module.exports = () => { 33 | co(function* () { 34 | const spinner = ora().start(); 35 | spinner.color = 'green'; 36 | const lockFile = './package-lock.json'; 37 | const node_modules = './node_modules'; 38 | const packageJson = require(CWD + '/package.json'); 39 | const pkg = argvs[3]; 40 | let result = false; 41 | if(packageJson){ //获取更新大包 42 | const test = (obj) => { 43 | for(let i in obj) { 44 | const strArr = i.split('/') 45 | if(strArr[0] === pkg) { 46 | result = true 47 | } 48 | } 49 | }; 50 | test(packageJson.dependencies); 51 | test(packageJson.devDependencies); 52 | } 53 | fs.exists(lockFile, (exists) => { 54 | if(exists) { 55 | fs.unlinkSync(lockFile); 56 | } 57 | }); 58 | if(pkg) { 59 | console.log(chalk.green(`node_modules/${pkg} need to be deleted before reloading, please wait!`)); 60 | deleteFolder(node_modules + '/' + pkg) 61 | } else { 62 | console.log(chalk.green(`node_modules need to be deleted before reloading, please wait!`)); 63 | deleteFolder(node_modules) 64 | } 65 | let argv = argvs.slice(3); 66 | argv.push(`--registry=${YON_INNER_MIRROR}`); 67 | argv.push(`--no-save`); 68 | argv.unshift(`install`); 69 | if(result) { // 更新@mdf 70 | argv = ['install', `--registry=${YON_INNER_MIRROR}`, '--no-save'] 71 | } 72 | spinner.stop(); 73 | 74 | const child = spawn('ynpm', argv, { 75 | env, 76 | cwd: CWD, 77 | stdio, 78 | }); 79 | child.on('exit', code => { 80 | process.exit(code); 81 | }); 82 | }).catch(err => { 83 | console.error(chalk.red('\n' + err)); 84 | }); 85 | } 86 | -------------------------------------------------------------------------------- /src/help.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const chalk = require('chalk'); 4 | const path = require('path'); 5 | const fs = require('fs'); 6 | 7 | module.exports = { 8 | help: () => { 9 | console.log(chalk.green('Usage :')); 10 | console.log(); 11 | 12 | console.log(chalk.green( 13 | ` 14 | Usage: 15 | ---------------------------------------------------- 16 | ynpm install 17 | ynpm install 18 | ynpm install @ 19 | ynpm install @ 20 | ynpm install @ 21 | ynpm install 22 | ynpm install 23 | ynpm install 24 | ynpm install 25 | ynpm install / 26 | ynpm reinstall 27 | ynpm reinstall 28 | 29 | Options: 30 | ---------------------------------------------------- 31 | --save, -S, --save-dev, -D: save installed dependencies into package.json 32 | -g, --global: install devDependencies to global directory 33 | 34 | Others: 35 | ---------------------------------------------------- 36 | ynpm --registry: change default mirror address 37 | ynpm sync : Synchronize npm to ynpm 38 | ` 39 | )); 40 | console.log(); 41 | }, 42 | setConfig: () => { 43 | console.log(chalk.green(` 44 | help: 45 | ------------------------请设置npm发包账户信息---------------------------- 46 | 设置用户名 47 | $ ynpm set user="xx" 48 | 设置email 49 | $ ynpm set email=xx@yonyou.com 50 | 生成key 51 | $ ynpm sshk 52 | ------------------------请设置npm发包账户信息---------------------------- 53 | `)); 54 | }, 55 | version: () => { 56 | const cVesion = require("../package.json").version; 57 | console.log(); 58 | console.log(chalk.green('Yonyou Package Manager(ynpm) Version : ' + cVesion)); 59 | console.log(); 60 | process.exit(); 61 | }, 62 | info: (msg) => { 63 | console.log(chalk.cyan("Info : " + msg)); 64 | }, 65 | showSSHKMsg: (sshk) => { 66 | console.log(chalk.green(` 67 | help: 68 | -------------请复制你的sshk到----------------- 69 | https://package.yonyoucloud.com#setting 设置您的key 70 | 71 | ${sshk} 72 | 73 | -------------------end---------------------- 74 | `)); 75 | }, 76 | error: (msg) => { 77 | console.log(chalk.red("Error : " + msg)); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/reportInfo/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const chalk = require('chalk'); 4 | const path = require('path'); 5 | const fs = require('fs'); 6 | const fetch = require('node-fetch'); 7 | const formData = require('form-data'); 8 | const co = require('co'); 9 | 10 | const URLSearchParams = require('url').URLSearchParams; 11 | 12 | const {getRc, setRc, getHttpConfig} = require('../utils'); 13 | 14 | function get(options, params) { 15 | let url = options.host ? options.host : "127.0.0.1"; 16 | url += options.port ? ":" + options.port : ""; 17 | // url += options.method?options.port:""; 18 | url += options.path ? options.path : ""; 19 | // let met = options.method.toUpperCase(); 20 | // if(met != "GET")return; 21 | let par = "?", i = 0, len = Object.keys(params).length; 22 | for (let attr in params) { 23 | i++; 24 | let _att = attr + "=" + params[attr]; 25 | len == i ? "" : _att += "&"; 26 | par += _att; 27 | } 28 | ; 29 | url += par; 30 | return fetch(url) 31 | .then(res => res.text()) 32 | .then(body => { 33 | let data = null; 34 | try { 35 | let res = JSON.parse(body); 36 | if (!isEmptyObject(res.data)) { 37 | data = res.data; 38 | } 39 | } catch (err) { 40 | } 41 | ; 42 | return data; 43 | }); 44 | } 45 | 46 | 47 | function isEmptyObject(obj) { 48 | for (var key in obj) { 49 | return false 50 | } 51 | ; 52 | return true 53 | }; 54 | function getLastVersion() { 55 | let config = getHttpConfig({ 56 | path: "/package/getLastToolVersion", 57 | }); 58 | return get(config, {}); 59 | } 60 | function userInfo(packageName) { 61 | let parame = getRc("ynpm"); 62 | parame.packageName = packageName 63 | let config = getHttpConfig({ 64 | path: "/user/getUserValidate", 65 | }); 66 | return get(config, parame); 67 | } 68 | 69 | function getAuth() { 70 | let parame = getRc("ynpm"); 71 | let config = getHttpConfig({ 72 | path: "/user/getUserValidate", 73 | }); 74 | return get(config, parame); 75 | } 76 | 77 | function addDownloadNum(params) { 78 | let config = getHttpConfig({ 79 | path: "/package/addDownloadNum", 80 | }); 81 | const form = new formData() 82 | form.append('installPackMap', params.installPackMap) 83 | return fetch(config.host + config.path, { 84 | method: 'post', 85 | body: form, 86 | }) 87 | } 88 | 89 | function packageDownloadDetail(pkg) { 90 | let params = getRc("ynpm") || {}; 91 | params.package_name = pkg 92 | let config = getHttpConfig({ 93 | path: "/package/packageDownloadDetail", 94 | }); 95 | return get(config, params); 96 | } 97 | 98 | function setPackage(params) { 99 | let config = getHttpConfig({ 100 | path: "/package/set", 101 | }); 102 | return get(config, params); 103 | } 104 | 105 | module.exports = { 106 | userInfo, 107 | setPackage, 108 | getLastVersion, 109 | addDownloadNum, 110 | packageDownloadDetail 111 | } 112 | -------------------------------------------------------------------------------- /src/publish.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const thunkify = require("thunkify"); 6 | const request = require('request'); 7 | const exec = require('child_process').exec; 8 | const ora = require('ora'); 9 | const co = require('co'); 10 | const moment = require('moment'); 11 | const chalk = require('chalk'); 12 | const {userInfo, setPackage} = require('./reportInfo/index'); 13 | const {getRcFile, getRc, HOST_REGISTRY, getPckParams, replaceErrMsg, getIPAdress, uploadReadme} = require('./utils'); 14 | const help = require('./help'); 15 | 16 | const IP_Req = thunkify(request); 17 | const Exec = thunkify(exec); 18 | 19 | module.exports = (registry) => { 20 | const argvs = process.argv; 21 | const ip = getIPAdress(); 22 | const spinner = ora().start(); 23 | spinner.color = 'green'; 24 | co(function* () { 25 | if (argvs[2] == 'publish') { 26 | var ynpmConfig = getRc("ynpm"); 27 | ynpmConfig.sshk = ynpmConfig._auth; 28 | var packOrigin = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'))); 29 | //validate user rolse 30 | let data = yield userInfo(packOrigin.name); 31 | if (!data) { 32 | help.setConfig(); 33 | spinner.stop(); 34 | process.exit(0); 35 | } else if (data === 'NO PERMISSION') { 36 | console.log('\n') 37 | console.log(chalk.red('[ERROR] NO PERMISSION!')) 38 | console.log(chalk.red('[ERROR] Please contact the package administrator!')) 39 | spinner.stop(); 40 | process.exit(0); 41 | } 42 | 43 | if (ynpmConfig.user && ynpmConfig.sshk && data) { 44 | console.log('Aviable: Pass Validation, Start to Publish...') 45 | let userconfig = getRcFile('ynpm') 46 | const arg_publish_inner = `npm --registry=${HOST_REGISTRY} --userconfig=${userconfig} publish ` + argvs.slice(3).join(' '); 47 | spinner.text = 'Publishing your package in Yonyou Local Area Net'; 48 | try { 49 | let publish_result = yield Exec(arg_publish_inner); 50 | } catch (e) { 51 | console.error(replaceErrMsg(e, HOST_REGISTRY)) 52 | console.error(chalk.red('\n' + 'please check the package.json\'s version, if had try many time, \n please connect admin\'s email wangshih@yonyou.com or chenpanf@yonyou.com !')); 53 | spinner.stop(); 54 | process.exit(0); 55 | } 56 | let params = getPckParams(packOrigin); 57 | let pckMsg = yield setPackage({ 58 | ip, 59 | userId: data.user_id, 60 | name: params.name, 61 | author: ynpmConfig.user, 62 | version: params.version, 63 | last_auth: ynpmConfig.user, 64 | last_time: moment().format('YYYY-MM-DD HH:mm:ss'), 65 | packageInfo: escape(JSON.stringify(params)) 66 | }) 67 | try { 68 | let result = yield uploadReadme(params.name); 69 | } catch (e) { 70 | console.log('\n') 71 | console.log(chalk.yellow(`[WARN]publish success, but upload README.md file fail`)); 72 | } 73 | console.log('\n') 74 | console.log(chalk.green(`√ Finish, Happy enjoy coding!`)); 75 | } else { 76 | console.error("Error: Cant Find User, Please Use `npm set user=xxx && npm set email=xxx` or Contact Admin to Create User!"); 77 | } 78 | } 79 | spinner.stop(); 80 | process.exit(0); 81 | }).catch(err => { 82 | console.error(chalk.red('\n' + replaceErrMsg(err, HOST_REGISTRY))); 83 | }); 84 | } 85 | 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

概述

3 | 4 |   `ynpm`是一款基于用友内部的镜像库,为用友内部打造一个优质的代码共享平台、业务组件的多样性、组件能力最大化的输出。把各种组件、工具的能力快速输出到各个项目中,提高项目的开发速度、节省项目成本、从而实现组件价值最大化、利益的最大化。 5 | 6 |   `ynpm`还提供组件的上传、下载的以及热门组件的统计。进行有针对性的进行组件优化和能力的持续集成。 7 | 8 | 9 | ### ynpm 功能特性 10 | 11 | 1. 根据用户网络进行自动匹配、自动切换、内网快速下载 12 | 2. 镜像无需同步,下载即缓存,实现一次下载,全员共享 13 | 3. 安全可靠,友互通域账号权限校验 14 | 4. 内网发包配置简单、融合`github`设置`sshk`模式 15 | 5. 提供强大的`cli`工具、模块化的实现、快速融合其他cli工具 16 | 6. 不对`npm`的镜像源入侵 17 | 18 | ### 基本原理 19 | 20 | 1. 使用 Nexus Repository OSS 构建镜像 21 | 2. 使用自己独立的数据存储、资源包做统计 22 | 3. 使用`koa+node`做中间层做请求转发和校验机制 23 | 4. react开发独立的官网站点 24 | 25 | ## 开始使用 26 | 27 |

安装

28 | 29 | >请确认你在本地全局安装了`Node.js`,然后使用`npm`将`ynpm`全局安装: 30 | 31 | ``` 32 | $ npm install ynpm-tool -g 33 | ``` 34 | 35 |

下载 package

36 | 37 | ``` 38 | # 安装到dependencies依赖的包 39 | 40 | $ ynpm install @yonyou/xxx --save 41 | 42 | # 安装到devDependencies依赖的包 43 | 44 | $ ynpm install xxx --save-dev 45 | ``` 46 | 47 | >也可以直接使用简写: 48 | 49 | ``` 50 | $ ynpm i @yonyou/xxx -S 51 | ``` 52 | 53 | >显示ynpm的帮助信息; 54 | 55 | ``` 56 | $ ynpm -h 57 | ``` 58 | 59 | ## 发包私有包到 ynpm 60 | 61 | 2. 设置 ynpm 62 | 63 | >用户名必须是登录友互通的用户名 64 | 65 | ``` 66 | $ ynpm set user=xxx 67 | ``` 68 | 69 | >邮箱必须是登录友互通的邮箱或者手机号 70 | 71 | ``` 72 | $ ynpm set email=xxx 73 | 74 | ``` 75 | >显示sshk(不显示sshk见QA) 76 | 77 | 2. 复制sshk[登陆官网](https://package.yonyoucloud.com/)-->选择头像-->选择设置sshk (如图) 78 | 79 | ![新增sshk](http://iuap-design-cdn.oss-cn-beijing.aliyuncs.com/static/ynpm/image/8194969-cda1b44fc7272cab.jpeg) 80 | 81 | 3. 发布 82 | 83 | ``` 84 | $ cd xx_component && ynpm publish 85 | ``` 86 | 87 | >显示finish xx_component 表示成功 88 | 89 | [官网搜索包名](https://package.yonyoucloud.com) 90 | 91 | 92 |

发包规范

93 | 94 | > package.json 必填项 95 | 96 | 1. name :模块名称,内部包统一用(@yonyou/xx)作为前缀 97 | 98 | 2. homepage :组件主页url,eg: http://xx.git#redme 99 | 100 | 3. author :作者 101 | 102 | 3. repository :指定一个代码存放地址。string or {} 103 | 104 | ``` 105 | repository:'https://xxx.git' 106 | repository:{'url' : 'https://xxx.git'} 107 | ``` 108 | [更多npm规范](https://docs.npmjs.com/files/package.json)    [例子](https://github.com/tinper-acs/ac-button/blob/master/package.json) 109 | 110 |

常用命令

111 | 112 | |命令|说明|使用| 113 | |:--|:---|:--| 114 | install / i |安装包 |ynpm install| 115 | update |更新包 |ynpm update| 116 | show |显示包信息 |ynpm show | 117 | list |显示当前安装报的版本 |ynpm list| 118 | reinstall / rei|重装包 |ynpm rei| 119 | sync |同步npm包到ynpm |ynpm sync| 120 | publish |发布包到ynpm |ynpm publish| 121 | set |设置ynpm的用户名 |ynpm set user/email| 122 | version |查看ynpm版本 |ynpm -v| 123 | help |查看帮助 |ynpm -h| 124 | sshk |查看sshk |ynpm sshk| 125 | 126 |

Q&A常见问题

127 | 128 | 129 | 1. 下载包极慢,报错timeout 130 | 131 | 根据反馈,少数包会报错。原因是安装包依赖一个外链下载(可能是github或amazon等第三方地址)。因为众所周知的原因,你很有可能下载不到从而出现timeout(相同的问题cnpm也会存在). 132 | 133 | 2. install 的时候出现 401 权限问题 134 | 135 | >请执行 136 | 137 | ``` 138 | rm -rf ~/.ynpmrc 139 | ``` 140 | 3. 发包出现 400、401 的情况 141 | 142 | 请重新 set 用户名、密码以及设置sshk 143 | 144 | 4. windows电脑sshk不显示 145 | > window电脑请使用`git bash`窗口模式,执行 146 | 147 | ``` 148 | cat ~/.ynpmrc # _auth后面的就是sshk 149 | ``` 150 | 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /_docs/source/shBrush-css.js: -------------------------------------------------------------------------------- 1 | ;(function () { 2 | // CommonJS 3 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined' ? require('shCore').SyntaxHighlighter : null); 4 | 5 | function Brush() { 6 | function getKeywordsCSS(str) { 7 | return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; 8 | }; 9 | 10 | function getValuesCSS(str) { 11 | return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; 12 | }; 13 | 14 | var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + 15 | 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + 16 | 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + 17 | 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + 18 | 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + 19 | 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + 20 | 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + 21 | 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + 22 | 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + 23 | 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + 24 | 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + 25 | 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + 26 | 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + 27 | 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; 28 | 29 | var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder ' + 30 | 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed ' + 31 | 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double ' + 32 | 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia ' + 33 | 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic ' + 34 | 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha ' + 35 | 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower ' + 36 | 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset ' + 37 | 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side ' + 38 | 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow ' + 39 | 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize ' + 40 | 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal ' + 41 | 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin ' + 42 | 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; 43 | 44 | var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; 45 | 46 | this.regexList = [ 47 | {regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments'}, // multiline comments 48 | {regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string'}, // double quoted strings 49 | {regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string'}, // single quoted strings 50 | {regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value'}, // html colors 51 | {regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value'}, // sizes 52 | {regex: /!important/g, css: 'color3'}, // !important 53 | {regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword'}, // keywords 54 | {regex: new RegExp(getValuesCSS(values), 'g'), css: 'value'}, // values 55 | {regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1'} // fonts 56 | ]; 57 | 58 | this.forHtmlScript({ 59 | left: /(<|<)\s*style.*?(>|>)/gi, 60 | right: /(<|<)\/\s*style\s*(>|>)/gi 61 | }); 62 | }; 63 | 64 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 65 | Brush.aliases = ['css']; 66 | 67 | SyntaxHighlighter.brushes.CSS = Brush; 68 | 69 | // CommonJS 70 | typeof (exports) != 'undefined' ? exports.Brush = Brush : null; 71 | })(); 72 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const chalk = require('chalk'); 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const co = require('co'); 6 | const {getRc, setRc, getPing, getByAtrrBool, consoleLog} = require('./utils'); 7 | const { getLastVersion} = require('./reportInfo/index'); 8 | const help = require('./help'); 9 | const install = require('./install'); 10 | const reinstall = require('./reinstall'); 11 | const publish = require('./publish'); 12 | const npm = require('./npm'); 13 | const sync = require('./sync'); 14 | const updateInfo = require('./updateInfo'); 15 | const update = require('./update'); 16 | 17 | function getHelp() { 18 | console.log(chalk.green(" Usage : ")); 19 | console.log(chalk.green(" ac sample init sample")); 20 | process.exit(0); 21 | } 22 | 23 | function getVersion() { 24 | console.log(chalk.green(require("../package.json").version)); 25 | process.exit(0); 26 | } 27 | function consoleNoVersion(mastVesion) { 28 | console.log(chalk.yellow(`YNPM-[WARNING]:Current version is ${mastVesion}`)); 29 | console.log(chalk.yellow(`YNPM-[WARNING]:No latest version information obtained`)); 30 | console.log(chalk.yellow(`YNPM-[WARNING]:You can continue with the current version, but at risk`)); 31 | } 32 | function checkVersion() { 33 | const cVesion = require("../package.json").version; 34 | if(process.version.split('.')[0].replace('v', '') < 6) { 35 | console.log(chalk.yellow(`node version is ${process.version}`)) 36 | } 37 | const mastVesion = cVesion.split('-')[0]; 38 | return getLastVersion().then(res => { 39 | if(res) { 40 | if(!~cVesion.indexOf(res)) { 41 | console.log('\n'); 42 | console.log(chalk.yellow(`YNPM-[WARNING]:Current version is ${mastVesion}, but the latest version is ${res}\n`)); 43 | console.log(chalk.yellow(`YNPM-[WARNING]:Please use the following command to update\n`)); 44 | console.log(chalk.green(`--------------------------------------\n`)); 45 | console.log(chalk.green(` npm i ynpm-tool -g\n`)); 46 | console.log(chalk.green(`--------------------------------------\n`)); 47 | } 48 | } else { 49 | consoleNoVersion(mastVesion) 50 | } 51 | }).catch(err => { 52 | consoleNoVersion(mastVesion) 53 | }); 54 | } 55 | 56 | function init(fun) { 57 | // Ping内网 58 | const {Ping_Response, registry} = getPing(); 59 | // const spinner = ora().start(); 60 | 61 | if (Ping_Response.avg) { 62 | console.log(chalk.dim('Yonyou Mirror Downloading...\n')); 63 | } else { 64 | console.log(chalk.dim('npm Mirror Downloading...\n')); 65 | } 66 | return fun(registry); 67 | } 68 | 69 | module.exports = { 70 | plugin: function (options, global) { 71 | let commands = options.cmd; 72 | const argvs = process.argv; 73 | const fun = function(){ 74 | switch (commands) { 75 | case "-h": 76 | case "-help": 77 | help.help(); 78 | break; 79 | case "-v": 80 | case "-version": 81 | help.version(); 82 | break; 83 | case "i": 84 | process.argv[2] = 'install'; 85 | co(function* () { 86 | // Ping内网; 87 | install(yield getPing('install'), ''); 88 | }).catch(err => { 89 | console.error(chalk.red('\n' + err)); 90 | }); 91 | break; 92 | case "updateInfo": 93 | co(function* () { 94 | // Ping内网; 95 | updateInfo(yield getPing(), ''); 96 | }).catch(err => { 97 | console.error(chalk.red('\n' + err)); 98 | }); 99 | break; 100 | case "update": 101 | co(function* () { 102 | // Ping内网; 103 | update(yield getPing(), ''); 104 | }).catch(err => { 105 | console.error(chalk.red('\n' + err)); 106 | }); 107 | break; 108 | case "reinstall": 109 | case "rei": 110 | co(function* () { 111 | // Ping内网; 112 | reinstall(yield getPing(), ''); 113 | }).catch(err => { 114 | console.error(chalk.red('\n' + err)); 115 | }); 116 | break; 117 | case "install": 118 | co(function* () { 119 | // Ping内网; 120 | install(yield getPing(), ''); 121 | }).catch(err => { 122 | console.error(chalk.red('\n' + err)); 123 | }); 124 | break; 125 | case "sync": 126 | co(function* () { 127 | // Ping内网; 128 | sync(yield getPing(), ''); 129 | }).catch(err => { 130 | console.error(chalk.red('\n' + err)); 131 | }); 132 | break; 133 | case "installdev": 134 | //替换 installdev 成 install 135 | process.argv[2] = 'install' 136 | co(function* () { 137 | // Ping内网; 138 | install(yield getPing(), 'dev'); 139 | }).catch(err => { 140 | console.error(chalk.red('\n' + err)); 141 | }); 142 | break; 143 | case "publish": 144 | co(function* () { 145 | // Ping内网; 146 | publish(yield getPing()); 147 | }).catch(err => { 148 | console.error(chalk.red('\n' + err)); 149 | }); 150 | break; 151 | case "set": 152 | let config = setRc("ynpm"); 153 | break; 154 | case "sshk": 155 | let ynpmrcCon = getRc("ynpm"); 156 | help.showSSHKMsg(ynpmrcCon.sshk); 157 | break; 158 | default: 159 | co(function* () { 160 | // Ping内网; 161 | npm(yield getPing()); 162 | }).catch(err => { 163 | console.error(chalk.red('\n' + err)); 164 | }); 165 | } 166 | }; 167 | checkVersion().then(() => { 168 | fun(); 169 | }).catch(err => { 170 | fun(); 171 | }) 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /_docs/release.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Yon 版本 7 | 8 | 9 | 10 | 11 | 12 |
Skip to main content
13 |
14 | 15 | 16 | 17 | 58 | 59 | 60 | 61 |
62 |
63 |

Yon

64 |

版本

65 |
66 |
67 | 68 | 69 |
70 | 71 | 72 |
73 | 74 | 75 |
76 |
77 | 78 |

开发说明

79 |

夭折的v0.0.1版本 pub分支

80 |
    81 |
  • 前期对安装命令行工具工作量评估不足,导致入源码坑太深
  • 82 |
  • 依赖npminstall完成,内网Nexus Repository 83 | OSS搭建的镜像,存在部分下载404的问题(latest,>=v1 84 | <v2),此部分原因为npminstall工具对下载机制做了调整,镜像在npm环境测试没有问题 85 |
  • 86 |
87 |

v0.0.2版本

88 |

上一版当天无法修复的情况下,无法短时间从npm等工具源码中构建项目。遂修改策略,短时间撸出的一个试用版本:在npm上套壳,确保:能使用内网镜像,能自动切换镜像,不侵入`npm 89 |

90 |

v0.0.3-0.0.4

91 |
    92 |
  • 版本调整,仓库迁移测试
  • 93 |
94 |

v0.0.6

95 |
    96 |
  • 增加显示镜像地址
  • 97 |
  • 增加不支持命令的error提示
  • 98 |
99 | 100 |
101 | 116 |
117 | 118 | 119 |
120 | 121 | 123 |
124 |
125 |

Made By YonYouFED. © 2014 - 2016

126 |
127 |
128 | 129 | 130 | 131 | 132 | 133 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /_docs/source/shBrush-sass.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function () { 18 | // CommonJS 19 | typeof (require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 20 | 21 | function Brush() { 22 | function getKeywordsCSS(str) { 23 | return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; 24 | }; 25 | 26 | function getValuesCSS(str) { 27 | return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; 28 | }; 29 | 30 | var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + 31 | 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + 32 | 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + 33 | 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + 34 | 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + 35 | 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + 36 | 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + 37 | 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + 38 | 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + 39 | 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + 40 | 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + 41 | 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + 42 | 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + 43 | 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; 44 | 45 | var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder ' + 46 | 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed ' + 47 | 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double ' + 48 | 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia ' + 49 | 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic ' + 50 | 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha ' + 51 | 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower ' + 52 | 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset ' + 53 | 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side ' + 54 | 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow ' + 55 | 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize ' + 56 | 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal ' + 57 | 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin ' + 58 | 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; 59 | 60 | var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; 61 | 62 | var statements = '!important !default'; 63 | var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include'; 64 | 65 | var r = SyntaxHighlighter.regexLib; 66 | 67 | this.regexList = [ 68 | {regex: r.multiLineCComments, css: 'comments'}, // multiline comments 69 | {regex: r.singleLineCComments, css: 'comments'}, // singleline comments 70 | {regex: r.doubleQuotedString, css: 'string'}, // double quoted strings 71 | {regex: r.singleQuotedString, css: 'string'}, // single quoted strings 72 | {regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value'}, // html colors 73 | {regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value'}, // sizes 74 | {regex: /\$\w+/g, css: 'variable'}, // variables 75 | {regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3'}, // statements 76 | {regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor'}, // preprocessor 77 | {regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword'}, // keywords 78 | {regex: new RegExp(getValuesCSS(values), 'g'), css: 'value'}, // values 79 | {regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1'} // fonts 80 | ]; 81 | }; 82 | 83 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 84 | Brush.aliases = ['sass', 'scss']; 85 | 86 | SyntaxHighlighter.brushes.Sass = Brush; 87 | 88 | // CommonJS 89 | typeof (exports) != 'undefined' ? exports.Brush = Brush : null; 90 | })(); 91 | -------------------------------------------------------------------------------- /bin/yon: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | const co = require('co'); 6 | const chalk = require('chalk'); 7 | const execSync = require('child_process').execSync; 8 | const exec = require('child_process').exec; 9 | const pkgFile = require('../package.json'); 10 | const thunkify = require("thunkify"); 11 | const tcpp = require('tcp-ping'); 12 | const request = require('request'); 13 | const ora = require('ora'); 14 | const fs = require('fs'); 15 | const path = require('path'); 16 | const http = require('http'); 17 | const ini = require('ini'); 18 | 19 | 20 | /* 21 | // Nexus OSS 2.x Info 22 | // Npm official mirror: https://registry.npmjs.org 23 | const IPCOMPANY = '172.16.51.12'; 24 | const YON_MIRROR = 'http://maven.yonyou.com/nexus/content/groups/NPM-Yonyou-Repository/'; 25 | */ 26 | 27 | // Nexus OSS 3.3 Info 28 | const IPCOMPANY = '172.20.27.204'; 29 | const YON_MIRROR = 'http://172.20.27.204:8081/repository/ynpm-all/'; 30 | const DEAFAULT_MIRROR = 'https://registry.npm.taobao.org'; 31 | const HOST_REGISTRY = 'http://172.20.27.204:8081/repository/ynpm-private/'; 32 | const CDNJSON = 'http://iuap-design-cdn.oss-cn-beijing.aliyuncs.com/static/ynpm/ynpm.json' 33 | 34 | /** 35 | * ynpm --version || ynpm -v 36 | */ 37 | const opt = process.argv[2]; 38 | if (opt == '-v' || opt == '--version') { 39 | console.log('Yonyou Package Manager(ynpm) : v' + pkgFile.version); 40 | process.exit(0); 41 | } 42 | 43 | /** 44 | * ynpm --help || ynpm -h 45 | */ 46 | if (opt == '-h' || opt == '--help' || opt == undefined) { 47 | console.log( 48 | ` 49 | Usage: 50 | ---------------------------------------------------- 51 | ynpm install 52 | ynpm install 53 | ynpm install @ 54 | ynpm install @ 55 | ynpm install @ 56 | ynpm install 57 | ynpm install 58 | ynpm install 59 | ynpm install 60 | ynpm install / 61 | 62 | Options: 63 | ---------------------------------------------------- 64 | --save, -S, --save-dev, -D: save installed dependencies into package.json 65 | -g, --global: install devDependencies to global directory 66 | 67 | Others: 68 | ---------------------------------------------------- 69 | ynpm --registry: change default mirror address 70 | 71 | ` 72 | ); 73 | process.exit(0); 74 | } 75 | 76 | const IP_Req = thunkify(request); 77 | const Ping = thunkify(tcpp.ping); 78 | const Exec = thunkify(exec); 79 | 80 | co(function* () { 81 | //IP判断 - 耗时暂取消 82 | /* 83 | const IP_Response = yield IP_Req('https://api.ipify.org?format=json') 84 | const IP_Body = IP_Response[IP_Response.length - 1] 85 | const IP_ADDRESS = JSON.parse(IP_Body)['ip']; 86 | const IP_REG = new RegExp(/^123\.103/); 87 | if(IP_REG.test(IP_ADDRESS)){ 88 | console.log('内网') 89 | } 90 | */ 91 | 92 | // Ping内网 93 | const Ping_Response = yield Ping({ 94 | address: IPCOMPANY, 95 | port: 8081, 96 | timeout: 50, 97 | attempts: 1 98 | }) 99 | let registry = Ping_Response.avg ? YON_MIRROR : DEAFAULT_MIRROR; 100 | 101 | const argvs = process.argv; 102 | const spinner = ora().start(); 103 | spinner.color = 'green'; 104 | 105 | let arg_install = `npm --registry=${registry} `; 106 | if (argvs[2] == 'i' || argvs[2] == 'install') { 107 | if (Ping_Response.avg) { 108 | console.log(chalk.dim('Yonyou Mirror Downloading...\n')); 109 | } else { 110 | console.log(chalk.dim('CNPM Mirror Downloading...\n')); 111 | } 112 | 113 | const argv_part = argvs.slice(2).join(' '); 114 | arg_install += argv_part; 115 | 116 | // execSync(arg_install); 117 | spinner.text = 'Installing package ⬇️...'; 118 | var data = yield Exec(arg_install); 119 | console.log(chalk.bold('\n\nInstall Info:\n' + data[0])); 120 | console.log(chalk.yellow('Warn Info:\n' + data[1])); 121 | console.log(chalk.green(`√ Finish, Happy enjoy coding!`)); 122 | 123 | } else if (argvs[2] == 'publish' && argvs[3] == 'inner') { 124 | // Get Publish Package Info 125 | var packOrigin = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'))).name; 126 | var packName = packOrigin.split('/')[0].replace("@", ""); 127 | 128 | // Get Data 129 | var cdnRes = yield IP_Req(CDNJSON); 130 | var jsonRes = JSON.parse(cdnRes[cdnRes.length - 1]); 131 | console.log("=====jsonRes=====", jsonRes); 132 | // Get User Info - using offical method - ini 133 | var _auth; 134 | var npmConfigReturn = yield Exec('npm get userconfig'); 135 | // npmConfigReturn: [ '/Users/AYA/.npmrc\n', '' ] 136 | var npmUserConfig = npmConfigReturn[0].trim(); 137 | console.log("=====npmUserConfig=====", npmUserConfig); 138 | var iniConfig = ini.parse(fs.readFileSync(npmUserConfig, 'utf-8')) 139 | var parseAuth = new Buffer(iniConfig._auth, 'base64').toString().split(":")[0]; 140 | 141 | // Verify Publish Scoped 142 | console.log(parseAuth + "=========="); 143 | if (jsonRes[parseAuth] && jsonRes[parseAuth].includes(packName)) { 144 | console.log('Aviable: Pass Validation, Start to Publish...') 145 | var arg_publish_inner = `npm --registry=${HOST_REGISTRY} publish`; 146 | console.log("--arg_publish_inner-- : " + arg_publish_inner); 147 | spinner.text = 'Publishing your package in Yonyou Local Area Net'; 148 | console.log("arg_publish_inner:" + arg_publish_inner); 149 | // var data = yield Exec(arg_publish_inner); 150 | } else if (jsonRes[parseAuth]) { 151 | console.error(`Error: Overflow User Privilege, Publish Package Scoped with "@${jsonRes[parseAuth]}" or Contact Admin to Extend Privilege!`); 152 | } else { 153 | console.error("Error: Cant Find User, Please Use `npm config set _auth=base64String` or Contact Admin to Create User!"); 154 | } 155 | 156 | } else if (argvs[2] == 'publish' && !argvs[3]) { 157 | var arg_publish = `npm publish`; 158 | spinner.text = 'Publishing your package on NPM Official Repos'; 159 | var data = yield Exec(arg_publish); 160 | 161 | } 162 | spinner.stop(); 163 | process.exit(0); 164 | 165 | 166 | }).catch(err => { 167 | console.error(chalk.red('\n' + err)); 168 | // console.error(chalk.red(err.stack)); 169 | console.error(chalk.yellow('ynpm version: %s'), pkgFile.version); 170 | console.error(chalk.yellow('ynpm args: %s'), process.argv.slice(2).join(' ')); 171 | process.exit(1); 172 | }); 173 | -------------------------------------------------------------------------------- /bin/yon.3955132297: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | const co = require('co'); 6 | const chalk = require('chalk'); 7 | const execSync = require('child_process').execSync; 8 | const exec = require('child_process').exec; 9 | const pkgFile = require('../package.json'); 10 | const thunkify = require("thunkify"); 11 | const tcpp = require('tcp-ping'); 12 | const request = require('request'); 13 | const ora = require('ora'); 14 | const fs = require('fs'); 15 | const path = require('path'); 16 | const http = require('http'); 17 | const ini = require('ini'); 18 | 19 | 20 | /* 21 | // Nexus OSS 2.x Info 22 | // Npm official mirror: https://registry.npmjs.org 23 | const IPCOMPANY = '172.16.51.12'; 24 | const YON_MIRROR = 'http://maven.yonyou.com/nexus/content/groups/NPM-Yonyou-Repository/'; 25 | */ 26 | 27 | // Nexus OSS 3.3 Info 28 | const IPCOMPANY = '172.20.27.204'; 29 | const YON_MIRROR = 'http://172.20.27.204:8081/repository/ynpm-all/'; 30 | const DEAFAULT_MIRROR = 'https://registry.npm.taobao.org'; 31 | const HOST_REGISTRY = 'http://172.20.27.204:8081/repository/ynpm-private/'; 32 | const CDNJSON = 'http://iuap-design-cdn.oss-cn-beijing.aliyuncs.com/static/ynpm/ynpm.json' 33 | 34 | /** 35 | * ynpm --version || ynpm -v 36 | */ 37 | const opt = process.argv[2]; 38 | if (opt == '-v' || opt == '--version') { 39 | console.log('Yonyou Package Manager(ynpm) : v' + pkgFile.version); 40 | process.exit(0); 41 | } 42 | 43 | /** 44 | * ynpm --help || ynpm -h 45 | */ 46 | if (opt == '-h' || opt == '--help' || opt == undefined) { 47 | console.log( 48 | ` 49 | Usage: 50 | ---------------------------------------------------- 51 | ynpm install 52 | ynpm install 53 | ynpm install @ 54 | ynpm install @ 55 | ynpm install @ 56 | ynpm install 57 | ynpm install 58 | ynpm install 59 | ynpm install 60 | ynpm install / 61 | 62 | Options: 63 | ---------------------------------------------------- 64 | --save, -S, --save-dev, -D: save installed dependencies into package.json 65 | -g, --global: install devDependencies to global directory 66 | 67 | Others: 68 | ---------------------------------------------------- 69 | ynpm --registry: change default mirror address 70 | 71 | ` 72 | ); 73 | process.exit(0); 74 | } 75 | 76 | const IP_Req = thunkify(request); 77 | const Ping = thunkify(tcpp.ping); 78 | const Exec = thunkify(exec); 79 | 80 | co(function* () { 81 | //IP判断 - 耗时暂取消 82 | /* 83 | const IP_Response = yield IP_Req('https://api.ipify.org?format=json') 84 | const IP_Body = IP_Response[IP_Response.length - 1] 85 | const IP_ADDRESS = JSON.parse(IP_Body)['ip']; 86 | const IP_REG = new RegExp(/^123\.103/); 87 | if(IP_REG.test(IP_ADDRESS)){ 88 | console.log('内网') 89 | } 90 | */ 91 | 92 | // Ping内网 93 | const Ping_Response = yield Ping({ 94 | address: IPCOMPANY, 95 | port: 8081, 96 | timeout: 50, 97 | attempts: 1 98 | }) 99 | let registry = Ping_Response.avg ? YON_MIRROR : DEAFAULT_MIRROR; 100 | 101 | const argvs = process.argv; 102 | const spinner = ora().start(); 103 | spinner.color = 'green'; 104 | 105 | let arg_install = `npm --registry=${registry} `; 106 | if (argvs[2] == 'i' || argvs[2] == 'install') { 107 | if (Ping_Response.avg) { 108 | console.log(chalk.dim('Yonyou Mirror Downloading...\n')); 109 | } else { 110 | console.log(chalk.dim('CNPM Mirror Downloading...\n')); 111 | } 112 | 113 | const argv_part = argvs.slice(2).join(' '); 114 | arg_install += argv_part; 115 | 116 | // execSync(arg_install); 117 | spinner.text = 'Installing package ⬇️...'; 118 | var data = yield Exec(arg_install); 119 | console.log(chalk.bold('\n\nInstall Info:\n' + data[0])); 120 | console.log(chalk.yellow('Warn Info:\n' + data[1])); 121 | console.log(chalk.green(`√ Finish, Happy enjoy coding!`)); 122 | 123 | } else if (argvs[2] == 'publish' && argvs[3] == 'inner') { 124 | // Get Publish Package Info 125 | var packOrigin = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'))).name; 126 | var packName = packOrigin.split('/')[0].replace("@", ""); 127 | 128 | // Get Data 129 | var cdnRes = yield IP_Req(CDNJSON); 130 | var jsonRes = JSON.parse(cdnRes[cdnRes.length - 1]); 131 | console.log("=====jsonRes=====", jsonRes); 132 | // Get User Info - using offical method - ini 133 | var _auth; 134 | var npmConfigReturn = yield Exec('npm get userconfig'); 135 | // npmConfigReturn: [ '/Users/AYA/.npmrc\n', '' ] 136 | var npmUserConfig = npmConfigReturn[0].trim(); 137 | console.log("=====npmUserConfig=====", npmUserConfig); 138 | var iniConfig = ini.parse(fs.readFileSync(npmUserConfig, 'utf-8')) 139 | var parseAuth = new Buffer(iniConfig._auth, 'base64').toString().split(":")[0]; 140 | 141 | // Verify Publish Scoped 142 | console.log(parseAuth + "=========="); 143 | if (jsonRes[parseAuth] && jsonRes[parseAuth].includes(packName)) { 144 | console.log('Aviable: Pass Validation, Start to Publish...') 145 | var arg_publish_inner = `npm --registry=${HOST_REGISTRY} publish`; 146 | console.log("--arg_publish_inner-- : " + arg_publish_inner); 147 | spinner.text = 'Publishing your package in Yonyou Local Area Net'; 148 | console.log("arg_publish_inner:" + arg_publish_inner); 149 | // var data = yield Exec(arg_publish_inner); 150 | } else if (jsonRes[parseAuth]) { 151 | console.error(`Error: Overflow User Privilege, Publish Package Scoped with "@${jsonRes[parseAuth]}" or Contact Admin to Extend Privilege!`); 152 | } else { 153 | console.error("Error: Cant Find User, Please Use `npm config set _auth=base64String` or Contact Admin to Create User!"); 154 | } 155 | 156 | } else if (argvs[2] == 'publish' && !argvs[3]) { 157 | var arg_publish = `npm publish`; 158 | spinner.text = 'Publishing your package on NPM Official Repos'; 159 | var data = yield Exec(arg_publish); 160 | 161 | } 162 | spinner.stop(); 163 | process.exit(0); 164 | 165 | 166 | }).catch(err => { 167 | console.error(chalk.red('\n' + err)); 168 | // console.error(chalk.red(err.stack)); 169 | console.error(chalk.yellow('ynpm version: %s'), pkgFile.version); 170 | console.error(chalk.yellow('ynpm args: %s'), process.argv.slice(2).join(' ')); 171 | process.exit(1); 172 | }); 173 | -------------------------------------------------------------------------------- /_docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Yon 开始 7 | 8 | 9 | 10 | 11 | 12 |
Skip to main content
13 |
14 | 15 | 16 | 17 | 58 | 59 | 60 | 61 |
62 |
63 |

Yon

64 |

开始

65 |
66 |
67 | 68 | 69 |
70 | 71 | 72 |
73 | 74 | 75 |
76 |
77 | 78 |

概述

79 |

yonnode在公司内部的镜像仓库配套的命令行工具,根据镜像代理,嵌套npm,关于镜像和命令行工具说明如下:

80 |
    81 |
  • 镜像 82 |
      83 |
    • 使用Nexus Repository OSS搭建npm镜像
    • 84 |
    • 镜像源使用淘宝cnpm镜像库
    • 85 |
    • 镜像无需同步,下载即缓存,实现一次下载,全员共享
    • 86 |
    87 |
  • 88 |
  • 命令行 89 |
      90 |
    • 实现自动根据IP选择下载源 91 |
        92 |
      • 内网自动使用公司镜像
      • 93 |
      • 外网自动使用淘宝镜像
      • 94 |
      • 不对npm的镜像源入侵
      • 95 |
      96 |
    • 97 |
    98 |
  • 99 |
100 |

总体实现:公司内通过使用yon,实现快速下载包,减少下载等待时间

101 |

安装

102 |
npm install yon -g
103 | 
104 |

使用

105 |
# 安装(install相关命令均支持)
106 | yon install xxx --option
107 | 
108 | # 帮助
109 | yon 或 yon -h 或 yon --help
110 | 
111 | # 版本
112 | yon -v 或 yon --version
113 | 
114 |
    115 |
  • 其他命令暂不准备实现
  • 116 |
117 | 118 |
119 | 148 |
149 | 150 | 151 |
152 | 153 | 155 |
156 |
157 |

Made By YonYouFED. © 2014 - 2016

158 |
159 |
160 | 161 | 162 | 163 | 164 | 165 | 223 | 224 | 225 | -------------------------------------------------------------------------------- /_docs/progress.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Yon 进度 7 | 8 | 9 | 10 | 11 | 12 |
Skip to main content
13 |
14 | 15 | 16 | 17 | 58 | 59 | 60 | 61 |
62 |
63 |

Yon

64 |

进度

65 |
66 |
67 | 68 | 69 |
70 | 71 | 72 |
73 | 74 | 75 |
76 |
77 | 78 |

用友镜像初探

79 |
    80 |
  • 保证现有用户的操作习惯,所以要改造npminstall输入方式为"yon install"

    81 |
  • 82 |
  • 增加ip识别,确保自动切换不同镜像

    83 |
  • 84 |
  • 实现命令

    85 |
    // 安装命令
     86 | yon install gulp --save
     87 | yon install gulp -S
     88 | yon install gulp --global
     89 | yon install gulp -G
     90 | yon install gulp --save-dev
     91 | yon install gulp -D
     92 | 
     93 | // 版本
     94 | yon --version
     95 | yon -v
     96 | 
     97 | // help
     98 | yon --help
     99 | yon -h
    100 | 
    101 | // 默认
    102 | yon install
    103 | 
    104 |
  • 105 |
106 |

已完成内容

107 |
    108 |
  • 完成版本识别

    109 |
    yon --version
    110 | yon -v
    111 | 
    112 |
  • 113 |
  • 完成帮助

    114 |
    yon
    115 | yon -h
    116 | yon --help
    117 | 
    118 |
  • 119 |
  • 实现了cnpmnpm镜像的切换,但是用友的镜像存在以下问题:

    120 |
      121 |
    • 请求最新版本latest时,获取页面为404
    • 122 |
    • 请求范围版本号(>=1.2.0 <=2.0.0)时,获取页面为404
    • 123 |
    • 镜像采用了nexus oss管理:优点可以做代理,保证只需下载一份,缺陷如上
    • 124 |
    • 使用了npminstall作为依赖,阿里做了处理,以致出现以上情况
    • 125 |
    • 故准备在relase分支发布折中版本: 126 |
        127 |
      • 使用yon install包装命令
      • 128 |
      • 创建文件,写入是否能ping通内网地址及可选镜像地址
      • 129 |
      • 读取文件,更改镜像
      • 130 |
      131 |
    • 132 |
    133 |
  • 134 |
135 | 136 |
137 | 159 |
160 | 161 | 162 |
163 | 164 | 166 |
167 |
168 |

Made By YonYouFED. © 2014 - 2016

169 |
170 |
171 | 172 | 173 | 174 | 175 | 176 | 234 | 235 | 236 | -------------------------------------------------------------------------------- /src/install.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const chalk = require('chalk'); 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const co = require('co'); 6 | const ora = require('ora'); 7 | const childProcess = require('child_process') 8 | const exec = childProcess.exec; 9 | const thunkify = require("thunkify"); 10 | const Exec = thunkify(exec); 11 | var spawn = require('cross-spawn') 12 | const {replaceErrMsg} = require('./utils'); 13 | const {addDownloadNum, packageDownloadDetail} = require('./reportInfo/index'); 14 | 15 | function countStrLeng(str, subStr) { 16 | let strs = str.split(''); 17 | let count = 0; 18 | strs.forEach(st => { 19 | if (st == subStr) { 20 | count++; 21 | } 22 | }) 23 | return count; 24 | } 25 | 26 | function console_log(ifHasLog, msg) { 27 | if (ifHasLog == 'dev') { 28 | console.log(msg) 29 | } 30 | return 31 | } 32 | 33 | function getResultPkgs(paramArr) { 34 | let obj = {} 35 | paramArr.forEach((item) => { 36 | let temp = item.replace(/\+\s+/, '').trim() 37 | let index = temp.lastIndexOf('@') 38 | obj[temp.slice(0, index)] = '^' + temp.slice(index + 1) 39 | }) 40 | return obj; 41 | } 42 | 43 | 44 | module.exports = (registry, ifHasLog) => { 45 | const argvs = process.argv; 46 | const pkgPath = path.join(process.cwd(), 'package.json'); 47 | let _pack = []; 48 | let pkgJson = {}; 49 | if (fs.existsSync(pkgPath)) { 50 | pkgJson = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')); 51 | } 52 | let _package; 53 | let commIndex = argvs.findIndex(comm => comm == "--save"); 54 | let aliasCommIndex = argvs.findIndex(comm => comm == "-S"); 55 | let devCommIndex = argvs.findIndex(comm => comm == "--save-dev"); 56 | let aliasDevCommIndex = argvs.findIndex(comm => comm == "-D"); 57 | let globalCommIndex = argvs.findIndex(comm => comm == "-g"); 58 | let commLeng = argvs.length - 1; 59 | if (argvs.length !== 3 && !~commIndex && !~devCommIndex && !~aliasCommIndex && !~aliasDevCommIndex && !~globalCommIndex) { 60 | //no --save -S --save-dev -D -g 61 | console_log(ifHasLog, 'npm install xx'); 62 | _package = argvs.slice(3, commLeng + 1); 63 | _pack = getPackMsg(_package); 64 | } else if (commIndex == commLeng || devCommIndex == commLeng || aliasCommIndex == commLeng || aliasDevCommIndex == commLeng || globalCommIndex == commLeng) {//npm install xx --save 65 | console_log(ifHasLog, 'npm install xx --save ') 66 | _package = argvs.slice(3, commLeng) 67 | _pack = getPackMsg(_package) 68 | } else if (commIndex == 3 || devCommIndex == 3 || aliasCommIndex == 3 || aliasDevCommIndex == 3 || globalCommIndex == 3) {//npm install --save xx 69 | console_log(ifHasLog, 'npm install --save xx') 70 | _package = argvs.slice(4, commLeng + 1) 71 | _pack = getPackMsg(_package) 72 | } else if (argvs.length == 3 && argvs[2] == "install") {//npm install 73 | //ynpm install 命令 74 | try { 75 | console_log(ifHasLog, 'npm install') 76 | let dependencies = {}; 77 | pkgJson.dependencies = pkgJson.dependencies || {} 78 | pkgJson.devDependencies = pkgJson.devDependencies || {} 79 | dependencies = Object.assign(pkgJson.dependencies, pkgJson.devDependencies); 80 | Object.keys(dependencies).forEach(name => { 81 | _pack.push({name: name, version: dependencies[name]}) 82 | }) 83 | } catch (e) { 84 | console.error(chalk.red('\n package.json is not de find !')); 85 | } 86 | } 87 | const spinner = ora().start(); 88 | spinner.color = 'green'; 89 | // HOST_REGISTRY 90 | let allInner = installValidate(_pack, spinner);//内网缓存中下载 91 | let pkgs = _pack 92 | co(function* () { 93 | const argvs = process.argv; 94 | const argv_part = argvs.slice(2).join(' '); 95 | console_log(ifHasLog, 'process.argv', process.argv) 96 | console_log(ifHasLog, 'arg_install') 97 | let resultInstall = yield npminstall(argv_part, registry); 98 | //如果报错就不进行下去 99 | if (resultInstall.status !== 0) { 100 | stop(spinner, resultInstall.status); 101 | return 102 | } 103 | let formatResult 104 | 105 | let tempPkgs = {} 106 | yield addDownloadNum({installPackMap: JSON.stringify(pkgs)}) 107 | yield packageDownloadDetail(JSON.stringify(formatResult)) 108 | console.log('\n') 109 | console.log(chalk.green(`√ Finish, Happy enjoy coding!`)); 110 | stop(spinner); 111 | }).catch(err => { 112 | console.error(chalk.red('\n' + replaceErrMsg(err, registry))); 113 | stop(spinner); 114 | }); 115 | } 116 | 117 | 118 | function getPackMsg(_pack) { 119 | let _package = []; 120 | _pack.forEach(pa => { 121 | let count = countStrLeng(pa, "@"); 122 | let obj = {name: "", version: "latest"}; 123 | let _pas = pa.split("@"); 124 | if (count == 2) { 125 | obj.name = "@" + _pas[1]; 126 | obj.version = _pas[2]; 127 | } else { 128 | let ind = pa.indexOf("@"); 129 | if (ind == -1) { 130 | obj.name = pa; 131 | } else { 132 | obj.name = (ind == 0 ? "@" + _pas[1] : _pas[0]); 133 | obj.version = ind == 0 ? "latest" : _pas[1]; 134 | } 135 | } 136 | _package.push(obj) 137 | }) 138 | return _package 139 | } 140 | 141 | function stop(spinner, code = 0) { 142 | if (!spinner) return; 143 | spinner.stop(); 144 | process.exit(code); 145 | } 146 | 147 | /** 148 | * npm install validate after 149 | * @param {*} pkgs package object 150 | * @param {*} registry url 151 | */ 152 | 153 | function installValidate(pkgs, spinner) { 154 | if (pkgs && pkgs.length < 1) { 155 | console.error(chalk.red('\n sorry,error options or package is null !')); 156 | stop(spinner); 157 | return; 158 | } 159 | } 160 | 161 | 162 | function npminstall(arg_install, registry) { 163 | return co(function* () { 164 | try { 165 | // let res = yield Exec(arg_install, { 166 | // // env: parsedArgs.env, 167 | // cwd: process.cwd(), 168 | // stdio: [ 169 | // process.stdin, 170 | // process.stdout, 171 | // process.stderr 172 | // ] 173 | // }); 174 | // return eval(res)[0]; 175 | const argvs = process.argv; 176 | let command = argvs.splice(2) 177 | command.concat(['--registry', registry]) 178 | // console.log('command', command.concat(['--registry', registry])) 179 | var child = yield spawn.sync('npm', command.concat(['--registry', registry]), { 180 | // env: parsedArgs.env, 181 | cwd: process.cwd(), 182 | stdio: [ 183 | process.stdin, 184 | process.stdout, 185 | process.stderr 186 | ] 187 | }) 188 | return child 189 | } catch (err) { 190 | console.error(chalk.red('\n' + replaceErrMsg(err, registry))); 191 | return false; 192 | } 193 | }).catch(err => { 194 | console.error(chalk.red('\n' + replaceErrMsg(err, registry))); 195 | return false; 196 | }); 197 | } 198 | 199 | /** 200 | * 修改dependencies文件 201 | * @param {*} packJson 202 | * @param {*} dependencies 203 | * @param {*} type 204 | */ 205 | function updateDependencies(packJson) { 206 | let root = process.cwd(); 207 | fs.writeFileSync(path.join(`${root}`, 'package.json'), JSON.stringify(packJson, null, ' '), 'utf-8') 208 | } 209 | 210 | function showProcess(spinner, pkgs) { 211 | let text1 = `.`; 212 | let text2 = `..`; 213 | let text3 = `...`; 214 | let time = 0, value, index = 0; 215 | let pkgLeng = pkgs.length 216 | setInterval(() => { 217 | let item = pkgs[index]; 218 | if (time % 3 === 0) { 219 | value = text1 220 | } else if (time % 3 === 1) { 221 | value = text2 222 | } else { 223 | value = text3 224 | } 225 | if (index < pkgLeng - 1) { 226 | spinner.text = `[${pkgLeng}/${index}]Installing ${item.name} package ⬇️ ${value}` 227 | } else { 228 | spinner.text = `[${pkgLeng}/${pkgLeng}]Installing ${pkgs[pkgLeng - 1].name} package ⬇️ ${value}` 229 | } 230 | index++ 231 | time++ 232 | time === 3 ? time = 0 : null 233 | }, 800) 234 | } 235 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Nexus OSS 3.12 Info 4 | // const IPCOMPANY = '10.3.15.212';//内网 5 | const IPCOMPANY = '10.3.15.79';//内网 6 | const YON_INNER_MIRROR = 'http://'+IPCOMPANY+':80/repository/ynpm-all/'; 7 | //外网 8 | const YON_MIRROR = 'http://ynpm.yonyoucloud.com/repository/ynpm-all/'; 9 | const HOST_REGISTRY = 'http://'+IPCOMPANY+':80/repository/ynpm-private/'; 10 | // const HOST_REGISTRY = 'http://172.20.53.74:8081/repository/ynpm-private/'; 11 | const YNPM_SERVER = "https://package.yonyoucloud.com/npm"; 12 | // const YNPM_SERVER = "http://127.0.0.1:3001/npm"; 13 | 14 | const chalk = require('chalk'); 15 | const fs = require('fs'); 16 | const path = require('path'); 17 | const fetch = require('node-fetch'); 18 | const formData = require('form-data'); 19 | const co = require('co'); 20 | const tcpp = require('tcp-ping'); 21 | const thunkify = require("thunkify"); 22 | const btoa = require('btoa'); 23 | let objectAssign = require('object-assign'); 24 | const propertiesParser = require('properties-parser') 25 | const Ping = thunkify(tcpp.ping); 26 | 27 | const help = require('./help'); 28 | const userPath = process.env.HOME; 29 | const fileName = "ynpm"; 30 | 31 | 32 | /** 33 | * 根据数据源寻找属性是否存在 34 | * @param {array }}} array 数据源 35 | * @param {string} attr 属性 36 | */ 37 | function getByAtrrBool(array,attr){ 38 | let b = false; 39 | for(let index = 0; index < array.length; index++) { 40 | const element = array[index]; 41 | element == attr?b = true:""; 42 | } 43 | return b; 44 | } 45 | 46 | /** 47 | *server 接口设置 48 | * @param {*} config 49 | * @returns 50 | */ 51 | function getHttpConfig(config){ 52 | return Object.assign({ 53 | host: YNPM_SERVER 54 | },config) 55 | } 56 | 57 | function getCommands(fileName){ 58 | let config = {}; 59 | let argvs = process.argv; 60 | try{ 61 | let attr 62 | if(argvs[2] == "set" && argvs[3].indexOf("email") > -1 ){ 63 | let data = propertiesParser.read(getRcFile(fileName)); 64 | attr = argvs[3].split("="); 65 | if(attr[1]===undefined){ 66 | console.error('email 不能为空') 67 | return 68 | } 69 | data[attr[0]] = attr[1]; 70 | data["sshk"] = btoa(data.user+":"+data.user); 71 | data["_auth"] = btoa(data.user+":"+data.user); 72 | let sshk = data["sshk"]; 73 | help.showSSHKMsg(sshk) 74 | config = data; 75 | }else if(argvs[2] == "set"){ 76 | attr = argvs[3].split("="); 77 | config[attr[0]] = attr[1]; 78 | }else{return null;} 79 | return config; 80 | }catch(e){ 81 | return null; 82 | } 83 | 84 | } 85 | 86 | function getIPAdress(){ 87 | var interfaces = require('os').networkInterfaces(); 88 | for(var devName in interfaces){ 89 | var iface = interfaces[devName]; 90 | for(var i=0;i{ 130 | // if(error) { 131 | // console.error('error: ' + error); 132 | // return; 133 | // } 134 | // exec(set_npmrc_auth_config,(error, stdout, stderr)=>{ 135 | // if(error) { 136 | // console.error('error: ' + error); 137 | // return; 138 | // } 139 | // }); 140 | // }); 141 | // } 142 | }; 143 | } 144 | }catch(e){ 145 | 146 | } 147 | } 148 | 149 | 150 | /** 151 | * 获取文件 152 | * @param {any} fileName 153 | * @returns 154 | */ 155 | function getRc(fileName){ 156 | if(getValidateRc(fileName)){ 157 | return propertiesParser.read(getRcFile(fileName)); 158 | }else{ 159 | return null; 160 | } 161 | } 162 | /** 163 | * 判断是否有Rc文件 164 | * @param {any} fileName 165 | * @returns true、false 166 | */ 167 | function getValidateRc(fileName){ 168 | try { 169 | fs.accessSync(getRcFile(fileName),fs.F_OK); 170 | }catch (e) { 171 | return false; 172 | } 173 | return true; 174 | } 175 | 176 | function getRcFile(fileName){ 177 | let filePath = fileName? userPath+"/."+fileName+"rc":""; 178 | return filePath; 179 | } 180 | /** 181 | * package.json中信息抽取有用信息 182 | * @param {any} jsonParams 183 | * @returns json 184 | */ 185 | 186 | function getPckParams(jsonParams){ 187 | delete jsonParams.scripts 188 | delete jsonParams.devDependencies 189 | delete jsonParams.dependencies 190 | return jsonParams; 191 | } 192 | 193 | 194 | // 过滤敏感 ip地址 195 | function replaceErrMsg(err,key) { 196 | if(typeof err !== 'string') { 197 | err = err+'' 198 | } 199 | return err.replace(new RegExp(key,'g'),"").replace(/npm \-\-registry\=/,'ynpm'); 200 | } 201 | // upload 202 | function uploadReadme(name) { 203 | try { 204 | let readmeFilePath = path.join(process.cwd(), 'README.md'); 205 | let form = new formData(); 206 | if (fs.existsSync(readmeFilePath)) { 207 | form.append("readme", fs.readFileSync(readmeFilePath, 'utf-8')); 208 | form.append("name", name); 209 | return fetch(getHttpConfig().host + '/package/readmeUpload', {method: 'post', body: form}) 210 | .then(res => res.json()) 211 | .then((res) => { 212 | if(res.success) { 213 | console.log('\n') 214 | console.log(chalk.green('README.md file upload success!')); 215 | } else { 216 | console.log('\n') 217 | console.log(res.msg); 218 | } 219 | }).catch(err => { 220 | console.log('\n'); 221 | console.log(err); 222 | }) 223 | } else { 224 | console.log('\n') 225 | console.log(chalk.yellow('[WARN]:NO README.md file, Please add README.md!')); 226 | return new Promise((reslove) => reslove()); 227 | } 228 | } catch (err) { 229 | console.log(chalk.dim(err)); 230 | return new Promise(); 231 | } 232 | } 233 | 234 | // sync 235 | function sync(name) { 236 | try { 237 | let form = new formData(); 238 | form.append("name", name); 239 | return fetch(getHttpConfig().host + '/package/syncPackage', {method: 'post', body: form}) 240 | .then(res => res.json()) 241 | .then((res) => { 242 | if(res.success) { 243 | console.log('\n'); 244 | console.log(chalk.green(`package ${name} synchronization success!`)); 245 | } else { 246 | console.log('\n'); 247 | console.error(chalk.red('\n' + res.message)); 248 | } 249 | }) 250 | } catch (err) { 251 | console.log(chalk.dim(err)); 252 | return new Promise(); 253 | } 254 | } 255 | 256 | module.exports = { 257 | registry:"", 258 | IPCOMPANY, 259 | YON_MIRROR, 260 | YON_INNER_MIRROR, 261 | // DEAFAULT_MIRROR, 262 | HOST_REGISTRY, 263 | // CDNJSON, 264 | getHttpConfig, 265 | setRc, 266 | getRc, 267 | getByAtrrBool, 268 | getPckParams, 269 | getRcFile, 270 | sync, 271 | replaceErrMsg, 272 | getIPAdress, 273 | uploadReadme, 274 | getPing: (action) => { 275 | return co(function* (){ 276 | // Ping内网 277 | const Ping_Response = yield Ping({ 278 | address: IPCOMPANY, 279 | port: 8081, 280 | timeout: 50, 281 | attempts: 1 282 | }) 283 | if(action === 'install' || action === 'i') { // 只在安装的时候给提示语 284 | if(Ping_Response.avg) { 285 | console.log(chalk.dim('Yonyou Inner Mirror Downloading...\n')); 286 | } else { 287 | console.log(chalk.dim(`Yonyou Mirror Downloading...\n`)); 288 | } 289 | } 290 | let registry = Ping_Response.avg ? YON_INNER_MIRROR : YON_MIRROR; 291 | 292 | this.registry = registry; 293 | return registry; 294 | }).catch(err => { 295 | console.error(chalk.red('\n' + err)); 296 | }); 297 | } 298 | } 299 | -------------------------------------------------------------------------------- /_docs/source/shCoreDefault.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter a, 18 | .syntaxhighlighter div, 19 | .syntaxhighlighter code, 20 | .syntaxhighlighter table, 21 | .syntaxhighlighter table td, 22 | .syntaxhighlighter table tr, 23 | .syntaxhighlighter table tbody, 24 | .syntaxhighlighter table thead, 25 | .syntaxhighlighter table caption, 26 | .syntaxhighlighter textarea { 27 | -moz-border-radius: 0 0 0 0 !important; 28 | -webkit-border-radius: 0 0 0 0 !important; 29 | background: none !important; 30 | border: 0 !important; 31 | bottom: auto !important; 32 | float: none !important; 33 | height: auto !important; 34 | left: auto !important; 35 | line-height: 1.1em !important; 36 | margin: 0 !important; 37 | outline: 0 !important; 38 | overflow: visible !important; 39 | padding: 0 !important; 40 | position: static !important; 41 | right: auto !important; 42 | text-align: left !important; 43 | top: auto !important; 44 | vertical-align: baseline !important; 45 | width: auto !important; 46 | box-sizing: content-box !important; 47 | font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; 48 | font-weight: normal !important; 49 | font-style: normal !important; 50 | font-size: 1em !important; 51 | min-height: inherit !important; 52 | min-height: auto !important; 53 | } 54 | 55 | .syntaxhighlighter { 56 | width: 100% !important; 57 | margin: 1em 0 1em 0 !important; 58 | position: relative !important; 59 | overflow: auto !important; 60 | font-size: 1em !important; 61 | } 62 | 63 | .syntaxhighlighter.source { 64 | overflow: hidden !important; 65 | } 66 | 67 | .syntaxhighlighter .bold { 68 | font-weight: bold !important; 69 | } 70 | 71 | .syntaxhighlighter .italic { 72 | font-style: italic !important; 73 | } 74 | 75 | .syntaxhighlighter .line { 76 | white-space: pre !important; 77 | } 78 | 79 | .syntaxhighlighter table { 80 | width: 100% !important; 81 | } 82 | 83 | .syntaxhighlighter table caption { 84 | text-align: left !important; 85 | padding: .5em 0 0.5em 1em !important; 86 | } 87 | 88 | .syntaxhighlighter table td.code { 89 | width: 100% !important; 90 | } 91 | 92 | .syntaxhighlighter table td.code .container { 93 | position: relative !important; 94 | } 95 | 96 | .syntaxhighlighter table td.code .container textarea { 97 | box-sizing: border-box !important; 98 | position: absolute !important; 99 | left: 0 !important; 100 | top: 0 !important; 101 | width: 100% !important; 102 | height: 100% !important; 103 | border: none !important; 104 | background: white !important; 105 | padding-left: 1em !important; 106 | overflow: hidden !important; 107 | white-space: pre !important; 108 | } 109 | 110 | .syntaxhighlighter table td.gutter .line { 111 | text-align: right !important; 112 | padding: 0 0.5em 0 1em !important; 113 | } 114 | 115 | .syntaxhighlighter table td.code .line { 116 | padding: 0 1em !important; 117 | } 118 | 119 | .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { 120 | padding-left: 0em !important; 121 | } 122 | 123 | .syntaxhighlighter.show { 124 | display: block !important; 125 | } 126 | 127 | .syntaxhighlighter.collapsed table { 128 | display: none !important; 129 | } 130 | 131 | .syntaxhighlighter.collapsed .toolbar { 132 | padding: 0.1em 0.8em 0em 0.8em !important; 133 | font-size: 1em !important; 134 | position: static !important; 135 | width: auto !important; 136 | height: auto !important; 137 | } 138 | 139 | .syntaxhighlighter.collapsed .toolbar span { 140 | display: inline !important; 141 | margin-right: 1em !important; 142 | } 143 | 144 | .syntaxhighlighter.collapsed .toolbar span a { 145 | padding: 0 !important; 146 | display: none !important; 147 | } 148 | 149 | .syntaxhighlighter.collapsed .toolbar span a.expandSource { 150 | display: inline !important; 151 | } 152 | 153 | .syntaxhighlighter .toolbar { 154 | position: absolute !important; 155 | right: 1px !important; 156 | top: 1px !important; 157 | width: 11px !important; 158 | height: 11px !important; 159 | font-size: 10px !important; 160 | z-index: 10 !important; 161 | } 162 | 163 | .syntaxhighlighter .toolbar span.title { 164 | display: inline !important; 165 | } 166 | 167 | .syntaxhighlighter .toolbar a { 168 | display: block !important; 169 | text-align: center !important; 170 | text-decoration: none !important; 171 | padding-top: 1px !important; 172 | } 173 | 174 | .syntaxhighlighter .toolbar a.expandSource { 175 | display: none !important; 176 | } 177 | 178 | .syntaxhighlighter.ie { 179 | font-size: .9em !important; 180 | padding: 1px 0 1px 0 !important; 181 | } 182 | 183 | .syntaxhighlighter.ie .toolbar { 184 | line-height: 8px !important; 185 | } 186 | 187 | .syntaxhighlighter.ie .toolbar a { 188 | padding-top: 0px !important; 189 | } 190 | 191 | .syntaxhighlighter.printing .line.alt1 .content, 192 | .syntaxhighlighter.printing .line.alt2 .content, 193 | .syntaxhighlighter.printing .line.highlighted .number, 194 | .syntaxhighlighter.printing .line.highlighted.alt1 .content, 195 | .syntaxhighlighter.printing .line.highlighted.alt2 .content { 196 | background: none !important; 197 | } 198 | 199 | .syntaxhighlighter.printing .line .number { 200 | color: #bbbbbb !important; 201 | } 202 | 203 | .syntaxhighlighter.printing .line .content { 204 | color: black !important; 205 | } 206 | 207 | .syntaxhighlighter.printing .toolbar { 208 | display: none !important; 209 | } 210 | 211 | .syntaxhighlighter.printing a { 212 | text-decoration: none !important; 213 | } 214 | 215 | .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { 216 | color: black !important; 217 | } 218 | 219 | .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { 220 | color: #008200 !important; 221 | } 222 | 223 | .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { 224 | color: blue !important; 225 | } 226 | 227 | .syntaxhighlighter.printing .keyword { 228 | color: #006699 !important; 229 | font-weight: bold !important; 230 | } 231 | 232 | .syntaxhighlighter.printing .preprocessor { 233 | color: gray !important; 234 | } 235 | 236 | .syntaxhighlighter.printing .variable { 237 | color: #aa7700 !important; 238 | } 239 | 240 | .syntaxhighlighter.printing .value { 241 | color: #009900 !important; 242 | } 243 | 244 | .syntaxhighlighter.printing .functions { 245 | color: #ff1493 !important; 246 | } 247 | 248 | .syntaxhighlighter.printing .constants { 249 | color: #0066cc !important; 250 | } 251 | 252 | .syntaxhighlighter.printing .script { 253 | font-weight: bold !important; 254 | } 255 | 256 | .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { 257 | color: gray !important; 258 | } 259 | 260 | .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { 261 | color: #ff1493 !important; 262 | } 263 | 264 | .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { 265 | color: red !important; 266 | } 267 | 268 | .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { 269 | color: black !important; 270 | } 271 | 272 | .syntaxhighlighter { 273 | background-color: white !important; 274 | } 275 | 276 | .syntaxhighlighter .line.alt1 { 277 | background-color: white !important; 278 | } 279 | 280 | .syntaxhighlighter .line.alt2 { 281 | background-color: white !important; 282 | } 283 | 284 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 285 | background-color: #e0e0e0 !important; 286 | } 287 | 288 | .syntaxhighlighter .line.highlighted.number { 289 | color: black !important; 290 | } 291 | 292 | .syntaxhighlighter table caption { 293 | color: black !important; 294 | } 295 | 296 | .syntaxhighlighter .gutter { 297 | color: #afafaf !important; 298 | } 299 | 300 | .syntaxhighlighter .gutter .line { 301 | border-right: 3px solid #6ce26c !important; 302 | } 303 | 304 | .syntaxhighlighter .gutter .line.highlighted { 305 | background-color: #6ce26c !important; 306 | color: white !important; 307 | } 308 | 309 | .syntaxhighlighter.printing .line .content { 310 | border: none !important; 311 | } 312 | 313 | .syntaxhighlighter.collapsed { 314 | overflow: visible !important; 315 | } 316 | 317 | .syntaxhighlighter.collapsed .toolbar { 318 | color: blue !important; 319 | background: white !important; 320 | border: 1px solid #6ce26c !important; 321 | } 322 | 323 | .syntaxhighlighter.collapsed .toolbar a { 324 | color: blue !important; 325 | } 326 | 327 | .syntaxhighlighter.collapsed .toolbar a:hover { 328 | color: red !important; 329 | } 330 | 331 | .syntaxhighlighter .toolbar { 332 | color: white !important; 333 | background: #6ce26c !important; 334 | border: none !important; 335 | } 336 | 337 | .syntaxhighlighter .toolbar a { 338 | color: white !important; 339 | } 340 | 341 | .syntaxhighlighter .toolbar a:hover { 342 | color: black !important; 343 | } 344 | 345 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 346 | color: black !important; 347 | } 348 | 349 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 350 | color: #008200 !important; 351 | } 352 | 353 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 354 | color: blue !important; 355 | } 356 | 357 | .syntaxhighlighter .keyword { 358 | color: #006699 !important; 359 | } 360 | 361 | .syntaxhighlighter .preprocessor { 362 | color: gray !important; 363 | } 364 | 365 | .syntaxhighlighter .variable { 366 | color: #aa7700 !important; 367 | } 368 | 369 | .syntaxhighlighter .value { 370 | color: #009900 !important; 371 | } 372 | 373 | .syntaxhighlighter .functions { 374 | color: #ff1493 !important; 375 | } 376 | 377 | .syntaxhighlighter .constants { 378 | color: #0066cc !important; 379 | } 380 | 381 | .syntaxhighlighter .script { 382 | font-weight: bold !important; 383 | color: #006699 !important; 384 | background-color: none !important; 385 | } 386 | 387 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 388 | color: gray !important; 389 | } 390 | 391 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 392 | color: #ff1493 !important; 393 | } 394 | 395 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 396 | color: red !important; 397 | } 398 | 399 | .syntaxhighlighter .keyword { 400 | font-weight: bold !important; 401 | } 402 | -------------------------------------------------------------------------------- /_docs/source/shCore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{})) 18 | -------------------------------------------------------------------------------- /_docs/source/docs.min.css: -------------------------------------------------------------------------------- 1 | .hll{background-color:#ffc}.c{color:#999}.err{color:#A00;background-color:#FAA}.k{color:#069}.o{color:#555}.cm{color:#999}.cp{color:#099}.c1{color:#999}.cs{color:#999}.gd{background-color:#FCC;border:1px solid #C00}.ge{font-style:italic}.gr{color:red}.gh{color:#030}.gi{background-color:#CFC;border:1px solid #0C0}.go{color:#AAA}.gp{color:#009}.gu{color:#030}.gt{color:#9C6}.kc{color:#069}.kd{color:#069}.kn{color:#069}.kp{color:#069}.kr{color:#069}.kt{color:#078}.m{color:#F60}.s{color:#d44950}.na{color:#4f9fcf}.nb{color:#366}.nc{color:#0A8}.no{color:#360}.nd{color:#99F}.ni{color:#999}.ne{color:#C00}.nf{color:#C0F}.nl{color:#99F}.nn{color:#0CF}.nt{color:#2f6f9f}.nv{color:#033}.ow{color:#000}.w{color:#bbb}.mf{color:#F60}.mh{color:#F60}.mi{color:#F60}.mo{color:#F60}.sb{color:#C30}.sc{color:#C30}.sd{color:#C30;font-style:italic}.s2{color:#C30}.se{color:#C30}.sh{color:#C30}.si{color:#A00}.sx{color:#C30}.sr{color:#3AA}.s1{color:#C30}.ss{color:#FC3}.bp{color:#366}.vc{color:#033}.vg{color:#033}.vi{color:#033}.il{color:#F60}.css .nt+.nt,.css .o,.css .o+.nt{color:#999}/*! 2 | * Bootstrap Docs (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 5 | * details, see https://creativecommons.org/licenses/by/3.0/. 6 | */body{position:relative}.table code{font-size:13px;font-weight:400}h2 code,h3 code,h4 code{background-color:inherit}.btn-outline{color:#563d7c;background-color:transparent;border-color:#563d7c}.btn-outline:active,.btn-outline:focus,.btn-outline:hover{color:#fff;background-color:#563d7c;border-color:#563d7c}.btn-outline-inverse{color:#fff;background-color:transparent;border-color:#cdbfe3}.btn-outline-inverse:active,.btn-outline-inverse:focus,.btn-outline-inverse:hover{color:#563d7c;text-shadow:none;background-color:#fff;border-color:#fff}.bs-docs-booticon{display:block;font-weight:500;color:#fff;text-align:center;cursor:default;background-color:#563d7c;border-radius:15%}.bs-docs-booticon-sm{width:30px;height:30px;font-size:20px;line-height:28px}.bs-docs-booticon-lg{width:144px;height:144px;font-size:108px;line-height:140px}.bs-docs-booticon-inverse{color:#563d7c;background-color:#fff}.bs-docs-booticon-outline{background-color:transparent;border:1px solid #cdbfe3}#skippy{display:block;padding:1em;color:#fff;background-color:#6f5499;outline:0}#skippy .skiplink-text{padding:.5em;outline:1px dotted}#content:focus{outline:0}.bs-docs-nav{margin-bottom:0;background-color:#fff;border-bottom:0}.bs-home-nav .bs-nav-b{display:none}.bs-docs-nav .navbar-brand,.bs-docs-nav .navbar-nav>li>a{font-weight:500;color:#563d7c}.bs-docs-nav .navbar-nav>.active>a,.bs-docs-nav .navbar-nav>.active>a:hover,.bs-docs-nav .navbar-nav>li>a:hover{color:#463265;background-color:#f9f9f9}.bs-docs-nav .navbar-toggle .icon-bar{background-color:#563d7c}.bs-docs-nav .navbar-header .navbar-toggle{border-color:#fff}.bs-docs-nav .navbar-header .navbar-toggle:focus,.bs-docs-nav .navbar-header .navbar-toggle:hover{background-color:#f9f9f9;border-color:#f9f9f9}.bs-docs-footer{padding-top:40px;padding-bottom:40px;margin-top:100px;color:#767676;text-align:center;border-top:1px solid #e5e5e5}.bs-docs-footer-links{padding-left:0;margin-top:20px}.bs-docs-footer-links li{display:inline;padding:0 2px}.bs-docs-footer-links li:first-child{padding-left:0}@media (min-width:768px){.bs-docs-footer p{margin-bottom:0}}.bs-docs-social{margin-bottom:20px;text-align:center}.bs-docs-social-buttons{display:inline-block;padding-left:0;margin-bottom:0;list-style:none}.bs-docs-social-buttons li{display:inline-block;padding:5px 8px;line-height:1}.bs-docs-social-buttons .twitter-follow-button{width:225px!important}.bs-docs-social-buttons .twitter-share-button{width:98px!important}.github-btn{overflow:hidden;border:0}.bs-docs-header,.bs-docs-masthead{position:relative;padding:30px 0;color:#cdbfe3;text-align:center;text-shadow:0 1px 0 rgba(0,0,0,.1);background-color:#6f5499;background-image:-webkit-gradient(linear,left top,left bottom,from(#563d7c),to(#6f5499));background-image:-webkit-linear-gradient(top,#563d7c 0,#6f5499 100%);background-image:-o-linear-gradient(top,#563d7c 0,#6f5499 100%);background-image:linear-gradient(to bottom,#563d7c 0,#6f5499 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);background-repeat:repeat-x}.bs-docs-masthead .bs-docs-booticon{margin:0 auto 30px}.bs-docs-masthead h1{font-weight:300;line-height:1;color:#fff}.bs-docs-masthead .lead{margin:0 auto 30px;font-size:20px;color:#fff}.bs-docs-masthead .version{margin-top:-15px;margin-bottom:30px;color:#9783b9}.bs-docs-masthead .btn{width:100%;padding:15px 30px;font-size:20px}@media (min-width:480px){.bs-docs-masthead .btn{width:auto}}@media (min-width:768px){.bs-docs-masthead{padding:80px 0}.bs-docs-masthead h1{font-size:60px}.bs-docs-masthead .lead{font-size:24px}}@media (min-width:992px){.bs-docs-masthead .lead{width:80%;font-size:30px}}.bs-docs-header{margin-bottom:40px;font-size:20px}.bs-docs-header h1{margin-top:0;color:#fff}.bs-docs-header p{margin-bottom:0;font-weight:300;line-height:1.4}.bs-docs-header .container{position:relative}@media (min-width:768px){.bs-docs-header{padding-top:60px;padding-bottom:60px;font-size:24px;text-align:left}.bs-docs-header h1{font-size:60px;line-height:1}}@media (min-width:992px){.bs-docs-header h1,.bs-docs-header p{margin-right:380px}}.carbonad{width:auto!important;height:auto!important;padding:20px!important;margin:30px -15px -31px!important;overflow:hidden;font-size:13px!important;line-height:16px!important;text-align:left;background:0 0!important;border:solid #866ab3!important;border-width:1px 0!important}.carbonad-img{margin:0!important}.carbonad-tag,.carbonad-text{display:block!important;float:none!important;width:auto!important;height:auto!important;margin-left:145px!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif!important}.carbonad-text{padding-top:0!important}.carbonad-tag{color:inherit!important;text-align:left!important}.carbonad-tag a,.carbonad-text a{color:#fff!important}.carbonad #azcarbon>img{display:none}@media (min-width:480px){.carbonad{width:330px!important;margin:20px auto!important;border-width:1px!important;border-radius:4px}.bs-docs-masthead .carbonad{margin:50px auto 0!important}}@media (min-width:768px){.carbonad{margin-right:0!important;margin-left:0!important}}@media (min-width:992px){.carbonad{position:absolute;top:0;right:15px;width:330px!important;padding:15px!important;margin:0!important}.bs-docs-masthead .carbonad{position:static}}.bs-docs-featurette{padding-top:40px;padding-bottom:40px;font-size:16px;line-height:1.5;color:#555;text-align:center;background-color:#fff;border-bottom:1px solid #e5e5e5}.bs-docs-featurette+.bs-docs-footer{margin-top:0;border-top:0}.bs-docs-featurette-title{margin-bottom:5px;font-size:30px;font-weight:400;color:#333}.half-rule{width:100px;margin:40px auto}.bs-docs-featurette h3{margin-bottom:5px;font-weight:400;color:#333}.bs-docs-featurette-img{display:block;margin-bottom:20px;color:#333}.bs-docs-featurette-img:hover{color:#337ab7;text-decoration:none}.bs-docs-featurette-img img{display:block;margin-bottom:15px}@media (min-width:480px){.bs-docs-featurette .img-responsive{margin-top:30px}}@media (min-width:768px){.bs-docs-featurette{padding-top:100px;padding-bottom:100px}.bs-docs-featurette-title{font-size:40px}.bs-docs-featurette .lead{max-width:80%;margin-right:auto;margin-left:auto}.bs-docs-featurette .img-responsive{margin-top:0}}.bs-docs-featured-sites{margin-right:-1px;margin-left:-1px}.bs-docs-featured-sites .col-xs-6{padding:1px}.bs-docs-featured-sites .img-responsive{margin-top:0}@media (min-width:768px){.bs-docs-featured-sites .col-sm-3:first-child img{border-top-left-radius:4px;border-bottom-left-radius:4px}.bs-docs-featured-sites .col-sm-3:last-child img{border-top-right-radius:4px;border-bottom-right-radius:4px}}.bs-examples .thumbnail{margin-bottom:10px}.bs-examples h4{margin-bottom:5px}.bs-examples p{margin-bottom:20px}@media (max-width:480px){.bs-examples{margin-right:-10px;margin-left:-10px}.bs-examples>[class^=col-]{padding-right:10px;padding-left:10px}}.bs-docs-sidebar.affix{position:static}@media (min-width:768px){.bs-docs-sidebar{padding-left:20px}}.bs-docs-sidenav{margin-top:20px;margin-bottom:20px}.bs-docs-sidebar .nav>li>a{display:block;padding:4px 20px;font-size:13px;font-weight:500;color:#767676}.bs-docs-sidebar .nav>li>a:focus,.bs-docs-sidebar .nav>li>a:hover{padding-left:19px;color:#563d7c;text-decoration:none;background-color:transparent;border-left:1px solid #563d7c}.bs-docs-sidebar .nav>.active:focus>a,.bs-docs-sidebar .nav>.active:hover>a,.bs-docs-sidebar .nav>.active>a{padding-left:18px;font-weight:700;color:#563d7c;background-color:transparent;border-left:2px solid #563d7c}.bs-docs-sidebar .nav .nav{display:none;padding-bottom:10px}.bs-docs-sidebar .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-size:12px;font-weight:400}.bs-docs-sidebar .nav .nav>li>a:focus,.bs-docs-sidebar .nav .nav>li>a:hover{padding-left:29px}.bs-docs-sidebar .nav .nav>.active:focus>a,.bs-docs-sidebar .nav .nav>.active:hover>a,.bs-docs-sidebar .nav .nav>.active>a{padding-left:28px;font-weight:500}.back-to-top,.bs-docs-theme-toggle{display:none;padding:4px 10px;margin-top:10px;margin-left:10px;font-size:12px;font-weight:500;color:#999}.back-to-top:hover,.bs-docs-theme-toggle:hover{color:#563d7c;text-decoration:none}.bs-docs-theme-toggle{margin-top:0}@media (min-width:768px){.back-to-top,.bs-docs-theme-toggle{display:block}}@media (min-width:992px){.bs-docs-sidebar .nav>.active>ul{display:block}.bs-docs-sidebar.affix,.bs-docs-sidebar.affix-bottom{width:213px}.bs-docs-sidebar.affix{position:fixed;top:20px}.bs-docs-sidebar.affix-bottom{position:absolute}.bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav{margin-top:0;margin-bottom:0}}@media (min-width:1200px){.bs-docs-sidebar.affix,.bs-docs-sidebar.affix-bottom{width:263px}}.bs-docs-section{margin-bottom:60px}.bs-docs-section:last-child{margin-bottom:0}h1[id]{padding-top:20px;margin-top:0}.bs-callout{padding:20px;margin:20px 0;border:1px solid #eee;border-left-width:5px;border-radius:3px}.bs-callout h4{margin-top:0;margin-bottom:5px}.bs-callout p:last-child{margin-bottom:0}.bs-callout code{border-radius:3px}.bs-callout+.bs-callout{margin-top:-5px}.bs-callout-danger{border-left-color:#ce4844}.bs-callout-danger h4{color:#ce4844}.bs-callout-warning{border-left-color:#aa6708}.bs-callout-warning h4{color:#aa6708}.bs-callout-info{border-left-color:#1b809e}.bs-callout-info h4{color:#1b809e}.color-swatches{margin:0 -5px;overflow:hidden}.color-swatch{float:left;width:60px;height:60px;margin:0 5px;border-radius:3px}@media (min-width:768px){.color-swatch{width:100px;height:100px}}.color-swatches .gray-darker{background-color:#222}.color-swatches .gray-dark{background-color:#333}.color-swatches .gray{background-color:#555}.color-swatches .gray-light{background-color:#999}.color-swatches .gray-lighter{background-color:#eee}.color-swatches .brand-primary{background-color:#337ab7}.color-swatches .brand-success{background-color:#5cb85c}.color-swatches .brand-warning{background-color:#f0ad4e}.color-swatches .brand-danger{background-color:#d9534f}.color-swatches .brand-info{background-color:#5bc0de}.color-swatches .bs-purple{background-color:#563d7c}.color-swatches .bs-purple-light{background-color:#c7bfd3}.color-swatches .bs-purple-lighter{background-color:#e5e1ea}.color-swatches .bs-gray{background-color:#f9f9f9}.bs-team .team-member{line-height:32px;color:#555}.bs-team .team-member:hover{color:#333;text-decoration:none}.bs-team .github-btn{float:right;width:180px;height:20px;margin-top:6px}.bs-team img{float:left;width:32px;margin-right:10px;border-radius:4px}.bs-docs-browser-bugs td p{margin-bottom:0}.bs-docs-browser-bugs th:first-child{width:18%}.show-grid{margin-bottom:15px}.show-grid [class^=col-]{padding-top:10px;padding-bottom:10px;background-color:#eee;background-color:rgba(86,61,124,.15);border:1px solid #ddd;border:1px solid rgba(86,61,124,.2)}.bs-example{position:relative;padding:45px 15px 15px;margin:0 -15px 15px;border-color:#e5e5e5 #eee #eee;border-style:solid;border-width:1px 0;-webkit-box-shadow:inset 0 3px 6px rgba(0,0,0,.05);box-shadow:inset 0 3px 6px rgba(0,0,0,.05)}.bs-example:after{position:absolute;top:15px;left:15px;font-size:12px;font-weight:700;color:#959595;text-transform:uppercase;letter-spacing:1px;content:"Example"}.bs-example-padded-bottom{padding-bottom:24px}.bs-example+.highlight,.bs-example+.zero-clipboard+.highlight{margin:-15px -15px 15px;border-width:0 0 1px;border-radius:0}@media (min-width:768px){.bs-example{margin-right:0;margin-left:0;background-color:#fff;border-color:#ddd;border-width:1px;border-radius:4px 4px 0 0;-webkit-box-shadow:none;box-shadow:none}.bs-example+.highlight,.bs-example+.zero-clipboard+.highlight{margin-top:-16px;margin-right:0;margin-left:0;border-width:1px;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.bs-example-standalone{border-radius:4px}}.bs-example .container{width:auto}.bs-example>.alert:last-child,.bs-example>.form-control:last-child,.bs-example>.jumbotron:last-child,.bs-example>.list-group:last-child,.bs-example>.navbar:last-child,.bs-example>.panel:last-child,.bs-example>.progress:last-child,.bs-example>.table-responsive:last-child>.table,.bs-example>.table:last-child,.bs-example>.well:last-child,.bs-example>blockquote:last-child,.bs-example>ol:last-child,.bs-example>p:last-child,.bs-example>ul:last-child{margin-bottom:0}.bs-example>p>.close{float:none}.bs-example-type .table .type-info{color:#767676;vertical-align:middle}.bs-example-type .table td{padding:15px 0;border-color:#eee}.bs-example-type .table tr:first-child td{border-top:0}.bs-example-type h1,.bs-example-type h2,.bs-example-type h3,.bs-example-type h4,.bs-example-type h5,.bs-example-type h6{margin:0}.bs-example-bg-classes p{padding:15px}.bs-example>.img-circle,.bs-example>.img-rounded,.bs-example>.img-thumbnail{margin:5px}.bs-example>.table-responsive>.table{background-color:#fff}.bs-example>.btn,.bs-example>.btn-group{margin-top:5px;margin-bottom:5px}.bs-example>.btn-toolbar+.btn-toolbar{margin-top:10px}.bs-example-control-sizing input[type=text]+input[type=text],.bs-example-control-sizing select{margin-top:10px}.bs-example-form .input-group{margin-bottom:10px}.bs-example>textarea.form-control{resize:vertical}.bs-example>.list-group{max-width:400px}.bs-example .navbar:last-child{margin-bottom:0}.bs-navbar-bottom-example,.bs-navbar-top-example{z-index:1;padding:0;overflow:hidden}.bs-navbar-bottom-example .navbar-header,.bs-navbar-top-example .navbar-header{margin-left:0}.bs-navbar-bottom-example .navbar-fixed-bottom,.bs-navbar-top-example .navbar-fixed-top{position:relative;margin-right:0;margin-left:0}.bs-navbar-top-example{padding-bottom:45px}.bs-navbar-top-example:after{top:auto;bottom:15px}.bs-navbar-top-example .navbar-fixed-top{top:-1px}.bs-navbar-bottom-example{padding-top:45px}.bs-navbar-bottom-example .navbar-fixed-bottom{bottom:-1px}.bs-navbar-bottom-example .navbar{margin-bottom:0}@media (min-width:768px){.bs-navbar-bottom-example .navbar-fixed-bottom,.bs-navbar-top-example .navbar-fixed-top{position:absolute}}.bs-example .pagination{margin-top:10px;margin-bottom:10px}.bs-example>.pager{margin-top:0}.bs-example-modal{background-color:#f5f5f5}.bs-example-modal .modal{position:relative;top:auto;right:auto;bottom:auto;left:auto;z-index:1;display:block}.bs-example-modal .modal-dialog{left:auto;margin-right:auto;margin-left:auto}.bs-example>.dropdown>.dropdown-toggle{float:left}.bs-example>.dropdown>.dropdown-menu{position:static;display:block;margin-bottom:5px;clear:left}.bs-example-tabs .nav-tabs{margin-bottom:15px}.bs-example-tooltips{text-align:center}.bs-example-tooltips>.btn{margin-top:5px;margin-bottom:5px}.bs-example-tooltip .tooltip{position:relative;display:inline-block;margin:10px 20px;opacity:1}.bs-example-popover{padding-bottom:24px;background-color:#f9f9f9}.bs-example-popover .popover{position:relative;display:block;float:left;width:260px;margin:20px}.scrollspy-example{position:relative;height:200px;margin-top:10px;overflow:auto}.bs-example>.nav-pills-stacked-example{max-width:300px}#collapseExample .well{margin-bottom:0}.bs-events-table>tbody>tr>td:first-child,.bs-events-table>thead>tr>th:first-child{white-space:nowrap}.bs-events-table>thead>tr>th:first-child{width:150px}.js-options-table>thead>tr>th:nth-child(1),.js-options-table>thead>tr>th:nth-child(2){width:100px}.js-options-table>thead>tr>th:nth-child(3){width:50px}.highlight{padding:9px 14px;margin-bottom:14px;background-color:#f7f7f9;border:1px solid #e1e1e8;border-radius:4px}.highlight pre{padding:0;margin-top:0;margin-bottom:0;word-break:normal;white-space:nowrap;background-color:transparent;border:0}.highlight pre code{font-size:inherit;color:#333}.highlight pre code:first-child{display:inline-block;padding-right:45px}.table-responsive .highlight pre{white-space:normal}.bs-table th small,.responsive-utilities th small{display:block;font-weight:400;color:#999}.responsive-utilities tbody th{font-weight:400}.responsive-utilities td{text-align:center}.responsive-utilities td.is-visible{color:#468847;background-color:#dff0d8!important}.responsive-utilities td.is-hidden{color:#ccc;background-color:#f9f9f9!important}.responsive-utilities-test{margin-top:5px}.responsive-utilities-test .col-xs-6{margin-bottom:10px}.responsive-utilities-test span{display:block;padding:15px 10px;font-size:14px;font-weight:700;line-height:1.1;text-align:center;border-radius:4px}.hidden-on .col-xs-6 .hidden-lg,.hidden-on .col-xs-6 .hidden-md,.hidden-on .col-xs-6 .hidden-sm,.hidden-on .col-xs-6 .hidden-xs,.visible-on .col-xs-6 .hidden-lg,.visible-on .col-xs-6 .hidden-md,.visible-on .col-xs-6 .hidden-sm,.visible-on .col-xs-6 .hidden-xs{color:#999;border:1px solid #ddd}.hidden-on .col-xs-6 .visible-lg-block,.hidden-on .col-xs-6 .visible-md-block,.hidden-on .col-xs-6 .visible-sm-block,.hidden-on .col-xs-6 .visible-xs-block,.visible-on .col-xs-6 .visible-lg-block,.visible-on .col-xs-6 .visible-md-block,.visible-on .col-xs-6 .visible-sm-block,.visible-on .col-xs-6 .visible-xs-block{color:#468847;background-color:#dff0d8;border:1px solid #d6e9c6}.bs-glyphicons{margin:0 -10px 20px;overflow:hidden}.bs-glyphicons-list{padding-left:0;list-style:none}.bs-glyphicons li{float:left;width:25%;height:115px;padding:10px;font-size:10px;line-height:1.4;text-align:center;background-color:#f9f9f9;border:1px solid #fff}.bs-glyphicons .glyphicon{margin-top:5px;margin-bottom:10px;font-size:24px}.bs-glyphicons .glyphicon-class{display:block;text-align:center;word-wrap:break-word}.bs-glyphicons li:hover{color:#fff;background-color:#563d7c}@media (min-width:768px){.bs-glyphicons{margin-right:0;margin-left:0}.bs-glyphicons li{width:12.5%;font-size:12px}}.bs-customizer .toggle{float:right;margin-top:25px}.bs-customizer label{margin-top:10px;font-weight:500;color:#555}.bs-customizer h2{padding-top:30px;margin-top:0;margin-bottom:5px}.bs-customizer h3{margin-bottom:0}.bs-customizer h4{margin-top:15px;margin-bottom:0}.bs-customizer .bs-callout h4{margin-top:0;margin-bottom:5px}.bs-customizer input[type=text]{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;background-color:#fafafa}.bs-customizer .help-block{margin-bottom:5px;font-size:12px}#less-section label{font-weight:400}.bs-customize-download .btn-outline{padding:20px}.bs-customizer-alert{position:fixed;top:0;right:0;left:0;z-index:1030;padding:15px 0;color:#fff;background-color:#d9534f;border-bottom:1px solid #b94441;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25);box-shadow:inset 0 1px 0 rgba(255,255,255,.25)}.bs-customizer-alert .close{margin-top:-4px;font-size:24px}.bs-customizer-alert p{margin-bottom:0}.bs-customizer-alert .glyphicon{margin-right:5px}.bs-customizer-alert pre{margin:10px 0 0;color:#fff;background-color:#a83c3a;border-color:#973634;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 2px 4px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}.bs-dropzone{position:relative;padding:20px;margin-bottom:20px;color:#777;text-align:center;border:2px dashed #eee;border-radius:4px}.bs-dropzone .import-header{margin-bottom:5px}.bs-dropzone .glyphicon-download-alt{font-size:40px}.bs-dropzone hr{width:100px}.bs-dropzone .lead{margin-bottom:10px;font-weight:400;color:#333}#import-manual-trigger{cursor:pointer}.bs-dropzone p:last-child{margin-bottom:0}.bs-brand-logos{display:table;width:100%;margin-bottom:15px;overflow:hidden;color:#563d7c;background-color:#f9f9f9;border-radius:4px}.bs-brand-item{padding:60px 0;text-align:center}.bs-brand-item+.bs-brand-item{border-top:1px solid #fff}.bs-brand-logos .inverse{color:#fff;background-color:#563d7c}.bs-brand-item h1,.bs-brand-item h3{margin-top:0;margin-bottom:0}.bs-brand-item .bs-docs-booticon{margin-right:auto;margin-left:auto}.bs-brand-item .glyphicon{width:30px;height:30px;margin:10px auto -10px;line-height:30px;color:#fff;border-radius:50%}.bs-brand-item .glyphicon-ok{background-color:#5cb85c}.bs-brand-item .glyphicon-remove{background-color:#d9534f}@media (min-width:768px){.bs-brand-item{display:table-cell;width:1%}.bs-brand-item+.bs-brand-item{border-top:0;border-left:1px solid #fff}.bs-brand-item h1{font-size:60px}}.zero-clipboard{position:relative;display:none}.btn-clipboard{position:absolute;top:0;right:0;z-index:10;display:block;padding:5px 8px;font-size:12px;color:#767676;cursor:pointer;background-color:#fff;border:1px solid #e1e1e8;border-radius:0 4px 0 4px}.btn-clipboard-hover{color:#fff;background-color:#563d7c;border-color:#563d7c}@media (min-width:768px){.zero-clipboard{display:block}.bs-example+.zero-clipboard .btn-clipboard{top:-16px;border-top-right-radius:0}}.anchorjs-link{color:inherit}@media (max-width:480px){.anchorjs-link{display:none}}:hover>.anchorjs-link{opacity:.75;-webkit-transition:color .16s linear;-o-transition:color .16s linear;transition:color .16s linear}.anchorjs-link:focus,:hover>.anchorjs-link:hover{text-decoration:none;opacity:1}#focusedInput{border-color:#ccc;border-color:rgba(82,168,236,.8);outline:0;outline:thin dotted\9;-webkit-box-shadow:0 0 8px rgba(82,168,236,.6);box-shadow:0 0 8px rgba(82,168,236,.6)} -------------------------------------------------------------------------------- /_docs/source/app.css: -------------------------------------------------------------------------------- 1 | *,::after,::before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-tap-highlight-color:transparent}html{background-color:#fff;color:#212121;font-size:100px}body{margin:0;font-size:14px;line-height:1.5;font-family:Helvetica Neue,Helvetica,STHeiTi,sans-serif}blockquote,button,dd,dl,fieldset,figure,form,h1,h2,h3,h4,h5,h6,input,legend,ol,p,pre,td,textarea,th,ul,xmp{margin:0;padding:0}button,code,input,kbd,pre,samp,select,textarea,tt,xmp{line-height:inherit;font-family:inherit}big,button,h1,h2,h3,h4,h5,h6,input,select,small,textarea{font-size:inherit}address,cite,dfn,em,i,optgroup,var{font-style:normal}table{border-collapse:collapse;border-spacing:0;table-layout:fixed;text-align:left}menu,ol,ul{list-style:none}fieldset,img{border:0;vertical-align:middle}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,video{display:inline-block}blockquote:after,blockquote:before,q:after,q:before{content:"\0020"}pre,textarea,xmp{overflow:auto;-webkit-overflow-scrolling:touch}textarea{resize:vertical}button,input,select a,textarea{outline:0 none}button,input,select,textarea{color:inherit}button:disabled,input:disabled,select:disabled,textarea:disabled{opacity:1}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input[type=button],input[type=file]::-webkit-file-upload-button,input[type=reset],input[type=search]::-webkit-search-cancel-button,input[type=submit]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none}mark{background-color:transparent}a,del,ins,s,u{text-decoration:none}a,img{-webkit-touch-callout:none}@font-face{font-family:yofont;src:url(http://source.qunarzz.com/fonts/yo/1.0.0/yofont.woff) format("woff"),url(http://source.qunarzz.com/fonts/yo/1.0.0/yofont.ttf) format("truetype")}.yo-ico{font-family:yofont!important;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:middle}.glyphicon-ok:before{content:"\f078"}.g-clear::after,.g-mod::after{display:block;overflow:hidden;clear:both;height:0;content:"\0020"}.yo-badge{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-moz-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:.16rem;min-height:.16rem;padding:0 .03rem;border-width:1px;border-style:solid;border-color:red;border-radius:.1rem;-webkit-background-clip:padding-box!important;-moz-background-clip:padding-box!important;-ms-background-clip:padding-box!important;background-clip:padding-box!important;background-color:red;color:#fff;font-size:.12rem;line-height:1;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-moz-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-moz-align-items:center;-ms-flex-align:center;align-items:center}.yo-badge-primary{border-width:0;background-color:#337ab7;border-radius:.05rem;vertical-align:super;margin-left:10px;font-size:10px;padding:.2em .6em}.yo-badge-success{border-width:0;background-color:#5cb85c;border-radius:.05rem;vertical-align:super;margin-left:10px;font-size:10px;padding:.2em .6em}.yo-badge-info{border-width:0;background-color:#5bc0de;border-radius:.05rem;vertical-align:super;margin-left:10px;font-size:10px;padding:.2em .6em}.yo-badge-warning{border-width:0;background-color:#f0ad4e;border-radius:.05rem;vertical-align:super;margin-left:10px;font-size:10px;padding:.2em .6em}.yo-badge-danger{border-width:0;background-color:#d9534f;border-radius:.05rem;vertical-align:super;margin-left:10px;font-size:10px;padding:.2em .6em}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{line-height:1.1}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}h1[id]{padding-top:20px;margin-top:0}.mark,mark{background-color:#fcf8e3;padding:.2em}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}.markdown-body blockquote.api,blockquote.api{padding:0 10px;border-left-color:#067380;margin-top:50px}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}del{text-decoration:line-through}.yo-table{width:100%;background-color:#fff}.yo-table thead{background-color:#eee}.yo-table thead th{padding:.05rem .1rem}.yo-table td{padding:.1rem}.yo-table td,.yo-table th{border-width:0 0 1px 0;border-style:solid;border-color:#ccc}.yo-table-border td,.yo-table-border th{border-width:1px}.yo-table-border tbody tr.active,.yo-table-border tbody tr:active{background-color:#eee}.markdown-body code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px;font-family:Menlo,Monaco,Consolas,Courier New,monospace}.markdown-body pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}.markdown-body pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.markdown-body{overflow:hidden;font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;word-wrap:break-word}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:#c00}.markdown-body .anchor{position:absolute;top:0;left:0;display:block;padding-right:6px;padding-left:30px;margin-left:-30px}.markdown-body .anchor:focus{outline:0}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{position:relative;margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{display:none;color:#000;vertical-align:middle}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{padding-left:8px;margin-left:-30px;text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{display:inline-block}.markdown-body h1 code,.markdown-body h1 tt,.markdown-body h2 code,.markdown-body h2 tt,.markdown-body h3 code,.markdown-body h3 tt,.markdown-body h4 code,.markdown-body h4 tt,.markdown-body h5 code,.markdown-body h5 tt,.markdown-body h6 code,.markdown-body h6 tt{font-size:inherit}.markdown-body h1{padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom:1px solid #eee}.markdown-body h1 .anchor{line-height:1}.markdown-body h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom:1px solid #eee}.markdown-body h2 .anchor{line-height:1}.markdown-body h3{font-size:1.5em;line-height:1.43}.markdown-body h3 .anchor{line-height:1.2}.markdown-body h4{font-size:1.25em}.markdown-body h4 .anchor{line-height:1.2}.markdown-body h5{font-size:1em}.markdown-body h5 .anchor{line-height:1.1}.markdown-body h6{font-size:1em;color:#777}.markdown-body h6 .anchor{line-height:1.1}.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-top:0;margin-bottom:16px}.markdown-body hr{height:4px;padding:0;margin:16px 0;background-color:#e7e7e7;border:0 none}.markdown-body ol,.markdown-body ul{padding-left:2em;list-style-type:disc}.markdown-body ol.no-list,.markdown-body ul.no-list{padding:0;list-style-type:none}.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:16px}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}.markdown-body dl dd{padding:0 16px;margin-bottom:16px}.markdown-body blockquote{padding:0 15px;color:#777;border-left:4px solid #ddd}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}.markdown-body table th{font-weight:700}.markdown-body table td,.markdown-body table th{padding:6px 13px;border:1px solid #ddd}.markdown-body table tr{background-color:#fff;border-top:1px solid #ccc}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8}.markdown-body img{max-width:100%;box-sizing:border-box}.markdown-body .emoji{max-width:none}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid #ddd}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:#333}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:0;padding-top:.2em;padding-bottom:.2em;margin:0;font-size:85%;background-color:rgba(0,0,0,.04);border-radius:3px}.markdown-body code:after,.markdown-body code:before,.markdown-body tt:after,.markdown-body tt:before{letter-spacing:-.2em;content:"\00a0"}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:0 0;border:0}.markdown-body .highlight{margin-bottom:16px}.markdown-body .highlight pre,.markdown-body pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body pre{word-wrap:normal}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body pre code:after,.markdown-body pre code:before,.markdown-body pre tt:after,.markdown-body pre tt:before{content:normal}.markdown-body kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}#readme.contributing>div{max-height:250px;overflow:auto}#readme .markdown-body,#readme .plain{background-color:#fff;border:1px solid #ddd;border-bottom-left-radius:3px;border-bottom-right-radius:3px;padding:30px;word-wrap:break-word}#readme .plain pre{font-size:15px;white-space:pre-wrap}#readme .markdown-body{border:0;padding:30px;border-radius:0}#readme table[data-table-type=yaml-metadata]{line-height:1;font-size:12px}#readme table[data-table-type=yaml-metadata] table{margin:0}.markdown-body .sms-or-app{width:100%;margin:0;padding:40px 0 0;border-top:1px solid #ddd}.markdown-body .sms-or-app:before{display:table;content:""}.markdown-body .sms-or-app:after{display:table;clear:both;content:""}.markdown-body .sms-or-app li{float:left;width:325px;padding:0;list-style:none}.markdown-body .sms-or-app li:first-child{margin-right:25px}.markdown-body .sms-or-app li .btn{display:block;text-align:center;margin:10px 0;padding-top:12px;padding-bottom:12px;font-size:15px;height:100%;width:100%}.markdown-body .sms-or-app small{font-size:80%}.markdown-body .app-only{padding:20px 0 0}.markdown-body .app-only li{float:none;width:auto}.markdown-body .app-only li .btn{display:inline-block;width:auto;padding-left:20px;padding-right:20px}.markdown-body .qr-code-table,.qr-code-table{width:auto;float:right;margin:0 0 0 40px;border:1px solid #ddd}.markdown-body .qr-code-table tr,.qr-code-table tr{background:0 0;border:0}.markdown-body .qr-code-table td,.markdown-body .qr-code-table th,.qr-code-table td,.qr-code-table th{border:0;padding:0}.markdown-body .qr-code-table td,.qr-code-table td{width:3px;height:3px}.markdown-body .qr-code-table .black,.qr-code-table .black{background:#000}.markdown-body .qr-code-table .white,.qr-code-table .white{background:#fff}.markdown-body .two-factor-actions{clear:both;padding:20px 0 0;margin:20px 0 0;border-top:1px solid #eaeaea;font-size:13px}.markdown-body .two-factor-actions ul{width:600px;margin:0;padding:0}.markdown-body .two-factor-actions li{list-style:none;display:inline-block;margin-right:10px}.markdown-body .qr-code-table,.qr-code-table{width:auto;float:right;margin:0 0 0 40px;border:1px solid #ddd}.markdown-body .qr-code-table tr,.qr-code-table tr{background:0 0;border:0}.markdown-body .qr-code-table td,.markdown-body .qr-code-table th,.qr-code-table td,.qr-code-table th{border:0;padding:0}.markdown-body .qr-code-table td,.qr-code-table td{width:3px;height:3px}.markdown-body .qr-code-table .black,.qr-code-table .black{background:#000}.markdown-body .qr-code-table .white,.qr-code-table .white{background:#fff}.markdown-body .two-factor-actions{clear:both;padding:20px 0 0;margin:20px 0 0;border-top:1px solid #eaeaea;font-size:13px}.markdown-body .two-factor-actions ul{width:600px;margin:0;padding:0}.markdown-body .two-factor-actions li{list-style:none;display:inline-block;margin-right:10px}.markdown-body .qr-code-table,.qr-code-table{width:auto;float:right;margin:0 0 0 40px;border:1px solid #ddd}.markdown-body .qr-code-table tr,.qr-code-table tr{background:0 0;border:0}.markdown-body .qr-code-table td,.markdown-body .qr-code-table th,.qr-code-table td,.qr-code-table th{border:0;padding:0}.markdown-body .qr-code-table td,.qr-code-table td{width:3px;height:3px}.markdown-body .qr-code-table .black,.qr-code-table .black{background:#000}.markdown-body .qr-code-table .white,.qr-code-table .white{background:#fff}.markdown-body .two-factor-actions{clear:both;padding:20px 0 0;margin:20px 0 0;border-top:1px solid #eaeaea;font-size:13px}.markdown-body .two-factor-actions ul{width:600px;margin:0;padding:0}.markdown-body .two-factor-actions li{list-style:none;display:inline-block;margin-right:10px}.markdown-body .sms-or-app{width:100%;margin:0;padding:40px 0 0;border-top:1px solid #ddd}.markdown-body .sms-or-app:before{display:table;content:""}.markdown-body .sms-or-app:after{display:table;clear:both;content:""}.markdown-body .sms-or-app li{float:left;width:325px;padding:0;list-style:none}.markdown-body .sms-or-app li:first-child{margin-right:25px}.markdown-body .sms-or-app li .btn{display:block;text-align:center;margin:10px 0;padding-top:12px;padding-bottom:12px;font-size:15px;height:100%;width:100%}.markdown-body .sms-or-app small{font-size:80%}.markdown-body .app-only{padding:20px 0 0}.markdown-body .app-only li{float:none;width:auto}.markdown-body .app-only li .btn{display:inline-block;width:auto;padding-left:20px;padding-right:20px}*{box-sizing:border-box}.example-code .line{line-height:normal!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.code code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}.code pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}.code pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:700;font-size:.2rem;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-ok:before{content:"\f078"}.text-success{color:#3c763d}blockquote.api h3{word-wrap:break-word}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.syntaxhighlighter table td.code{width:90%!important;line-height:1.5em}.docs-table del{color:#999}.syntaxhighlighter .number1 .spaces,.syntaxhighlighter .toolbar{display:none}.text-extend{font-size:20px;font-weight:400}.text-muted{color:#777}.groupVisible{font-size:0;height:0;overflow:hidden}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}.container{margin-right:auto;margin-left:auto}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}.navbar-static-top{z-index:1000;border-width:0 0 1px}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}.navbar-header{overflow:hidden}.docs-nav{margin-bottom:0;padding:0 30px;background-color:#fff;border-bottom:0;overflow:hidden}.docs-nav .navbar-brand,.docs-nav .navbar-nav>li>a{font-weight:500;color:#067380}.docs-nav .navbar-nav>.active>a,.docs-nav .navbar-nav>.active>a:hover,.docs-nav .navbar-nav>li>a:hover{color:#067380;background-color:#f9f9f9}.docs-nav .navbar-toggle .icon-bar{background-color:#067380}.docs-nav .navbar-header .navbar-toggle{border-color:#fff}.docs-nav .navbar-header .navbar-toggle:focus,.docs-nav .navbar-header .navbar-toggle:hover{background-color:#f9f9f9;border-color:#f9f9f9}.docs-second-nav .navbar-nav>li>a{font-weight:500;color:#555}.docs-second-nav .navbar-nav>li>a:hover{font-weight:500;color:#555;background-color:#f9f9f9}.docs-second-nav .navbar-nav>.active>a,.docs-second-nav .navbar-nav>.active>a:hover,.docs-second-nav .navbar-nav>li>a:hover{color:#555;background-color:#f9f9f9}.docs-header{position:relative;overflow:hidden;padding:50px 30px;font-size:20px;color:rgba(255,255,255,.6);text-shadow:0 1px 0 rgba(0,0,0,.1);background-color:#1ba9ba;background-image:-webkit-gradient(linear,left top,left bottom,from(#0088a4),to(#1ba9ba));background-image:-webkit-linear-gradient(top,#0088a4 0,#1ba9ba 100%);background-image:-o-linear-gradient(top,#0088a4 0,#1ba9ba 100%);background-image:linear-gradient(to bottom,#0088a4 0,#1ba9ba 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088a4', endColorstr='#1ba9ba', GradientType=0);background-repeat:repeat-x;clear:both}.docs-header h1{margin-top:0;color:#fff}.docs-header p{margin-right:3rem;line-height:1.7}.docs-header .container{position:relative}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-md-3,.col-md-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.affix{position:fixed}.docs-sidebar.affix{position:static}.docs-sidenav{margin-top:20px;margin-bottom:20px}.docs-sidebar .nav>li>a,.docs-sidebar .nav>li>span{display:block;padding:4px 20px;font-weight:500;color:#767676}.docs-sidebar .nav>li>a:focus,.docs-sidebar .nav>li>a:hover{padding-left:19px;color:#0088a4;text-decoration:none;background-color:transparent;border-left:1px solid #0088a4}.docs-sidebar .nav .nav{display:none;padding-bottom:10px}.docs-sidebar .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-weight:400}.docs-sidenav>li>.nav>li>.nav>li>a,.docs-sidenav>li>.nav>li>.nav>li>a:hover{padding-left:38px}.docs-sidenav>li.active>.nav>li.active>.nav>li.active>a,.docs-sidenav>li.active>.nav>li.active>.nav>li.active>a:hover{padding-left:36px}.c1{width:25%}.c2{width:15%}.c3{width:35%}.docs-footer{clear:both;padding-top:40px;padding-bottom:40px;margin-top:100px;color:#767676;text-align:center;border-top:1px solid #e5e5e5}.docs-section{margin-bottom:60px}.docs-section p{font-size:.16rem;line-height:1.75;margin-bottom:.1rem}.docs-section:last-child{margin-bottom:0}.docs-table{position:relative;margin:0 0 15px;background-color:#fff}.docs-section p.source-file{font-size:12px}.docs-sidebar.affix{position:static}.docs-sidenav{margin-top:20px;margin-bottom:20px}.docs-sidebar .nav>li>a,.docs-sidebar .nav>li>span{display:block;padding:4px 20px;font-weight:500;color:#767676}.docs-sidebar .nav>li>a:focus,.docs-sidebar .nav>li>a:hover{padding-left:19px;color:#0088a4;text-decoration:none;background-color:transparent;border-left:1px solid #0088a4}.docs-sidebar .nav>.active:focus>a,.docs-sidebar .nav>.active:hover>a,.docs-sidebar .nav>.active>a{padding-left:18px;font-weight:700;color:#0088a4;background-color:transparent;border-left:2px solid #0088a4}.docs-sidebar .nav .nav{display:none;padding-bottom:10px}.docs-sidebar .nav>li>a,.docs-sidebar .nav>li>span{font-size:.16rem}.docs-sidebar .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-size:.14rem;font-weight:400}.docs-sidebar .nav .nav .nav>li>a{font-size:.12rem}.docs-sidebar .nav .nav>li>a:focus,.docs-sidebar .nav .nav>li>a:hover{padding-left:29px}.docs-sidebar .nav .nav>.active:focus>a,.docs-sidebar .nav .nav>.active:hover>a,.docs-sidebar .nav .nav>.active>a{padding-left:28px;font-weight:500}.back-to-top,.docs-theme-toggle{display:none;padding:4px 10px;margin-top:10px;margin-left:10px;font-size:12px;font-weight:500;color:#999}.back-to-top:hover,.docs-theme-toggle:hover{color:#0088a4;text-decoration:none}.docs-theme-toggle{margin-top:0}.docs-section{margin-bottom:60px}.docs-section:last-child{margin-bottom:0}.example-code{border:1px solid #ccc;overflow:hidden;border-radius:4px 4px 0 0}.example-desc{padding:10px 10px 0}.anchorjs-link,.anchorjs-link:hover{text-decoration:none}.col-md-3,.col-md-9{float:left}.col-md-9{width:75%}.col-md-3{width:25%}.docs-sidebar .nav>.active>ul{display:block}.docs-sidebar.affix,.docs-sidebar.affix-bottom{width:213px}.docs-sidebar.affix{position:fixed;top:20px}.docs-sidebar.affix-bottom{position:absolute}.docs-sidebar.affix .docs-sidenav,.docs-sidebar.affix-bottom .docs-sidenav{margin-top:0;margin-bottom:0}.docs-sidebar.affix,.docs-sidebar.affix-bottom{width:263px}.docs-second-nav .navbar-nav{margin:0}.docs-container{overflow:hidden}.source-file a{word-wrap:break-word}@media (min-width:1200px){.container{width:1200px}.navbar-static-top{border-radius:0}.navbar-toggle{display:none}.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}.navbar{border-radius:4px}.navbar-header{float:left}.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}@media (min-width:992px) and (max-width:1199px){.container{width:992px}.navbar-static-top{border-radius:0}.navbar-toggle{display:none}.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}.navbar{border-radius:4px}.navbar-header{float:left}.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}@media (min-width:768px) and (max-width:991px){.container{width:768px}.navbar-static-top{border-radius:0}.navbar-toggle{display:none}.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}.navbar{border-radius:4px}.navbar-header{float:left}.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}.docs-header p{margin-right:1.5rem}}@media (max-width:767px){html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row{width:94%;margin:0 auto}.col-md-9{width:100%;margin:0;padding:0}.anchorjs-link::after{display:none}.docs-second-nav{overflow:hidden;margin-bottom:.1rem}.docs-second-nav .nav>li{float:left}.navbar-collapse{background:#fff}.docs-header{padding:.2rem 30px .1rem}.docs-header h1{font-size:.16rem}.docs-header p{margin-right:0;font-size:.14rem}.nav>li>a{padding:.1rem}.docs-section h1{padding-top:.05rem}.page-header{margin:.2rem 0 .1rem}.col-md-3,.docs-sidebar{display:none}.docs-container h1{font-size:.26rem}.navbar-collapse{background:#fff}.docs-table{width:100%;overflow-x:auto}.yo-table{width:auto;min-width:3.6rem}}.api-content{margin-left:.2rem} 2 | -------------------------------------------------------------------------------- /_docs/source/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); --------------------------------------------------------------------------------