From 8a2d928c817bec18bfde0c9b41ed6e39f7257296 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 10:56:08 +0800 Subject: [PATCH 01/21] add theme maupassant --- _config.yml | 2 +- package-lock.json | 790 +++++++++++++++++++++++++ package.json | 2 +- themes/{maupassant-hexo => maupassant} | 0 4 files changed, 792 insertions(+), 2 deletions(-) rename themes/{maupassant-hexo => maupassant} (100%) diff --git a/_config.yml b/_config.yml index d93ec58..6ccd863 100644 --- a/_config.yml +++ b/_config.yml @@ -73,7 +73,7 @@ pagination_dir: page ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ #theme: landscape -theme: maupassant-hexo +theme: maupassant #theme: hexo-theme-yilia #theme: next diff --git a/package-lock.json b/package-lock.json index e2cb56e..bc8c37b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -430,6 +430,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -928,6 +929,795 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "optional": true, + "requires": { + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + } + } + }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", diff --git a/package.json b/package.json index 8fa8a43..322e52f 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "hexo-generator-tag": "^0.2.0", "hexo-renderer-ejs": "^0.3.0", "hexo-renderer-marked": "^0.3.0", - "hexo-renderer-pug": "0.0.5", + "hexo-renderer-pug": "^0.0.5", "hexo-renderer-sass": "^0.3.2", "hexo-renderer-stylus": "^0.3.1", "hexo-server": "^0.2.0" diff --git a/themes/maupassant-hexo b/themes/maupassant similarity index 100% rename from themes/maupassant-hexo rename to themes/maupassant From d17f36e2d81201bebaf3992406956204103650ff Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 11:03:14 +0800 Subject: [PATCH 02/21] delete maupassant --- themes/maupassant | 1 - 1 file changed, 1 deletion(-) delete mode 160000 themes/maupassant diff --git a/themes/maupassant b/themes/maupassant deleted file mode 160000 index 6460d28..0000000 --- a/themes/maupassant +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6460d28f8512138bff22cdcc5c3d2c4794b059c4 From f17367363dfdd3221db67c0b9ae77ddc8466c0c2 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 11:05:34 +0800 Subject: [PATCH 03/21] add theme maupassant --- _config.yml | 2 +- themes/maupassant-hexo/.travis.yml | 5 + themes/maupassant-hexo/LICENSE | 7 + themes/maupassant-hexo/README.md | 236 ++ themes/maupassant-hexo/_config.yml | 96 + themes/maupassant-hexo/languages/de-DE.yml | 22 + themes/maupassant-hexo/languages/en.yml | 25 + themes/maupassant-hexo/languages/es-ES.yml | 22 + themes/maupassant-hexo/languages/fr-FR.yml | 22 + themes/maupassant-hexo/languages/ko.yml | 22 + themes/maupassant-hexo/languages/ru.yml | 22 + themes/maupassant-hexo/languages/zh-CN.yml | 25 + themes/maupassant-hexo/languages/zh-TW.yml | 25 + .../layout/_partial/after_footer.pug | 65 + .../layout/_partial/comments.pug | 92 + .../layout/_partial/footer.pug | 7 + .../maupassant-hexo/layout/_partial/head.pug | 26 + .../layout/_partial/helpers.pug | 21 + .../layout/_partial/mathjax.pug | 6 + .../layout/_partial/mathjax2.pug | 1 + .../layout/_partial/paginator.pug | 3 + .../layout/_partial/post_nav.pug | 6 + .../maupassant-hexo/layout/_partial/tag.pug | 4 + .../maupassant-hexo/layout/_partial/totop.pug | 5 + .../layout/_widget/category.pug | 4 + .../maupassant-hexo/layout/_widget/links.pug | 6 + .../layout/_widget/recent_comments.pug | 5 + .../layout/_widget/recent_posts.pug | 4 + .../maupassant-hexo/layout/_widget/search.pug | 27 + themes/maupassant-hexo/layout/_widget/tag.pug | 5 + themes/maupassant-hexo/layout/archive.pug | 24 + .../layout/base-without-sidebar.pug | 38 + themes/maupassant-hexo/layout/base.pug | 46 + themes/maupassant-hexo/layout/index.pug | 55 + themes/maupassant-hexo/layout/page.pug | 13 + themes/maupassant-hexo/layout/post.pug | 48 + .../maupassant-hexo/layout/single-column.pug | 10 + themes/maupassant-hexo/layout/timeline.pug | 29 + themes/maupassant-hexo/package.json | 22 + themes/maupassant-hexo/source/css/default.css | 1146 +++++ themes/maupassant-hexo/source/css/donate.css | 285 ++ themes/maupassant-hexo/source/css/style.scss | 1713 ++++++++ .../maupassant-hexo/source/donate/index.html | 28 + .../maupassant-hexo/source/img/AliPayQR.png | Bin 0 -> 28743 bytes themes/maupassant-hexo/source/img/BTCQR.png | Bin 0 -> 20129 bytes .../maupassant-hexo/source/img/WeChatQR.png | Bin 0 -> 29107 bytes themes/maupassant-hexo/source/img/alipay.svg | 46 + themes/maupassant-hexo/source/img/bitcoin.svg | 135 + themes/maupassant-hexo/source/img/github.svg | 1 + themes/maupassant-hexo/source/img/like.svg | 1 + themes/maupassant-hexo/source/img/paypal.svg | 63 + themes/maupassant-hexo/source/img/wechat.svg | 49 + .../source/js/codeblock-resizer.js | 51 + themes/maupassant-hexo/source/js/donate.js | 78 + themes/maupassant-hexo/source/js/fancybox.js | 19 + .../source/js/gitment.browser.js | 3751 +++++++++++++++++ themes/maupassant-hexo/source/js/search.js | 86 + themes/maupassant-hexo/source/js/share.js | 60 + .../maupassant-hexo/source/js/smartresize.js | 32 + themes/maupassant-hexo/source/js/totop.js | 12 + 60 files changed, 8658 insertions(+), 1 deletion(-) create mode 100644 themes/maupassant-hexo/.travis.yml create mode 100644 themes/maupassant-hexo/LICENSE create mode 100644 themes/maupassant-hexo/README.md create mode 100644 themes/maupassant-hexo/_config.yml create mode 100644 themes/maupassant-hexo/languages/de-DE.yml create mode 100644 themes/maupassant-hexo/languages/en.yml create mode 100644 themes/maupassant-hexo/languages/es-ES.yml create mode 100644 themes/maupassant-hexo/languages/fr-FR.yml create mode 100644 themes/maupassant-hexo/languages/ko.yml create mode 100644 themes/maupassant-hexo/languages/ru.yml create mode 100644 themes/maupassant-hexo/languages/zh-CN.yml create mode 100644 themes/maupassant-hexo/languages/zh-TW.yml create mode 100644 themes/maupassant-hexo/layout/_partial/after_footer.pug create mode 100644 themes/maupassant-hexo/layout/_partial/comments.pug create mode 100644 themes/maupassant-hexo/layout/_partial/footer.pug create mode 100644 themes/maupassant-hexo/layout/_partial/head.pug create mode 100644 themes/maupassant-hexo/layout/_partial/helpers.pug create mode 100644 themes/maupassant-hexo/layout/_partial/mathjax.pug create mode 100644 themes/maupassant-hexo/layout/_partial/mathjax2.pug create mode 100644 themes/maupassant-hexo/layout/_partial/paginator.pug create mode 100644 themes/maupassant-hexo/layout/_partial/post_nav.pug create mode 100644 themes/maupassant-hexo/layout/_partial/tag.pug create mode 100644 themes/maupassant-hexo/layout/_partial/totop.pug create mode 100644 themes/maupassant-hexo/layout/_widget/category.pug create mode 100644 themes/maupassant-hexo/layout/_widget/links.pug create mode 100644 themes/maupassant-hexo/layout/_widget/recent_comments.pug create mode 100644 themes/maupassant-hexo/layout/_widget/recent_posts.pug create mode 100644 themes/maupassant-hexo/layout/_widget/search.pug create mode 100644 themes/maupassant-hexo/layout/_widget/tag.pug create mode 100644 themes/maupassant-hexo/layout/archive.pug create mode 100644 themes/maupassant-hexo/layout/base-without-sidebar.pug create mode 100644 themes/maupassant-hexo/layout/base.pug create mode 100644 themes/maupassant-hexo/layout/index.pug create mode 100644 themes/maupassant-hexo/layout/page.pug create mode 100644 themes/maupassant-hexo/layout/post.pug create mode 100644 themes/maupassant-hexo/layout/single-column.pug create mode 100644 themes/maupassant-hexo/layout/timeline.pug create mode 100644 themes/maupassant-hexo/package.json create mode 100644 themes/maupassant-hexo/source/css/default.css create mode 100644 themes/maupassant-hexo/source/css/donate.css create mode 100644 themes/maupassant-hexo/source/css/style.scss create mode 100644 themes/maupassant-hexo/source/donate/index.html create mode 100644 themes/maupassant-hexo/source/img/AliPayQR.png create mode 100644 themes/maupassant-hexo/source/img/BTCQR.png create mode 100644 themes/maupassant-hexo/source/img/WeChatQR.png create mode 100644 themes/maupassant-hexo/source/img/alipay.svg create mode 100644 themes/maupassant-hexo/source/img/bitcoin.svg create mode 100644 themes/maupassant-hexo/source/img/github.svg create mode 100644 themes/maupassant-hexo/source/img/like.svg create mode 100644 themes/maupassant-hexo/source/img/paypal.svg create mode 100644 themes/maupassant-hexo/source/img/wechat.svg create mode 100644 themes/maupassant-hexo/source/js/codeblock-resizer.js create mode 100644 themes/maupassant-hexo/source/js/donate.js create mode 100644 themes/maupassant-hexo/source/js/fancybox.js create mode 100644 themes/maupassant-hexo/source/js/gitment.browser.js create mode 100644 themes/maupassant-hexo/source/js/search.js create mode 100644 themes/maupassant-hexo/source/js/share.js create mode 100644 themes/maupassant-hexo/source/js/smartresize.js create mode 100644 themes/maupassant-hexo/source/js/totop.js diff --git a/_config.yml b/_config.yml index 6ccd863..d93ec58 100644 --- a/_config.yml +++ b/_config.yml @@ -73,7 +73,7 @@ pagination_dir: page ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ #theme: landscape -theme: maupassant +theme: maupassant-hexo #theme: hexo-theme-yilia #theme: next diff --git a/themes/maupassant-hexo/.travis.yml b/themes/maupassant-hexo/.travis.yml new file mode 100644 index 0000000..06e45d6 --- /dev/null +++ b/themes/maupassant-hexo/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "4.1" +install: + npm install diff --git a/themes/maupassant-hexo/LICENSE b/themes/maupassant-hexo/LICENSE new file mode 100644 index 0000000..7b3113c --- /dev/null +++ b/themes/maupassant-hexo/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2017 tufu9441 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/maupassant-hexo/README.md b/themes/maupassant-hexo/README.md new file mode 100644 index 0000000..5a68288 --- /dev/null +++ b/themes/maupassant-hexo/README.md @@ -0,0 +1,236 @@ +# Maupassant + +[![Build Status](https://travis-ci.org/tufu9441/maupassant-hexo.svg?branch=master)](https://travis-ci.org/tufu9441/maupassant-hexo) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/tufu9441/maupassant-hexo/blob/master/LICENSE) + +> 大道至简 + +[Preview](https://www.haomwei.com)|[中文文档](https://www.haomwei.com/technology/maupassant-hexo.html) + +A simple Hexo template with great performance on different devices, ported from a Typecho theme by [Cho](https://github.com/pagecho/maupassant/), forked and modified from [icylogic](https://github.com/icylogic/maupassant-hexo/). + +![template preview](http://ooo.0o0.ooo/2015/10/24/562b5be12177e.jpg + "Maupassant template preview") + +## Installation +Install theme and renderers: + +```shell +$ git clone https://github.com/tufu9441/maupassant-hexo.git themes/maupassant +$ npm install hexo-renderer-pug --save +$ npm install hexo-renderer-sass --save +``` + +Then change your `theme` setting in `_config.yml` to `maupassant`. + +## Configuration +Default config: + +```YAML +fancybox: true ## If you want to use fancybox please set the value to true. +disqus: ## Your disqus_shortname, e.g. username +gitment: + enable: false ## If you want to use Gitment comment system please set the value to true. + owner: ## Your GitHub ID, e.g. username + repo: ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io + client_id: ## GitHub client ID, e.g. 75752dafe7907a897619 + client_secret: ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 +uyan: ## Your uyan_id. e.g. 1234567 +livere: ## Your livere data-uid, e.g. MTAyMC8zMDAxOC78NTgz +changyan: ## Your changyan appid, e.g. cyrALsXc8 +changyan_conf: ## Your changyan conf, e.g. prod_d8a508c2825ab57eeb43e7c69bba0e8b +valine: ## https://valine.js.org + enable: false ## If you want to use Valine comment system, please set the value to true. + appid: ## Your LeanCloud application App ID, e.g. pRBBL2JR4N7kLEGojrF0MsSs-gzGzoHsz + appkey: ## Your LeanCloud application App Key, e.g. tjczHpDfhjYDSYddzymYK1JJ + notify: false ## Mail notifier, see https://github.com/xCss/Valine/wiki/Valine-评论系统中的邮件提醒设置 + verify: false ## Validation code. + placeholder: Just so so ## Comment box placeholders. + avatar: 'mm' ## Gravatar type, see https://github.com/xCss/Valine/wiki/avatar-setting-for-valine + pageSize: 10 ## Number of comments per page. + guest_info: nick,mail,link ## Attributes of reviewers. + +google_search: true ## Use Google search, true/false. +baidu_search: false ## Use Baidu search, true/false. +swiftype: ## Your swiftype_key, e.g. m7b11ZrsT8Me7gzApciT +tinysou: ## Your tinysou_key, e.g. 4ac092ad8d749fdc6293 +self_search: false ## Use a jQuery-based local search engine, true/false. +google_analytics: ## Your Google Analytics tracking id, e.g. UA-42425684-2 +baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000 +show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true. +toc_number: true ## If you want to add list number to toc please set the value to true. +shareto: false ## If you want to use the share button please set the value to true, you must have hexo-helper-qrcode installed. +busuanzi: false ## If you want to use Busuanzi page views please set the value to true. +widgets_on_small_screens: false ## Set to true to enable widgets on small screens. +canvas_nest: + enable: false ## If you want to use dynamic background please set the value to true, you can also fill the following parameters to customize the dynamic effect, or just leave them blank to keep the default effect. + color: ## RGB value of the color, e.g. "100,99,98" + opacity: ## Transparency of lines, e.g. "0.7" + zIndex: ## The z-index property of the background, e.g. "-1" + count: ## Quantity of lines, e.g. "150" +donate: + enable: false ## If you want to show the donate button after each post, please set the value to true and fill the following items according to your need. You can also enable donate button in a page by adding a "donate: true" item to the front-matter. + github: ## GitHub URL, e.g. https://github.com/Kaiyuan/donate-page + alipay_qr: ## Path of Alipay QRcode image, e.g. /img/AliPayQR.png + wechat_qr: ## Path of Wechat QRcode image, e.g. /img/WeChatQR.png + btc_qr: ## Path of Bitcoin QRcode image, e.g. /img/BTCQR.png + btc_key: ## Bitcoin key, e.g. 1KuK5eK2BLsqpsFVXXSBG5wbSAwZVadt6L + paypal_url: ## Paypal URL, e.g. https://paypal.me/tufu9441 + +menu: + - page: home + directory: . + icon: fa-home + - page: archive + directory: archives/ + icon: fa-archive + - page: about + directory: about/ + icon: fa-user + - page: rss + directory: atom.xml + icon: fa-rss + +widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links. + - search + - category + - tag + - recent_posts + - recent_comments + - links + +links: + - title: site-name1 + url: http://www.example1.com/ + - title: site-name2 + url: http://www.example2.com/ + - title: site-name3 + url: http://www.example3.com/ + +timeline: + - num: 1 + word: 2014/06/12-Start + - num: 2 + word: 2014/11/29-XXX + - num: 3 + word: 2015/02/18-DDD + - num: 4 + word: More + +# Static files +js: js +css: css + +# Theme version +version: 0.0.0 +``` +- fancybox - Enable [Fancybox](http://fancyapps.com/fancybox/) +- disqus - [Disqus](https://disqus.com) shortname +- gitment - [Gitment](https://github.com/imsun/gitment) comment system +- uyan - [Uyan](http://www.uyan.cc) id +- livere - [LiveRe](https://livere.com) data-uid +- changyan - [Changyan](http://changyan.kuaizhan.com) appid +- valine - [Valine](https://valine.js.org) comment system +- google_search - Default search engine +- baidu_search - Search engine for users in China +- swiftype - [Swiftype Search](https://swiftype.com) key +- tinysou - [Tiny Search](http://tinysou.com) key +- self_search - A jQuery-based [local search engine](http://hahack.com/codes/local-search-engine-for-hexo), with the dependency on the plugin [hexo-generator-search](https://github.com/PaicHyperionDev/hexo-generator-search) +- google_analytics - [Google Analytics](https://www.google.com/analytics/) tracking id +- baidu_analytics - [Baidu Analytics](http://tongji.baidu.com) tracking id +- show_category_count - Show the count of categories in the sidebar widget +- toc_number - Show the list number of toc +- shareto - Enable share button, with the dependency on the plugin [hexo-helper-qrcode](https://github.com/yscoder/hexo-helper-qrcode) +- busuanzi - Enable [Busuanzi](http://busuanzi.ibruce.info) page views +- widgets_on_small_screens - Show the widgets at the bottom of small screens +- [canvas_nest](https://github.com/hustcc/canvas-nest.js) - Enable dynamic background +- donate - Enable donate button after each post +- menu - Customize your menu of pages here, just follow the format of existied items. Don't forget to create corresponding folders inlcuding `index.md` in `source` folder to ensure the pages will correctly display. [FontAwesome](http://fontawesome.io) icon fonts have been integrated, and you can choose other icons which you like [here](http://fontawesome.io/icons/) and use them according to the instruction. +- widgets - Choose and arrange the widgets in sidebar here. +- links - Edit your blogroll here. +- timeline - Show a timeline of the website by setting `layout: timeline` of a page. +- Static files - Static files directory, for convenience of CDN usage. +- Theme version - For automatic refresh of static files on CDN. + +## Features +#### Logo +You can set a **favicon.ico** for your website, please put it into `source` folder of hexo directory, recommended size: 32px*32px. + +You can add a website logo for apple devices, please put an image named **apple-touch-icon.png** into `source` folder of hexo directory, recommended size: 114px*114px. + +#### Abstract +You can control the abstract of a post shown at index, by either filling a `description:` item in `front-matter` of the `post.md`, or just inserting a `` before your hidden content. + +#### Page +Create folders inlcuding `index.md` in `source` folder to add pages, and add a `layout: page` in `front-matter` of `index.md`. If you need a single column page without sidebar, just set `layout: single-column` instead of `layout: page`. + +#### Table of Contents +TOC in a post can be enabled by adding a `toc: true` item in `front-matter`. + +#### Comments +Comment feature of each post and page can be enabled (default) and disabled by adding a `comments: true` or a `comments: false` in `front-matter`. This could be useful when you want comment feature for a guestbook page, but don't want comment feature for a about page. + +#### Syntax Highlighting +Highlighted code showcase is supported, please set the `highlight` option in `_config.yml` of hexo directory like this: + +```YAML +highlight: + enable: true + auto_detect: true + line_number: true + tab_replace: +``` + +#### Math Equation +Add +```YAML +mathjax: true +``` +in Hexo's `_config.yml`. + +In the post which you would like to use math equation, add `mathjax: true` in the `front-matter`. For example: + +```YAML +title: Test Math +date: 2016-04-05 14:16:00 +categories: math +mathjax: true +--- +``` +The default math delimiters are `$$...$$` and `\\[...\\]` for displayed mathematics, +and `$...$` and `\\(...\\)` for in-line mathematics. + +However, if your post contains dollar signs (`$`), and they appear often in non-mathematical parts, in other words, you want to use `$` as dollar sign not inline math delimiter, please add + +```YAML +mathjax2: true +``` +in Hexo's `_config.yml` instead of `mathjax: true`. Correspondingly, add `mathjax2: true` to the `front-matter` of the post in which +you would like to use math equation. + +See the [example](http://zhongpu.info/2016/05/06/Mathjax%20and%20Hexo/). + +#### Languages +Seven languages are available for this theme currently: Simplified Chinese (zh-CN), Traditional Chinese (zh-TW), English (en), French (fr-FR), German (de-DE), Korean (ko) and Spanish (es-ES). Contributions of translating to other languages will be highly appreciated. + +## Solutions +- Check whether your Terminal's current directory is in hexo's root directory which contains `source/`, `themes/`, etc. + +- If you have any trouble in using this theme, please feel free to open an [issue](https://github.com/tufu9441/maupassant-hexo/issues). + +## Browser Support +![Imgur](http://i.imgur.com/iO9L5ty.png) + +## Contributing +All kinds of contributions (enhancements, new features, documentation & code improvements, issues & bugs reporting) are welcome. + +Looking forward to your pull request. + +## Acknowledgements +Thanks for all the [contributors](https://github.com/tufu9441/maupassant-hexo/graphs/contributors) of this theme. +. +## Maupassant on other platforms: ++ Typecho:https://github.com/pagecho/maupassant/ ++ Octopress:https://github.com/pagecho/mewpassant/ ++ Farbox:https://github.com/pagecho/Maupassant-farbox/ ++ Wordpress:https://github.com/iMuFeng/maupassant/ ++ Ghost: https://github.com/LjxPrime/maupassant/ diff --git a/themes/maupassant-hexo/_config.yml b/themes/maupassant-hexo/_config.yml new file mode 100644 index 0000000..f757e1b --- /dev/null +++ b/themes/maupassant-hexo/_config.yml @@ -0,0 +1,96 @@ +fancybox: true ## If you want to use fancybox please set the value to true. +disqus: ## Your disqus_shortname, e.g. username +gitment: + enable: false ## If you want to use Gitment comment system please set the value to true. + owner: ## Your GitHub ID, e.g. username + repo: ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io + client_id: ## GitHub client ID, e.g. 75752dafe7907a897619 + client_secret: ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 +uyan: ## Your uyan_id. e.g. 1234567 +livere: ## Your livere data-uid, e.g. MTAyMC8zMDAxOC78NTgz +changyan: ## Your changyan appid, e.g. cyrALsXc8 +changyan_conf: ## Your changyan conf, e.g. prod_d8a508c2825ab57eeb43e7c69bba0e8b +valine: ## https://valine.js.org + enable: false ## If you want to use Valine comment system, please set the value to true. + appid: ## Your LeanCloud application App ID, e.g. pRBBL2JR4N7kLEGojrF0MsSs-gzGzoHsz + appkey: ## Your LeanCloud application App Key, e.g. tjczHpDfhjYDSYddzymYK1JJ + notify: false ## Mail notifier, see https://github.com/xCss/Valine/wiki/Valine-评论系统中的邮件提醒设置 + verify: false ## Validation code. + placeholder: Just so so ## Comment box placeholders. + avatar: 'mm' ## Gravatar type, see https://github.com/xCss/Valine/wiki/avatar-setting-for-valine + pageSize: 10 ## Number of comments per page. + guest_info: nick,mail,link ## Attributes of reviewers. + +google_search: true ## Use Google search, true/false. +baidu_search: false ## Use Baidu search, true/false. +swiftype: ## Your swiftype_key, e.g. m7b11ZrsT8Me7gzApciT +tinysou: ## Your tinysou_key, e.g. 4ac092ad8d749fdc6293 +self_search: false ## Use a jQuery-based local search engine, true/false. +google_analytics: ## Your Google Analytics tracking id, e.g. UA-42425684-2 +baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000 +show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true. +toc_number: true ## If you want to add list number to toc please set the value to true. +shareto: false ## If you want to use the share button please set the value to true, you must have hexo-helper-qrcode installed. +busuanzi: false ## If you want to use Busuanzi page views please set the value to true. +widgets_on_small_screens: false ## Set to true to enable widgets on small screens. +canvas_nest: + enable: false ## If you want to use dynamic background please set the value to true, you can also fill the following parameters to customize the dynamic effect, or just leave them blank to keep the default effect. + color: ## RGB value of the color, e.g. "100,99,98" + opacity: ## Transparency of lines, e.g. "0.7" + zIndex: ## The z-index property of the background, e.g. "-1" + count: ## Quantity of lines, e.g. "150" +donate: + enable: false ## If you want to show the donate button after each post, please set the value to true and fill the following items according to your need. You can also enable donate button in a page by adding a "donate: true" item to the front-matter. + github: ## GitHub URL, e.g. https://github.com/Kaiyuan/donate-page + alipay_qr: ## Path of Alipay QRcode image, e.g. /img/AliPayQR.png + wechat_qr: ## Path of Wechat QRcode image, e.g. /img/WeChatQR.png + btc_qr: ## Path of Bitcoin QRcode image, e.g. /img/BTCQR.png + btc_key: ## Bitcoin key, e.g. 1KuK5eK2BLsqpsFVXXSBG5wbSAwZVadt6L + paypal_url: ## Paypal URL, e.g. https://paypal.me/tufu9441 + +menu: + - page: home + directory: . + icon: fa-home + - page: archive + directory: archives/ + icon: fa-archive + - page: about + directory: about/ + icon: fa-user + - page: rss + directory: atom.xml + icon: fa-rss + +widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links. + - search + - category + - tag + - recent_posts + - recent_comments + - links + +links: + - title: site-name1 + url: http://www.example1.com/ + - title: site-name2 + url: http://www.example2.com/ + - title: site-name3 + url: http://www.example3.com/ + +timeline: + - num: 1 + word: 2014/06/12-Start + - num: 2 + word: 2014/11/29-XXX + - num: 3 + word: 2015/02/18-DDD + - num: 4 + word: More + +# Static files +js: js +css: css + +# Theme version +version: 0.0.0 diff --git a/themes/maupassant-hexo/languages/de-DE.yml b/themes/maupassant-hexo/languages/de-DE.yml new file mode 100644 index 0000000..149bc2d --- /dev/null +++ b/themes/maupassant-hexo/languages/de-DE.yml @@ -0,0 +1,22 @@ +reading_label: Beiträge in %s +blog: Blog +albums: Alben +categories: Kategorien +tags: Tags +archive: Archiv +links: Links +about: Über +recent: Letzte +next: Nächster +previous: Vorheriger +notitle: Kein Titel +blogroll: Blogroll +history: Chronik +rss: RSS +guestbook: Gästebuch +home: Start +recent_comments: Letzte Kommentare +Readmore: Mehr lesen +belongsto: kategorisiert in +contents: Inhalte +shareto: Aktie diff --git a/themes/maupassant-hexo/languages/en.yml b/themes/maupassant-hexo/languages/en.yml new file mode 100644 index 0000000..249635a --- /dev/null +++ b/themes/maupassant-hexo/languages/en.yml @@ -0,0 +1,25 @@ +reading_label: Reading articles in %s +blog: Blog +albums: Albums +categories: Categories +tags: Tags +archive: Archive +links: Links +about: About +recent: Recent +next: Next +previous: Previous +notitle: No Title +blogroll: Links +history: History +rss: RSS +guestbook: Guestbook +home: Home +recent_comments: Recent Comments +Readmore: Read More +belongsto: Categorized in +contents: Contents +shareto: Share +Discuss: Discuss +Comment: Comment +Hits: Hits diff --git a/themes/maupassant-hexo/languages/es-ES.yml b/themes/maupassant-hexo/languages/es-ES.yml new file mode 100644 index 0000000..05ae976 --- /dev/null +++ b/themes/maupassant-hexo/languages/es-ES.yml @@ -0,0 +1,22 @@ +reading_label: Leyendo artículos en %s +blog: Blog +albums: Álbums +categories: Categorías +tags: Etiquetas +archive: Archivo +links: Enlaces +about: Acerca de +recent: Recientes +next: Siguiente +previous: Anterior +notitle: Sin título +blogroll: Blogroll +history: Historial +rss: RSS +guestbook: Libro de visitas +home: Inicio +recent_comments: Comentarios recientes +Readmore: Leer más +belongsto: Guardado en +contents: Contenidos +shareto: Cuota diff --git a/themes/maupassant-hexo/languages/fr-FR.yml b/themes/maupassant-hexo/languages/fr-FR.yml new file mode 100644 index 0000000..876cd4a --- /dev/null +++ b/themes/maupassant-hexo/languages/fr-FR.yml @@ -0,0 +1,22 @@ +reading_label: Reading articles in %s +blog: Blog +albums: Albums +categories: Catégories +tags: Tags +archive: Archive +links: Liens +about: À propos +recent: Récent +next: Suivant +previous: Précdent +notitle: Sans titre +blogroll: À suivre +history: Historique +rss: RSS +guestbook: Livre d'or +home: Accueil +recent_comments: Commentaires récents +Readmore: Lire plus +belongsto: Catégorisé dans +contents: Contenus +shareto: Partager diff --git a/themes/maupassant-hexo/languages/ko.yml b/themes/maupassant-hexo/languages/ko.yml new file mode 100644 index 0000000..b42b12d --- /dev/null +++ b/themes/maupassant-hexo/languages/ko.yml @@ -0,0 +1,22 @@ +reading_label: '%s 의 게시물 모음' +blog: 블로그 +albums: 앨범 +categories: 카테고리 +tags: 태그 +archive: 아카이브 +links: 링크 +about: 소개 +recent: 과거 +next: 다음 +previous: 이전 +notitle: 제목없음 +blogroll: 블로그롤 +history: 히스토리 +rss: RSS +guestbook: 방명록 +home: 홈 +recent_comments: 최근 댓글 +Readmore: 더보기 +belongsto: 분류됨 +contents: 컨텐츠 +shareto: 공유하기 diff --git a/themes/maupassant-hexo/languages/ru.yml b/themes/maupassant-hexo/languages/ru.yml new file mode 100644 index 0000000..1555503 --- /dev/null +++ b/themes/maupassant-hexo/languages/ru.yml @@ -0,0 +1,22 @@ +reading_label: Reading articles in %s +blog: Блог +albums: Альбомы +categories: Категории +tags: Теги +archive: Архив +links: Ссылки +about: О сайта +recent: Недавние +next: Следующая +previous: Предыдущая +notitle: Без заголовка +blogroll: Blogroll +history: История +rss: RSS +guestbook: Гостевая книга +home: Главная +recent_comments: Недавние комментарии +Readmore: Читать далее +belongsto: Определено в +contents: Содержимое +shareto: Поделиться diff --git a/themes/maupassant-hexo/languages/zh-CN.yml b/themes/maupassant-hexo/languages/zh-CN.yml new file mode 100644 index 0000000..30aee9f --- /dev/null +++ b/themes/maupassant-hexo/languages/zh-CN.yml @@ -0,0 +1,25 @@ +reading_label: 正在查看 %s 下的文章 +blog: 博客 +albums: 相册 +categories: 分类 +tags: 标签 +archive: 归档 +links: 链接 +about: 关于 +recent: 最近文章 +next: 下一页 +previous: 上一页 +notitle: 无题 +blogroll: 友情链接 +history: 历史 +rss: 订阅 +guestbook: 留言 +home: 首页 +recent_comments: 最近评论 +Readmore: 阅读全文 +belongsto: 分类于 +contents: 文章目录 +shareto: 分享 +Discuss: 条参与 +Comment: 条评论 +Hits: 阅读 diff --git a/themes/maupassant-hexo/languages/zh-TW.yml b/themes/maupassant-hexo/languages/zh-TW.yml new file mode 100644 index 0000000..79b3569 --- /dev/null +++ b/themes/maupassant-hexo/languages/zh-TW.yml @@ -0,0 +1,25 @@ +reading_label: 正在查看 %s 下的文章 +blog: 部落格 +albums: 相簿 +categories: 分類 +tags: 標籤 +archive: 所有文章 +links: 連結 +about: 關於 +recent: 最近文章 +next: 下一頁 +previous: 上一頁 +notitle: 無標題 +blogroll: 友站連結 +history: 歷史 +rss: 訂閱 +guestbook: 留言 +home: 首頁 +recent_comments: 最近評論 +Readmore: 閱讀全文 +belongsto: 分類於 +contents: 文章目錄 +shareto: 分享 +Discuss: 條參與 +Comment: 條評論 +Hits: 閱讀 diff --git a/themes/maupassant-hexo/layout/_partial/after_footer.pug b/themes/maupassant-hexo/layout/_partial/after_footer.pug new file mode 100644 index 0000000..693bb78 --- /dev/null +++ b/themes/maupassant-hexo/layout/_partial/after_footer.pug @@ -0,0 +1,65 @@ +if theme.fancybox == true + script(type='text/javascript', src='//cdn.bootcss.com/fancybox/3.2.5/jquery.fancybox.min.js', async) + script(type='text/javascript', src=url_for(theme.js) + '/fancybox.js' + '?v=' + theme.version, async) + link(rel='stylesheet', type='text/css', href='//cdn.bootcss.com/fancybox/3.2.5/jquery.fancybox.min.css') + +if theme.tinysou + script. + var option = { + engineKey: '#{theme.tinysou}' + }; + (function(w,d,t,u,n,s,e){ + s = d.createElement(t); + s.src = u; + s.async = 1; + w[n] = function(r){ + w[n].opts = r; + }; + e = d.getElementsByTagName(t)[0]; + e.parentNode.insertBefore(s, e); + })(window,document,'script','//tinysou-cdn.b0.upaiyun.com/ts.js','_ts'); + _ts(option); + +if theme.swiftype + script. + (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){ + (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t); + e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e); + })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st'); + _st('install','#{theme.swiftype}','2.0.0'); + +if theme.self_search == true + script(type='text/javascript', src=url_for(theme.js) + '/search.js' + '?v=' + theme.version) + script. + var search_path = '#{config.search.path}'; + if (search_path.length == 0) { + search_path = 'search.xml'; + } + var path = '#{config.root}' + search_path; + searchFunc(path, 'local-search-input', 'local-search-result'); + +if theme.baidu_analytics + script. + var _hmt = _hmt || []; + (function() { + var hm = document.createElement("script"); + hm.src = '//hm.baidu.com/hm.js?' + theme.baidu_analytics; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); + })(); + +if theme.canvas_nest.enable == true + - var color=theme.canvas_nest.color || "0,0,0" + - var opacity=theme.canvas_nest.opacity || "0.5" + - var zIndex=theme.canvas_nest.zIndex || "-2" + - var count=theme.canvas_nest.count || "50" + script(type='text/javascript', color=color, opacity=opacity, zIndex=zIndex, count=count,src='//cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js') + +if page.mathjax + include mathjax.pug + +if page.mathjax2 + include mathjax2.pug + +script(type='text/javascript', src=url_for(theme.js) + '/codeblock-resizer.js' + '?v=' + theme.version) +script(type='text/javascript', src=url_for(theme.js) + '/smartresize.js' + '?v=' + theme.version) diff --git a/themes/maupassant-hexo/layout/_partial/comments.pug b/themes/maupassant-hexo/layout/_partial/comments.pug new file mode 100644 index 0000000..b706953 --- /dev/null +++ b/themes/maupassant-hexo/layout/_partial/comments.pug @@ -0,0 +1,92 @@ +if theme.gitment.enable == true + #container + link(rel='stylesheet', href=url_for(theme.css) + '/default.css' + '?v=' + theme.version) + script(src=url_for(theme.js) + '/gitment.browser.js' + '?v=' + theme.version) + script. + var gitment = new Gitment({ + owner: '#{theme.gitment.owner}', + repo: '#{theme.gitment.repo}', + oauth: { + client_id: '#{theme.gitment.client_id}', + client_secret: '#{theme.gitment.client_secret}', + }, + }) + gitment.render('container') + +if theme.disqus + #disqus_thread + .btn_click_load + button.disqus_click_btn 阅读评论 「请确保 disqus.com 可以正常加载」 + script. + var disqus_shortname = '#{theme.disqus}'; + var disqus_identifier = '#{page.path}'; + var disqus_title = '#{page.title}'; + var disqus_url = '#{config.url}/#{page.path}'; + $('.btn_click_load').click(function() { + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + $('.btn_click_load').css('display','none'); + }); + $.ajax({ + url: 'https://disqus.com/next/config.json', + timeout: 3000, + type: 'GET', + success: (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + $('.btn_click_load').css('display','none'); + })(), + error: function() { + $('.btn_click_load').css('display','block'); + } + }); + script(id='dsq-count-scr', src='//'+ theme.disqus + '.disqus.com/count.js', async) + +if theme.uyan + #uyan_frame + script(type='text/javascript' src='//v2.uyan.cc/code/uyan.js?uid=' + theme.uyan) + +if theme.changyan + div#SOHUCS(sid=page.date.valueOf()) + script. + (function(){var appid='#{theme.changyan}';var conf='#{theme.changyan_conf}';var width=window.innerWidth||document.documentElement.clientWidth;if(width<960){window.document.write(' + + + + + + +
Donate
+
    +
  • PayPal
  • +
  • +
  • AliPay
  • +
  • WeChat
  • +
+
+
+
+ + + + diff --git a/themes/maupassant-hexo/source/img/AliPayQR.png b/themes/maupassant-hexo/source/img/AliPayQR.png new file mode 100644 index 0000000000000000000000000000000000000000..e54760e35cca45e0a2ad40110c96f84d1a13be63 GIT binary patch literal 28743 zcmeHw2UJzbw(SuR5fcVLP=a8Cl5@@=Ad)0YPKOMKd`OZE2#AP?NQPE|1W`!>5^O~T zM3P7nQ1OW5oYP+$>{hwmynEk&fBf;rfHC^Y-nDn_s#&Ynnrp7o8?34-`GB@5pU-I@L{twN@JYSw7hJ5tY)0t0<`>sY@ED;0$e;Sv|JpVeC!;8?3_HT9GpTNf{ z9wv_LoNOHI|L~HM($=rp+yCvGF0NytUA@8zs2(WVSYH)H2aSI6X3NUjB2yt-y)XBz^oBB`! z>o+%XHTks{ehsi|ZXO{{&Yyev<=M^sV9c#8JpZj;emwbWA4*C>XB}KzO&rY7XJy1- z?rhf9=0d#u{Ja7dTo$ZoF0>#k4?njcs|k;QIjaSi89yI~nW+Vu&t!d)zrOx2UCUt1 z+z?BEt~a*6ImQgS|I4t1EKIriO}NeYSWQhh%~?4)`At{_(1Ludg8V%Ef;<8i+-P3j zKR@(SXaDjc6=!SkOeS_eJ%h}}96rWlDj>kc!OP9cZ3ffe;YQ|S&d0&ZV{U>r;WOnn zL8CVo4CeAT-Tcd^s1x>hlS@{IG1PeHe19(V|N4daVaaAzCJvTpb20Wm=l17~ z|4nQ6@A<_4_9psQ@BjaE6a9~^-NtVG)ieI-(Ertwiu{NS(il68vl7M}EygXv{&%;3 z*v?OHX`nq^6-_+R&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US~+!1r}}eHMBUt=RsuO0s6vqFV@V)| z3@DrJwAB<#D76PwWv^zTP@4M0ybcQk94mqGN9dRP6#E3)2qidNJAjEo7UI<`C<9lS zVDU;22j9LA3e2fpPobXFX6T*sb!_tE^GjYn^VQVeZ>Zp;h?QNsN|ND{AaZChBDUg8 z!q?>EA|8z+_)@@92&XR5EPsSji6jXe!GP`Q_3VsO^VtDsOVAm+57mXE!m4jUbr7jBe?qM;ZIk5_#a)+!Z23zVU*g?? z$xoA+-~~jk?$JuO^no$c+BrF$r$@z2A`*`xLtd+Th^;S(;RUs3;i82-hs?pNr-V&} z2!BL!)ILyJhux&5rMrY5`^bsA_YYi z(jicLQ`yPM$=j$OD6MIe>elQ)FE|$izUOm8U0q!Y8%Yatm~uA5KD*s%pgFaq zybhf32lC|j6pG|oIBk%jHf)O=h$w+&OGL`!#`GWxxs^=9aYoDfJsOD0ChcyIYk>nO zv>F40gUzcFf}(U1VQ@kQ&Vh}fH11XPkTiY+4h`w1HJZG<4XOo@CxVa8zq?+*V`AeN zQ`xtE7S{uuX80E+=>bc8SYwC7;DKBqGsRVZ)06a4bIpevi>aDl#C)#cY@%a@vf6a{*^Y77B+L4u~&v916BN zg{XD@R4{HR)-&b6I=~rqIOTH?*&K_t=3Fq@sswM~?uCzgslgmjB6uM9K$Q8f|GogY zY-H_`m*DXYGx(c3|4Cnn%=Mpt8X3Xg4(8wL>&Mu)e*D;?A3jQp-#I~g4!sxozxq3S MMp@>elyTty0Zxy_m;e9( literal 0 HcmV?d00001 diff --git a/themes/maupassant-hexo/source/img/BTCQR.png b/themes/maupassant-hexo/source/img/BTCQR.png new file mode 100644 index 0000000000000000000000000000000000000000..b7cd7d434b519c25562008b4a9cce30969afe892 GIT binary patch literal 20129 zcmeHOc|6ox|DQ^TYboJImMqoHFoq`0U}R}QmPCfgOiT>MU`F=T$fJ^6in8arS`e~j z_e`5)Ey*ogi=D`p5Ps)Ni{^IccklCie*ew%!a3)2KFfKZ&vtsf=B%mlUOp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`BHxfUl7Lf=q(Wotl0ajFppX9JlwZJe=7Z ziHV7_Q};rq)hge;yIBR5gzxS^K|r22a|Gl?fW7B6f7@t3^|elNoEt9@=13FvM+F^} zYSN}A;swz-NFl zX5O!teHiKhX$|TUa*@(xpgRS$)=P_7Mm}^jH|O10nFZ~GG8%>j{{!RlZ>R})2C*&Q z2n1x?;Oi!9^N)@H;p5+4^lwN1`MmydGCzMDnc}~}VarwjcOZ?puC1X?nWo43{dS!O R`EM1^oK}|3IBDeje*n|hOD6yT literal 0 HcmV?d00001 diff --git a/themes/maupassant-hexo/source/img/alipay.svg b/themes/maupassant-hexo/source/img/alipay.svg new file mode 100644 index 0000000..2e78967 --- /dev/null +++ b/themes/maupassant-hexo/source/img/alipay.svg @@ -0,0 +1,46 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + diff --git a/themes/maupassant-hexo/source/img/bitcoin.svg b/themes/maupassant-hexo/source/img/bitcoin.svg new file mode 100644 index 0000000..dc64d87 --- /dev/null +++ b/themes/maupassant-hexo/source/img/bitcoin.svg @@ -0,0 +1,135 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/maupassant-hexo/source/img/github.svg b/themes/maupassant-hexo/source/img/github.svg new file mode 100644 index 0000000..7d9f99f --- /dev/null +++ b/themes/maupassant-hexo/source/img/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/maupassant-hexo/source/img/like.svg b/themes/maupassant-hexo/source/img/like.svg new file mode 100644 index 0000000..44adab3 --- /dev/null +++ b/themes/maupassant-hexo/source/img/like.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/themes/maupassant-hexo/source/img/paypal.svg b/themes/maupassant-hexo/source/img/paypal.svg new file mode 100644 index 0000000..cdacb58 --- /dev/null +++ b/themes/maupassant-hexo/source/img/paypal.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + diff --git a/themes/maupassant-hexo/source/img/wechat.svg b/themes/maupassant-hexo/source/img/wechat.svg new file mode 100644 index 0000000..c5d50af --- /dev/null +++ b/themes/maupassant-hexo/source/img/wechat.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/maupassant-hexo/source/js/codeblock-resizer.js b/themes/maupassant-hexo/source/js/codeblock-resizer.js new file mode 100644 index 0000000..96fd57f --- /dev/null +++ b/themes/maupassant-hexo/source/js/codeblock-resizer.js @@ -0,0 +1,51 @@ ++function($) { + 'use strict'; + + // Resize code blocks to fit the screen width + + var CodeBlockResizer = function(elem) { + this.$codeBlocks = $(elem); + }; + + CodeBlockResizer.prototype = { + /** + * Run main feature + */ + run: function() { + var self = this; + // resize all codeblocks + self.resize(); + // resize codeblocks when window is resized + $(window).smartresize(function() { + self.resize(); + }); + }, + + /** + * Resize codeblocks + */ + resize: function() { + var self = this; + self.$codeBlocks.each(function() { + var $gutter = $(this).find('.gutter'); + var $code = $(this).find('.code'); + // get padding of code div + var codePaddings = $code.width() - $code.innerWidth(); + // code block div width with padding - gutter div with padding + code div padding + var width = $(this).outerWidth() - $gutter.outerWidth() + codePaddings; + // apply new width + $code.css('width', width); + $code.children('pre').css('width', width); + }); + } + }; + + $(document).ready(function() { + // register jQuery function to check if an element has an horizontal scroll bar + $.fn.hasHorizontalScrollBar = function() { + return this.get(0).scrollWidth > this.innerWidth(); + }; + var resizer = new CodeBlockResizer('figure.highlight'); + resizer.run(); + }); +}(jQuery); diff --git a/themes/maupassant-hexo/source/js/donate.js b/themes/maupassant-hexo/source/js/donate.js new file mode 100644 index 0000000..514e97b --- /dev/null +++ b/themes/maupassant-hexo/source/js/donate.js @@ -0,0 +1,78 @@ +(function($) { + $.getUrlParam = function(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); + var r = window.location.search.substr(1).match(reg); + if(r && r[2] && r[2] != 'null' && r[2] != 'undefined' && r[2] != '') { + return unescape(r[2]); + } else { + return null; + } + } +})(jQuery); +jQuery(document).ready(function() { + $("#github").attr('href', $.getUrlParam('GitHub') || "https://github.com/" + window.location.href.split(".github.io")[0].split("/").pop()) + var QRBox = $('#QRBox'); + var MainBox = $('#MainBox'); + var count = 0; + $("li").hide(); + if($.getUrlParam('BTCQR') && $.getUrlParam('BTCKEY')) { + var BTCQR = $.getUrlParam('BTCQR'); // 二维码路径 + var BTCKEY = $.getUrlParam('BTCKEY'); + count++; + $("#BTC").show(); + $("#BTC").addClass('yc') + $("#btc-key").attr("value",BTCKEY) + } + if($.getUrlParam('AliPayQR')) { + var AliPayQR = $.getUrlParam('AliPayQR'); + count++; + $("#AliPay").show(); + } + if($.getUrlParam('WeChatQR')) { + var WeChatQR = $.getUrlParam('WeChatQR'); + count++; + $("#WeChat").show(); + } + if($.getUrlParam('PayPal')) { + var PayPal = $.getUrlParam('PayPal'); + count++; + $("#PayPal a").attr("href",PayPal) + $("#PayPal").show(); + } + if(count == 0){ + $("#WeChat").after('

没有开启任何Donate选项!
'); + } + $("#donateBox li,#donateBox li a").css("width", Math.ceil(74+(74*(4-count)/count))+"px"); + function showQR(QR) { + if(QR) { + MainBox.css('background-image', 'url(' + QR + ')'); + } + $('#DonateText,#donateBox,#github').addClass('blur'); + QRBox.fadeIn(300, function(argument) { + MainBox.addClass('showQR'); + }); + } + + $('#donateBox>li').click(function(event) { + var thisID = $(this).attr('id'); + if(thisID === 'BTC') { + showQR(BTCQR); + new Clipboard('#BTCBn'); + } else if(thisID === 'AliPay') { + showQR(AliPayQR); + } else if(thisID === 'WeChat') { + showQR(WeChatQR); + } + }); + + MainBox.click(function(event) { + MainBox.removeClass('showQR').addClass('hideQR'); + setTimeout(function(a) { + QRBox.fadeOut(300, function(argument) { + MainBox.removeClass('hideQR'); + }); + $('#DonateText,#donateBox,#github').removeClass('blur'); + }, 600); + + }); +}); diff --git a/themes/maupassant-hexo/source/js/fancybox.js b/themes/maupassant-hexo/source/js/fancybox.js new file mode 100644 index 0000000..3535a34 --- /dev/null +++ b/themes/maupassant-hexo/source/js/fancybox.js @@ -0,0 +1,19 @@ +$(document).ready(function() { + $('img').each(function() { + if ($(this).parent().hasClass('fancybox')) return; + if ($(this).hasClass('nofancybox')) return; + var alt = this.alt; + if (alt) $(this).after('' + alt + ''); + $(this).wrap(''); + }); + $(this).find('.fancybox').each(function(){ + $(this).attr('rel', 'article'); + }); +}); +$(document).ready(function() { + $("a[href$='.jpg'],a[href$='.png'],a[href$='.gif'],a[href$='.webp']").attr('rel', 'gallery').fancybox({ + helpers : { + title: { type: 'inside'} + } + }); +}); diff --git a/themes/maupassant-hexo/source/js/gitment.browser.js b/themes/maupassant-hexo/source/js/gitment.browser.js new file mode 100644 index 0000000..06e1322 --- /dev/null +++ b/themes/maupassant-hexo/source/js/gitment.browser.js @@ -0,0 +1,3751 @@ +var Gitment = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 5); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var LS_ACCESS_TOKEN_KEY = exports.LS_ACCESS_TOKEN_KEY = 'gitment-comments-token'; +var LS_USER_KEY = exports.LS_USER_KEY = 'gitment-user-info'; + +var NOT_INITIALIZED_ERROR = exports.NOT_INITIALIZED_ERROR = new Error('Comments Not Initialized'); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var __extends = undefined && undefined.__extends || function () { + var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + return function (d, b) { + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +}(); +Object.defineProperty(exports, "__esModule", { value: true }); +registerGlobals(); +exports.extras = { + allowStateChanges: allowStateChanges, + deepEqual: deepEqual, + getAtom: getAtom, + getDebugName: getDebugName, + getDependencyTree: getDependencyTree, + getAdministration: getAdministration, + getGlobalState: getGlobalState, + getObserverTree: getObserverTree, + isComputingDerivation: isComputingDerivation, + isSpyEnabled: isSpyEnabled, + onReactionError: onReactionError, + resetGlobalState: resetGlobalState, + shareGlobalState: shareGlobalState, + spyReport: spyReport, + spyReportEnd: spyReportEnd, + spyReportStart: spyReportStart, + setReactionScheduler: setReactionScheduler +}; +if ((typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === "undefined" ? "undefined" : _typeof(__MOBX_DEVTOOLS_GLOBAL_HOOK__)) === "object") { + __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(module.exports); +} +module.exports.default = module.exports; +var actionFieldDecorator = createClassPropertyDecorator(function (target, key, value, args, originalDescriptor) { + var actionName = args && args.length === 1 ? args[0] : value.name || key || ""; + var wrappedAction = action(actionName, value); + addHiddenProp(target, key, wrappedAction); +}, function (key) { + return this[key]; +}, function () { + invariant(false, getMessage("m001")); +}, false, true); +var boundActionDecorator = createClassPropertyDecorator(function (target, key, value) { + defineBoundAction(target, key, value); +}, function (key) { + return this[key]; +}, function () { + invariant(false, getMessage("m001")); +}, false, false); +var action = function action(arg1, arg2, arg3, arg4) { + if (arguments.length === 1 && typeof arg1 === "function") return createAction(arg1.name || "", arg1); + if (arguments.length === 2 && typeof arg2 === "function") return createAction(arg1, arg2); + if (arguments.length === 1 && typeof arg1 === "string") return namedActionDecorator(arg1); + return namedActionDecorator(arg2).apply(null, arguments); +}; +exports.action = action; +action.bound = function boundAction(arg1, arg2, arg3) { + if (typeof arg1 === "function") { + var action_1 = createAction("", arg1); + action_1.autoBind = true; + return action_1; + } + return boundActionDecorator.apply(null, arguments); +}; +function namedActionDecorator(name) { + return function (target, prop, descriptor) { + if (descriptor && typeof descriptor.value === "function") { + descriptor.value = createAction(name, descriptor.value); + descriptor.enumerable = false; + descriptor.configurable = true; + return descriptor; + } + return actionFieldDecorator(name).apply(this, arguments); + }; +} +function runInAction(arg1, arg2, arg3) { + var actionName = typeof arg1 === "string" ? arg1 : arg1.name || ""; + var fn = typeof arg1 === "function" ? arg1 : arg2; + var scope = typeof arg1 === "function" ? arg2 : arg3; + invariant(typeof fn === "function", getMessage("m002")); + invariant(fn.length === 0, getMessage("m003")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + return executeAction(actionName, fn, scope, undefined); +} +exports.runInAction = runInAction; +function isAction(thing) { + return typeof thing === "function" && thing.isMobxAction === true; +} +exports.isAction = isAction; +function defineBoundAction(target, propertyName, fn) { + var res = function res() { + return executeAction(propertyName, fn, target, arguments); + }; + res.isMobxAction = true; + addHiddenProp(target, propertyName, res); +} +function autorun(arg1, arg2, arg3) { + var name, view, scope; + if (typeof arg1 === "string") { + name = arg1; + view = arg2; + scope = arg3; + } else { + name = arg1.name || "Autorun@" + getNextId(); + view = arg1; + scope = arg2; + } + invariant(typeof view === "function", getMessage("m004")); + invariant(isAction(view) === false, getMessage("m005")); + if (scope) view = view.bind(scope); + var reaction = new Reaction(name, function () { + this.track(reactionRunner); + }); + function reactionRunner() { + view(reaction); + } + reaction.schedule(); + return reaction.getDisposer(); +} +exports.autorun = autorun; +function when(arg1, arg2, arg3, arg4) { + var name, predicate, effect, scope; + if (typeof arg1 === "string") { + name = arg1; + predicate = arg2; + effect = arg3; + scope = arg4; + } else { + name = "When@" + getNextId(); + predicate = arg1; + effect = arg2; + scope = arg3; + } + var disposer = autorun(name, function (r) { + if (predicate.call(scope)) { + r.dispose(); + var prevUntracked = untrackedStart(); + effect.call(scope); + untrackedEnd(prevUntracked); + } + }); + return disposer; +} +exports.when = when; +function autorunAsync(arg1, arg2, arg3, arg4) { + var name, func, delay, scope; + if (typeof arg1 === "string") { + name = arg1; + func = arg2; + delay = arg3; + scope = arg4; + } else { + name = arg1.name || "AutorunAsync@" + getNextId(); + func = arg1; + delay = arg2; + scope = arg3; + } + invariant(isAction(func) === false, getMessage("m006")); + if (delay === void 0) delay = 1; + if (scope) func = func.bind(scope); + var isScheduled = false; + var r = new Reaction(name, function () { + if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + if (!r.isDisposed) r.track(reactionRunner); + }, delay); + } + }); + function reactionRunner() { + func(r); + } + r.schedule(); + return r.getDisposer(); +} +exports.autorunAsync = autorunAsync; +function reaction(expression, effect, arg3) { + if (arguments.length > 3) { + fail(getMessage("m007")); + } + if (isModifierDescriptor(expression)) { + fail(getMessage("m008")); + } + var opts; + if ((typeof arg3 === "undefined" ? "undefined" : _typeof(arg3)) === "object") { + opts = arg3; + } else { + opts = {}; + } + opts.name = opts.name || expression.name || effect.name || "Reaction@" + getNextId(); + opts.fireImmediately = arg3 === true || opts.fireImmediately === true; + opts.delay = opts.delay || 0; + opts.compareStructural = opts.compareStructural || opts.struct || false; + effect = action(opts.name, opts.context ? effect.bind(opts.context) : effect); + if (opts.context) { + expression = expression.bind(opts.context); + } + var firstTime = true; + var isScheduled = false; + var nextValue; + var r = new Reaction(opts.name, function () { + if (firstTime || opts.delay < 1) { + reactionRunner(); + } else if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + reactionRunner(); + }, opts.delay); + } + }); + function reactionRunner() { + if (r.isDisposed) return; + var changed = false; + r.track(function () { + var v = expression(r); + changed = valueDidChange(opts.compareStructural, nextValue, v); + nextValue = v; + }); + if (firstTime && opts.fireImmediately) effect(nextValue, r); + if (!firstTime && changed === true) effect(nextValue, r); + if (firstTime) firstTime = false; + } + r.schedule(); + return r.getDisposer(); +} +exports.reaction = reaction; +function createComputedDecorator(compareStructural) { + return createClassPropertyDecorator(function (target, name, _, __, originalDescriptor) { + invariant(typeof originalDescriptor !== "undefined", getMessage("m009")); + invariant(typeof originalDescriptor.get === "function", getMessage("m010")); + var adm = asObservableObject(target, ""); + defineComputedProperty(adm, name, originalDescriptor.get, originalDescriptor.set, compareStructural, false); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + this.$mobx.values[name].set(value); + }, false, false); +} +var computedDecorator = createComputedDecorator(false); +var computedStructDecorator = createComputedDecorator(true); +var computed = function computed(arg1, arg2, arg3) { + if (typeof arg2 === "string") { + return computedDecorator.apply(null, arguments); + } + invariant(typeof arg1 === "function", getMessage("m011")); + invariant(arguments.length < 3, getMessage("m012")); + var opts = (typeof arg2 === "undefined" ? "undefined" : _typeof(arg2)) === "object" ? arg2 : {}; + opts.setter = typeof arg2 === "function" ? arg2 : opts.setter; + return new ComputedValue(arg1, opts.context, opts.compareStructural || opts.struct || false, opts.name || arg1.name || "", opts.setter); +}; +exports.computed = computed; +computed.struct = computedStructDecorator; +function createTransformer(transformer, onCleanup) { + invariant(typeof transformer === "function" && transformer.length < 2, "createTransformer expects a function that accepts one argument"); + var objectCache = {}; + var resetId = globalState.resetId; + var Transformer = function (_super) { + __extends(Transformer, _super); + function Transformer(sourceIdentifier, sourceObject) { + var _this = _super.call(this, function () { + return transformer(sourceObject); + }, undefined, false, "Transformer-" + transformer.name + "-" + sourceIdentifier, undefined) || this; + _this.sourceIdentifier = sourceIdentifier; + _this.sourceObject = sourceObject; + return _this; + } + Transformer.prototype.onBecomeUnobserved = function () { + var lastValue = this.value; + _super.prototype.onBecomeUnobserved.call(this); + delete objectCache[this.sourceIdentifier]; + if (onCleanup) onCleanup(lastValue, this.sourceObject); + }; + return Transformer; + }(ComputedValue); + return function (object) { + if (resetId !== globalState.resetId) { + objectCache = {}; + resetId = globalState.resetId; + } + var identifier = getMemoizationId(object); + var reactiveTransformer = objectCache[identifier]; + if (reactiveTransformer) return reactiveTransformer.get(); + reactiveTransformer = objectCache[identifier] = new Transformer(identifier, object); + return reactiveTransformer.get(); + }; +} +exports.createTransformer = createTransformer; +function getMemoizationId(object) { + if (object === null || (typeof object === "undefined" ? "undefined" : _typeof(object)) !== "object") throw new Error("[mobx] transform expected some kind of object, got: " + object); + var tid = object.$transformId; + if (tid === undefined) { + tid = getNextId(); + addHiddenProp(object, "$transformId", tid); + } + return tid; +} +function expr(expr, scope) { + if (!isComputingDerivation()) console.warn(getMessage("m013")); + return computed(expr, { context: scope }).get(); +} +exports.expr = expr; +function extendObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, deepEnhancer, properties); +} +exports.extendObservable = extendObservable; +function extendShallowObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, referenceEnhancer, properties); +} +exports.extendShallowObservable = extendShallowObservable; +function extendObservableHelper(target, defaultEnhancer, properties) { + invariant(arguments.length >= 2, getMessage("m014")); + invariant((typeof target === "undefined" ? "undefined" : _typeof(target)) === "object", getMessage("m015")); + invariant(!isObservableMap(target), getMessage("m016")); + properties.forEach(function (propSet) { + invariant((typeof propSet === "undefined" ? "undefined" : _typeof(propSet)) === "object", getMessage("m017")); + invariant(!isObservable(propSet), getMessage("m018")); + }); + var adm = asObservableObject(target); + var definedProps = {}; + for (var i = properties.length - 1; i >= 0; i--) { + var propSet = properties[i]; + for (var key in propSet) { + if (definedProps[key] !== true && hasOwnProperty(propSet, key)) { + definedProps[key] = true; + if (target === propSet && !isPropertyConfigurable(target, key)) continue; + var descriptor = Object.getOwnPropertyDescriptor(propSet, key); + defineObservablePropertyFromDescriptor(adm, key, descriptor, defaultEnhancer); + } + } + } + return target; +} +function getDependencyTree(thing, property) { + return nodeToDependencyTree(getAtom(thing, property)); +} +function nodeToDependencyTree(node) { + var result = { + name: node.name + }; + if (node.observing && node.observing.length > 0) result.dependencies = unique(node.observing).map(nodeToDependencyTree); + return result; +} +function getObserverTree(thing, property) { + return nodeToObserverTree(getAtom(thing, property)); +} +function nodeToObserverTree(node) { + var result = { + name: node.name + }; + if (hasObservers(node)) result.observers = getObservers(node).map(nodeToObserverTree); + return result; +} +function intercept(thing, propOrHandler, handler) { + if (typeof handler === "function") return interceptProperty(thing, propOrHandler, handler);else return interceptInterceptable(thing, propOrHandler); +} +exports.intercept = intercept; +function interceptInterceptable(thing, handler) { + return getAdministration(thing).intercept(handler); +} +function interceptProperty(thing, property, handler) { + return getAdministration(thing, property).intercept(handler); +} +function isComputed(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableObject(value) === false) return false; + var atom = getAtom(value, property); + return isComputedValue(atom); + } + return isComputedValue(value); +} +exports.isComputed = isComputed; +function isObservable(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableArray(value) || isObservableMap(value)) throw new Error(getMessage("m019"));else if (isObservableObject(value)) { + var o = value.$mobx; + return o.values && !!o.values[property]; + } + return false; + } + return isObservableObject(value) || !!value.$mobx || isAtom(value) || isReaction(value) || isComputedValue(value); +} +exports.isObservable = isObservable; +var deepDecorator = createDecoratorForEnhancer(deepEnhancer); +var shallowDecorator = createDecoratorForEnhancer(shallowEnhancer); +var refDecorator = createDecoratorForEnhancer(referenceEnhancer); +var deepStructDecorator = createDecoratorForEnhancer(deepStructEnhancer); +var refStructDecorator = createDecoratorForEnhancer(refStructEnhancer); +function createObservable(v) { + if (v === void 0) { + v = undefined; + } + if (typeof arguments[1] === "string") return deepDecorator.apply(null, arguments); + invariant(arguments.length <= 1, getMessage("m021")); + invariant(!isModifierDescriptor(v), getMessage("m020")); + if (isObservable(v)) return v; + var res = deepEnhancer(v, undefined, undefined); + if (res !== v) return res; + return observable.box(v); +} +var IObservableFactories = function () { + function IObservableFactories() {} + IObservableFactories.prototype.box = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("box"); + return new ObservableValue(value, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowBox = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowBox"); + return new ObservableValue(value, referenceEnhancer, name); + }; + IObservableFactories.prototype.array = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("array"); + return new ObservableArray(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowArray = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowArray"); + return new ObservableArray(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.map = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("map"); + return new ObservableMap(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowMap = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowMap"); + return new ObservableMap(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.object = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("object"); + var res = {}; + asObservableObject(res, name); + extendObservable(res, props); + return res; + }; + IObservableFactories.prototype.shallowObject = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowObject"); + var res = {}; + asObservableObject(res, name); + extendShallowObservable(res, props); + return res; + }; + IObservableFactories.prototype.ref = function () { + if (arguments.length < 2) { + return createModifierDescriptor(referenceEnhancer, arguments[0]); + } else { + return refDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.shallow = function () { + if (arguments.length < 2) { + return createModifierDescriptor(shallowEnhancer, arguments[0]); + } else { + return shallowDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.deep = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepEnhancer, arguments[0]); + } else { + return deepDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepStructEnhancer, arguments[0]); + } else { + return deepStructDecorator.apply(null, arguments); + } + }; + return IObservableFactories; +}(); +exports.IObservableFactories = IObservableFactories; +var observable = createObservable; +exports.observable = observable; +Object.keys(IObservableFactories.prototype).forEach(function (key) { + return observable[key] = IObservableFactories.prototype[key]; +}); +observable.deep.struct = observable.struct; +observable.ref.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(refStructEnhancer, arguments[0]); + } else { + return refStructDecorator.apply(null, arguments); + } +}; +function incorrectlyUsedAsDecorator(methodName) { + fail("Expected one or two arguments to observable." + methodName + ". Did you accidentally try to use observable." + methodName + " as decorator?"); +} +function createDecoratorForEnhancer(enhancer) { + invariant(!!enhancer, ":("); + return createClassPropertyDecorator(function (target, name, baseValue, _, baseDescriptor) { + assertPropertyConfigurable(target, name); + invariant(!baseDescriptor || !baseDescriptor.get, getMessage("m022")); + var adm = asObservableObject(target, undefined); + defineObservableProperty(adm, name, baseValue, enhancer); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + setPropertyValue(this, name, value); + }, true, false); +} +function observe(thing, propOrCb, cbOrFire, fireImmediately) { + if (typeof cbOrFire === "function") return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);else return observeObservable(thing, propOrCb, cbOrFire); +} +exports.observe = observe; +function observeObservable(thing, listener, fireImmediately) { + return getAdministration(thing).observe(listener, fireImmediately); +} +function observeObservableProperty(thing, property, listener, fireImmediately) { + return getAdministration(thing, property).observe(listener, fireImmediately); +} +function toJS(source, detectCycles, __alreadySeen) { + if (detectCycles === void 0) { + detectCycles = true; + } + if (__alreadySeen === void 0) { + __alreadySeen = []; + } + function cache(value) { + if (detectCycles) __alreadySeen.push([source, value]); + return value; + } + if (isObservable(source)) { + if (detectCycles && __alreadySeen === null) __alreadySeen = []; + if (detectCycles && source !== null && (typeof source === "undefined" ? "undefined" : _typeof(source)) === "object") { + for (var i = 0, l = __alreadySeen.length; i < l; i++) { + if (__alreadySeen[i][0] === source) return __alreadySeen[i][1]; + } + } + if (isObservableArray(source)) { + var res = cache([]); + var toAdd = source.map(function (value) { + return toJS(value, detectCycles, __alreadySeen); + }); + res.length = toAdd.length; + for (var i = 0, l = toAdd.length; i < l; i++) { + res[i] = toAdd[i]; + }return res; + } + if (isObservableObject(source)) { + var res = cache({}); + for (var key in source) { + res[key] = toJS(source[key], detectCycles, __alreadySeen); + }return res; + } + if (isObservableMap(source)) { + var res_1 = cache({}); + source.forEach(function (value, key) { + return res_1[key] = toJS(value, detectCycles, __alreadySeen); + }); + return res_1; + } + if (isObservableValue(source)) return toJS(source.get(), detectCycles, __alreadySeen); + } + return source; +} +exports.toJS = toJS; +function transaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + deprecated(getMessage("m023")); + return runInTransaction.apply(undefined, arguments); +} +exports.transaction = transaction; +function runInTransaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + return executeAction("", action); +} +function log(msg) { + console.log(msg); + return msg; +} +function whyRun(thing, prop) { + switch (arguments.length) { + case 0: + thing = globalState.trackingDerivation; + if (!thing) return log(getMessage("m024")); + break; + case 2: + thing = getAtom(thing, prop); + break; + } + thing = getAtom(thing); + if (isComputedValue(thing)) return log(thing.whyRun());else if (isReaction(thing)) return log(thing.whyRun()); + return fail(getMessage("m025")); +} +exports.whyRun = whyRun; +function createAction(actionName, fn) { + invariant(typeof fn === "function", getMessage("m026")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + var res = function res() { + return executeAction(actionName, fn, this, arguments); + }; + res.originalFn = fn; + res.isMobxAction = true; + return res; +} +function executeAction(actionName, fn, scope, args) { + var runInfo = startAction(actionName, fn, scope, args); + try { + return fn.apply(scope, args); + } finally { + endAction(runInfo); + } +} +function startAction(actionName, fn, scope, args) { + var notifySpy = isSpyEnabled() && !!actionName; + var startTime = 0; + if (notifySpy) { + startTime = Date.now(); + var l = args && args.length || 0; + var flattendArgs = new Array(l); + if (l > 0) for (var i = 0; i < l; i++) { + flattendArgs[i] = args[i]; + }spyReportStart({ + type: "action", + name: actionName, + fn: fn, + object: scope, + arguments: flattendArgs + }); + } + var prevDerivation = untrackedStart(); + startBatch(); + var prevAllowStateChanges = allowStateChangesStart(true); + return { + prevDerivation: prevDerivation, + prevAllowStateChanges: prevAllowStateChanges, + notifySpy: notifySpy, + startTime: startTime + }; +} +function endAction(runInfo) { + allowStateChangesEnd(runInfo.prevAllowStateChanges); + endBatch(); + untrackedEnd(runInfo.prevDerivation); + if (runInfo.notifySpy) spyReportEnd({ time: Date.now() - runInfo.startTime }); +} +function useStrict(strict) { + invariant(globalState.trackingDerivation === null, getMessage("m028")); + globalState.strictMode = strict; + globalState.allowStateChanges = !strict; +} +exports.useStrict = useStrict; +function isStrictModeEnabled() { + return globalState.strictMode; +} +exports.isStrictModeEnabled = isStrictModeEnabled; +function allowStateChanges(allowStateChanges, func) { + var prev = allowStateChangesStart(allowStateChanges); + var res; + try { + res = func(); + } finally { + allowStateChangesEnd(prev); + } + return res; +} +function allowStateChangesStart(allowStateChanges) { + var prev = globalState.allowStateChanges; + globalState.allowStateChanges = allowStateChanges; + return prev; +} +function allowStateChangesEnd(prev) { + globalState.allowStateChanges = prev; +} +var BaseAtom = function () { + function BaseAtom(name) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + this.name = name; + this.isPendingUnobservation = true; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.NOT_TRACKING; + } + BaseAtom.prototype.onBecomeUnobserved = function () {}; + BaseAtom.prototype.reportObserved = function () { + reportObserved(this); + }; + BaseAtom.prototype.reportChanged = function () { + startBatch(); + propagateChanged(this); + endBatch(); + }; + BaseAtom.prototype.toString = function () { + return this.name; + }; + return BaseAtom; +}(); +exports.BaseAtom = BaseAtom; +var Atom = function (_super) { + __extends(Atom, _super); + function Atom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + if (onBecomeObservedHandler === void 0) { + onBecomeObservedHandler = noop; + } + if (onBecomeUnobservedHandler === void 0) { + onBecomeUnobservedHandler = noop; + } + var _this = _super.call(this, name) || this; + _this.name = name; + _this.onBecomeObservedHandler = onBecomeObservedHandler; + _this.onBecomeUnobservedHandler = onBecomeUnobservedHandler; + _this.isPendingUnobservation = false; + _this.isBeingTracked = false; + return _this; + } + Atom.prototype.reportObserved = function () { + startBatch(); + _super.prototype.reportObserved.call(this); + if (!this.isBeingTracked) { + this.isBeingTracked = true; + this.onBecomeObservedHandler(); + } + endBatch(); + return !!globalState.trackingDerivation; + }; + Atom.prototype.onBecomeUnobserved = function () { + this.isBeingTracked = false; + this.onBecomeUnobservedHandler(); + }; + return Atom; +}(BaseAtom); +exports.Atom = Atom; +var isAtom = createInstanceofPredicate("Atom", BaseAtom); +var ComputedValue = function () { + function ComputedValue(derivation, scope, compareStructural, name, setter) { + this.derivation = derivation; + this.scope = scope; + this.compareStructural = compareStructural; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.observing = []; + this.newObserving = null; + this.isPendingUnobservation = false; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.runId = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.UP_TO_DATE; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.value = undefined; + this.isComputing = false; + this.isRunningSetter = false; + this.name = name || "ComputedValue@" + getNextId(); + if (setter) this.setter = createAction(name + "-setter", setter); + } + ComputedValue.prototype.onBecomeStale = function () { + propagateMaybeChanged(this); + }; + ComputedValue.prototype.onBecomeUnobserved = function () { + invariant(this.dependenciesState !== IDerivationState.NOT_TRACKING, getMessage("m029")); + clearObserving(this); + this.value = undefined; + }; + ComputedValue.prototype.get = function () { + invariant(!this.isComputing, "Cycle detected in computation " + this.name, this.derivation); + if (globalState.inBatch === 0) { + startBatch(); + if (shouldCompute(this)) this.value = this.computeValue(false); + endBatch(); + } else { + reportObserved(this); + if (shouldCompute(this)) if (this.trackAndCompute()) propagateChangeConfirmed(this); + } + var result = this.value; + if (isCaughtException(result)) throw result.cause; + return result; + }; + ComputedValue.prototype.peek = function () { + var res = this.computeValue(false); + if (isCaughtException(res)) throw res.cause; + return res; + }; + ComputedValue.prototype.set = function (value) { + if (this.setter) { + invariant(!this.isRunningSetter, "The setter of computed value '" + this.name + "' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"); + this.isRunningSetter = true; + try { + this.setter.call(this.scope, value); + } finally { + this.isRunningSetter = false; + } + } else invariant(false, "[ComputedValue '" + this.name + "'] It is not possible to assign a new value to a computed value."); + }; + ComputedValue.prototype.trackAndCompute = function () { + if (isSpyEnabled()) { + spyReport({ + object: this.scope, + type: "compute", + fn: this.derivation + }); + } + var oldValue = this.value; + var newValue = this.value = this.computeValue(true); + return isCaughtException(newValue) || valueDidChange(this.compareStructural, newValue, oldValue); + }; + ComputedValue.prototype.computeValue = function (track) { + this.isComputing = true; + globalState.computationDepth++; + var res; + if (track) { + res = trackDerivedFunction(this, this.derivation, this.scope); + } else { + try { + res = this.derivation.call(this.scope); + } catch (e) { + res = new CaughtException(e); + } + } + globalState.computationDepth--; + this.isComputing = false; + return res; + }; + ; + ComputedValue.prototype.observe = function (listener, fireImmediately) { + var _this = this; + var firstTime = true; + var prevValue = undefined; + return autorun(function () { + var newValue = _this.get(); + if (!firstTime || fireImmediately) { + var prevU = untrackedStart(); + listener({ + type: "update", + object: _this, + newValue: newValue, + oldValue: prevValue + }); + untrackedEnd(prevU); + } + firstTime = false; + prevValue = newValue; + }); + }; + ComputedValue.prototype.toJSON = function () { + return this.get(); + }; + ComputedValue.prototype.toString = function () { + return this.name + "[" + this.derivation.toString() + "]"; + }; + ComputedValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + }; + ; + ComputedValue.prototype.whyRun = function () { + var isTracking = Boolean(globalState.trackingDerivation); + var observing = unique(this.isComputing ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + var observers = unique(getObservers(this).map(function (dep) { + return dep.name; + })); + return "\nWhyRun? computation '" + this.name + "':\n * Running because: " + (isTracking ? "[active] the value of this computation is needed by a reaction" : this.isComputing ? "[get] The value of this computed was requested outside a reaction" : "[idle] not running at the moment") + "\n" + (this.dependenciesState === IDerivationState.NOT_TRACKING ? getMessage("m032") : " * This computation will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this.isComputing && isTracking ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n\n * If the outcome of this computation changes, the following observers will be re-run:\n " + joinStrings(observers) + "\n"); + }; + return ComputedValue; +}(); +ComputedValue.prototype[primitiveSymbol()] = ComputedValue.prototype.valueOf; +var isComputedValue = createInstanceofPredicate("ComputedValue", ComputedValue); +var IDerivationState; +(function (IDerivationState) { + IDerivationState[IDerivationState["NOT_TRACKING"] = -1] = "NOT_TRACKING"; + IDerivationState[IDerivationState["UP_TO_DATE"] = 0] = "UP_TO_DATE"; + IDerivationState[IDerivationState["POSSIBLY_STALE"] = 1] = "POSSIBLY_STALE"; + IDerivationState[IDerivationState["STALE"] = 2] = "STALE"; +})(IDerivationState || (IDerivationState = {})); +exports.IDerivationState = IDerivationState; +var CaughtException = function () { + function CaughtException(cause) { + this.cause = cause; + } + return CaughtException; +}(); +function isCaughtException(e) { + return e instanceof CaughtException; +} +function shouldCompute(derivation) { + switch (derivation.dependenciesState) { + case IDerivationState.UP_TO_DATE: + return false; + case IDerivationState.NOT_TRACKING: + case IDerivationState.STALE: + return true; + case IDerivationState.POSSIBLY_STALE: + { + var prevUntracked = untrackedStart(); + var obs = derivation.observing, + l = obs.length; + for (var i = 0; i < l; i++) { + var obj = obs[i]; + if (isComputedValue(obj)) { + try { + obj.get(); + } catch (e) { + untrackedEnd(prevUntracked); + return true; + } + if (derivation.dependenciesState === IDerivationState.STALE) { + untrackedEnd(prevUntracked); + return true; + } + } + } + changeDependenciesStateTo0(derivation); + untrackedEnd(prevUntracked); + return false; + } + } +} +function isComputingDerivation() { + return globalState.trackingDerivation !== null; +} +function checkIfStateModificationsAreAllowed(atom) { + var hasObservers = atom.observers.length > 0; + if (globalState.computationDepth > 0 && hasObservers) fail(getMessage("m031") + atom.name); + if (!globalState.allowStateChanges && hasObservers) fail(getMessage(globalState.strictMode ? "m030a" : "m030b") + atom.name); +} +function trackDerivedFunction(derivation, f, context) { + changeDependenciesStateTo0(derivation); + derivation.newObserving = new Array(derivation.observing.length + 100); + derivation.unboundDepsCount = 0; + derivation.runId = ++globalState.runId; + var prevTracking = globalState.trackingDerivation; + globalState.trackingDerivation = derivation; + var result; + try { + result = f.call(context); + } catch (e) { + result = new CaughtException(e); + } + globalState.trackingDerivation = prevTracking; + bindDependencies(derivation); + return result; +} +function bindDependencies(derivation) { + var prevObserving = derivation.observing; + var observing = derivation.observing = derivation.newObserving; + derivation.newObserving = null; + var i0 = 0, + l = derivation.unboundDepsCount; + for (var i = 0; i < l; i++) { + var dep = observing[i]; + if (dep.diffValue === 0) { + dep.diffValue = 1; + if (i0 !== i) observing[i0] = dep; + i0++; + } + } + observing.length = i0; + l = prevObserving.length; + while (l--) { + var dep = prevObserving[l]; + if (dep.diffValue === 0) { + removeObserver(dep, derivation); + } + dep.diffValue = 0; + } + while (i0--) { + var dep = observing[i0]; + if (dep.diffValue === 1) { + dep.diffValue = 0; + addObserver(dep, derivation); + } + } +} +function clearObserving(derivation) { + var obs = derivation.observing; + var i = obs.length; + while (i--) { + removeObserver(obs[i], derivation); + }derivation.dependenciesState = IDerivationState.NOT_TRACKING; + obs.length = 0; +} +function untracked(action) { + var prev = untrackedStart(); + var res = action(); + untrackedEnd(prev); + return res; +} +exports.untracked = untracked; +function untrackedStart() { + var prev = globalState.trackingDerivation; + globalState.trackingDerivation = null; + return prev; +} +function untrackedEnd(prev) { + globalState.trackingDerivation = prev; +} +function changeDependenciesStateTo0(derivation) { + if (derivation.dependenciesState === IDerivationState.UP_TO_DATE) return; + derivation.dependenciesState = IDerivationState.UP_TO_DATE; + var obs = derivation.observing; + var i = obs.length; + while (i--) { + obs[i].lowestObserverState = IDerivationState.UP_TO_DATE; + } +} +var persistentKeys = ["mobxGuid", "resetId", "spyListeners", "strictMode", "runId"]; +var MobXGlobals = function () { + function MobXGlobals() { + this.version = 5; + this.trackingDerivation = null; + this.computationDepth = 0; + this.runId = 0; + this.mobxGuid = 0; + this.inBatch = 0; + this.pendingUnobservations = []; + this.pendingReactions = []; + this.isRunningReactions = false; + this.allowStateChanges = true; + this.strictMode = false; + this.resetId = 0; + this.spyListeners = []; + this.globalReactionErrorHandlers = []; + } + return MobXGlobals; +}(); +var globalState = new MobXGlobals(); +function shareGlobalState() { + var global = getGlobal(); + var ownState = globalState; + if (global.__mobservableTrackingStack || global.__mobservableViewStack) throw new Error("[mobx] An incompatible version of mobservable is already loaded."); + if (global.__mobxGlobal && global.__mobxGlobal.version !== ownState.version) throw new Error("[mobx] An incompatible version of mobx is already loaded."); + if (global.__mobxGlobal) globalState = global.__mobxGlobal;else global.__mobxGlobal = ownState; +} +function getGlobalState() { + return globalState; +} +function registerGlobals() {} +function resetGlobalState() { + globalState.resetId++; + var defaultGlobals = new MobXGlobals(); + for (var key in defaultGlobals) { + if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key]; + }globalState.allowStateChanges = !globalState.strictMode; +} +function hasObservers(observable) { + return observable.observers && observable.observers.length > 0; +} +function getObservers(observable) { + return observable.observers; +} +function invariantObservers(observable) { + var list = observable.observers; + var map = observable.observersIndexes; + var l = list.length; + for (var i = 0; i < l; i++) { + var id = list[i].__mapid; + if (i) { + invariant(map[id] === i, "INTERNAL ERROR maps derivation.__mapid to index in list"); + } else { + invariant(!(id in map), "INTERNAL ERROR observer on index 0 shouldnt be held in map."); + } + } + invariant(list.length === 0 || Object.keys(map).length === list.length - 1, "INTERNAL ERROR there is no junk in map"); +} +function addObserver(observable, node) { + var l = observable.observers.length; + if (l) { + observable.observersIndexes[node.__mapid] = l; + } + observable.observers[l] = node; + if (observable.lowestObserverState > node.dependenciesState) observable.lowestObserverState = node.dependenciesState; +} +function removeObserver(observable, node) { + if (observable.observers.length === 1) { + observable.observers.length = 0; + queueForUnobservation(observable); + } else { + var list = observable.observers; + var map_1 = observable.observersIndexes; + var filler = list.pop(); + if (filler !== node) { + var index = map_1[node.__mapid] || 0; + if (index) { + map_1[filler.__mapid] = index; + } else { + delete map_1[filler.__mapid]; + } + list[index] = filler; + } + delete map_1[node.__mapid]; + } +} +function queueForUnobservation(observable) { + if (!observable.isPendingUnobservation) { + observable.isPendingUnobservation = true; + globalState.pendingUnobservations.push(observable); + } +} +function startBatch() { + globalState.inBatch++; +} +function endBatch() { + if (--globalState.inBatch === 0) { + runReactions(); + var list = globalState.pendingUnobservations; + for (var i = 0; i < list.length; i++) { + var observable_1 = list[i]; + observable_1.isPendingUnobservation = false; + if (observable_1.observers.length === 0) { + observable_1.onBecomeUnobserved(); + } + } + globalState.pendingUnobservations = []; + } +} +function reportObserved(observable) { + var derivation = globalState.trackingDerivation; + if (derivation !== null) { + if (derivation.runId !== observable.lastAccessedBy) { + observable.lastAccessedBy = derivation.runId; + derivation.newObserving[derivation.unboundDepsCount++] = observable; + } + } else if (observable.observers.length === 0) { + queueForUnobservation(observable); + } +} +function invariantLOS(observable, msg) { + var min = getObservers(observable).reduce(function (a, b) { + return Math.min(a, b.dependenciesState); + }, 2); + if (min >= observable.lowestObserverState) return; + throw new Error("lowestObserverState is wrong for " + msg + " because " + min + " < " + observable.lowestObserverState); +} +function propagateChanged(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) d.onBecomeStale(); + d.dependenciesState = IDerivationState.STALE; + } +} +function propagateChangeConfirmed(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.POSSIBLY_STALE) d.dependenciesState = IDerivationState.STALE;else if (d.dependenciesState === IDerivationState.UP_TO_DATE) observable.lowestObserverState = IDerivationState.UP_TO_DATE; + } +} +function propagateMaybeChanged(observable) { + if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE) return; + observable.lowestObserverState = IDerivationState.POSSIBLY_STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) { + d.dependenciesState = IDerivationState.POSSIBLY_STALE; + d.onBecomeStale(); + } + } +} +var Reaction = function () { + function Reaction(name, onInvalidate) { + if (name === void 0) { + name = "Reaction@" + getNextId(); + } + this.name = name; + this.onInvalidate = onInvalidate; + this.observing = []; + this.newObserving = []; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.diffValue = 0; + this.runId = 0; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.isDisposed = false; + this._isScheduled = false; + this._isTrackPending = false; + this._isRunning = false; + } + Reaction.prototype.onBecomeStale = function () { + this.schedule(); + }; + Reaction.prototype.schedule = function () { + if (!this._isScheduled) { + this._isScheduled = true; + globalState.pendingReactions.push(this); + runReactions(); + } + }; + Reaction.prototype.isScheduled = function () { + return this._isScheduled; + }; + Reaction.prototype.runReaction = function () { + if (!this.isDisposed) { + startBatch(); + this._isScheduled = false; + if (shouldCompute(this)) { + this._isTrackPending = true; + this.onInvalidate(); + if (this._isTrackPending && isSpyEnabled()) { + spyReport({ + object: this, + type: "scheduled-reaction" + }); + } + } + endBatch(); + } + }; + Reaction.prototype.track = function (fn) { + startBatch(); + var notify = isSpyEnabled(); + var startTime; + if (notify) { + startTime = Date.now(); + spyReportStart({ + object: this, + type: "reaction", + fn: fn + }); + } + this._isRunning = true; + var result = trackDerivedFunction(this, fn, undefined); + this._isRunning = false; + this._isTrackPending = false; + if (this.isDisposed) { + clearObserving(this); + } + if (isCaughtException(result)) this.reportExceptionInDerivation(result.cause); + if (notify) { + spyReportEnd({ + time: Date.now() - startTime + }); + } + endBatch(); + }; + Reaction.prototype.reportExceptionInDerivation = function (error) { + var _this = this; + if (this.errorHandler) { + this.errorHandler(error, this); + return; + } + var message = "[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '" + this; + var messageToUser = getMessage("m037"); + console.error(message || messageToUser, error); + if (isSpyEnabled()) { + spyReport({ + type: "error", + message: message, + error: error, + object: this + }); + } + globalState.globalReactionErrorHandlers.forEach(function (f) { + return f(error, _this); + }); + }; + Reaction.prototype.dispose = function () { + if (!this.isDisposed) { + this.isDisposed = true; + if (!this._isRunning) { + startBatch(); + clearObserving(this); + endBatch(); + } + } + }; + Reaction.prototype.getDisposer = function () { + var r = this.dispose.bind(this); + r.$mobx = this; + r.onError = registerErrorHandler; + return r; + }; + Reaction.prototype.toString = function () { + return "Reaction[" + this.name + "]"; + }; + Reaction.prototype.whyRun = function () { + var observing = unique(this._isRunning ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + return "\nWhyRun? reaction '" + this.name + "':\n * Status: [" + (this.isDisposed ? "stopped" : this._isRunning ? "running" : this.isScheduled() ? "scheduled" : "idle") + "]\n * This reaction will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this._isRunning ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n"; + }; + return Reaction; +}(); +exports.Reaction = Reaction; +function registerErrorHandler(handler) { + invariant(this && this.$mobx && isReaction(this.$mobx), "Invalid `this`"); + invariant(!this.$mobx.errorHandler, "Only one onErrorHandler can be registered"); + this.$mobx.errorHandler = handler; +} +function onReactionError(handler) { + globalState.globalReactionErrorHandlers.push(handler); + return function () { + var idx = globalState.globalReactionErrorHandlers.indexOf(handler); + if (idx >= 0) globalState.globalReactionErrorHandlers.splice(idx, 1); + }; +} +var MAX_REACTION_ITERATIONS = 100; +var reactionScheduler = function reactionScheduler(f) { + return f(); +}; +function runReactions() { + if (globalState.inBatch > 0 || globalState.isRunningReactions) return; + reactionScheduler(runReactionsHelper); +} +function runReactionsHelper() { + globalState.isRunningReactions = true; + var allReactions = globalState.pendingReactions; + var iterations = 0; + while (allReactions.length > 0) { + if (++iterations === MAX_REACTION_ITERATIONS) { + console.error("Reaction doesn't converge to a stable state after " + MAX_REACTION_ITERATIONS + " iterations." + (" Probably there is a cycle in the reactive function: " + allReactions[0])); + allReactions.splice(0); + } + var remainingReactions = allReactions.splice(0); + for (var i = 0, l = remainingReactions.length; i < l; i++) { + remainingReactions[i].runReaction(); + } + } + globalState.isRunningReactions = false; +} +var isReaction = createInstanceofPredicate("Reaction", Reaction); +function setReactionScheduler(fn) { + var baseScheduler = reactionScheduler; + reactionScheduler = function reactionScheduler(f) { + return fn(function () { + return baseScheduler(f); + }); + }; +} +function isSpyEnabled() { + return !!globalState.spyListeners.length; +} +function spyReport(event) { + if (!globalState.spyListeners.length) return; + var listeners = globalState.spyListeners; + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](event); + } +} +function spyReportStart(event) { + var change = objectAssign({}, event, { spyReportStart: true }); + spyReport(change); +} +var END_EVENT = { spyReportEnd: true }; +function spyReportEnd(change) { + if (change) spyReport(objectAssign({}, change, END_EVENT));else spyReport(END_EVENT); +} +function spy(listener) { + globalState.spyListeners.push(listener); + return once(function () { + var idx = globalState.spyListeners.indexOf(listener); + if (idx !== -1) globalState.spyListeners.splice(idx, 1); + }); +} +exports.spy = spy; +function hasInterceptors(interceptable) { + return interceptable.interceptors && interceptable.interceptors.length > 0; +} +function registerInterceptor(interceptable, handler) { + var interceptors = interceptable.interceptors || (interceptable.interceptors = []); + interceptors.push(handler); + return once(function () { + var idx = interceptors.indexOf(handler); + if (idx !== -1) interceptors.splice(idx, 1); + }); +} +function interceptChange(interceptable, change) { + var prevU = untrackedStart(); + try { + var interceptors = interceptable.interceptors; + if (interceptors) for (var i = 0, l = interceptors.length; i < l; i++) { + change = interceptors[i](change); + invariant(!change || change.type, "Intercept handlers should return nothing or a change object"); + if (!change) break; + } + return change; + } finally { + untrackedEnd(prevU); + } +} +function hasListeners(listenable) { + return listenable.changeListeners && listenable.changeListeners.length > 0; +} +function registerListener(listenable, handler) { + var listeners = listenable.changeListeners || (listenable.changeListeners = []); + listeners.push(handler); + return once(function () { + var idx = listeners.indexOf(handler); + if (idx !== -1) listeners.splice(idx, 1); + }); +} +function notifyListeners(listenable, change) { + var prevU = untrackedStart(); + var listeners = listenable.changeListeners; + if (!listeners) return; + listeners = listeners.slice(); + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](change); + } + untrackedEnd(prevU); +} +function asReference(value) { + deprecated("asReference is deprecated, use observable.ref instead"); + return observable.ref(value); +} +exports.asReference = asReference; +function asStructure(value) { + deprecated("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."); + return observable.struct(value); +} +exports.asStructure = asStructure; +function asFlat(value) { + deprecated("asFlat is deprecated, use observable.shallow instead"); + return observable.shallow(value); +} +exports.asFlat = asFlat; +function asMap(data) { + deprecated("asMap is deprecated, use observable.map or observable.shallowMap instead"); + return observable.map(data || {}); +} +exports.asMap = asMap; +function isModifierDescriptor(thing) { + return (typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null && thing.isMobxModifierDescriptor === true; +} +exports.isModifierDescriptor = isModifierDescriptor; +function createModifierDescriptor(enhancer, initialValue) { + invariant(!isModifierDescriptor(initialValue), "Modifiers cannot be nested"); + return { + isMobxModifierDescriptor: true, + initialValue: initialValue, + enhancer: enhancer + }; +} +function deepEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (isObservable(v)) return v; + if (Array.isArray(v)) return observable.array(v, name); + if (isPlainObject(v)) return observable.object(v, name); + if (isES6Map(v)) return observable.map(v, name); + return v; +} +function shallowEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (v === undefined || v === null) return v; + if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v)) return v; + if (Array.isArray(v)) return observable.shallowArray(v, name); + if (isPlainObject(v)) return observable.shallowObject(v, name); + if (isES6Map(v)) return observable.shallowMap(v, name); + return fail("The shallow modifier / decorator can only used in combination with arrays, objects and maps"); +} +function referenceEnhancer(newValue) { + return newValue; +} +function deepStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + if (isObservable(v)) return v; + if (Array.isArray(v)) return new ObservableArray(v, deepStructEnhancer, name); + if (isES6Map(v)) return new ObservableMap(v, deepStructEnhancer, name); + if (isPlainObject(v)) { + var res = {}; + asObservableObject(res, name); + extendObservableHelper(res, deepStructEnhancer, [v]); + return res; + } + return v; +} +function refStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + return v; +} +var MAX_SPLICE_SIZE = 10000; +var safariPrototypeSetterInheritanceBug = function () { + var v = false; + var p = {}; + Object.defineProperty(p, "0", { set: function set() { + v = true; + } }); + Object.create(p)["0"] = 1; + return v === false; +}(); +var OBSERVABLE_ARRAY_BUFFER_SIZE = 0; +var StubArray = function () { + function StubArray() {} + return StubArray; +}(); +StubArray.prototype = []; +var ObservableArrayAdministration = function () { + function ObservableArrayAdministration(name, enhancer, array, owned) { + this.array = array; + this.owned = owned; + this.lastKnownLength = 0; + this.interceptors = null; + this.changeListeners = null; + this.atom = new BaseAtom(name || "ObservableArray@" + getNextId()); + this.enhancer = function (newV, oldV) { + return enhancer(newV, oldV, name + "[..]"); + }; + } + ObservableArrayAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + if (fireImmediately) { + listener({ + object: this.array, + type: "splice", + index: 0, + added: this.values.slice(), + addedCount: this.values.length, + removed: [], + removedCount: 0 + }); + } + return registerListener(this, listener); + }; + ObservableArrayAdministration.prototype.getArrayLength = function () { + this.atom.reportObserved(); + return this.values.length; + }; + ObservableArrayAdministration.prototype.setArrayLength = function (newLength) { + if (typeof newLength !== "number" || newLength < 0) throw new Error("[mobx.array] Out of range: " + newLength); + var currentLength = this.values.length; + if (newLength === currentLength) return;else if (newLength > currentLength) { + var newItems = new Array(newLength - currentLength); + for (var i = 0; i < newLength - currentLength; i++) { + newItems[i] = undefined; + }this.spliceWithArray(currentLength, 0, newItems); + } else this.spliceWithArray(newLength, currentLength - newLength); + }; + ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) { + if (oldLength !== this.lastKnownLength) throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?"); + this.lastKnownLength += delta; + if (delta > 0 && oldLength + delta + 1 > OBSERVABLE_ARRAY_BUFFER_SIZE) reserveArrayBuffer(oldLength + delta + 1); + }; + ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) { + var _this = this; + checkIfStateModificationsAreAllowed(this.atom); + var length = this.values.length; + if (index === undefined) index = 0;else if (index > length) index = length;else if (index < 0) index = Math.max(0, length + index); + if (arguments.length === 1) deleteCount = length - index;else if (deleteCount === undefined || deleteCount === null) deleteCount = 0;else deleteCount = Math.max(0, Math.min(deleteCount, length - index)); + if (newItems === undefined) newItems = []; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + object: this.array, + type: "splice", + index: index, + removedCount: deleteCount, + added: newItems + }); + if (!change) return EMPTY_ARRAY; + deleteCount = change.removedCount; + newItems = change.added; + } + newItems = newItems.map(function (v) { + return _this.enhancer(v, undefined); + }); + var lengthDelta = newItems.length - deleteCount; + this.updateArrayLength(length, lengthDelta); + var res = this.spliceItemsIntoValues(index, deleteCount, newItems); + if (deleteCount !== 0 || newItems.length !== 0) this.notifyArraySplice(index, newItems, res); + return res; + }; + ObservableArrayAdministration.prototype.spliceItemsIntoValues = function (index, deleteCount, newItems) { + if (newItems.length < MAX_SPLICE_SIZE) { + return (_a = this.values).splice.apply(_a, [index, deleteCount].concat(newItems)); + } else { + var res = this.values.slice(index, index + deleteCount); + this.values = this.values.slice(0, index).concat(newItems, this.values.slice(index + deleteCount)); + return res; + } + var _a; + }; + ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "update", + index: index, newValue: newValue, oldValue: oldValue + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "splice", + index: index, removed: removed, added: added, + removedCount: removed.length, + addedCount: added.length + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + return ObservableArrayAdministration; +}(); +var ObservableArray = function (_super) { + __extends(ObservableArray, _super); + function ObservableArray(initialValues, enhancer, name, owned) { + if (name === void 0) { + name = "ObservableArray@" + getNextId(); + } + if (owned === void 0) { + owned = false; + } + var _this = _super.call(this) || this; + var adm = new ObservableArrayAdministration(name, enhancer, _this, owned); + addHiddenFinalProp(_this, "$mobx", adm); + if (initialValues && initialValues.length) { + adm.updateArrayLength(0, initialValues.length); + adm.values = initialValues.map(function (v) { + return enhancer(v, undefined, name + "[..]"); + }); + adm.notifyArraySplice(0, adm.values.slice(), EMPTY_ARRAY); + } else { + adm.values = []; + } + if (safariPrototypeSetterInheritanceBug) { + Object.defineProperty(adm.array, "0", ENTRY_0); + } + return _this; + } + ObservableArray.prototype.intercept = function (handler) { + return this.$mobx.intercept(handler); + }; + ObservableArray.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + return this.$mobx.observe(listener, fireImmediately); + }; + ObservableArray.prototype.clear = function () { + return this.splice(0); + }; + ObservableArray.prototype.concat = function () { + var arrays = []; + for (var _i = 0; _i < arguments.length; _i++) { + arrays[_i] = arguments[_i]; + } + this.$mobx.atom.reportObserved(); + return Array.prototype.concat.apply(this.peek(), arrays.map(function (a) { + return isObservableArray(a) ? a.peek() : a; + })); + }; + ObservableArray.prototype.replace = function (newItems) { + return this.$mobx.spliceWithArray(0, this.$mobx.values.length, newItems); + }; + ObservableArray.prototype.toJS = function () { + return this.slice(); + }; + ObservableArray.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableArray.prototype.peek = function () { + return this.$mobx.values; + }; + ObservableArray.prototype.find = function (predicate, thisArg, fromIndex) { + if (fromIndex === void 0) { + fromIndex = 0; + } + this.$mobx.atom.reportObserved(); + var items = this.$mobx.values, + l = items.length; + for (var i = fromIndex; i < l; i++) { + if (predicate.call(thisArg, items[i], i, this)) return items[i]; + }return undefined; + }; + ObservableArray.prototype.splice = function (index, deleteCount) { + var newItems = []; + for (var _i = 2; _i < arguments.length; _i++) { + newItems[_i - 2] = arguments[_i]; + } + switch (arguments.length) { + case 0: + return []; + case 1: + return this.$mobx.spliceWithArray(index); + case 2: + return this.$mobx.spliceWithArray(index, deleteCount); + } + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.spliceWithArray = function (index, deleteCount, newItems) { + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.push = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(adm.values.length, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.pop = function () { + return this.splice(Math.max(this.$mobx.values.length - 1, 0), 1)[0]; + }; + ObservableArray.prototype.shift = function () { + return this.splice(0, 1)[0]; + }; + ObservableArray.prototype.unshift = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(0, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.reverse = function () { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.reverse.apply(clone, arguments); + }; + ObservableArray.prototype.sort = function (compareFn) { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.sort.apply(clone, arguments); + }; + ObservableArray.prototype.remove = function (value) { + var idx = this.$mobx.values.indexOf(value); + if (idx > -1) { + this.splice(idx, 1); + return true; + } + return false; + }; + ObservableArray.prototype.move = function (fromIndex, toIndex) { + function checkIndex(index) { + if (index < 0) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is negative"); + } + var length = this.$mobx.values.length; + if (index >= length) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is not smaller than " + length); + } + } + checkIndex.call(this, fromIndex); + checkIndex.call(this, toIndex); + if (fromIndex === toIndex) { + return; + } + var oldItems = this.$mobx.values; + var newItems; + if (fromIndex < toIndex) { + newItems = oldItems.slice(0, fromIndex).concat(oldItems.slice(fromIndex + 1, toIndex + 1), [oldItems[fromIndex]], oldItems.slice(toIndex + 1)); + } else { + newItems = oldItems.slice(0, toIndex).concat([oldItems[fromIndex]], oldItems.slice(toIndex, fromIndex), oldItems.slice(fromIndex + 1)); + } + this.replace(newItems); + }; + ObservableArray.prototype.toString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toString.apply(this.$mobx.values, arguments); + }; + ObservableArray.prototype.toLocaleString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toLocaleString.apply(this.$mobx.values, arguments); + }; + return ObservableArray; +}(StubArray); +declareIterator(ObservableArray.prototype, function () { + return arrayAsIterator(this.slice()); +}); +makeNonEnumerable(ObservableArray.prototype, ["constructor", "intercept", "observe", "clear", "concat", "replace", "toJS", "toJSON", "peek", "find", "splice", "spliceWithArray", "push", "pop", "shift", "unshift", "reverse", "sort", "remove", "move", "toString", "toLocaleString"]); +Object.defineProperty(ObservableArray.prototype, "length", { + enumerable: false, + configurable: true, + get: function get() { + return this.$mobx.getArrayLength(); + }, + set: function set(newLength) { + this.$mobx.setArrayLength(newLength); + } +}); +["every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "map", "reduce", "reduceRight", "slice", "some"].forEach(function (funcName) { + var baseFunc = Array.prototype[funcName]; + invariant(typeof baseFunc === "function", "Base function not defined on Array prototype: '" + funcName + "'"); + addHiddenProp(ObservableArray.prototype, funcName, function () { + this.$mobx.atom.reportObserved(); + return baseFunc.apply(this.$mobx.values, arguments); + }); +}); +var ENTRY_0 = { + configurable: true, + enumerable: false, + set: createArraySetter(0), + get: createArrayGetter(0) +}; +function createArrayBufferItem(index) { + var set = createArraySetter(index); + var get = createArrayGetter(index); + Object.defineProperty(ObservableArray.prototype, "" + index, { + enumerable: false, + configurable: true, + set: set, get: get + }); +} +function createArraySetter(index) { + return function (newValue) { + var adm = this.$mobx; + var values = adm.values; + if (index < values.length) { + checkIfStateModificationsAreAllowed(adm.atom); + var oldValue = values[index]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: adm.array, + index: index, newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = adm.enhancer(newValue, oldValue); + var changed = newValue !== oldValue; + if (changed) { + values[index] = newValue; + adm.notifyArrayChildUpdate(index, newValue, oldValue); + } + } else if (index === values.length) { + adm.spliceWithArray(index, 0, [newValue]); + } else throw new Error("[mobx.array] Index out of bounds, " + index + " is larger than " + values.length); + }; +} +function createArrayGetter(index) { + return function () { + var impl = this.$mobx; + if (impl) { + if (index < impl.values.length) { + impl.atom.reportObserved(); + return impl.values[index]; + } + console.warn("[mobx.array] Attempt to read an array index (" + index + ") that is out of bounds (" + impl.values.length + "). Please check length first. Out of bound indices will not be tracked by MobX"); + } + return undefined; + }; +} +function reserveArrayBuffer(max) { + for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max; index++) { + createArrayBufferItem(index); + }OBSERVABLE_ARRAY_BUFFER_SIZE = max; +} +reserveArrayBuffer(1000); +var isObservableArrayAdministration = createInstanceofPredicate("ObservableArrayAdministration", ObservableArrayAdministration); +function isObservableArray(thing) { + return isObject(thing) && isObservableArrayAdministration(thing.$mobx); +} +exports.isObservableArray = isObservableArray; +var ObservableMapMarker = {}; +var ObservableMap = function () { + function ObservableMap(initialData, enhancer, name) { + if (enhancer === void 0) { + enhancer = deepEnhancer; + } + if (name === void 0) { + name = "ObservableMap@" + getNextId(); + } + this.enhancer = enhancer; + this.name = name; + this.$mobx = ObservableMapMarker; + this._data = {}; + this._hasMap = {}; + this._keys = new ObservableArray(undefined, referenceEnhancer, this.name + ".keys()", true); + this.interceptors = null; + this.changeListeners = null; + this.merge(initialData); + } + ObservableMap.prototype._has = function (key) { + return typeof this._data[key] !== "undefined"; + }; + ObservableMap.prototype.has = function (key) { + if (!this.isValidKey(key)) return false; + key = "" + key; + if (this._hasMap[key]) return this._hasMap[key].get(); + return this._updateHasMapEntry(key, false).get(); + }; + ObservableMap.prototype.set = function (key, value) { + this.assertValidKey(key); + key = "" + key; + var hasKey = this._has(key); + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: hasKey ? "update" : "add", + object: this, + newValue: value, + name: key + }); + if (!change) return this; + value = change.newValue; + } + if (hasKey) { + this._updateValue(key, value); + } else { + this._addValue(key, value); + } + return this; + }; + ObservableMap.prototype.delete = function (key) { + var _this = this; + this.assertValidKey(key); + key = "" + key; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: "delete", + object: this, + name: key + }); + if (!change) return false; + } + if (this._has(key)) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "delete", + object: this, + oldValue: this._data[key].value, + name: key + } : null; + if (notifySpy) spyReportStart(change); + runInTransaction(function () { + _this._keys.remove(key); + _this._updateHasMapEntry(key, false); + var observable = _this._data[key]; + observable.setNewValue(undefined); + _this._data[key] = undefined; + }); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + return true; + } + return false; + }; + ObservableMap.prototype._updateHasMapEntry = function (key, value) { + var entry = this._hasMap[key]; + if (entry) { + entry.setNewValue(value); + } else { + entry = this._hasMap[key] = new ObservableValue(value, referenceEnhancer, this.name + "." + key + "?", false); + } + return entry; + }; + ObservableMap.prototype._updateValue = function (name, newValue) { + var observable = this._data[name]; + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "update", + object: this, + oldValue: observable.value, + name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + } + }; + ObservableMap.prototype._addValue = function (name, newValue) { + var _this = this; + runInTransaction(function () { + var observable = _this._data[name] = new ObservableValue(newValue, _this.enhancer, _this.name + "." + name, false); + newValue = observable.value; + _this._updateHasMapEntry(name, true); + _this._keys.push(name); + }); + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "add", + object: this, + name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableMap.prototype.get = function (key) { + key = "" + key; + if (this.has(key)) return this._data[key].get(); + return undefined; + }; + ObservableMap.prototype.keys = function () { + return arrayAsIterator(this._keys.slice()); + }; + ObservableMap.prototype.values = function () { + return arrayAsIterator(this._keys.map(this.get, this)); + }; + ObservableMap.prototype.entries = function () { + var _this = this; + return arrayAsIterator(this._keys.map(function (key) { + return [key, _this.get(key)]; + })); + }; + ObservableMap.prototype.forEach = function (callback, thisArg) { + var _this = this; + this.keys().forEach(function (key) { + return callback.call(thisArg, _this.get(key), key, _this); + }); + }; + ObservableMap.prototype.merge = function (other) { + var _this = this; + if (isObservableMap(other)) { + other = other.toJS(); + } + runInTransaction(function () { + if (isPlainObject(other)) Object.keys(other).forEach(function (key) { + return _this.set(key, other[key]); + });else if (Array.isArray(other)) other.forEach(function (_a) { + var key = _a[0], + value = _a[1]; + return _this.set(key, value); + });else if (isES6Map(other)) other.forEach(function (value, key) { + return _this.set(key, value); + });else if (other !== null && other !== undefined) fail("Cannot initialize map from " + other); + }); + return this; + }; + ObservableMap.prototype.clear = function () { + var _this = this; + runInTransaction(function () { + untracked(function () { + _this.keys().forEach(_this.delete, _this); + }); + }); + }; + ObservableMap.prototype.replace = function (values) { + var _this = this; + runInTransaction(function () { + _this.clear(); + _this.merge(values); + }); + return this; + }; + Object.defineProperty(ObservableMap.prototype, "size", { + get: function get() { + return this._keys.length; + }, + enumerable: true, + configurable: true + }); + ObservableMap.prototype.toJS = function () { + var _this = this; + var res = {}; + this.keys().forEach(function (key) { + return res[key] = _this.get(key); + }); + return res; + }; + ObservableMap.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableMap.prototype.isValidKey = function (key) { + if (key === null || key === undefined) return false; + if (typeof key === "string" || typeof key === "number" || typeof key === "boolean") return true; + return false; + }; + ObservableMap.prototype.assertValidKey = function (key) { + if (!this.isValidKey(key)) throw new Error("[mobx.map] Invalid key: '" + key + "', only strings, numbers and booleans are accepted as key in observable maps."); + }; + ObservableMap.prototype.toString = function () { + var _this = this; + return this.name + "[{ " + this.keys().map(function (key) { + return key + ": " + ("" + _this.get(key)); + }).join(", ") + " }]"; + }; + ObservableMap.prototype.observe = function (listener, fireImmediately) { + invariant(fireImmediately !== true, getMessage("m033")); + return registerListener(this, listener); + }; + ObservableMap.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableMap; +}(); +exports.ObservableMap = ObservableMap; +declareIterator(ObservableMap.prototype, function () { + return this.entries(); +}); +function map(initialValues) { + deprecated("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"); + return observable.map(initialValues); +} +exports.map = map; +var isObservableMap = createInstanceofPredicate("ObservableMap", ObservableMap); +exports.isObservableMap = isObservableMap; +var ObservableObjectAdministration = function () { + function ObservableObjectAdministration(target, name) { + this.target = target; + this.name = name; + this.values = {}; + this.changeListeners = null; + this.interceptors = null; + } + ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) { + invariant(fireImmediately !== true, "`observe` doesn't support the fire immediately property for observable objects."); + return registerListener(this, callback); + }; + ObservableObjectAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableObjectAdministration; +}(); +function asObservableObject(target, name) { + if (isObservableObject(target)) return target.$mobx; + invariant(Object.isExtensible(target), getMessage("m035")); + if (!isPlainObject(target)) name = (target.constructor.name || "ObservableObject") + "@" + getNextId(); + if (!name) name = "ObservableObject@" + getNextId(); + var adm = new ObservableObjectAdministration(target, name); + addHiddenFinalProp(target, "$mobx", adm); + return adm; +} +function defineObservablePropertyFromDescriptor(adm, propName, descriptor, defaultEnhancer) { + if (adm.values[propName]) { + invariant("value" in descriptor, "The property " + propName + " in " + adm.name + " is already observable, cannot redefine it as computed property"); + adm.target[propName] = descriptor.value; + return; + } + if ("value" in descriptor) { + if (isModifierDescriptor(descriptor.value)) { + var modifierDescriptor = descriptor.value; + defineObservableProperty(adm, propName, modifierDescriptor.initialValue, modifierDescriptor.enhancer); + } else if (isAction(descriptor.value) && descriptor.value.autoBind === true) { + defineBoundAction(adm.target, propName, descriptor.value.originalFn); + } else if (isComputedValue(descriptor.value)) { + defineComputedPropertyFromComputedValue(adm, propName, descriptor.value); + } else { + defineObservableProperty(adm, propName, descriptor.value, defaultEnhancer); + } + } else { + defineComputedProperty(adm, propName, descriptor.get, descriptor.set, false, true); + } +} +function defineObservableProperty(adm, propName, newValue, enhancer) { + assertPropertyConfigurable(adm.target, propName); + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + object: adm.target, + name: propName, + type: "add", + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + var observable = adm.values[propName] = new ObservableValue(newValue, enhancer, adm.name + "." + propName, false); + newValue = observable.value; + Object.defineProperty(adm.target, propName, generateObservablePropConfig(propName)); + notifyPropertyAddition(adm, adm.target, propName, newValue); +} +function defineComputedProperty(adm, propName, getter, setter, compareStructural, asInstanceProperty) { + if (asInstanceProperty) assertPropertyConfigurable(adm.target, propName); + adm.values[propName] = new ComputedValue(getter, adm.target, compareStructural, adm.name + "." + propName, setter); + if (asInstanceProperty) { + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); + } +} +function defineComputedPropertyFromComputedValue(adm, propName, computedValue) { + var name = adm.name + "." + propName; + computedValue.name = name; + if (!computedValue.scope) computedValue.scope = adm.target; + adm.values[propName] = computedValue; + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); +} +var observablePropertyConfigs = {}; +var computedPropertyConfigs = {}; +function generateObservablePropConfig(propName) { + return observablePropertyConfigs[propName] || (observablePropertyConfigs[propName] = { + configurable: true, + enumerable: true, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + setPropertyValue(this, propName, v); + } + }); +} +function generateComputedPropConfig(propName) { + return computedPropertyConfigs[propName] || (computedPropertyConfigs[propName] = { + configurable: true, + enumerable: false, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + return this.$mobx.values[propName].set(v); + } + }); +} +function setPropertyValue(instance, name, newValue) { + var adm = instance.$mobx; + var observable = adm.values[name]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: instance, + name: name, newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "update", + object: instance, + oldValue: observable.value, + name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); + } +} +function notifyPropertyAddition(adm, object, name, newValue) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "add", + object: object, name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); +} +var isObservableObjectAdministration = createInstanceofPredicate("ObservableObjectAdministration", ObservableObjectAdministration); +function isObservableObject(thing) { + if (isObject(thing)) { + runLazyInitializers(thing); + return isObservableObjectAdministration(thing.$mobx); + } + return false; +} +exports.isObservableObject = isObservableObject; +var UNCHANGED = {}; +var ObservableValue = function (_super) { + __extends(ObservableValue, _super); + function ObservableValue(value, enhancer, name, notifySpy) { + if (name === void 0) { + name = "ObservableValue@" + getNextId(); + } + if (notifySpy === void 0) { + notifySpy = true; + } + var _this = _super.call(this, name) || this; + _this.enhancer = enhancer; + _this.hasUnreportedChange = false; + _this.value = enhancer(value, undefined, name); + if (notifySpy && isSpyEnabled()) { + spyReport({ type: "create", object: _this, newValue: _this.value }); + } + return _this; + } + ObservableValue.prototype.set = function (newValue) { + var oldValue = this.value; + newValue = this.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + if (notifySpy) { + spyReportStart({ + type: "update", + object: this, + newValue: newValue, oldValue: oldValue + }); + } + this.setNewValue(newValue); + if (notifySpy) spyReportEnd(); + } + }; + ObservableValue.prototype.prepareNewValue = function (newValue) { + checkIfStateModificationsAreAllowed(this); + if (hasInterceptors(this)) { + var change = interceptChange(this, { object: this, type: "update", newValue: newValue }); + if (!change) return UNCHANGED; + newValue = change.newValue; + } + newValue = this.enhancer(newValue, this.value, this.name); + return this.value !== newValue ? newValue : UNCHANGED; + }; + ObservableValue.prototype.setNewValue = function (newValue) { + var oldValue = this.value; + this.value = newValue; + this.reportChanged(); + if (hasListeners(this)) { + notifyListeners(this, { + type: "update", + object: this, + newValue: newValue, + oldValue: oldValue + }); + } + }; + ObservableValue.prototype.get = function () { + this.reportObserved(); + return this.value; + }; + ObservableValue.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableValue.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately) listener({ + object: this, + type: "update", + newValue: this.value, + oldValue: undefined + }); + return registerListener(this, listener); + }; + ObservableValue.prototype.toJSON = function () { + return this.get(); + }; + ObservableValue.prototype.toString = function () { + return this.name + "[" + this.value + "]"; + }; + ObservableValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + }; + return ObservableValue; +}(BaseAtom); +ObservableValue.prototype[primitiveSymbol()] = ObservableValue.prototype.valueOf; +var isObservableValue = createInstanceofPredicate("ObservableValue", ObservableValue); +exports.isBoxedObservable = isObservableValue; +function getAtom(thing, property) { + if ((typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null) { + if (isObservableArray(thing)) { + invariant(property === undefined, getMessage("m036")); + return thing.$mobx.atom; + } + if (isObservableMap(thing)) { + var anyThing = thing; + if (property === undefined) return getAtom(anyThing._keys); + var observable_2 = anyThing._data[property] || anyThing._hasMap[property]; + invariant(!!observable_2, "the entry '" + property + "' does not exist in the observable map '" + getDebugName(thing) + "'"); + return observable_2; + } + runLazyInitializers(thing); + if (isObservableObject(thing)) { + if (!property) return fail("please specify a property"); + var observable_3 = thing.$mobx.values[property]; + invariant(!!observable_3, "no observable property '" + property + "' found on the observable object '" + getDebugName(thing) + "'"); + return observable_3; + } + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) { + return thing; + } + } else if (typeof thing === "function") { + if (isReaction(thing.$mobx)) { + return thing.$mobx; + } + } + return fail("Cannot obtain atom from " + thing); +} +function getAdministration(thing, property) { + invariant(thing, "Expecting some object"); + if (property !== undefined) return getAdministration(getAtom(thing, property)); + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) return thing; + if (isObservableMap(thing)) return thing; + runLazyInitializers(thing); + if (thing.$mobx) return thing.$mobx; + invariant(false, "Cannot obtain administration from " + thing); +} +function getDebugName(thing, property) { + var named; + if (property !== undefined) named = getAtom(thing, property);else if (isObservableObject(thing) || isObservableMap(thing)) named = getAdministration(thing);else named = getAtom(thing); + return named.name; +} +function createClassPropertyDecorator(onInitialize, _get, _set, enumerable, allowCustomArguments) { + function classPropertyDecorator(target, key, descriptor, customArgs, argLen) { + if (argLen === void 0) { + argLen = 0; + } + invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator"); + if (!descriptor) { + var newDescriptor = { + enumerable: enumerable, + configurable: true, + get: function get() { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) typescriptInitializeProperty(this, key, undefined, onInitialize, customArgs, descriptor); + return _get.call(this, key); + }, + set: function set(v) { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) { + typescriptInitializeProperty(this, key, v, onInitialize, customArgs, descriptor); + } else { + _set.call(this, key, v); + } + } + }; + if (arguments.length < 3 || arguments.length === 5 && argLen < 3) { + Object.defineProperty(target, key, newDescriptor); + } + return newDescriptor; + } else { + if (!hasOwnProperty(target, "__mobxLazyInitializers")) { + addHiddenProp(target, "__mobxLazyInitializers", target.__mobxLazyInitializers && target.__mobxLazyInitializers.slice() || []); + } + var value_1 = descriptor.value, + initializer_1 = descriptor.initializer; + target.__mobxLazyInitializers.push(function (instance) { + onInitialize(instance, key, initializer_1 ? initializer_1.call(instance) : value_1, customArgs, descriptor); + }); + return { + enumerable: enumerable, configurable: true, + get: function get() { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + return _get.call(this, key); + }, + set: function set(v) { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + _set.call(this, key, v); + } + }; + } + } + if (allowCustomArguments) { + return function () { + if (quacksLikeADecorator(arguments)) return classPropertyDecorator.apply(null, arguments); + var outerArgs = arguments; + var argLen = arguments.length; + return function (target, key, descriptor) { + return classPropertyDecorator(target, key, descriptor, outerArgs, argLen); + }; + }; + } + return classPropertyDecorator; +} +function typescriptInitializeProperty(instance, key, v, onInitialize, customArgs, baseDescriptor) { + if (!hasOwnProperty(instance, "__mobxInitializedProps")) addHiddenProp(instance, "__mobxInitializedProps", {}); + instance.__mobxInitializedProps[key] = true; + onInitialize(instance, key, v, customArgs, baseDescriptor); +} +function runLazyInitializers(instance) { + if (instance.__mobxDidRunLazyInitializers === true) return; + if (instance.__mobxLazyInitializers) { + addHiddenProp(instance, "__mobxDidRunLazyInitializers", true); + instance.__mobxDidRunLazyInitializers && instance.__mobxLazyInitializers.forEach(function (initializer) { + return initializer(instance); + }); + } +} +function quacksLikeADecorator(args) { + return (args.length === 2 || args.length === 3) && typeof args[1] === "string"; +} +function iteratorSymbol() { + return typeof Symbol === "function" && Symbol.iterator || "@@iterator"; +} +var IS_ITERATING_MARKER = "__$$iterating"; +function arrayAsIterator(array) { + invariant(array[IS_ITERATING_MARKER] !== true, "Illegal state: cannot recycle array as iterator"); + addHiddenFinalProp(array, IS_ITERATING_MARKER, true); + var idx = -1; + addHiddenFinalProp(array, "next", function next() { + idx++; + return { + done: idx >= this.length, + value: idx < this.length ? this[idx] : undefined + }; + }); + return array; +} +function declareIterator(prototType, iteratorFactory) { + addHiddenFinalProp(prototType, iteratorSymbol(), iteratorFactory); +} +var messages = { + "m001": "It is not allowed to assign new values to @action fields", + "m002": "`runInAction` expects a function", + "m003": "`runInAction` expects a function without arguments", + "m004": "autorun expects a function", + "m005": "Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m006": "Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m007": "reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object", + "m008": "wrapping reaction expression in `asReference` is no longer supported, use options object instead", + "m009": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.", + "m010": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'", + "m011": "First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments", + "m012": "computed takes one or two arguments if used as function", + "m013": "[mobx.expr] 'expr' should only be used inside other reactive functions.", + "m014": "extendObservable expected 2 or more arguments", + "m015": "extendObservable expects an object as first argument", + "m016": "extendObservable should not be used on maps, use map.merge instead", + "m017": "all arguments of extendObservable should be objects", + "m018": "extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540", + "m019": "[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.", + "m020": "modifiers can only be used for individual object properties", + "m021": "observable expects zero or one arguments", + "m022": "@observable can not be used on getters, use @computed instead", + "m023": "Using `transaction` is deprecated, use `runInAction` or `(@)action` instead.", + "m024": "whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.", + "m025": "whyRun can only be used on reactions and computed values", + "m026": "`action` can only be invoked on functions", + "m028": "It is not allowed to set `useStrict` when a derivation is running", + "m029": "INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row", + "m030a": "Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ", + "m030b": "Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ", + "m031": "Computed values are not allowed to not cause side effects by changing observables that are already being observed. Tried to modify: ", + "m032": "* This computation is suspended (not in use by any reaction) and won't run automatically.\n Didn't expect this computation to be suspended at this point?\n 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).", + "m033": "`observe` doesn't support the fire immediately property for observable maps.", + "m034": "`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead", + "m035": "Cannot make the designated object observable; it is not extensible", + "m036": "It is not possible to get index atoms from arrays", + "m037": "Hi there! I'm sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle \"(...)\" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error(\"Oops\")` instead of `throw \"Oops\"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling \"Pause on caught exception\".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn't help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n", + "m038": "Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n" +}; +function getMessage(id) { + return messages[id]; +} +var EMPTY_ARRAY = []; +Object.freeze(EMPTY_ARRAY); +function getGlobal() { + return global; +} +function getNextId() { + return ++globalState.mobxGuid; +} +function fail(message, thing) { + invariant(false, message, thing); + throw "X"; +} +function invariant(check, message, thing) { + if (!check) throw new Error("[mobx] Invariant failed: " + message + (thing ? " in '" + thing + "'" : "")); +} +var deprecatedMessages = []; +function deprecated(msg) { + if (deprecatedMessages.indexOf(msg) !== -1) return false; + deprecatedMessages.push(msg); + console.error("[mobx] Deprecated: " + msg); + return true; +} +function once(func) { + var invoked = false; + return function () { + if (invoked) return; + invoked = true; + return func.apply(this, arguments); + }; +} +var noop = function noop() {}; +function unique(list) { + var res = []; + list.forEach(function (item) { + if (res.indexOf(item) === -1) res.push(item); + }); + return res; +} +function joinStrings(things, limit, separator) { + if (limit === void 0) { + limit = 100; + } + if (separator === void 0) { + separator = " - "; + } + if (!things) return ""; + var sliced = things.slice(0, limit); + return "" + sliced.join(separator) + (things.length > limit ? " (... and " + (things.length - limit) + "more)" : ""); +} +function isObject(value) { + return value !== null && (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object"; +} +function isPlainObject(value) { + if (value === null || (typeof value === "undefined" ? "undefined" : _typeof(value)) !== "object") return false; + var proto = Object.getPrototypeOf(value); + return proto === Object.prototype || proto === null; +} +function objectAssign() { + var res = arguments[0]; + for (var i = 1, l = arguments.length; i < l; i++) { + var source = arguments[i]; + for (var key in source) { + if (hasOwnProperty(source, key)) { + res[key] = source[key]; + } + } + } + return res; +} +function valueDidChange(compareStructural, oldValue, newValue) { + if (typeof oldValue === 'number' && isNaN(oldValue)) { + return typeof newValue !== 'number' || !isNaN(newValue); + } + return compareStructural ? !deepEqual(oldValue, newValue) : oldValue !== newValue; +} +var prototypeHasOwnProperty = Object.prototype.hasOwnProperty; +function hasOwnProperty(object, propName) { + return prototypeHasOwnProperty.call(object, propName); +} +function makeNonEnumerable(object, propNames) { + for (var i = 0; i < propNames.length; i++) { + addHiddenProp(object, propNames[i], object[propNames[i]]); + } +} +function addHiddenProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: true, + configurable: true, + value: value + }); +} +function addHiddenFinalProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: false, + configurable: true, + value: value + }); +} +function isPropertyConfigurable(object, prop) { + var descriptor = Object.getOwnPropertyDescriptor(object, prop); + return !descriptor || descriptor.configurable !== false && descriptor.writable !== false; +} +function assertPropertyConfigurable(object, prop) { + invariant(isPropertyConfigurable(object, prop), "Cannot make property '" + prop + "' observable, it is not configurable and writable in the target object"); +} +function getEnumerableKeys(obj) { + var res = []; + for (var key in obj) { + res.push(key); + }return res; +} +function deepEqual(a, b) { + if (a === null && b === null) return true; + if (a === undefined && b === undefined) return true; + if ((typeof a === "undefined" ? "undefined" : _typeof(a)) !== "object") return a === b; + var aIsArray = isArrayLike(a); + var aIsMap = isMapLike(a); + if (aIsArray !== isArrayLike(b)) { + return false; + } else if (aIsMap !== isMapLike(b)) { + return false; + } else if (aIsArray) { + if (a.length !== b.length) return false; + for (var i = a.length - 1; i >= 0; i--) { + if (!deepEqual(a[i], b[i])) return false; + }return true; + } else if (aIsMap) { + if (a.size !== b.size) return false; + var equals_1 = true; + a.forEach(function (value, key) { + equals_1 = equals_1 && deepEqual(b.get(key), value); + }); + return equals_1; + } else if ((typeof a === "undefined" ? "undefined" : _typeof(a)) === "object" && (typeof b === "undefined" ? "undefined" : _typeof(b)) === "object") { + if (a === null || b === null) return false; + if (isMapLike(a) && isMapLike(b)) { + if (a.size !== b.size) return false; + return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries()); + } + if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length) return false; + for (var prop in a) { + if (!(prop in b)) return false; + if (!deepEqual(a[prop], b[prop])) return false; + } + return true; + } + return false; +} +function createInstanceofPredicate(name, clazz) { + var propName = "isMobX" + name; + clazz.prototype[propName] = true; + return function (x) { + return isObject(x) && x[propName] === true; + }; +} +function isArrayLike(x) { + return Array.isArray(x) || isObservableArray(x); +} +exports.isArrayLike = isArrayLike; +function isMapLike(x) { + return isES6Map(x) || isObservableMap(x); +} +function isES6Map(thing) { + if (getGlobal().Map !== undefined && thing instanceof getGlobal().Map) return true; + return false; +} +function primitiveSymbol() { + return typeof Symbol === "function" && Symbol.toPrimitive || "@@toPrimitive"; +} +function toPrimitive(value) { + return value === null ? null : (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? "" + value : value; +} +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _icons = __webpack_require__(6); + +var _constants = __webpack_require__(0); + +function renderHeader(_ref, instance) { + var meta = _ref.meta, + user = _ref.user, + reactions = _ref.reactions; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-header-container'; + + var likeButton = document.createElement('span'); + var likedReaction = reactions.find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + likeButton.className = 'gitment-header-like-btn'; + likeButton.innerHTML = '\n ' + _icons.heart + '\n ' + (likedReaction ? 'Unlike' : 'Like') + '\n ' + (meta.reactions && meta.reactions.heart ? ' \u2022 ' + meta.reactions.heart + ' Liked' : '') + '\n '; + + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlike(); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.like(); + }; + } + container.appendChild(likeButton); + + var commentsCount = document.createElement('span'); + commentsCount.innerHTML = '\n ' + (meta.comments ? ' \u2022 ' + meta.comments + ' Comments' : '') + '\n '; + container.appendChild(commentsCount); + + var issueLink = document.createElement('a'); + issueLink.className = 'gitment-header-issue-link'; + issueLink.href = meta.html_url; + issueLink.target = '_blank'; + issueLink.innerText = 'Issue Page'; + container.appendChild(issueLink); + + return container; +} + +function renderComments(_ref2, instance) { + var meta = _ref2.meta, + comments = _ref2.comments, + commentReactions = _ref2.commentReactions, + currentPage = _ref2.currentPage, + user = _ref2.user, + error = _ref2.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-comments-container'; + + if (error) { + var errorBlock = document.createElement('div'); + errorBlock.className = 'gitment-comments-error'; + + if (error === _constants.NOT_INITIALIZED_ERROR && user.login && user.login.toLowerCase() === instance.owner.toLowerCase()) { + var initHint = document.createElement('div'); + var initButton = document.createElement('button'); + initButton.className = 'gitment-comments-init-btn'; + initButton.onclick = function () { + initButton.setAttribute('disabled', true); + instance.init().catch(function (e) { + initButton.removeAttribute('disabled'); + alert(e); + }); + }; + initButton.innerText = 'Initialize Comments'; + initHint.appendChild(initButton); + errorBlock.appendChild(initHint); + } else { + errorBlock.innerText = error; + } + container.appendChild(errorBlock); + return container; + } else if (comments === undefined) { + var loading = document.createElement('div'); + loading.innerText = 'Loading comments...'; + loading.className = 'gitment-comments-loading'; + container.appendChild(loading); + return container; + } else if (!comments.length) { + var emptyBlock = document.createElement('div'); + emptyBlock.className = 'gitment-comments-empty'; + emptyBlock.innerText = 'No Comment Yet'; + container.appendChild(emptyBlock); + return container; + } + + var commentsList = document.createElement('ul'); + commentsList.className = 'gitment-comments-list'; + + comments.forEach(function (comment) { + var createDate = new Date(comment.created_at); + var updateDate = new Date(comment.updated_at); + var commentItem = document.createElement('li'); + commentItem.className = 'gitment-comment'; + commentItem.innerHTML = '\n \n \n \n
\n
\n \n ' + comment.user.login + '\n \n commented on\n ' + createDate.toDateString() + '\n ' + (createDate.toString() !== updateDate.toString() ? ' \u2022 edited' : '') + '\n
' + _icons.heart + ' ' + (comment.reactions.heart || '') + '
\n
\n
' + comment.body_html + '
\n
\n '; + var likeButton = commentItem.querySelector('.gitment-comment-like-btn'); + var likedReaction = commentReactions[comment.id] && commentReactions[comment.id].find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlikeAComment(comment.id); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.likeAComment(comment.id); + }; + } + + // dirty + // use a blank image to trigger height calculating when element rendered + var imgTrigger = document.createElement('img'); + var markdownBody = commentItem.querySelector('.gitment-comment-body'); + imgTrigger.className = 'gitment-hidden'; + imgTrigger.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + imgTrigger.onload = function () { + if (markdownBody.clientHeight > instance.maxCommentHeight) { + markdownBody.classList.add('gitment-comment-body-folded'); + markdownBody.style.maxHeight = instance.maxCommentHeight + 'px'; + markdownBody.title = 'Click to Expand'; + markdownBody.onclick = function () { + markdownBody.classList.remove('gitment-comment-body-folded'); + markdownBody.style.maxHeight = ''; + markdownBody.title = ''; + markdownBody.onclick = null; + }; + } + }; + commentItem.appendChild(imgTrigger); + + commentsList.appendChild(commentItem); + }); + + container.appendChild(commentsList); + + if (meta) { + var pageCount = Math.ceil(meta.comments / instance.perPage); + if (pageCount > 1) { + var pagination = document.createElement('ul'); + pagination.className = 'gitment-comments-pagination'; + + if (currentPage > 1) { + var previousButton = document.createElement('li'); + previousButton.className = 'gitment-comments-page-item'; + previousButton.innerText = 'Previous'; + previousButton.onclick = function () { + return instance.goto(currentPage - 1); + }; + pagination.appendChild(previousButton); + } + + var _loop = function _loop(i) { + var pageItem = document.createElement('li'); + pageItem.className = 'gitment-comments-page-item'; + pageItem.innerText = i; + pageItem.onclick = function () { + return instance.goto(i); + }; + if (currentPage === i) pageItem.classList.add('gitment-selected'); + pagination.appendChild(pageItem); + }; + + for (var i = 1; i <= pageCount; i++) { + _loop(i); + } + + if (currentPage < pageCount) { + var nextButton = document.createElement('li'); + nextButton.className = 'gitment-comments-page-item'; + nextButton.innerText = 'Next'; + nextButton.onclick = function () { + return instance.goto(currentPage + 1); + }; + pagination.appendChild(nextButton); + } + + container.appendChild(pagination); + } + } + + return container; +} + +function renderEditor(_ref3, instance) { + var user = _ref3.user, + error = _ref3.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-editor-container'; + + var shouldDisable = user.login && !error ? '' : 'disabled'; + var disabledTip = user.login ? '' : 'Login to Comment'; + container.innerHTML = '\n ' + (user.login ? '\n \n ' : user.isLoggingIn ? '
' + _icons.spinner + '
' : '\n ' + _icons.github + '\n ') + '\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n '; + if (user.login) { + container.querySelector('.gitment-editor-logout-link').onclick = function () { + return instance.logout(); + }; + } + + var writeField = container.querySelector('.gitment-editor-write-field'); + var previewField = container.querySelector('.gitment-editor-preview-field'); + + var textarea = writeField.querySelector('textarea'); + textarea.oninput = function () { + textarea.style.height = 'auto'; + var style = window.getComputedStyle(textarea, null); + var height = parseInt(style.height, 10); + var clientHeight = textarea.clientHeight; + var scrollHeight = textarea.scrollHeight; + if (clientHeight < scrollHeight) { + textarea.style.height = height + scrollHeight - clientHeight + 'px'; + } + }; + + var _container$querySelec = container.querySelectorAll('.gitment-editor-tab'), + _container$querySelec2 = _slicedToArray(_container$querySelec, 2), + writeTab = _container$querySelec2[0], + previewTab = _container$querySelec2[1]; + + writeTab.onclick = function () { + writeTab.classList.add('gitment-selected'); + previewTab.classList.remove('gitment-selected'); + writeField.classList.remove('gitment-hidden'); + previewField.classList.add('gitment-hidden'); + + textarea.focus(); + }; + previewTab.onclick = function () { + previewTab.classList.add('gitment-selected'); + writeTab.classList.remove('gitment-selected'); + previewField.classList.remove('gitment-hidden'); + writeField.classList.add('gitment-hidden'); + + var preview = previewField.querySelector('.gitment-editor-preview'); + var content = textarea.value.trim(); + if (!content) { + preview.innerText = 'Nothing to preview'; + return; + } + + preview.innerText = 'Loading preview...'; + instance.markdown(content).then(function (html) { + return preview.innerHTML = html; + }); + }; + + var submitButton = container.querySelector('.gitment-editor-submit'); + submitButton.onclick = function () { + submitButton.innerText = 'Submitting...'; + submitButton.setAttribute('disabled', true); + instance.post(textarea.value.trim()).then(function (data) { + textarea.value = ''; + textarea.style.height = 'auto'; + submitButton.removeAttribute('disabled'); + submitButton.innerText = 'Comment'; + }).catch(function (e) { + alert(e); + submitButton.removeAttribute('disabled'); + submitButton.innerText = 'Comment'; + }); + }; + + return container; +} + +function renderFooter() { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-footer-container'; + container.innerHTML = '\n Powered by\n \n Gitment\n \n '; + return container; +} + +function render(state, instance) { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-root-container'; + container.appendChild(instance.renderHeader(state, instance)); + container.appendChild(instance.renderComments(state, instance)); + container.appendChild(instance.renderEditor(state, instance)); + container.appendChild(instance.renderFooter(state, instance)); + return container; +} + +exports.default = { render: render, renderHeader: renderHeader, renderComments: renderComments, renderEditor: renderEditor, renderFooter: renderFooter }; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.http = exports.Query = exports.isString = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +exports.getTargetContainer = getTargetContainer; + +var _constants = __webpack_require__(0); + +var isString = exports.isString = function isString(s) { + return toString.call(s) === '[object String]'; +}; + +function getTargetContainer(container) { + var targetContainer = void 0; + if (container instanceof Element) { + targetContainer = container; + } else if (isString(container)) { + targetContainer = document.getElementById(container); + } else { + targetContainer = document.createElement('div'); + } + + return targetContainer; +} + +var Query = exports.Query = { + parse: function parse() { + var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.search; + + if (!search) return {}; + var queryString = search[0] === '?' ? search.substring(1) : search; + var query = {}; + queryString.split('&').forEach(function (queryStr) { + var _queryStr$split = queryStr.split('='), + _queryStr$split2 = _slicedToArray(_queryStr$split, 2), + key = _queryStr$split2[0], + value = _queryStr$split2[1]; + + if (key) query[key] = value; + }); + + return query; + }, + stringify: function stringify(query) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '?'; + + var queryString = Object.keys(query).map(function (key) { + return key + '=' + encodeURIComponent(query[key] || ''); + }).join('&'); + return queryString ? prefix + queryString : ''; + } +}; + +function ajaxFactory(method) { + return function (apiPath) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var base = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'https://api.github.com'; + + var req = new XMLHttpRequest(); + var token = localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + + var url = '' + base + apiPath; + var body = null; + if (method === 'GET' || method === 'DELETE') { + url += Query.stringify(data); + } + + var p = new Promise(function (resolve, reject) { + req.addEventListener('load', function () { + var contentType = req.getResponseHeader('content-type'); + var res = req.responseText; + if (!/json/.test(contentType)) { + resolve(res); + return; + } + var data = req.responseText ? JSON.parse(res) : {}; + if (data.message) { + reject(new Error(data.message)); + } else { + resolve(data); + } + }); + req.addEventListener('error', function (error) { + return reject(error); + }); + }); + req.open(method, url, true); + + req.setRequestHeader('Accept', 'application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json'); + if (token) { + req.setRequestHeader('Authorization', 'token ' + token); + } + if (method !== 'GET' && method !== 'DELETE') { + body = JSON.stringify(data); + req.setRequestHeader('Content-Type', 'application/json'); + } + + req.send(body); + return p; + }; +} + +var http = exports.http = { + get: ajaxFactory('GET'), + post: ajaxFactory('POST'), + delete: ajaxFactory('DELETE'), + put: ajaxFactory('PUT') +}; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var g; + +// This works in non-strict mode +g = function () { + return this; +}(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1, eval)("this"); +} catch (e) { + // This works if the window reference is available + if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _mobx = __webpack_require__(1); + +var _constants = __webpack_require__(0); + +var _utils = __webpack_require__(3); + +var _default = __webpack_require__(2); + +var _default2 = _interopRequireDefault(_default); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var scope = 'public_repo'; + +function extendRenderer(instance, renderer) { + instance[renderer] = function (container) { + var targetContainer = (0, _utils.getTargetContainer)(container); + var render = instance.theme[renderer] || instance.defaultTheme[renderer]; + + (0, _mobx.autorun)(function () { + var e = render(instance.state, instance); + if (targetContainer.firstChild) { + targetContainer.replaceChild(e, targetContainer.firstChild); + } else { + targetContainer.appendChild(e); + } + }); + + return targetContainer; + }; +} + +var Gitment = function () { + _createClass(Gitment, [{ + key: 'accessToken', + get: function get() { + return localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + }, + set: function set(token) { + localStorage.setItem(_constants.LS_ACCESS_TOKEN_KEY, token); + } + }, { + key: 'loginLink', + get: function get() { + var oauthUri = 'https://github.com/login/oauth/authorize'; + var redirect_uri = this.oauth.redirect_uri || window.location.href; + + var oauthParams = Object.assign({ + scope: scope, + redirect_uri: redirect_uri + }, this.oauth); + + return '' + oauthUri + _utils.Query.stringify(oauthParams); + } + }]); + + function Gitment() { + var _this = this; + + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Gitment); + + this.defaultTheme = _default2.default; + this.useTheme(_default2.default); + + Object.assign(this, { + id: window.location.href, + title: window.document.title, + link: window.location.href, + desc: '', + labels: [], + theme: _default2.default, + oauth: {}, + perPage: 20, + maxCommentHeight: 250 + }, options); + + this.useTheme(this.theme); + + var user = {}; + try { + var userInfo = localStorage.getItem(_constants.LS_USER_KEY); + if (this.accessToken && userInfo) { + Object.assign(user, JSON.parse(userInfo), { + fromCache: true + }); + } + } catch (e) { + localStorage.removeItem(_constants.LS_USER_KEY); + } + + this.state = (0, _mobx.observable)({ + user: user, + error: null, + meta: {}, + comments: undefined, + reactions: [], + commentReactions: {}, + currentPage: 1 + }); + + var query = _utils.Query.parse(); + if (query.code) { + var _oauth = this.oauth, + client_id = _oauth.client_id, + client_secret = _oauth.client_secret; + + var code = query.code; + delete query.code; + var search = _utils.Query.stringify(query); + var replacedUrl = '' + window.location.origin + window.location.pathname + search + window.location.hash; + history.replaceState({}, '', replacedUrl); + + Object.assign(this, { + id: replacedUrl, + link: replacedUrl + }, options); + + this.state.user.isLoggingIn = true; + _utils.http.post('https://gh-oauth.imsun.net', { + code: code, + client_id: client_id, + client_secret: client_secret + }, '').then(function (data) { + _this.accessToken = data.access_token; + _this.update(); + }).catch(function (e) { + _this.state.user.isLoggingIn = false; + alert(e); + }); + } else { + this.update(); + } + } + + _createClass(Gitment, [{ + key: 'init', + value: function init() { + var _this2 = this; + + return this.createIssue().then(function () { + return _this2.loadComments(); + }).then(function (comments) { + _this2.state.error = null; + return comments; + }); + } + }, { + key: 'useTheme', + value: function useTheme() { + var _this3 = this; + + var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.theme = theme; + + var renderers = Object.keys(this.theme); + renderers.forEach(function (renderer) { + return extendRenderer(_this3, renderer); + }); + } + }, { + key: 'update', + value: function update() { + var _this4 = this; + + return Promise.all([this.loadMeta(), this.loadUserInfo()]).then(function () { + return Promise.all([_this4.loadComments().then(function () { + return _this4.loadCommentReactions(); + }), _this4.loadReactions()]); + }).catch(function (e) { + return _this4.state.error = e; + }); + } + }, { + key: 'markdown', + value: function markdown(text) { + return _utils.http.post('/markdown', { + text: text, + mode: 'gfm' + }); + } + }, { + key: 'createIssue', + value: function createIssue() { + var _this5 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo, + title = this.title, + link = this.link, + desc = this.desc, + labels = this.labels; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues', { + title: title, + labels: labels.concat(['gitment', id]), + body: link + '\n\n' + desc + }).then(function (meta) { + _this5.state.meta = meta; + return meta; + }); + } + }, { + key: 'getIssue', + value: function getIssue() { + if (this.state.meta.id) return Promise.resolve(this.state.meta); + + return this.loadMeta(); + } + }, { + key: 'post', + value: function post(body) { + var _this6 = this; + + return this.getIssue().then(function (issue) { + return _utils.http.post(issue.comments_url, { body: body }, ''); + }).then(function (data) { + _this6.state.meta.comments++; + var pageCount = Math.ceil(_this6.state.meta.comments / _this6.perPage); + if (_this6.state.currentPage === pageCount) { + _this6.state.comments.push(data); + } + return data; + }); + } + }, { + key: 'loadMeta', + value: function loadMeta() { + var _this7 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues', { + creator: owner, + labels: id + }).then(function (issues) { + if (!issues.length) return Promise.reject(_constants.NOT_INITIALIZED_ERROR); + _this7.state.meta = issues[0]; + return issues[0]; + }); + } + }, { + key: 'loadComments', + value: function loadComments() { + var _this8 = this; + + var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.currentPage; + + return this.getIssue().then(function (issue) { + return _utils.http.get(issue.comments_url, { page: page, per_page: _this8.perPage }, ''); + }).then(function (comments) { + _this8.state.comments = comments; + return comments; + }); + } + }, { + key: 'loadUserInfo', + value: function loadUserInfo() { + var _this9 = this; + + if (!this.accessToken) { + this.logout(); + return Promise.resolve({}); + } + + return _utils.http.get('/user').then(function (user) { + _this9.state.user = user; + localStorage.setItem(_constants.LS_USER_KEY, JSON.stringify(user)); + return user; + }); + } + }, { + key: 'loadReactions', + value: function loadReactions() { + var _this10 = this; + + if (!this.accessToken) { + this.state.reactions = []; + return Promise.resolve([]); + } + + return this.getIssue().then(function (issue) { + if (!issue.reactions.total_count) return []; + return _utils.http.get(issue.reactions.url, {}, ''); + }).then(function (reactions) { + _this10.state.reactions = reactions; + return reactions; + }); + } + }, { + key: 'loadCommentReactions', + value: function loadCommentReactions() { + var _this11 = this; + + if (!this.accessToken) { + this.state.commentReactions = {}; + return Promise.resolve([]); + } + + var comments = this.state.comments; + var comentReactions = {}; + + return Promise.all(comments.map(function (comment) { + if (!comment.reactions.total_count) return []; + + var owner = _this11.owner, + repo = _this11.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues/comments/' + comment.id + '/reactions', {}); + })).then(function (reactionsArray) { + comments.forEach(function (comment, index) { + comentReactions[comment.id] = reactionsArray[index]; + }); + _this11.state.commentReactions = comentReactions; + + return comentReactions; + }); + } + }, { + key: 'login', + value: function login() { + window.location.href = this.loginLink; + } + }, { + key: 'logout', + value: function logout() { + localStorage.removeItem(_constants.LS_ACCESS_TOKEN_KEY); + localStorage.removeItem(_constants.LS_USER_KEY); + this.state.user = {}; + } + }, { + key: 'goto', + value: function goto(page) { + this.state.currentPage = page; + this.state.comments = undefined; + return this.loadComments(page); + } + }, { + key: 'like', + value: function like() { + var _this12 = this; + + if (!this.accessToken) { + alert('Login to Like'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/' + this.state.meta.number + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this12.state.reactions.push(reaction); + _this12.state.meta.reactions.heart++; + }); + } + }, { + key: 'unlike', + value: function unlike() { + var _this13 = this; + + if (!this.accessToken) return Promise.reject(); + + var _state = this.state, + user = _state.user, + reactions = _state.reactions; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + _this13.state.meta.reactions.heart--; + }); + } + }, { + key: 'likeAComment', + value: function likeAComment(commentId) { + var _this14 = this; + + if (!this.accessToken) { + alert('Login to Like'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/comments/' + commentId + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this14.state.commentReactions[commentId].push(reaction); + comment.reactions.heart++; + }); + } + }, { + key: 'unlikeAComment', + value: function unlikeAComment(commentId) { + if (!this.accessToken) return Promise.reject(); + + var reactions = this.state.commentReactions[commentId]; + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + var user = this.state.user; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + comment.reactions.heart--; + }); + } + }]); + + return Gitment; +}(); + +module.exports = Gitment; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Modified from https://github.com/evil-icons/evil-icons + */ + +var close = exports.close = ''; +var github = exports.github = ''; +var heart = exports.heart = ''; +var spinner = exports.spinner = ''; + +/***/ }) +/******/ ]); +//# sourceMappingURL=gitment.browser.js.map \ No newline at end of file diff --git a/themes/maupassant-hexo/source/js/search.js b/themes/maupassant-hexo/source/js/search.js new file mode 100644 index 0000000..bba51fb --- /dev/null +++ b/themes/maupassant-hexo/source/js/search.js @@ -0,0 +1,86 @@ +var searchFunc = function(path, search_id, content_id) { + 'use strict'; + $.ajax({ + url: path, + dataType: "xml", + success: function( xmlResponse ) { + // get the contents from search data + var datas = $( "entry", xmlResponse ).map(function() { + return { + title: $( "title", this ).text(), + content: $("content",this).text(), + url: $( "url" , this).text() + }; + }).get(); + var $input = document.getElementById(search_id); + var $resultContent = document.getElementById(content_id); + $input.addEventListener('input', function(){ + var str='
    '; + var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/); + $resultContent.innerHTML = ""; + if (this.value.trim().length <= 0) { + return; + } + // perform local searching + datas.forEach(function(data) { + var isMatch = true; + var content_index = []; + var data_title = data.title.trim().toLowerCase(); + var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase(); + var data_url = data.url; + var index_title = -1; + var index_content = -1; + var first_occur = -1; + // only match artiles with not empty titles and contents + if(data_title != '' && data_content != '') { + keywords.forEach(function(keyword, i) { + index_title = data_title.indexOf(keyword); + index_content = data_content.indexOf(keyword); + if( index_title < 0 && index_content < 0 ){ + isMatch = false; + } else { + if (index_content < 0) { + index_content = 0; + } + if (i == 0) { + first_occur = index_content; + } + } + }); + } + // show search results + if (isMatch) { + str += "
  • "+ data_title +""; + var content = data.content.trim().replace(/<[^>]+>/g,""); + if (first_occur >= 0) { + // cut out 100 characters + var start = first_occur - 30; + var outLength = 78; + if(start < 0){ + start = 0; + } + if (start + outLength > content.length){ + if(content.length < outLength){ + outLength = content.length - start; + }else{ + start = content.length - outLength; + } + } + var match_content = content.substr(start, outLength); + // highlight all keywords + keywords.forEach(function(keyword){ + var regS = new RegExp(keyword, "gi"); + match_content = match_content.replace(regS, ""+keyword+""); + }); + + str += "

    " + match_content +"...

    " + } + str += "
  • "; + } + }); + str += "
"; + $resultContent.innerHTML = str; + }); + } + }); +} diff --git a/themes/maupassant-hexo/source/js/share.js b/themes/maupassant-hexo/source/js/share.js new file mode 100644 index 0000000..f358213 --- /dev/null +++ b/themes/maupassant-hexo/source/js/share.js @@ -0,0 +1,60 @@ +(function($){ + + // article-share + $('body').on('click', function(){ + $('.article-share-box.on').removeClass('on'); + }).on('click', '.article-share-link', function(e){ + e.stopPropagation(); + + var $this = $(this), + url = $this.attr('data-url'), + qrcode_img = $this.attr('data-qrcode'), + encodedUrl = encodeURIComponent(url), + id = 'article-share-box-' + $this.attr('data-id'), + title = document.title, + offset = $this.offset(); + + if ($('#' + id).length){ + var box = $('#' + id); + + if (box.hasClass('on')){ + box.removeClass('on'); + return; + } + } else { + var html = [ + '
', + '', + '
', + '', + '', + '', + '', + '
', + '
', + '
' + ].join(''); + + var box = $(html); + + $('body').append(box); + } + + $('.article-share-box.on').hide(); + + box.css({ + top: offset.top + 25, + left: offset.left + }).addClass('on'); + }).on('click', '.article-share-box', function(e){ + e.stopPropagation(); + }).on('click', '.article-share-box-input', function(){ + $(this).select(); + }).on('click', '.article-share-box-link', function(e){ + e.preventDefault(); + e.stopPropagation(); + + window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450'); + }); + +})(jQuery); diff --git a/themes/maupassant-hexo/source/js/smartresize.js b/themes/maupassant-hexo/source/js/smartresize.js new file mode 100644 index 0000000..7def5e7 --- /dev/null +++ b/themes/maupassant-hexo/source/js/smartresize.js @@ -0,0 +1,32 @@ ++(function($, sr) { + // debouncing function from John Hann + // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ + var debounce = function(func, threshold, execAsap) { + var timeout; + + return function debounced() { + var obj = this, args = arguments; + + function delayed() { + if (!execAsap) { + func.apply(obj, args); + } + + timeout = null; + }; + + if (timeout) { + clearTimeout(timeout); + } + else if (execAsap) { + func.apply(obj, args); + } + + timeout = setTimeout(delayed, threshold || 100); + }; + }; + + jQuery.fn[sr] = function(fn) { + return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); + }; +})(jQuery, 'smartresize'); diff --git a/themes/maupassant-hexo/source/js/totop.js b/themes/maupassant-hexo/source/js/totop.js new file mode 100644 index 0000000..afa66d9 --- /dev/null +++ b/themes/maupassant-hexo/source/js/totop.js @@ -0,0 +1,12 @@ +$(window).scroll(function() { + $(window).scrollTop() > 500 ? $("#rocket").addClass("show") : $("#rocket").removeClass("show"); +}); +$("#rocket").click(function() { + $("#rocket").addClass("launch"); + $("html, body").animate({ + scrollTop: 0 + }, 500, function() { + $("#rocket").removeClass("show launch"); + }); + return false; +}); From c432e955ee94b88c2f4549e53a28fbc233e75bc6 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 11:06:55 +0800 Subject: [PATCH 04/21] remove bofore scription action --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index eb7a979..669519a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,9 @@ install: #before_script: # - npm install -g gulp - - npm install -g cnpm --registry=https://registry.npm.taobao.org - - cnpm install hexo-renderer-pug --save - - cnpm install hexo-renderer-sass --save + # - npm install -g cnpm --registry=https://registry.npm.taobao.org + # - cnpm install hexo-renderer-pug --save + # - cnpm install hexo-renderer-sass --save script: - hexo clean From 35449ec5992466282bafa550be812147d02db699 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 11:33:27 +0800 Subject: [PATCH 05/21] add time line --- source/timeline/index.md | 6 ++++++ themes/maupassant-hexo/_config.yml | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 source/timeline/index.md diff --git a/source/timeline/index.md b/source/timeline/index.md new file mode 100644 index 0000000..bf8f15f --- /dev/null +++ b/source/timeline/index.md @@ -0,0 +1,6 @@ +--- +layout: timeline +title: history +date: 2018-01-18 11:19:28 +tags: +--- diff --git a/themes/maupassant-hexo/_config.yml b/themes/maupassant-hexo/_config.yml index f757e1b..45b06fe 100644 --- a/themes/maupassant-hexo/_config.yml +++ b/themes/maupassant-hexo/_config.yml @@ -61,6 +61,8 @@ menu: - page: rss directory: atom.xml icon: fa-rss + - page: timeline + directory: timeline/ widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links. - search From 2faa1bf75b745b7b0a261013526fa7e007ac3281 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 12:42:42 +0800 Subject: [PATCH 06/21] modify the timeline --- themes/maupassant-hexo/_config.yml | 10 +++++----- themes/maupassant-hexo/layout/timeline.pug | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/maupassant-hexo/_config.yml b/themes/maupassant-hexo/_config.yml index 45b06fe..7cf171d 100644 --- a/themes/maupassant-hexo/_config.yml +++ b/themes/maupassant-hexo/_config.yml @@ -62,7 +62,7 @@ menu: directory: atom.xml icon: fa-rss - page: timeline - directory: timeline/ + directory: timeline widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links. - search @@ -81,13 +81,13 @@ links: url: http://www.example3.com/ timeline: - - num: 1 + - num: 4 word: 2014/06/12-Start - - num: 2 - word: 2014/11/29-XXX - num: 3 + word: 2014/11/29-XXX + - num: 2 word: 2015/02/18-DDD - - num: 4 + - num: 1 word: More # Static files diff --git a/themes/maupassant-hexo/layout/timeline.pug b/themes/maupassant-hexo/layout/timeline.pug index 6d3fb3e..44707f6 100644 --- a/themes/maupassant-hexo/layout/timeline.pug +++ b/themes/maupassant-hexo/layout/timeline.pug @@ -12,9 +12,9 @@ block content div(class="col-xs-12 col-sm-12 col-md-8 col-md-offset-2") div(class="timeline-centered") div.line - div.present Past + div.present Now div.dot_tp - div.born Now + div.born Past div.dot_bt - for (var i in theme.timeline) div.timeline-entry From af1c8e0c91bb5201df4df89ee75ab986c4f32e43 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 19:26:46 +0800 Subject: [PATCH 07/21] enable gitment system --- themes/maupassant-hexo/_config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/maupassant-hexo/_config.yml b/themes/maupassant-hexo/_config.yml index 7cf171d..e8c1695 100644 --- a/themes/maupassant-hexo/_config.yml +++ b/themes/maupassant-hexo/_config.yml @@ -1,11 +1,11 @@ fancybox: true ## If you want to use fancybox please set the value to true. disqus: ## Your disqus_shortname, e.g. username gitment: - enable: false ## If you want to use Gitment comment system please set the value to true. - owner: ## Your GitHub ID, e.g. username - repo: ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io - client_id: ## GitHub client ID, e.g. 75752dafe7907a897619 - client_secret: ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 + enable: true ## If you want to use Gitment comment system please set the value to true. + owner: SysTick ## Your GitHub ID, e.g. username + repo: systick.github.io ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io + client_id: 384d6e21709d72f05847 ## GitHub client ID, e.g. 75752dafe7907a897619 + client_secret: dad6de584c53ce7e4763cc4a4b14915463a488a7 ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 uyan: ## Your uyan_id. e.g. 1234567 livere: ## Your livere data-uid, e.g. MTAyMC8zMDAxOC78NTgz changyan: ## Your changyan appid, e.g. cyrALsXc8 @@ -31,7 +31,7 @@ baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000 show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true. toc_number: true ## If you want to add list number to toc please set the value to true. shareto: false ## If you want to use the share button please set the value to true, you must have hexo-helper-qrcode installed. -busuanzi: false ## If you want to use Busuanzi page views please set the value to true. +busuanzi: true ## If you want to use Busuanzi page views please set the value to true. widgets_on_small_screens: false ## Set to true to enable widgets on small screens. canvas_nest: enable: false ## If you want to use dynamic background please set the value to true, you can also fill the following parameters to customize the dynamic effect, or just leave them blank to keep the default effect. From 177b3a06297456f2bafb76ec72d7ff136a49a4b5 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 19:42:48 +0800 Subject: [PATCH 08/21] rename the artile --- .../_posts/bubblesort-and-selectionsort.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "source/_posts/\345\206\222\346\263\241\346\216\222\345\272\217\346\263\225\345\222\214\351\200\211\346\213\251\346\216\222\345\272\217\346\263\225.md" => source/_posts/bubblesort-and-selectionsort.md (100%) diff --git "a/source/_posts/\345\206\222\346\263\241\346\216\222\345\272\217\346\263\225\345\222\214\351\200\211\346\213\251\346\216\222\345\272\217\346\263\225.md" b/source/_posts/bubblesort-and-selectionsort.md similarity index 100% rename from "source/_posts/\345\206\222\346\263\241\346\216\222\345\272\217\346\263\225\345\222\214\351\200\211\346\213\251\346\216\222\345\272\217\346\263\225.md" rename to source/_posts/bubblesort-and-selectionsort.md From 6c0cc0025ae63692ab963462d6a9100905535e1f Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 19:55:18 +0800 Subject: [PATCH 09/21] change the repo --- themes/maupassant-hexo/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/maupassant-hexo/_config.yml b/themes/maupassant-hexo/_config.yml index e8c1695..efc9b97 100644 --- a/themes/maupassant-hexo/_config.yml +++ b/themes/maupassant-hexo/_config.yml @@ -3,7 +3,7 @@ disqus: ## Your disqus_shortname, e.g. username gitment: enable: true ## If you want to use Gitment comment system please set the value to true. owner: SysTick ## Your GitHub ID, e.g. username - repo: systick.github.io ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io + repo: github.com/SysTick/lircs ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io client_id: 384d6e21709d72f05847 ## GitHub client ID, e.g. 75752dafe7907a897619 client_secret: dad6de584c53ce7e4763cc4a4b14915463a488a7 ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 uyan: ## Your uyan_id. e.g. 1234567 From 0fdec380feb286ad2234540cc1604d0c3bd20fb3 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 20:00:23 +0800 Subject: [PATCH 10/21] change the repo --- themes/maupassant-hexo/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/maupassant-hexo/_config.yml b/themes/maupassant-hexo/_config.yml index efc9b97..4845dba 100644 --- a/themes/maupassant-hexo/_config.yml +++ b/themes/maupassant-hexo/_config.yml @@ -3,7 +3,7 @@ disqus: ## Your disqus_shortname, e.g. username gitment: enable: true ## If you want to use Gitment comment system please set the value to true. owner: SysTick ## Your GitHub ID, e.g. username - repo: github.com/SysTick/lircs ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io + repo: lircs ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io client_id: 384d6e21709d72f05847 ## GitHub client ID, e.g. 75752dafe7907a897619 client_secret: dad6de584c53ce7e4763cc4a4b14915463a488a7 ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50 uyan: ## Your uyan_id. e.g. 1234567 From 92fc6f7b5dac6bda967dfd58348b109645c8608a Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 20:38:24 +0800 Subject: [PATCH 11/21] modify some layout for web --- source/timeline/index.md | 1 + themes/maupassant-hexo/_config.yml | 17 +++++++++-------- .../maupassant-hexo/layout/_widget/category.pug | 2 +- themes/maupassant-hexo/layout/_widget/links.pug | 2 +- .../layout/_widget/recent_comments.pug | 2 +- .../layout/_widget/recent_posts.pug | 2 +- themes/maupassant-hexo/layout/_widget/tag.pug | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/source/timeline/index.md b/source/timeline/index.md index bf8f15f..2d15fa3 100644 --- a/source/timeline/index.md +++ b/source/timeline/index.md @@ -3,4 +3,5 @@ layout: timeline title: history date: 2018-01-18 11:19:28 tags: +comments: false --- diff --git a/themes/maupassant-hexo/_config.yml b/themes/maupassant-hexo/_config.yml index 4845dba..4194c4b 100644 --- a/themes/maupassant-hexo/_config.yml +++ b/themes/maupassant-hexo/_config.yml @@ -49,20 +49,21 @@ donate: paypal_url: ## Paypal URL, e.g. https://paypal.me/tufu9441 menu: - - page: home + - page: 主页 directory: . icon: fa-home - - page: archive + - page: 归档 directory: archives/ icon: fa-archive - - page: about + - page: 历史 + directory: timeline + icon: fa-random + - page: 关于 directory: about/ icon: fa-user - - page: rss - directory: atom.xml - icon: fa-rss - - page: timeline - directory: timeline + # - page: rss + # directory: atom.xml + # icon: fa-rss widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links. - search diff --git a/themes/maupassant-hexo/layout/_widget/category.pug b/themes/maupassant-hexo/layout/_widget/category.pug index cd9354a..01e014c 100644 --- a/themes/maupassant-hexo/layout/_widget/category.pug +++ b/themes/maupassant-hexo/layout/_widget/category.pug @@ -1,4 +1,4 @@ .widget .widget-title - i(class='fa fa-folder-o')= ' ' + __('categories') + i(class='fa fa-folder-o')= ' ' + __('分类目录') != list_categories({show_count: theme.show_category_count}) diff --git a/themes/maupassant-hexo/layout/_widget/links.pug b/themes/maupassant-hexo/layout/_widget/links.pug index a7e1a71..45009b2 100644 --- a/themes/maupassant-hexo/layout/_widget/links.pug +++ b/themes/maupassant-hexo/layout/_widget/links.pug @@ -1,6 +1,6 @@ .widget .widget-title - i(class='fa fa-external-link')= ' ' + __('blogroll') + i(class='fa fa-external-link')= ' ' + __('友情链接') - for (var i in theme.links) ul a(href=theme.links[i].url title=theme.links[i].title target='_blank') #{theme.links[i].title} diff --git a/themes/maupassant-hexo/layout/_widget/recent_comments.pug b/themes/maupassant-hexo/layout/_widget/recent_comments.pug index ea54d9b..0436cf6 100644 --- a/themes/maupassant-hexo/layout/_widget/recent_comments.pug +++ b/themes/maupassant-hexo/layout/_widget/recent_comments.pug @@ -1,5 +1,5 @@ if theme.disqus .widget .widget-title - i(class='fa fa-comment-o')= ' ' + __('recent_comments') + i(class='fa fa-comment-o')= ' ' + __('最新评论') script(type='text/javascript', src='//' + theme.disqus + '.disqus.com/recent_comments_widget.js?num_items=5&hide_avatars=1&avatar_size=32&excerpt_length=20&hide_mods=1') diff --git a/themes/maupassant-hexo/layout/_widget/recent_posts.pug b/themes/maupassant-hexo/layout/_widget/recent_posts.pug index 3466929..1201725 100644 --- a/themes/maupassant-hexo/layout/_widget/recent_posts.pug +++ b/themes/maupassant-hexo/layout/_widget/recent_posts.pug @@ -1,4 +1,4 @@ .widget .widget-title - i(class='fa fa-file-o')= ' ' + __('recent') + i(class='fa fa-file-o')= ' ' + __('最新文章') != list_posts({amount: 10}) diff --git a/themes/maupassant-hexo/layout/_widget/tag.pug b/themes/maupassant-hexo/layout/_widget/tag.pug index dd44371..c95e93d 100644 --- a/themes/maupassant-hexo/layout/_widget/tag.pug +++ b/themes/maupassant-hexo/layout/_widget/tag.pug @@ -1,5 +1,5 @@ .widget .widget-title - i(class='fa fa-star-o')= ' ' + __('tags') + i(class='fa fa-star-o')= ' ' + __('标签') .tagcloud != tagcloud({min_font: 15, max_font: 15, amount: 100, orderby: 'count'}) From 47ecb5ffb113b551e7c6679dad5402d072b30783 Mon Sep 17 00:00:00 2001 From: zhili Date: Thu, 18 Jan 2018 20:58:31 +0800 Subject: [PATCH 12/21] cache article --- source/_drafts/aupe-note-md.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 source/_drafts/aupe-note-md.md diff --git a/source/_drafts/aupe-note-md.md b/source/_drafts/aupe-note-md.md new file mode 100755 index 0000000..488a2a1 --- /dev/null +++ b/source/_drafts/aupe-note-md.md @@ -0,0 +1,31 @@ +--- +title: aupe_note.md +date: 2018-01-18 14:33:31 +tags: +--- + +linux 文件IO函数 + +> 本文介绍的函数被称为不带缓存的IO(unbuffered IO),不带缓存是指每一个read、write函数都调用内核中的一个系统调用。 +这些不带缓存的IO函数不是ANSIC C的组成部分,但是是POSIX.1和XPG3的组成部分。 +> 文件描述符: 对于内核而言,所有打开的文件都由文件描述符引用,文件描述符是一个*非负整数*。按照惯例,UNIX shell +使文件描述符0与进程的标准输入(STDIN_FILENO)相结合,文件描述符1与进程的标准输出(STDOUT_FILENO)相结合,文件描述符2 +与进程的标准错误输出(STDERR_FILENO)相结合。 + +## open函数 + +```c +#include +#include +#include "fcntl.h" + +//返回:若成功为文件描述符,若出错为-1 +int open(const char *pathname, int oflag, .../*, mode_t mode */); +``` + +- read +- write +- lseek +- close + + From b697348c99cb7f7bd8f38a457036d41c14b6f73a Mon Sep 17 00:00:00 2001 From: Sauli Date: Sun, 21 Jan 2018 19:16:34 +0800 Subject: [PATCH 13/21] update hexo --- package-lock.json | 790 ---------------------------------------------- 1 file changed, 790 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc8c37b..e2cb56e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -430,7 +430,6 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -929,795 +928,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fsevents": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", - "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", - "optional": true, - "requires": { - "nan": "2.8.0", - "node-pre-gyp": "0.6.39" - }, - "dependencies": { - "abbrev": { - "version": "1.1.0", - "bundled": true, - "optional": true - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.9" - } - }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "optional": true - }, - "balanced-match": { - "version": "0.4.2", - "bundled": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.7", - "bundled": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "bundled": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "optional": true - } - } - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "optional": true, - "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "optional": true - } - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.4", - "bundled": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "node-pre-gyp": { - "version": "0.6.39", - "bundled": true, - "optional": true, - "requires": { - "detect-libc": "1.0.2", - "hawk": "3.1.3", - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" - } - }, - "npmlog": { - "version": "4.1.0", - "bundled": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "optional": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, - "optional": true - }, - "rc": { - "version": "1.2.1", - "bundled": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.2.9", - "bundled": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" - } - }, - "rimraf": { - "version": "2.6.1", - "bundled": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.0.1", - "bundled": true - }, - "semver": { - "version": "5.3.0", - "bundled": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "optional": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "optional": true - } - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "optional": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "bundled": true, - "optional": true, - "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, - "optional": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - } - } - }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", From 5419b91fb0a667209573de555af4caa327f2ad77 Mon Sep 17 00:00:00 2001 From: Sauli Date: Sun, 21 Jan 2018 19:21:10 +0800 Subject: [PATCH 14/21] update ejs to 2.5.7 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 322e52f..5e3732e 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "version": "3.4.4" }, "dependencies": { + "ejs": "^2.5.7", "hexo": "^3.4.4", "hexo-deployer-git": "^0.3.1", "hexo-generator-archive": "^0.1.4", From 6e33ce4cc4e4123d803797c2d54f296c5979f305 Mon Sep 17 00:00:00 2001 From: Sauli Date: Sun, 21 Jan 2018 19:30:36 +0800 Subject: [PATCH 15/21] update ejs to 2.5.7 --- package-lock.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e2cb56e..1431bd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -735,9 +735,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "ejs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-1.0.0.tgz", - "integrity": "sha1-ycYKSKRu5FL7MqccMXuV5aofyz0=" + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.7.tgz", + "integrity": "sha1-zIcsFoiArjxxiXYv1f/ACJbJUYo=" }, "encodeurl": { "version": "1.0.1", @@ -1256,6 +1256,11 @@ "utils-merge": "1.0.1" }, "dependencies": { + "ejs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-1.0.0.tgz", + "integrity": "sha1-ycYKSKRu5FL7MqccMXuV5aofyz0=" + }, "striptags": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/striptags/-/striptags-3.1.1.tgz", From fbce55e5582b763e310b91d6afb56fdcbf3cc167 Mon Sep 17 00:00:00 2001 From: Sauli Date: Mon, 22 Jan 2018 08:34:23 +0800 Subject: [PATCH 16/21] cache the article --- source/_drafts/serial-programming-1-md.md | 39 +++++++++++++++++++++++ source/_drafts/serial-programming-2-md.md | 10 ++++++ 2 files changed, 49 insertions(+) create mode 100644 source/_drafts/serial-programming-1-md.md create mode 100644 source/_drafts/serial-programming-2-md.md diff --git a/source/_drafts/serial-programming-1-md.md b/source/_drafts/serial-programming-1-md.md new file mode 100644 index 0000000..823862c --- /dev/null +++ b/source/_drafts/serial-programming-1-md.md @@ -0,0 +1,39 @@ +--- +title: 嵌入式linux串口应用编程(1) +date: 2018-01-21 21:10:43 +tags: + - termios + - linux + - 串口编程 +categories: + - linux +--- + +## 串口编程介绍 + +常见的数据通信的基本方式可分为并行通信和串行通信两种 + +- 并行通信 +并行通信是指利用多条数据传输线将一个数据的各比特位同时传送。它的特点是传输速度快,适用于传输距离矩且传输速度较高的通信。 + +- 串行通信 +串行通信是指利用一条传输线将数据以比特位为单位顺序传送。特点是通信线路简单,利用简单的线路可实现通信,降低成本,适用于传输距离长且传输速度较慢的通信。 + +常见的串口有RS-232-C接口 +引脚 |名称 +--------|--------- +1 |DCD 载波检测 +2 |RxD 接收数据 +3 |DSR 数据就绪 +4 |DTR 数据终端就绪 +5 |SG 信号地 +6 |DSR 数据就绪 +7 |RTS 发送请求 +8 |CTS 清除发送 +9 |RI 振铃提示 + +UART的操作主要分为以下几个部分:数据发送,数据接收,产生中断,设置波特率,Loopback模式,红外模式及软硬流控制。 + +在linux中,所有的设备文件一般都位于`/dev`下,其中,串口1和串口2对应的设备名依次为`/dev/ttyS0`和`/dev/ttyS1`USB转串口的设备名通常为`/dev/ttyUSB0`和`/dev/ttyUSB1`,可以去查看`dev`下的文件确认。 + + diff --git a/source/_drafts/serial-programming-2-md.md b/source/_drafts/serial-programming-2-md.md new file mode 100644 index 0000000..05d5972 --- /dev/null +++ b/source/_drafts/serial-programming-2-md.md @@ -0,0 +1,10 @@ +--- +title: 嵌入式linux串口应用编程(2) +date: 2018-01-21 21:16:43 +tags: + - termios + - linux + - 串口编程 +categories: + - linux +--- From 12b8cd2013b6e5eef128ef39010eb0e7c8317b1c Mon Sep 17 00:00:00 2001 From: zhili Date: Mon, 22 Jan 2018 11:42:30 +0800 Subject: [PATCH 17/21] add article difference-between-malloc-calloc-and-realloc.md --- .../_drafts/difference-between-malloc-calloc-and-realloc.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 source/_drafts/difference-between-malloc-calloc-and-realloc.md diff --git a/source/_drafts/difference-between-malloc-calloc-and-realloc.md b/source/_drafts/difference-between-malloc-calloc-and-realloc.md new file mode 100644 index 0000000..406c650 --- /dev/null +++ b/source/_drafts/difference-between-malloc-calloc-and-realloc.md @@ -0,0 +1,6 @@ +--- +layout: the +title: difference-between-malloc-calloc-and-realloc.md +date: 2018-01-22 11:35:32 +tags: +--- From b66e68a7cb1f673117d6e01ea32c95eb10620c0e Mon Sep 17 00:00:00 2001 From: zhili Date: Mon, 22 Jan 2018 16:31:43 +0800 Subject: [PATCH 18/21] add article the-carriage-return-and-line-feed-under-linux --- .../_drafts/the-carriage-return-and-line-feed-under-linux.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 source/_drafts/the-carriage-return-and-line-feed-under-linux.md diff --git a/source/_drafts/the-carriage-return-and-line-feed-under-linux.md b/source/_drafts/the-carriage-return-and-line-feed-under-linux.md new file mode 100644 index 0000000..bc5870a --- /dev/null +++ b/source/_drafts/the-carriage-return-and-line-feed-under-linux.md @@ -0,0 +1,5 @@ +--- +title: the-carriage-return-and-line-feed-under-linux +date: 2018-01-22 16:30:25 +tags: +--- From b3fd531d7b97e33852dffae8d57db79b9a5e7bdc Mon Sep 17 00:00:00 2001 From: zhili Date: Mon, 22 Jan 2018 18:18:57 +0800 Subject: [PATCH 19/21] add article highlight-error-and-warning-when-make --- source/_drafts/highlight-error-and-warning-when-make.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 source/_drafts/highlight-error-and-warning-when-make.md diff --git a/source/_drafts/highlight-error-and-warning-when-make.md b/source/_drafts/highlight-error-and-warning-when-make.md new file mode 100644 index 0000000..548fefb --- /dev/null +++ b/source/_drafts/highlight-error-and-warning-when-make.md @@ -0,0 +1,5 @@ +--- +title: highlight-error-and-warning-when-make +date: 2018-01-22 18:17:56 +tags: +--- From bff5f2f7fca03bd984c262f1553f1ed419c71f31 Mon Sep 17 00:00:00 2001 From: Sauli Date: Wed, 24 Jan 2018 08:40:27 +0800 Subject: [PATCH 20/21] add article the-difference-between-select-poll-epoll --- source/_drafts/the-difference-between-select-poll-epoll.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 source/_drafts/the-difference-between-select-poll-epoll.md diff --git a/source/_drafts/the-difference-between-select-poll-epoll.md b/source/_drafts/the-difference-between-select-poll-epoll.md new file mode 100644 index 0000000..99a236d --- /dev/null +++ b/source/_drafts/the-difference-between-select-poll-epoll.md @@ -0,0 +1,5 @@ +--- +title: the-difference-between-select-poll-epoll +date: 2018-01-24 08:39:13 +tags: +--- From 426459cb138437b9895599c13aef6d7a52e74cf8 Mon Sep 17 00:00:00 2001 From: zhili Date: Wed, 24 Jan 2018 20:34:54 +0800 Subject: [PATCH 21/21] update article linux-cmd-top --- source/_posts/linux-cmd-top.md | 102 +++++++++++++++++++++++++++++++++ source/images/article/top.png | Bin 0 -> 34515 bytes 2 files changed, 102 insertions(+) create mode 100644 source/_posts/linux-cmd-top.md create mode 100644 source/images/article/top.png diff --git a/source/_posts/linux-cmd-top.md b/source/_posts/linux-cmd-top.md new file mode 100644 index 0000000..5b4e7a6 --- /dev/null +++ b/source/_posts/linux-cmd-top.md @@ -0,0 +1,102 @@ +--- +title: linux命令学习-top +date: 2018-01-24 09:57:29 +tags: + - top + - linux_cmd +categories: + - linux +--- + +```shell +# top //linux 命令行 +``` + +![](/images/article/top.png) + +图中所示是在我自己的ubuntu中使用`top`时所展示的。 + + + +## top 命令 + +```bash +top - 10:42:38 up 2 days, 1:00, 1 user, load average: 0.30, 0.24, 0.18 +Tasks: 275 total, 1 running, 274 sleeping, 0 stopped, 0 zombie +%Cpu(s): 2.1 us, 0.5 sy, 0.0 ni, 97.3 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st +KiB Mem : 4028316 total, 152980 free, 1603968 used, 2271368 buff/cache +KiB Swap: 2094076 total, 2094076 free, 0 used. 1970028 avail Mem + +PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND +49452 li 20 0 2179732 298492 186780 S 13.9 7.4 0:36.57 Web Content +``` + +## 解释 + +1. `top - 10:42:38 up 2 days, 1:00, 1 user, load average: 0.30, 0.24, 0.18` +10:42:38 — 当前系统时间 +up 2 days, 1:00 — 系统系统运行时间 +1 users — 当前登录用户数 +load average: 0.30, 0.24, 0.18 — 系统负载 三个数分别是1分钟、5分钟、15分钟的负载情况 + +2. `Tasks: 275 total, 1 running, 274 sleeping, 0 stopped, 0 zombie`、 +Tasks: 任务/进程 +275 total, 总共275个进程 +1 running, 1个正在运行进程 +274 sleeping, 274个睡眠进程 +0 stopped, 0个停止的进程 +0 zombie, 0个僵尸进程 + +3. `%Cpu(s): 2.1 us, 0.5 sy, 0.0 ni, 97.3 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st` +%Cpu(s): CPU占用 +2.1 us, 用户空间占用CPU百分比 +0.5 sy, 内核空间占用CPU百分比 +0.0 ni, 用户进程空间内改变过优先级的进程占用的百分比 +97.3 id, 空闲CPU百分比 +0.0 wa, 等待输入输出(IO)的CPU百分比 +0.0 hi, 硬件CPU中断占用的百分比 +0.1 si, 软件中断占用的百分比 +0.0 st 虚拟机占用百分比 + +4. `KiB Mem : 4028316 total, 152980 free, 1603968 used, 2271368 buff/cache` +KiB Mem : 物理内存 +4028316 total, 物理内存总量 +152980 free, 空闲内在总量 +1603968 used, 使用的物理内存总量 +2271368 buff/cache 用作内核缓存的内在总量 + +5. `KiB Swap: 2094076 total, 2094076 free, 0 used. 1970028 avail Mem` +KiB Swap: 交换分区 +2094076 total, 交换分区总量 +2094076 free, 空闲交换分区总量 +0 used. 使用的交换分区总量 +1970028 avail Mem 可用内存总量 + +6. `PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND` +PID 进程ID +USER 进程所有者 +PR 优先级 +NI nice值,负值表示高优先级,正值表示低优先级 +VIRT 进程使用的虚拟内在总量,单位kb VIRT=SWAP+RES +RES 进程使用的未被换出的 内存大小,单位kb RES=CODE+DATA +SHR 共享内存大小,单位kb +S 进程状态。D=不可中断的睡眠状态 R=运行 S=睡眠 T=跟踪/停止 Z=僵尸进程 +%CPU 上次更新到现在的CPU时间占用百分比 +%MEM 进程使用的物理内存百分比 +TIME+ 进程使用的CPU时间总计,单位1/100秒 +COMMAND 进程名称(命令名/命令行) + + +## 总结 + +top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器。top是一个动态显示过程,即可以通过用户按键来不断刷新当前状态.如果在前台执行该命令,它将独占前台,直到用户终止该程序为止.比较准确的说,top命令提供了实时的对系统处理器的状态监视.它将显示系统中CPU最“敏感”的任务列表.该命令可以按CPU使用.内存使用和执行时间对任务进行排序;而且该命令的很多特性都可以通过交互式命令或者在个人定制文件中进行设定。 + +更详细的解释看`top(1)` + +## 参考文档 + +- [Linux top命令的用法详细详解](https://www.cnblogs.com/edgedance/p/7044753.html) +- [linux的top命令参数详解](https://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316399.html) + + + diff --git a/source/images/article/top.png b/source/images/article/top.png new file mode 100644 index 0000000000000000000000000000000000000000..2bd21ae4b915959924a49d44d84af5068ec43b0e GIT binary patch literal 34515 zcmaI71yEf}y0E=)*WeBb?(XjH?hrhUI-G9!^ocm4Px${@; z+Iy|8Rb5@H-`(=`^F}BsNFu@G!2Jz1&}Tn|$2oXWjy^q%f0woFu^rnV9nW2?0| zmK_v8WL`dtRaV{|!_l?wAkH3t+U2^-+T$L-T5-;HKIO)dY?*vP8i1K;U)VlI6bXh! zBNGcpCGDhz1*#X1PwhfcN&i_0ixPKg7w|uKhOm##^iQ5o&AO`-3i@M0&8u zw(s`#lo7~Ethk)pv81`u(0*Z-w@;E;&~B|YpV~=r1`dvKJtpC~uPNx~x20d+1r#%M zi08#wVX(xYJI-pg=T$MXeIXU`^YP4A7U^ZLPpbYj3Z}AJ!T(jhey^LxuYJ~`a7Qa_`C)Z6sS{NgoKB|xAXsRooBmTV zz01Ry{){(Xh@7m)<#Shi4*E$9exP8!j=M9WvQ6P$%pVr`REdat53^}Kbst{cg%4fA zu{trdxm+tI!xWT7%1*!{y^MqP?cP|km6-RJ3puhF=jE0?xXRD>x9;lCbc@~LN6Xo* zO?vUa_dt-XM*5eyQR1(;@}>PY3=7VVMC|*f>~*uWE_fcJEn$QW)E$!LiKU!|6^MymtLmTy0+zf>mtc3vx_#7-3JCCbQr`tt16_=P_o6ZEfWKgy2wGNtV+W zUyJi}VG$|5DLwA@HtL5ULV>uwGgeQhrmp!^4%-?-sO-Lx;(D(+WT(0r$IKr2Y%+!M zSI#re;*RlUPfIOC#zL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