diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45c1505 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +_site +.sass-cache +.jekyll-metadata diff --git a/2018/06/13/blog1/index.html b/2018/06/13/blog1/index.html deleted file mode 100644 index 62c161b..0000000 --- a/2018/06/13/blog1/index.html +++ /dev/null @@ -1,5 +0,0 @@ -Mac+Hexo+Github搭建个人博客-(基础) | Hash's Blog

Mac+Hexo+Github搭建个人博客-(基础)

最近记忆力比较差,所以通过写一些文章来帮助记忆。写文章稍微正规一些好,搭一个个人博客来严格要求下自己。以搭建博客作为第一篇文章。

-

环境要求

操作系统:MAC

-

博客框架: Hexo

-

服务器:Github

-

环境配置

Hexo安装

Github关联

\ No newline at end of file diff --git a/2018/06/13/hello-world/index.html b/2018/06/13/hello-world/index.html deleted file mode 100644 index c33dc0b..0000000 --- a/2018/06/13/hello-world/index.html +++ /dev/null @@ -1,10 +0,0 @@ -Hello World | Hexo

Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

-

Quick Start

Create a new post

1
$ hexo new "My New Post"
-

More info: Writing

-

Run server

1
$ hexo server
-

More info: Server

-

Generate static files

1
$ hexo generate
-

More info: Generating

-

Deploy to remote sites

1
$ hexo deploy
-

More info: Deployment

-
文章
\ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..1c5e5bc --- /dev/null +++ b/_config.yml @@ -0,0 +1,21 @@ +# Welcome to Jekyll! +# +# This config file is meant for settings that affect your whole blog, values +# which you are expected to set up once and rarely need to edit after that. +# For technical reasons, this file is *NOT* reloaded automatically when you use +# 'jekyll serve'. If you change this file, please restart the server process. + +# Site settings +title: Your awesome title +email: your-email@domain.com +description: > # this means to ignore newlines until "baseurl:" + Write an awesome description for your new site here. You can edit this + line in _config.yml. It will appear in your document head meta (for + Google search results) and in your feed.xml site description. +baseurl: "" # the subpath of your site, e.g. /blog +url: "http://yourdomain.com" # the base hostname & protocol for your site +twitter_username: jekyllrb +github_username: jekyll + +# Build settings +markdown: kramdown diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..72239f1 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,38 @@ + diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 0000000..1598d6f --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,12 @@ + + + + + + {% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %} + + + + + + diff --git a/_includes/header.html b/_includes/header.html new file mode 100644 index 0000000..b3f86db --- /dev/null +++ b/_includes/header.html @@ -0,0 +1,27 @@ + diff --git a/_includes/icon-github.html b/_includes/icon-github.html new file mode 100644 index 0000000..e501a16 --- /dev/null +++ b/_includes/icon-github.html @@ -0,0 +1 @@ +{% include icon-github.svg %}{{ include.username }} diff --git a/_includes/icon-github.svg b/_includes/icon-github.svg new file mode 100644 index 0000000..4422c4f --- /dev/null +++ b/_includes/icon-github.svg @@ -0,0 +1 @@ + diff --git a/_includes/icon-twitter.html b/_includes/icon-twitter.html new file mode 100644 index 0000000..e623dbd --- /dev/null +++ b/_includes/icon-twitter.html @@ -0,0 +1 @@ +{% include icon-twitter.svg %}{{ include.username }} diff --git a/_includes/icon-twitter.svg b/_includes/icon-twitter.svg new file mode 100644 index 0000000..dcf660e --- /dev/null +++ b/_includes/icon-twitter.svg @@ -0,0 +1 @@ + diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..e4ab96f --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,20 @@ + + + + {% include head.html %} + + + + {% include header.html %} + +
+
+ {{ content }} +
+
+ + {% include footer.html %} + + + + diff --git a/_layouts/page.html b/_layouts/page.html new file mode 100644 index 0000000..ce233ad --- /dev/null +++ b/_layouts/page.html @@ -0,0 +1,14 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+
+ +
+ {{ content }} +
+ +
diff --git a/_layouts/post.html b/_layouts/post.html new file mode 100644 index 0000000..3a0fb52 --- /dev/null +++ b/_layouts/post.html @@ -0,0 +1,15 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+ +
+ +
+ {{ content }} +
+ +
diff --git a/_posts/2016-02-18-welcome-to-jekyll.markdown b/_posts/2016-02-18-welcome-to-jekyll.markdown new file mode 100644 index 0000000..417ae0e --- /dev/null +++ b/_posts/2016-02-18-welcome-to-jekyll.markdown @@ -0,0 +1,25 @@ +--- +layout: post +title: "Welcome to Jekyll!" +date: 2016-02-18 17:14:13 +0800 +categories: jekyll update +--- +You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. + +To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. + +Jekyll also offers powerful support for code snippets: + +{% highlight ruby %} +def print_hi(name) + puts "Hi, #{name}" +end +print_hi('Tom') +#=> prints 'Hi, Tom' to STDOUT. +{% endhighlight %} + +Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk]. + +[jekyll-docs]: http://jekyllrb.com/docs/home +[jekyll-gh]: https://github.com/jekyll/jekyll +[jekyll-talk]: https://talk.jekyllrb.com/ diff --git a/_sass/_base.scss b/_sass/_base.scss new file mode 100644 index 0000000..0883c3c --- /dev/null +++ b/_sass/_base.scss @@ -0,0 +1,206 @@ +/** + * Reset some basic elements + */ +body, h1, h2, h3, h4, h5, h6, +p, blockquote, pre, hr, +dl, dd, ol, ul, figure { + margin: 0; + padding: 0; +} + + + +/** + * Basic styling + */ +body { + font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family; + color: $text-color; + background-color: $background-color; + -webkit-text-size-adjust: 100%; + -webkit-font-feature-settings: "kern" 1; + -moz-font-feature-settings: "kern" 1; + -o-font-feature-settings: "kern" 1; + font-feature-settings: "kern" 1; + font-kerning: normal; +} + + + +/** + * Set `margin-bottom` to maintain vertical rhythm + */ +h1, h2, h3, h4, h5, h6, +p, blockquote, pre, +ul, ol, dl, figure, +%vertical-rhythm { + margin-bottom: $spacing-unit / 2; +} + + + +/** + * Images + */ +img { + max-width: 100%; + vertical-align: middle; +} + + + +/** + * Figures + */ +figure > img { + display: block; +} + +figcaption { + font-size: $small-font-size; +} + + + +/** + * Lists + */ +ul, ol { + margin-left: $spacing-unit; +} + +li { + > ul, + > ol { + margin-bottom: 0; + } +} + + + +/** + * Headings + */ +h1, h2, h3, h4, h5, h6 { + font-weight: $base-font-weight; +} + + + +/** + * Links + */ +a { + color: $brand-color; + text-decoration: none; + + &:visited { + color: darken($brand-color, 15%); + } + + &:hover { + color: $text-color; + text-decoration: underline; + } +} + + + +/** + * Blockquotes + */ +blockquote { + color: $grey-color; + border-left: 4px solid $grey-color-light; + padding-left: $spacing-unit / 2; + font-size: 18px; + letter-spacing: -1px; + font-style: italic; + + > :last-child { + margin-bottom: 0; + } +} + + + +/** + * Code formatting + */ +pre, +code { + font-size: 15px; + border: 1px solid $grey-color-light; + border-radius: 3px; + background-color: #eef; +} + +code { + padding: 1px 5px; +} + +pre { + padding: 8px 12px; + overflow-x: auto; + + > code { + border: 0; + padding-right: 0; + padding-left: 0; + } +} + + + +/** + * Wrapper + */ +.wrapper { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2)); + max-width: calc(#{$content-width} - (#{$spacing-unit} * 2)); + margin-right: auto; + margin-left: auto; + padding-right: $spacing-unit; + padding-left: $spacing-unit; + @extend %clearfix; + + @include media-query($on-laptop) { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit})); + max-width: calc(#{$content-width} - (#{$spacing-unit})); + padding-right: $spacing-unit / 2; + padding-left: $spacing-unit / 2; + } +} + + + +/** + * Clearfix + */ +%clearfix { + + &:after { + content: ""; + display: table; + clear: both; + } +} + + + +/** + * Icons + */ +.icon { + + > svg { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + + path { + fill: $grey-color; + } + } +} diff --git a/_sass/_layout.scss b/_sass/_layout.scss new file mode 100644 index 0000000..9cbfdde --- /dev/null +++ b/_sass/_layout.scss @@ -0,0 +1,242 @@ +/** + * Site header + */ +.site-header { + border-top: 5px solid $grey-color-dark; + border-bottom: 1px solid $grey-color-light; + min-height: 56px; + + // Positioning context for the mobile navigation icon + position: relative; +} + +.site-title { + font-size: 26px; + font-weight: 300; + line-height: 56px; + letter-spacing: -1px; + margin-bottom: 0; + float: left; + + &, + &:visited { + color: $grey-color-dark; + } +} + +.site-nav { + float: right; + line-height: 56px; + + .menu-icon { + display: none; + } + + .page-link { + color: $text-color; + line-height: $base-line-height; + + // Gaps between nav items, but not on the last one + &:not(:last-child) { + margin-right: 20px; + } + } + + @include media-query($on-palm) { + position: absolute; + top: 9px; + right: $spacing-unit / 2; + background-color: $background-color; + border: 1px solid $grey-color-light; + border-radius: 5px; + text-align: right; + + .menu-icon { + display: block; + float: right; + width: 36px; + height: 26px; + line-height: 0; + padding-top: 10px; + text-align: center; + + > svg { + width: 18px; + height: 15px; + + path { + fill: $grey-color-dark; + } + } + } + + .trigger { + clear: both; + display: none; + } + + &:hover .trigger { + display: block; + padding-bottom: 5px; + } + + .page-link { + display: block; + padding: 5px 10px; + + &:not(:last-child) { + margin-right: 0; + } + margin-left: 20px; + } + } +} + + + +/** + * Site footer + */ +.site-footer { + border-top: 1px solid $grey-color-light; + padding: $spacing-unit 0; +} + +.footer-heading { + font-size: 18px; + margin-bottom: $spacing-unit / 2; +} + +.contact-list, +.social-media-list { + list-style: none; + margin-left: 0; +} + +.footer-col-wrapper { + font-size: 15px; + color: $grey-color; + margin-left: -$spacing-unit / 2; + @extend %clearfix; +} + +.footer-col { + float: left; + margin-bottom: $spacing-unit / 2; + padding-left: $spacing-unit / 2; +} + +.footer-col-1 { + width: -webkit-calc(35% - (#{$spacing-unit} / 2)); + width: calc(35% - (#{$spacing-unit} / 2)); +} + +.footer-col-2 { + width: -webkit-calc(20% - (#{$spacing-unit} / 2)); + width: calc(20% - (#{$spacing-unit} / 2)); +} + +.footer-col-3 { + width: -webkit-calc(45% - (#{$spacing-unit} / 2)); + width: calc(45% - (#{$spacing-unit} / 2)); +} + +@include media-query($on-laptop) { + .footer-col-1, + .footer-col-2 { + width: -webkit-calc(50% - (#{$spacing-unit} / 2)); + width: calc(50% - (#{$spacing-unit} / 2)); + } + + .footer-col-3 { + width: -webkit-calc(100% - (#{$spacing-unit} / 2)); + width: calc(100% - (#{$spacing-unit} / 2)); + } +} + +@include media-query($on-palm) { + .footer-col { + float: none; + width: -webkit-calc(100% - (#{$spacing-unit} / 2)); + width: calc(100% - (#{$spacing-unit} / 2)); + } +} + + + +/** + * Page content + */ +.page-content { + padding: $spacing-unit 0; +} + +.page-heading { + font-size: 20px; +} + +.post-list { + margin-left: 0; + list-style: none; + + > li { + margin-bottom: $spacing-unit; + } +} + +.post-meta { + font-size: $small-font-size; + color: $grey-color; +} + +.post-link { + display: block; + font-size: 24px; +} + + + +/** + * Posts + */ +.post-header { + margin-bottom: $spacing-unit; +} + +.post-title { + font-size: 42px; + letter-spacing: -1px; + line-height: 1; + + @include media-query($on-laptop) { + font-size: 36px; + } +} + +.post-content { + margin-bottom: $spacing-unit; + + h2 { + font-size: 32px; + + @include media-query($on-laptop) { + font-size: 28px; + } + } + + h3 { + font-size: 26px; + + @include media-query($on-laptop) { + font-size: 22px; + } + } + + h4 { + font-size: 20px; + + @include media-query($on-laptop) { + font-size: 18px; + } + } +} diff --git a/_sass/_syntax-highlighting.scss b/_sass/_syntax-highlighting.scss new file mode 100644 index 0000000..8fac597 --- /dev/null +++ b/_sass/_syntax-highlighting.scss @@ -0,0 +1,71 @@ +/** + * Syntax highlighting styles + */ +.highlight { + background: #fff; + @extend %vertical-rhythm; + + .highlighter-rouge & { + background: #eef; + } + + .c { color: #998; font-style: italic } // Comment + .err { color: #a61717; background-color: #e3d2d2 } // Error + .k { font-weight: bold } // Keyword + .o { font-weight: bold } // Operator + .cm { color: #998; font-style: italic } // Comment.Multiline + .cp { color: #999; font-weight: bold } // Comment.Preproc + .c1 { color: #998; font-style: italic } // Comment.Single + .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special + .gd { color: #000; background-color: #fdd } // Generic.Deleted + .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific + .ge { font-style: italic } // Generic.Emph + .gr { color: #a00 } // Generic.Error + .gh { color: #999 } // Generic.Heading + .gi { color: #000; background-color: #dfd } // Generic.Inserted + .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific + .go { color: #888 } // Generic.Output + .gp { color: #555 } // Generic.Prompt + .gs { font-weight: bold } // Generic.Strong + .gu { color: #aaa } // Generic.Subheading + .gt { color: #a00 } // Generic.Traceback + .kc { font-weight: bold } // Keyword.Constant + .kd { font-weight: bold } // Keyword.Declaration + .kp { font-weight: bold } // Keyword.Pseudo + .kr { font-weight: bold } // Keyword.Reserved + .kt { color: #458; font-weight: bold } // Keyword.Type + .m { color: #099 } // Literal.Number + .s { color: #d14 } // Literal.String + .na { color: #008080 } // Name.Attribute + .nb { color: #0086B3 } // Name.Builtin + .nc { color: #458; font-weight: bold } // Name.Class + .no { color: #008080 } // Name.Constant + .ni { color: #800080 } // Name.Entity + .ne { color: #900; font-weight: bold } // Name.Exception + .nf { color: #900; font-weight: bold } // Name.Function + .nn { color: #555 } // Name.Namespace + .nt { color: #000080 } // Name.Tag + .nv { color: #008080 } // Name.Variable + .ow { font-weight: bold } // Operator.Word + .w { color: #bbb } // Text.Whitespace + .mf { color: #099 } // Literal.Number.Float + .mh { color: #099 } // Literal.Number.Hex + .mi { color: #099 } // Literal.Number.Integer + .mo { color: #099 } // Literal.Number.Oct + .sb { color: #d14 } // Literal.String.Backtick + .sc { color: #d14 } // Literal.String.Char + .sd { color: #d14 } // Literal.String.Doc + .s2 { color: #d14 } // Literal.String.Double + .se { color: #d14 } // Literal.String.Escape + .sh { color: #d14 } // Literal.String.Heredoc + .si { color: #d14 } // Literal.String.Interpol + .sx { color: #d14 } // Literal.String.Other + .sr { color: #009926 } // Literal.String.Regex + .s1 { color: #d14 } // Literal.String.Single + .ss { color: #990073 } // Literal.String.Symbol + .bp { color: #999 } // Name.Builtin.Pseudo + .vc { color: #008080 } // Name.Variable.Class + .vg { color: #008080 } // Name.Variable.Global + .vi { color: #008080 } // Name.Variable.Instance + .il { color: #099 } // Literal.Number.Integer.Long +} diff --git a/about.md b/about.md new file mode 100644 index 0000000..d0e6de5 --- /dev/null +++ b/about.md @@ -0,0 +1,15 @@ +--- +layout: page +title: About +permalink: /about/ +--- + +This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](http://jekyllrb.com/) + +You can find the source code for the Jekyll new theme at: +{% include icon-github.html username="jglovier" %} / +[jekyll-new](https://github.com/jglovier/jekyll-new) + +You can find the source code for Jekyll at +{% include icon-github.html username="jekyll" %} / +[jekyll](https://github.com/jekyll/jekyll) diff --git a/archives/2018/06/index.html b/archives/2018/06/index.html deleted file mode 100644 index 61e425a..0000000 --- a/archives/2018/06/index.html +++ /dev/null @@ -1 +0,0 @@ -Archive | Hash's Blog
\ No newline at end of file diff --git a/archives/2018/index.html b/archives/2018/index.html deleted file mode 100644 index 61e425a..0000000 --- a/archives/2018/index.html +++ /dev/null @@ -1 +0,0 @@ -Archive | Hash's Blog
\ No newline at end of file diff --git a/archives/index.html b/archives/index.html deleted file mode 100644 index 61e425a..0000000 --- a/archives/index.html +++ /dev/null @@ -1 +0,0 @@ -Archive | Hash's Blog
\ No newline at end of file diff --git a/categories/index.html b/categories/index.html deleted file mode 100644 index 52671da..0000000 --- a/categories/index.html +++ /dev/null @@ -1 +0,0 @@ -categories | Hash's Blog

categories

\ No newline at end of file diff --git a/css/default.css b/css/default.css deleted file mode 100644 index 123efd8..0000000 --- a/css/default.css +++ /dev/null @@ -1,1146 +0,0 @@ -.gitment-container { - font-family: sans-serif; - font-size: 14px; - line-height: 1.5; - color: #333; - word-wrap: break-word; -} - -.gitment-container * { - box-sizing: border-box; -} - -.gitment-container *:disabled { - cursor: not-allowed; -} - -.gitment-container a, -.gitment-container a:visited { - cursor: pointer; - text-decoration: none; -} - -.gitment-container a:hover { - text-decoration: underline; -} - -.gitment-container .gitment-hidden { - display: none; -} - -.gitment-container .gitment-spinner-icon { - fill: #333; - - -webkit-animation: gitment-spin 1s steps(12) infinite; - animation: gitment-spin 1s steps(12) infinite; -} - -@-webkit-keyframes gitment-spin { - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg) - } -} - -@keyframes gitment-spin { - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg) - } -} - -.gitment-root-container { - margin: 19px 0; -} - -.gitment-header-container { - margin: 19px 0; -} - -.gitment-header-like-btn, -.gitment-comment-like-btn { - cursor: pointer; -} - -.gitment-comment-like-btn { - float: right; -} - -.gitment-comment-like-btn.liked { - color: #F44336; -} - -.gitment-header-like-btn svg { - vertical-align: middle; - height: 30px; -} - -.gitment-comment-like-btn svg { - vertical-align: middle; - height: 20px; -} - -.gitment-header-like-btn.liked svg, -.gitment-comment-like-btn.liked svg { - fill: #F44336; -} - -a.gitment-header-issue-link, -a.gitment-header-issue-link:visited { - float: right; - line-height: 30px; - color: #666; -} - -a.gitment-header-issue-link:hover { - color: #666; -} - -.gitment-comments-loading, -.gitment-comments-error, -.gitment-comments-empty { - text-align: center; - margin: 50px 0; -} - -.gitment-comments-list { - list-style: none; - padding-left: 0; - margin: 0 0 38px; -} - -.gitment-comment, -.gitment-editor-container { - position: relative; - min-height: 60px; - padding-left: 60px; - margin: 19px 0; -} - -.gitment-comment-avatar, -.gitment-editor-avatar { - float: left; - margin-left: -60px; -} - -.gitment-comment-avatar, -.gitment-comment-avatar-img, -.gitment-comment-avatar, -.gitment-editor-avatar-img, -.gitment-editor-avatar svg { - width: 44px; - height: 44px; - border-radius: 3px; -} - -.gitment-editor-avatar .gitment-github-icon { - fill: #fff; - background-color: #333; -} - -.gitment-comment-main, -.gitment-editor-main { - position: relative; - border: 1px solid #CFD8DC; - border-radius: 0; -} - -.gitment-editor-main::before, -.gitment-editor-main::after, -.gitment-comment-main::before, -.gitment-comment-main::after { - position: absolute; - top: 11px; - left: -16px; - display: block; - width: 0; - height: 0; - pointer-events: none; - content: ""; - border-color: transparent; - border-style: solid solid outset; -} - -.gitment-editor-main::before, -.gitment-comment-main::before { - border-width: 8px; - border-right-color: #CFD8DC; -} - -.gitment-editor-main::after, -.gitment-comment-main::after { - margin-top: 1px; - margin-left: 2px; - border-width: 7px; - border-right-color: #fff; -} - -.gitment-comment-header { - margin: 12px 15px; - color: #666; - background-color: #fff; - border-radius: 3px; -} - -.gitment-editor-header { - padding: 0; - margin: 0; - border-bottom: 1px solid #CFD8DC; -} - -a.gitment-comment-name, -a.gitment-comment-name:visited { - font-weight: 600; - color: #666; -} - -.gitment-editor-tabs { - margin-bottom: -1px; - margin-left: -1px; -} - -.gitment-editor-tab { - display: inline-block; - padding: 11px 12px; - font-size: 14px; - line-height: 20px; - color: #666; - text-decoration: none; - background-color: transparent; - border-width: 0 1px; - border-style: solid; - border-color: transparent; - border-radius: 0; - - white-space: nowrap; - cursor: pointer; - user-select: none; - - outline: none; -} - -.gitment-editor-tab.gitment-selected { - color: #333; - background-color: #fff; - border-color: #CFD8DC; -} - -.gitment-editor-login { - float: right; - margin-top: -30px; - margin-right: 15px; -} - -a.gitment-footer-project-link, -a.gitment-footer-project-link:visited, -a.gitment-editor-login-link, -a.gitment-editor-login-link:visited { - color: #2196F3; -} - -a.gitment-editor-logout-link, -a.gitment-editor-logout-link:visited { - color: #666; -} - -a.gitment-editor-logout-link:hover { - color: #2196F3; - text-decoration: none; -} - -.gitment-comment-body { - position: relative; - margin: 12px 15px; - overflow: hidden; - border-radius: 3px; -} - -.gitment-comment-body-folded { - cursor: pointer; -} - -.gitment-comment-body-folded::before { - display: block !important; - content: ""; - position: absolute; - width: 100%; - left: 0; - top: 0; - bottom: 50px; - pointer-events: none; - background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), rgba(255, 255, 255, .9)); - background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .9)); -} - -.gitment-comment-body-folded::after { - display: block !important; - content: "Click to Expand" !important; - text-align: center; - color: #666; - position: absolute; - width: 100%; - height: 50px; - line-height: 50px; - left: 0; - bottom: 0; - pointer-events: none; - background: rgba(255, 255, 255, .9); -} - -.gitment-editor-body { - margin: 0; -} - -.gitment-comment-body > *:first-child, -.gitment-editor-preview > *:first-child { - margin-top: 0 !important; -} - -.gitment-comment-body > *:last-child, -.gitment-editor-preview > *:last-child { - margin-bottom: 0 !important; -} - -.gitment-editor-body textarea { - display: block; - width: 100%; - min-height: 150px; - max-height: 500px; - padding: 16px; - resize: vertical; - - max-width: 100%; - margin: 0; - font-size: 14px; - line-height: 1.6; - - background-color: #fff; - - color: #333; - vertical-align: middle; - border: none; - border-radius: 0; - outline: none; - box-shadow: none; - - overflow: visible; -} - -.gitment-editor-body textarea:focus { - background-color: #fff; -} - -.gitment-editor-preview { - min-height: 150px; - - padding: 16px; - background-color: transparent; - - width: 100%; - font-size: 14px; - - line-height: 1.5; - word-wrap: break-word; -} - -.gitment-editor-footer { - padding: 0; - margin-top: 10px; -} - -.gitment-editor-footer::after { - display: table; - clear: both; - content: ""; -} - -a.gitment-editor-footer-tip { - display: inline-block; - padding-top: 10px; - font-size: 12px; - color: #666; -} - -a.gitment-editor-footer-tip:hover { - color: #2196F3; - text-decoration: none; -} - -.gitment-comments-pagination { - list-style: none; - text-align: right; - border-radius: 0; - margin: -19px 0 19px 0; -} - -.gitment-comments-page-item { - display: inline-block; - cursor: pointer; - border: 1px solid #CFD8DC; - margin-left: -1px; - padding: .25rem .5rem; -} - -.gitment-comments-page-item:hover { - background-color: #f5f5f5; -} - -.gitment-comments-page-item.gitment-selected { - background-color: #f5f5f5; -} - -.gitment-editor-submit, -.gitment-comments-init-btn { - color: #fff; - background-color: #00BCD4; - - position: relative; - display: inline-block; - padding: 7px 13px; - font-size: 14px; - font-weight: 600; - line-height: 20px; - white-space: nowrap; - vertical-align: middle; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - background-size: 110% 110%; - border: none; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; -} - -.gitment-editor-submit:hover, -.gitment-comments-init-btn:hover { - background-color: #00ACC1; -} - -.gitment-comments-init-btn:disabled, -.gitment-editor-submit:disabled { - color: rgba(255,255,255,0.75); - background-color: #4DD0E1; - box-shadow: none; -} - -.gitment-editor-submit { - float: right; -} - -.gitment-footer-container { - margin-top: 30px; - margin-bottom: 20px; - text-align: right; - font-size: 12px; -} - -/* - * Markdown CSS - * Copied from https://github.com/sindresorhus/github-markdown-css - */ -.gitment-markdown { - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; - line-height: 1.5; - color: #333; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; - font-size: 16px; - line-height: 1.5; - word-wrap: break-word; -} - -.gitment-markdown .pl-c { - color: #969896; -} - -.gitment-markdown .pl-c1, -.gitment-markdown .pl-s .pl-v { - color: #0086b3; -} - -.gitment-markdown .pl-e, -.gitment-markdown .pl-en { - color: #795da3; -} - -.gitment-markdown .pl-smi, -.gitment-markdown .pl-s .pl-s1 { - color: #333; -} - -.gitment-markdown .pl-ent { - color: #63a35c; -} - -.gitment-markdown .pl-k { - color: #a71d5d; -} - -.gitment-markdown .pl-s, -.gitment-markdown .pl-pds, -.gitment-markdown .pl-s .pl-pse .pl-s1, -.gitment-markdown .pl-sr, -.gitment-markdown .pl-sr .pl-cce, -.gitment-markdown .pl-sr .pl-sre, -.gitment-markdown .pl-sr .pl-sra { - color: #183691; -} - -.gitment-markdown .pl-v, -.gitment-markdown .pl-smw { - color: #ed6a43; -} - -.gitment-markdown .pl-bu { - color: #b52a1d; -} - -.gitment-markdown .pl-ii { - color: #f8f8f8; - background-color: #b52a1d; -} - -.gitment-markdown .pl-c2 { - color: #f8f8f8; - background-color: #b52a1d; -} - -.gitment-markdown .pl-c2::before { - content: "^M"; -} - -.gitment-markdown .pl-sr .pl-cce { - font-weight: bold; - color: #63a35c; -} - -.gitment-markdown .pl-ml { - color: #693a17; -} - -.gitment-markdown .pl-mh, -.gitment-markdown .pl-mh .pl-en, -.gitment-markdown .pl-ms { - font-weight: bold; - color: #1d3e81; -} - -.gitment-markdown .pl-mq { - color: #008080; -} - -.gitment-markdown .pl-mi { - font-style: italic; - color: #333; -} - -.gitment-markdown .pl-mb { - font-weight: bold; - color: #333; -} - -.gitment-markdown .pl-md { - color: #bd2c00; - background-color: #ffecec; -} - -.gitment-markdown .pl-mi1 { - color: #55a532; - background-color: #eaffea; -} - -.gitment-markdown .pl-mc { - color: #ef9700; - background-color: #ffe3b4; -} - -.gitment-markdown .pl-mi2 { - color: #d8d8d8; - background-color: #808080; -} - -.gitment-markdown .pl-mdr { - font-weight: bold; - color: #795da3; -} - -.gitment-markdown .pl-mo { - color: #1d3e81; -} - -.gitment-markdown .pl-ba { - color: #595e62; -} - -.gitment-markdown .pl-sg { - color: #c0c0c0; -} - -.gitment-markdown .pl-corl { - text-decoration: underline; - color: #183691; -} - -.gitment-markdown .octicon { - display: inline-block; - vertical-align: text-top; - fill: currentColor; -} - -.gitment-markdown a { - background-color: transparent; - -webkit-text-decoration-skip: objects; -} - -.gitment-markdown a:active, -.gitment-markdown a:hover { - outline-width: 0; -} - -.gitment-markdown strong { - font-weight: inherit; -} - -.gitment-markdown strong { - font-weight: bolder; -} - -.gitment-markdown h1 { - font-size: 2em; - margin: 0.67em 0; -} - -.gitment-markdown img { - border-style: none; -} - -.gitment-markdown svg:not(:root) { - overflow: hidden; -} - -.gitment-markdown code, -.gitment-markdown kbd, -.gitment-markdown pre { - font-family: monospace, monospace; - font-size: 1em; -} - -.gitment-markdown hr { - box-sizing: content-box; - height: 0; - overflow: visible; -} - -.gitment-markdown input { - font: inherit; - margin: 0; -} - -.gitment-markdown input { - overflow: visible; -} - -.gitment-markdown [type="checkbox"] { - box-sizing: border-box; - padding: 0; -} - -.gitment-markdown * { - box-sizing: border-box; -} - -.gitment-markdown input { - font-family: inherit; - font-size: inherit; - line-height: inherit; -} - -.gitment-markdown a { - color: #0366d6; - text-decoration: none; -} - -.gitment-markdown a:hover { - text-decoration: underline; -} - -.gitment-markdown strong { - font-weight: 600; -} - -.gitment-markdown hr { - height: 0; - margin: 15px 0; - overflow: hidden; - background: transparent; - border: 0; - border-bottom: 1px solid #dfe2e5; -} - -.gitment-markdown hr::before { - display: table; - content: ""; -} - -.gitment-markdown hr::after { - display: table; - clear: both; - content: ""; -} - -.gitment-markdown table { - border-spacing: 0; - border-collapse: collapse; -} - -.gitment-markdown td, -.gitment-markdown th { - padding: 0; -} - -.gitment-markdown h1, -.gitment-markdown h2, -.gitment-markdown h3, -.gitment-markdown h4, -.gitment-markdown h5, -.gitment-markdown h6 { - margin-top: 0; - margin-bottom: 0; -} - -.gitment-markdown h1 { - font-size: 32px; - font-weight: 600; -} - -.gitment-markdown h2 { - font-size: 24px; - font-weight: 600; -} - -.gitment-markdown h3 { - font-size: 20px; - font-weight: 600; -} - -.gitment-markdown h4 { - font-size: 16px; - font-weight: 600; -} - -.gitment-markdown h5 { - font-size: 14px; - font-weight: 600; -} - -.gitment-markdown h6 { - font-size: 12px; - font-weight: 600; -} - -.gitment-markdown p { - margin-top: 0; - margin-bottom: 10px; -} - -.gitment-markdown blockquote { - margin: 0; -} - -.gitment-markdown ul, -.gitment-markdown ol { - padding-left: 0; - margin-top: 0; - margin-bottom: 0; -} - -.gitment-markdown ol ol, -.gitment-markdown ul ol { - list-style-type: lower-roman; -} - -.gitment-markdown ul ul ol, -.gitment-markdown ul ol ol, -.gitment-markdown ol ul ol, -.gitment-markdown ol ol ol { - list-style-type: lower-alpha; -} - -.gitment-markdown dd { - margin-left: 0; -} - -.gitment-markdown code { - font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - font-size: 12px; -} - -.gitment-markdown pre { - margin-top: 0; - margin-bottom: 0; - font: 12px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; -} - -.gitment-markdown .octicon { - vertical-align: text-bottom; -} - -.gitment-markdown .pl-0 { - padding-left: 0 !important; -} - -.gitment-markdown .pl-1 { - padding-left: 4px !important; -} - -.gitment-markdown .pl-2 { - padding-left: 8px !important; -} - -.gitment-markdown .pl-3 { - padding-left: 16px !important; -} - -.gitment-markdown .pl-4 { - padding-left: 24px !important; -} - -.gitment-markdown .pl-5 { - padding-left: 32px !important; -} - -.gitment-markdown .pl-6 { - padding-left: 40px !important; -} - -.gitment-markdown::before { - display: table; - content: ""; -} - -.gitment-markdown::after { - display: table; - clear: both; - content: ""; -} - -.gitment-markdown>*:first-child { - margin-top: 0 !important; -} - -.gitment-markdown>*:last-child { - margin-bottom: 0 !important; -} - -.gitment-markdown a:not([href]) { - color: inherit; - text-decoration: none; -} - -.gitment-markdown .anchor { - float: left; - padding-right: 4px; - margin-left: -20px; - line-height: 1; -} - -.gitment-markdown .anchor:focus { - outline: none; -} - -.gitment-markdown p, -.gitment-markdown blockquote, -.gitment-markdown ul, -.gitment-markdown ol, -.gitment-markdown dl, -.gitment-markdown table, -.gitment-markdown pre { - margin-top: 0; - margin-bottom: 16px; -} - -.gitment-markdown hr { - height: 0.25em; - padding: 0; - margin: 24px 0; - background-color: #e1e4e8; - border: 0; -} - -.gitment-markdown blockquote { - padding: 0 1em; - color: #6a737d; - border-left: 0.25em solid #dfe2e5; -} - -.gitment-markdown blockquote>:first-child { - margin-top: 0; -} - -.gitment-markdown blockquote>:last-child { - margin-bottom: 0; -} - -.gitment-markdown kbd { - display: inline-block; - padding: 3px 5px; - font-size: 11px; - line-height: 10px; - color: #444d56; - vertical-align: middle; - background-color: #fafbfc; - border: solid 1px #c6cbd1; - border-bottom-color: #959da5; - border-radius: 0; - box-shadow: inset 0 -1px 0 #959da5; -} - -.gitment-markdown h1, -.gitment-markdown h2, -.gitment-markdown h3, -.gitment-markdown h4, -.gitment-markdown h5, -.gitment-markdown h6 { - margin-top: 24px; - margin-bottom: 16px; - font-weight: 600; - line-height: 1.25; -} - -.gitment-markdown h1 .octicon-link, -.gitment-markdown h2 .octicon-link, -.gitment-markdown h3 .octicon-link, -.gitment-markdown h4 .octicon-link, -.gitment-markdown h5 .octicon-link, -.gitment-markdown h6 .octicon-link { - color: #1b1f23; - vertical-align: middle; - visibility: hidden; -} - -.gitment-markdown h1:hover .anchor, -.gitment-markdown h2:hover .anchor, -.gitment-markdown h3:hover .anchor, -.gitment-markdown h4:hover .anchor, -.gitment-markdown h5:hover .anchor, -.gitment-markdown h6:hover .anchor { - text-decoration: none; -} - -.gitment-markdown h1:hover .anchor .octicon-link, -.gitment-markdown h2:hover .anchor .octicon-link, -.gitment-markdown h3:hover .anchor .octicon-link, -.gitment-markdown h4:hover .anchor .octicon-link, -.gitment-markdown h5:hover .anchor .octicon-link, -.gitment-markdown h6:hover .anchor .octicon-link { - visibility: visible; -} - -.gitment-markdown h1 { - padding-bottom: 0.3em; - font-size: 2em; - border-bottom: 1px solid #eaecef; -} - -.gitment-markdown h2 { - padding-bottom: 0.3em; - font-size: 1.5em; - border-bottom: 1px solid #eaecef; -} - -.gitment-markdown h3 { - font-size: 1.25em; -} - -.gitment-markdown h4 { - font-size: 1em; -} - -.gitment-markdown h5 { - font-size: 0.875em; -} - -.gitment-markdown h6 { - font-size: 0.85em; - color: #6a737d; -} - -.gitment-markdown ul, -.gitment-markdown ol { - padding-left: 2em; -} - -.gitment-markdown ul ul, -.gitment-markdown ul ol, -.gitment-markdown ol ol, -.gitment-markdown ol ul { - margin-top: 0; - margin-bottom: 0; -} - -.gitment-markdown li>p { - margin-top: 16px; -} - -.gitment-markdown li+li { - margin-top: 0.25em; -} - -.gitment-markdown dl { - padding: 0; -} - -.gitment-markdown dl dt { - padding: 0; - margin-top: 16px; - font-size: 1em; - font-style: italic; - font-weight: 600; -} - -.gitment-markdown dl dd { - padding: 0 16px; - margin-bottom: 16px; -} - -.gitment-markdown table { - display: block; - width: 100%; - overflow: auto; -} - -.gitment-markdown table th { - font-weight: 600; -} - -.gitment-markdown table th, -.gitment-markdown table td { - padding: 6px 13px; - border: 1px solid #dfe2e5; -} - -.gitment-markdown table tr { - background-color: #fff; - border-top: 1px solid #c6cbd1; -} - -.gitment-markdown table tr:nth-child(2n) { - background-color: #f5f5f5; -} - -.gitment-markdown img { - max-width: 100%; - box-sizing: content-box; - background-color: #fff; -} - -.gitment-markdown code { - padding: 0; - padding-top: 0.2em; - padding-bottom: 0.2em; - margin: 0; - font-size: 85%; - background-color: rgba(27,31,35,0.05); - border-radius: 0; -} - -.gitment-markdown code::before, -.gitment-markdown code::after { - letter-spacing: -0.2em; - content: "\00a0"; -} - -.gitment-markdown pre { - word-wrap: normal; -} - -.gitment-markdown pre>code { - padding: 0; - margin: 0; - font-size: 100%; - word-break: normal; - white-space: pre; - background: transparent; - border: 0; -} - -.gitment-markdown .highlight { - margin-bottom: 16px; -} - -.gitment-markdown .highlight pre { - margin-bottom: 0; - word-break: normal; -} - -.gitment-markdown .highlight pre, -.gitment-markdown pre { - padding: 16px; - overflow: auto; - font-size: 85%; - line-height: 1.45; - background-color: #f5f5f5; - border-radius: 0; -} - -.gitment-markdown pre code { - display: inline; - max-width: auto; - padding: 0; - margin: 0; - overflow: visible; - line-height: inherit; - word-wrap: normal; - background-color: transparent; - border: 0; -} - -.gitment-markdown pre code::before, -.gitment-markdown pre code::after { - content: normal; -} - -.gitment-markdown .full-commit .btn-outline:not(:disabled):hover { - color: #005cc5; - border-color: #005cc5; -} - -.gitment-markdown kbd { - display: inline-block; - padding: 3px 5px; - font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; - line-height: 10px; - color: #444d56; - vertical-align: middle; - background-color: #fcfcfc; - border: solid 1px #c6cbd1; - border-bottom-color: #959da5; - border-radius: 0; - box-shadow: inset 0 -1px 0 #959da5; -} - -.gitment-markdown :checked+.radio-label { - position: relative; - z-index: 1; - border-color: #0366d6; -} - -.gitment-markdown .task-list-item { - list-style-type: none; -} - -.gitment-markdown .task-list-item+.task-list-item { - margin-top: 3px; -} - -.gitment-markdown .task-list-item input { - margin: 0 0.2em 0.25em -1.6em; - vertical-align: middle; -} - -.gitment-markdown hr { - border-bottom-color: #eee; -} diff --git a/css/donate.css b/css/donate.css deleted file mode 100644 index a2af08c..0000000 --- a/css/donate.css +++ /dev/null @@ -1,273 +0,0 @@ -html, html>body { - margin: 0px !important; - padding: 0px !important; - height: 100%; - width: 100%; -} -body { - font-family: "Helvetica Neue", Ubuntu, "WenQuanYi Micro Hei", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Micro Hei Mono", "WenQuanYi Zen Hei", "WenQuanYi Zen Hei", "Apple LiGothic Medium", "SimHei", "ST Heiti", "WenQuanYi Zen Hei Sharp", Arial, sans-serif; - -webkit-font-smoothing:antialiased; - line-height: 1.8em; - text-shadow: 0 0 1px rgba(255,255,255,0.1); - background: #fff; -} -img {border-width: 0px;} -a{ - color: #000; - text-decoration: none; - outline:none; - border:none; -} -.list, .list li, .list-left li { - list-style: none; - list-style-type: none; - margin: 0px; - padding: 0px; -} -.pos-f { - position: fixed; -} -.left-100 { - width: 100%; - height: 100%; -} -.blur { - -webkit-filter: blur(3px); - filter: blur(3px); -} -.tr3 { - transition: all .3s; -} -#DonateText { - position: fixed; - font-size: 12px; - width: 70px; - height: 70px; - line-height: 70px; - color: #fff; - background: #ffd886 url(../img/like.svg) no-repeat center 10px; - background-size: 20px; - border-radius: 35px; - text-align: center; - left: calc(50% - 120px); - top: calc(50% - 60px); - z-index: -1; - transform: rotatez(-15deg ); -} -#donateBox { - left: calc(50% - 150px); - top: calc(50% - 15px); - background-color: #fff; - border: 1px solid #ddd; - border-radius: 6px; - width: 299px; - height: 28px; - float: left; - z-index: 1; -} -#donateBox li { - width: 74px; - /*float: left;*/ - float: right; - text-align: center; - border-left: 1px solid #ddd; - background: no-repeat center center; - background-color: rgba(204, 217, 220,0.1); - background-size: 45px; - transition: all .3s; - cursor: pointer; - overflow: hidden; - line-height: 600px; - height: 28px; - -webkit-filter: grayscale(1); - filter: grayscale(1); - opacity: 0.5; -} -#donateBox li:hover { - background-color: rgba(204, 217, 220,0.3); - -webkit-filter: grayscale(0); - filter: grayscale(0); - opacity: 1; -} -#donateBox>li:first-child { - border-width: 0; -} -#donateBox a { - display: block; -} -#donateBox #PayPal { - background-image: url(../img/paypal.svg); -} -#donateBox>#BTC { - background-image: url(../img/bitcoin.svg); - line-height: 28px; -} -#donateBox>#BTC:hover { - overflow: visible; -} -#BTC>button { - opacity: 0; - cursor: pointer; -} -#donateBox #AliPay { - background-image: url(../img/alipay.svg); -} -#donateBox #WeChat { - background-image: url(../img/wechat.svg); -} -#QRBox { - top: 0; - left: 0; - z-index: 1; - background-color: rgba(255,255,255,0.3); - display: none; - perspective: 400px; -} -#MainBox { - cursor: pointer; - position: absolute; - text-align: center; - width: 200px; - height: 200px; - left: calc(50% - 100px); - top: calc(50% - 100px); - background: #fff no-repeat center center; - background-size: 190px; - border-radius: 6px; - box-shadow: 0px 2px 7px rgba(0,0,0,0.3); - opacity: 0; - transition: all 1s ease-in-out; - transform-style: preserve-3d; - transform-origin: center center; - overflow: hidden; -} -#btc-key { - opacity: 0; - width: 2px; - height: 8px; - overflow: hidden; - left: -2px; - top: -8px; -} -#github { - width: 24px; - height: 24px; - left: calc(50% + 135px); - top: calc(50% - 30px); - background: no-repeat center center url(../img/github.svg); - background-size: contain; - opacity: 0.3; - transform: rotatez(15deg ); -} -[data-footnote] { - position: relative; - overflow: hidden; -} -[data-footnote]:hover { - overflow: visible; -} -[data-footnote]::before, [data-footnote]::after { - position: absolute; - transition: all .3s; - transform: translate3d(-50%,0,0); - opacity: 0; - left: 37px; - z-index: 10; -} -[data-footnote]::before { - content: attr(data-footnote); - border-radius: 6px; - background-color: rgba(100,100,100,0.8); - color: #fff; - height: 24px; - line-height: 24px; - padding: 0 6px; - font-size: 12px; - white-space: nowrap; - top: -24px; - left: 37px; -} -[data-footnote]::after { - content: ''; - border: 5px solid #333; - border-color: rgba(100,100,100,0.8) transparent transparent transparent; - top: 0; - left: 37px; -} -[data-footnote]:hover::before,[data-footnote]:hover::after { - opacity: 1; -} -[data-footnote]:hover::before,[data-footnote]:hover::after { - transform: translate3d(-50%,-7px,0); -} - -#MainBox.showQR { - opacity: 1; - animation-name:showQR; - animation-duration:3s; - animation-timing-function:ease-in-out; - animation-iteration-count:1; - animation-fill-mode:forwards; - -webkit-animation:showQR 3s ease-in-out 0s 1 normal forwards; -} -@keyframes showQR { - from { - transform: rotateX(90deg); - } - 8% { - opacity: 1; - transform: rotateX(-60deg); - } - 18% { - opacity: 1; - transform: rotateX(40deg); - } - 34% { - opacity: 1; - transform: rotateX(-28deg); - } - 44% { - opacity: 1; - transform: rotateX(18deg); - } - 58% { - opacity: 1; - transform: rotateX(-12deg); - } - 72% { - opacity: 1; - transform: rotateX(9deg); - } - 88% { - opacity: 1; - transform: rotateX(-5deg); - } - 96% { - opacity: 1; - transform: rotateX(2deg); - } - to { - opacity: 1; - } -} -#MainBox.hideQR { - opacity: 1; - animation-name:hideQR; - animation-duration:0.5s; - animation-timing-function:ease-in-out; - animation-iteration-count:1; - animation-fill-mode:forwards; - -webkit-animation:hideQR 0.5s ease-in-out 0s 1 normal forwards; -} -@keyframes hideQR { - from { - } - 20%,50% { - transform: scale(1.08,1.08); - opacity: 1; - } - to { - opacity: 0; - transform: rotateZ(40deg) scale(0.6,0.6); - } -} diff --git a/css/fonts/FontAwesome.otf b/css/fonts/FontAwesome.otf deleted file mode 100644 index 8b0f54e..0000000 Binary files a/css/fonts/FontAwesome.otf and /dev/null differ diff --git a/css/fonts/fontawesome-webfont.eot b/css/fonts/fontawesome-webfont.eot deleted file mode 100644 index 7c79c6a..0000000 Binary files a/css/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/css/fonts/fontawesome-webfont.svg b/css/fonts/fontawesome-webfont.svg deleted file mode 100644 index 45fdf33..0000000 --- a/css/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/css/fonts/fontawesome-webfont.ttf b/css/fonts/fontawesome-webfont.ttf deleted file mode 100644 index e89738d..0000000 Binary files a/css/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/css/fonts/fontawesome-webfont.woff b/css/fonts/fontawesome-webfont.woff deleted file mode 100644 index 8c1748a..0000000 Binary files a/css/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/css/images/banner.jpg b/css/images/banner.jpg deleted file mode 100644 index b963e06..0000000 Binary files a/css/images/banner.jpg and /dev/null differ diff --git a/css/main.scss b/css/main.scss new file mode 100644 index 0000000..f2e566e --- /dev/null +++ b/css/main.scss @@ -0,0 +1,53 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- +@charset "utf-8"; + + + +// Our variables +$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +$base-font-size: 16px; +$base-font-weight: 400; +$small-font-size: $base-font-size * 0.875; +$base-line-height: 1.5; + +$spacing-unit: 30px; + +$text-color: #111; +$background-color: #fdfdfd; +$brand-color: #2a7ae2; + +$grey-color: #828282; +$grey-color-light: lighten($grey-color, 40%); +$grey-color-dark: darken($grey-color, 25%); + +// Width of the content area +$content-width: 800px; + +$on-palm: 600px; +$on-laptop: 800px; + + + +// Use media queries like this: +// @include media-query($on-palm) { +// .wrapper { +// padding-right: $spacing-unit / 2; +// padding-left: $spacing-unit / 2; +// } +// } +@mixin media-query($device) { + @media screen and (max-width: $device) { + @content; + } +} + + + +// Import partials from `sass_dir` (defaults to `_sass`) +@import + "base", + "layout", + "syntax-highlighting" +; diff --git a/css/style.css b/css/style.css deleted file mode 100644 index 2083e75..0000000 --- a/css/style.css +++ /dev/null @@ -1,1466 +0,0 @@ -/** - * - * @package Maupassant - * @author cho - * @version 2.0 - * @link http://chopstack.com - */ -/* -pure css setting -When setting the primary font stack, apply it to the Pure grid units along -with `html`, `button`, `input`, `select`, and `textarea`. Pure Grids use -specific font stacks to ensure the greatest OS/browser compatibility. -*/ -html, button, input, select, textarea, -.MJXc-TeX-unknown-R, -.pure-g [class*="pure-u"] { - /* Set your content font stack here: */ - font-family: "PingFangSC-Regular", Helvetica, "Helvetica Neue", "Segoe UI", "Hiragino Sans GB", "Source Han Sans CN", "Microsoft YaHei", "STHeiti", "WenQuanYi Micro Hei", sans-serif !important; } - -body { - background-color: #FFF; - color: #444; - font-family: "TIBch", "Classic Grotesque W01", "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 14px; } - -.body_container { - padding: 0 60px; - max-width: 1150px; - margin: 0 auto; } - -.content_container { - padding-right: 50px; - padding-top: 20px; } - -a, button.submit { - color: #6E7173; - text-decoration: none; - -webkit-transition: all .1s ease-in; - -moz-transition: all .1s ease-in; - -o-transition: all .1s ease-in; - transition: all .1s ease-in; } - -a:hover, a:active { - color: #444; } - -a:focus { - outline: auto; } - -.clear { - clear: both; } - -div { - box-sizing: border-box; } - -#header { - padding: 58px 0 0; - text-align: left; - border-bottom: 1px solid #ddd; - position: relative; } - #header .site-name { - margin-bottom: 40px; } - #header .site-name h1 { - padding: 0; - margin: 0; - height: 0; - overflow: hidden; } - #header .site-name #logo { - font: bold 38px/1.12 "Times New Roman", Georgia, Times, sans-serif; - color: #555; } - #header .site-name #logo span, #header .site-name #logo:hover { - color: #777; } - #header .site-name .description { - margin: .2em 0 0; - color: #999; } - #header #nav-menu { - margin: 10px 0 -1px; - padding: 0; - position: absolute; - right: 0; - bottom: 0; } - #header #nav-menu a { - display: inline-block; - padding: 3px 20px 3px; - line-height: 30px; - color: #444; - font-size: 13px; - border: 1px solid transparent; } - #header #nav-menu a:hover { - border-bottom-color: #444; } - #header #nav-menu a.current { - border: 1px solid #ddd; - border-bottom-color: #fff; } - -#sidebar { - border-left: 1px solid #ddd; - padding-left: 35px; - margin-top: 40px; - padding-bottom: 20px; - word-wrap: break-word; } - #sidebar .widget { - margin-bottom: 30px; } - #sidebar .widget .widget-title { - color: #6E7173; - line-height: 2.7; - margin-top: 0; - font-size: 16px; - border-bottom: 1px solid #ddd; - display: block; - font-weight: normal; } - #sidebar .widget .comments-title { - color: #6E7173; - line-height: 2.7; - margin-top: 0; - font-size: 16px; - border-bottom: 0px solid #ddd; - display: block; - font-weight: normal; } - #sidebar .widget .tagcloud { - margin-top: 10px; } - #sidebar .widget .tagcloud a { - line-height: 1.5; - padding: 5px; } - #sidebar .widget ul { - list-style: none; - padding: 0; } - #sidebar .widget ul li { - margin: 5px 0; - line-height: 1.5; } - #sidebar .widget .category-list-count { - padding-left: 5px; - color: #6E7173; } - #sidebar .widget .category-list-count::before { - content: "("; } - #sidebar .widget .category-list-count::after { - content: ")"; } - #sidebar .widget .search-form { - position: relative; - overflow: hidden; } - #sidebar .widget .search-form input { - background: #fff 8px 8px no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6%2BR8AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAG11AABzoAAA%2FN0AAINkAABw6AAA7GgAADA%2BAAAQkOTsmeoAAAESSURBVHjajNCxS9VRGMbxz71E4OwgoXPQxVEpXCI47%2BZqGP0LCoJO7UVD3QZzb3SwcHB7F3Uw3Zpd%2FAPCcJKG7Dj4u%2FK7Pwp94HDg5Xyf5z1Pr9YKImKANTzFXxzjU2ae6qhXaxURr%2FAFl9hHDy%2FwEK8z89sYVEp5gh84wMvMvGiSJ%2FEV85jNzLMR1McqfmN5BEBmnmMJFSvtpH7jdJiZv7q7Z%2BZPfMdcF6rN%2FT%2F1m2LGBkd4HhFT3dcRMY2FpskxaLNpayciHrWAGeziD7b%2BVfkithuTk8bkGa4wgWFmbrSTZOYeBvjc%2BucQj%2FEe6xHx4Taq1nrnKaW8K6XUUsrHWuvNevdRRLzFGwzvDbXAB9cDAHvhedDruuxSAAAAAElFTkSuQmCC); - padding: 7px 11px 7px 28px; - line-height: 16px; - border: 1px solid #bbb; - width: 65%; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -ms-border-radius: 5px; - -o-border-radius: 5px; - border-radius: 5px; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; } - -/* title for search result or tagged posts*/ -.label-title { - margin-top: 1.1em; - font-size: 20px; - font-weight: normal; - color: #888; } - -.post { - padding: 25px 0 15px; } - .post .post-title { - margin: 0; - color: #555; - text-align: left; - font: bold 25px/1.1 "ff-tisa-web-pro", Cambria, "Times New Roman", Georgia, Times, sans-serif; } - .post .post-title a { - color: #555; } - .post .post-meta { - padding: 0; - margin: 15px 0 0; - color: #6E7173; - float: left; - display: inline; - text-indent: .15em; } - .post .post-meta:before { - font-family: "FontAwesome"; - content: "\f073"; - padding-right: 0.3em; } - .post .post-meta .category:before { - font-family: "FontAwesome"; - content: "\f07c"; - padding-right: 0.3em; } - .post .post-meta #busuanzi_value_page_pv:before { - font-family: "FontAwesome"; - content: "\f024"; - padding-right: 0.3em; } - .post .ds-thread-count { - padding: 0; - margin: 15px 0 0; - color: #6E7173; - float: right; - display: inline; - text-indent: .15em; } - .post .ds-thread-count:before { - font-family: "FontAwesome"; - content: "\f0e5"; - padding-right: 0.3em; } - .post .ds-thread-count:hover { - color: #444; } - .post .disqus-comment-count { - padding: 0; - margin: 15px 0 0; - color: #6E7173; - float: right; - display: inline; - text-indent: .15em; } - .post .disqus-comment-count:before { - font-family: "FontAwesome"; - content: "\f0e5"; - padding-right: 0.3em; } - .post .disqus-comment-count:hover { - color: #444; } - .post .post-content { - clear: left; - font-size: 15px; - line-height: 1.77; - color: #444; - padding-top: 15px; - text-align: justify; - text-justify: distribute; - word-break: normal; } - .post .post-content h2 { - margin: 1.4em 0 1.1em; - border-bottom: 1px solid #eee; - overflow: hidden; } - .post .post-content h3 { - margin: 1.4em 0 1.1em; } - .post .post-content pre code { - padding: 0 2em; } - .post .post-content p { - margin: 0 0 1.234em; } - .post .post-content p code { - display: inline-block; - margin: 0 5px; - padding: 0 5px; - background: #f7f8f8; - font-family: Menlo, Consolas, monospace !important; } - .post .post-content p a { - color: #01579f; - padding-bottom: 2px; - word-break: normal; } - .post .post-content p a:hover { - text-decoration: underline; } - .post .post-content .caption { - color: #444; - display: block; - font-size: 0.9em; - margin-top: 0.1em; - position: relative; - text-align: center; } - .post .post-content hr { - margin: 2.4em auto; - border: none; - border-top: 1px solid #eee; - position: relative; } - .post .post-content img { - max-width: 100%; - padding: 0.5em 0; - margin: auto; - display: block; } - .post .post-content ul, .post .post-content ol { - border-radius: 3px; - margin: 1em 0; } - .post .post-content ul ul, .post .post-content ol ul { - margin: 0; } - .post .post-content ul code, .post .post-content ol code { - display: inline-block; - margin: 0 5px; - padding: 0px 5px; - background: #f7f8f8; - font-family: Menlo, Consolas, monospace !important; } - .post .post-content ul a, .post .post-content ol a { - color: #01579f; - padding-bottom: 2px; - word-break: normal; } - .post .post-content ul a:hover, .post .post-content ol a:hover { - text-decoration: underline; } - .post .tags { - padding-bottom: 1em; } - .post .tags a { - margin-right: .5em; } - .post .tags a:before { - font-family: "FontAwesome"; - content: "\f0c6"; - padding-right: 0.3em; } - -.page-navigator { - border-top: 1px solid #ddd; - list-style: none; - margin-top: 25px; - padding: 25px 0 0; - font-size: 14px; - text-align: center; } - .page-navigator .page-number { - display: inline-block; - margin: 0 5px 5px 0; } - .page-navigator a, .page-navigator span { - display: inline-block; - height: 25px; - line-height: 25px; - padding: 5px 9px; - border: 1px solid #DDD; - text-align: center; } - .page-navigator a:hover, .page-navigator span:hover { - background: #F8F8F8; - border-bottom-color: #D26911; } - .page-navigator a.prev, .page-navigator span.prev { - float: left; } - .page-navigator a.prev:before, .page-navigator span.prev:before { - font-family: "FontAwesome"; - content: "\f100"; - padding-right: 0.3em; } - .page-navigator a.next, .page-navigator span.next { - float: right; } - .page-navigator a.next:after, .page-navigator span.next:after { - font-family: "FontAwesome"; - content: "\f101"; - padding-left: 0.3em; } - .page-navigator .current { - background: #F8F8F8; - border-bottom-color: #D26911; } - .page-navigator .space { - border: none; - padding: 5px 5px; } - -#footer { - padding: .8em 0 3.6em; - margin-top: 1em; - line-height: 2.5; - color: #6E7173; - text-align: center; } - #footer span { - font-size: .9em; } - -/* for archive page starts*/ -.post-archive { - font-size: 15px; - line-height: 2; - padding-bottom: .8em; } - .post-archive h2 { - margin: 0; - font: bold 25px / 1.1 "ff-tisa-web-pro", Cambria, "Times New Roman", Georgia, Times, sans-serif; } - .post-archive .date { - padding-right: .7em; } - -/* for archive page ends*/ -/* middle*/ -@media print, screen and (max-width: 48em) { - .body_container { - padding: 0 30px; } - .content_container { - padding-right: 15px; } - .hidden_mid_and_down { - display: none !important; } - #sidebar { - border-left-width: 0px; } - #header .site-name { - margin-bottom: 20px; - text-align: center; } - #header #nav-menu { - position: relative; - text-align: center; } - #header #nav-menu a { - padding: 0 15px; - line-height: 27px; - height: 27px; - font-size: 13px; } } - -/* small*/ -@media print, screen and (max-width: 35.5em) { - .body_container { - padding: 0 20px; } - .content_container { - padding-right: 0; } } - -blockquote, .stressed { - -moz-box-sizing: border-box; - box-sizing: border-box; - margin: 2.5em 0; - padding: 0 0 0 50px; - color: #555; - border-left: none; } - -blockquote::before, .stressed-quote::before { - content: "\201C"; - display: block; - font-family: times; - font-style: normal; - font-size: 48px; - color: #444; - font-weight: bold; - line-height: 30px; - margin-left: -50px; - position: absolute; } - -strong, b, em { - font-weight: bold; } - -pre { - margin: 2em 0; } - -.hidden1 { - display: none; } - -/* back-to-top rocket*/ -@media print, screen and (min-width: 48em) { - #rocket { - position: fixed; - right: 50px; - bottom: 50px; - display: block; - visibility: hidden; - width: 26px; - height: 48px; - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAB8CAYAAAB356CJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAbdSURBVHja5NlbbBRVGAfw5VID+LAK8cEoxqTgmw8kPPhwipTGxJTDUAVBQBMNKtZboiDE2ES8pFEjGhNkkCrin3JbZo4YCqloUOoKJCDIRWyRAgW6R3dobU2bJtj6+eCMTqczs2d3Zh6Mm3xpdvc7++vMnHNmzvlSRJQqJgA8B8AC8EQx7YoBxgD4CAC54i0Ao2KDAIwCsNGDOPF6nNBLAYgTiyNDAKYDGCwA/Q7gtpIhAKMBHC+AOPF5FGiBIuLEXaVCR4uEzKIhAHcViRCAP4OuVRi0pgSIACwvFurw/ohhGJTP56m7u5vy+TwZhuEHHVKGANzmh3R3d48IH2wQwPWq0CIv5ByJN/L5vN9RzVKF3vQ29kOcULlOQZAZ8YjWq0JHI1wjAvClKnTJr+sq9joCcEoV6itxDDmRU4UoYvT8f6GeiFCXKpSLCJ1XhU5GhI6oQs0RoT2qUENESFeFlkeEXlCFZkeEqlWhWyNCtxSE7GdsPSL0AYAxgRCACQB2xzAzEAABYMIIyEYOxIQ4sR/AOC+UiRlxYvM/EID5CSFO1DjQoYShFmfFMJgwdC0FYHzCCAEYck5dZ8LQWQdCwpAe19xWKCocqAzA1YSQiwBGuwfs2yHJpwDcEBJHQtqu9s4MU0KSHy+wBF0c1NsATPabVL/ye6IBML4AVAbgik/bvUGz9zyf5HrFTY9VPm0XBkFlAH7xrN5uVYQmAuh3P0Q6M3fQje81V/LWIne+1gY9oPglTwLQai+Wby8SugnAj/Y2W7nqqnyUz2cagDb7P24DoAXshI2Nsl9XZXdXb/etintjMBswVrJxQ0H3rMG4oYEAaOA/e+rqAqC6uKHyAKg8VsjGDnqQg7Hve9tQrQeqTQpKuybOfgDpRCDParAhkZKBC5pmQ9MShWysvtg2RSOZTKYu0WqLYRhjTdMUQghqbGxMrtpimuYuIQQJIWj79u3JVFsMw3jHQYQQfhuC0asthmFUCiGG3JAQgjZv3hxftaW5uXmMEOJnLyKEoK1bt8ZXbTEMY5kfIoSgHTt2xFdtEUK0BkE7d+6Mp9piGMY9QYgQgkzTjKfaYprmJvcPn/vhOHV8+D511j5EuUWzqXPZEmpd9x59/102WrVFCPGrG7myopZkzUyS2ox/Ijf3bjq/8mkvpl5tMQzjDvfRdKx7l+TcmZR7bAH1nThGf167Rn0njlHn0gcoV1NJrWvXlFZtMQzjaTfU+eQSknMqqP+n0+R+9Z05RXJOBXUsW1xatcUwjAY3lLu/iuScCvJ7SW0GXVlUXVq1xTTN/cOghfcGH5E2w++I1Kot3vFzceP6vy++5xrlli6gXM1MOvOxXlq1RQiR946by6tXkpw7vNfJmko698qL1NzUVFq1RQgx4DdIL2z7lDqfephyD2l05dlH6ELjRj9EvdoSNiMozA7qtQlVSAjx34H6IkJdqlBXROi86oBtjwgdUYUOR4T2qEJmREhXnVTrI0IvqEJLIg7YalWoXAUKqSwXrrZIzsZIzvSfT5woCTr2zdckOftAchZcbZGcTZCc7ZacUfu+vQWhTCYzAjq9vZEkZyQ5E5KzkdUWGzlgJ9GFjetLgtrerXcgkpztl5yN80IZVwJdWvVMQcizqiAAdPHZR90QSc7+rbZIzuZ7vqTcfZXUdvp0KOR9/j78bQvlaiq9EEnOahzokM+X1P7FnlBoy5Ytw69P4yd+CEnOWlKSs9GSs0G/hI41bxQ1WNtffj4IupaSnI0P+JJyD1bT8aNHlbr24ZYWys2rCoKGnFPXGYS1N+1S6nFnPtaDEJKcnXUgBCVdfrHWF9q2bdswqGPZ4jBId6DZIUnUnm0J7Qgnd5lhCEnOKhyoTHJ2NSjx0qurQifTCytqw5CLkrPR7gH7dkhy6HaZ5OzbkLarvTPDlJDkRQWg+UG9TXI22W9S/conWUrOrisAjbVPkbft3qDZe55P8qsqmx6SsxU+bRcGQWWSs19ciX9Izm5WhG6UnPW52vY4M3fQje81V3JR1RbJ2Vr32Cl0h50kOWuVnHVIzm4vErpJcvaj5MySnKlVWyRnw7bHLF1L9WbTWm823dabTZP9V7N0bUQ7yVnp1RZL16p69k0eshHqzaapZ9/kIUvX4q22WLqW7cpMJzfUlZlOlq5l44YGrQ3VwyBrQzVZujYYNzRg6Rr1tkz8G2qZSJaukaVrA7GfOkvX6LemqdSbTdNvTVMdKPZTV2fpGl3dNIt6s2m6ummWA9XFDZXbP0zdn93pIGTpWnncUMrStYMugOz3qSSgWg9UmxSUtnSt30b67feJQClL1xpsqMH5LClomg1NSxpKWbpW736v0v6vAQCo4CbBrd8RBQAAAABJRU5ErkJggg==") no-repeat 50% 0; - opacity: 0; - -webkit-transition: visibility 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335), opacity 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335), -webkit-transform 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335); - -moz-transition: visibility 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335), opacity 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335), -moz-transform 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335); - transition: visibility 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335), opacity 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335), transform 0.6s cubic-bezier(0.6, 0.04, 0.98, 0.335); } - #rocket i { - display: block; - margin-top: 48px; - height: 14px; - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAB8CAYAAAB356CJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAbdSURBVHja5NlbbBRVGAfw5VID+LAK8cEoxqTgmw8kPPhwipTGxJTDUAVBQBMNKtZboiDE2ES8pFEjGhNkkCrin3JbZo4YCqloUOoKJCDIRWyRAgW6R3dobU2bJtj6+eCMTqczs2d3Zh6Mm3xpdvc7++vMnHNmzvlSRJQqJgA8B8AC8EQx7YoBxgD4CAC54i0Ao2KDAIwCsNGDOPF6nNBLAYgTiyNDAKYDGCwA/Q7gtpIhAKMBHC+AOPF5FGiBIuLEXaVCR4uEzKIhAHcViRCAP4OuVRi0pgSIACwvFurw/ohhGJTP56m7u5vy+TwZhuEHHVKGANzmh3R3d48IH2wQwPWq0CIv5ByJN/L5vN9RzVKF3vQ29kOcULlOQZAZ8YjWq0JHI1wjAvClKnTJr+sq9joCcEoV6itxDDmRU4UoYvT8f6GeiFCXKpSLCJ1XhU5GhI6oQs0RoT2qUENESFeFlkeEXlCFZkeEqlWhWyNCtxSE7GdsPSL0AYAxgRCACQB2xzAzEAABYMIIyEYOxIQ4sR/AOC+UiRlxYvM/EID5CSFO1DjQoYShFmfFMJgwdC0FYHzCCAEYck5dZ8LQWQdCwpAe19xWKCocqAzA1YSQiwBGuwfs2yHJpwDcEBJHQtqu9s4MU0KSHy+wBF0c1NsATPabVL/ye6IBML4AVAbgik/bvUGz9zyf5HrFTY9VPm0XBkFlAH7xrN5uVYQmAuh3P0Q6M3fQje81V/LWIne+1gY9oPglTwLQai+Wby8SugnAj/Y2W7nqqnyUz2cagDb7P24DoAXshI2Nsl9XZXdXb/etintjMBswVrJxQ0H3rMG4oYEAaOA/e+rqAqC6uKHyAKg8VsjGDnqQg7Hve9tQrQeqTQpKuybOfgDpRCDParAhkZKBC5pmQ9MShWysvtg2RSOZTKYu0WqLYRhjTdMUQghqbGxMrtpimuYuIQQJIWj79u3JVFsMw3jHQYQQfhuC0asthmFUCiGG3JAQgjZv3hxftaW5uXmMEOJnLyKEoK1bt8ZXbTEMY5kfIoSgHTt2xFdtEUK0BkE7d+6Mp9piGMY9QYgQgkzTjKfaYprmJvcPn/vhOHV8+D511j5EuUWzqXPZEmpd9x59/102WrVFCPGrG7myopZkzUyS2ox/Ijf3bjq/8mkvpl5tMQzjDvfRdKx7l+TcmZR7bAH1nThGf167Rn0njlHn0gcoV1NJrWvXlFZtMQzjaTfU+eQSknMqqP+n0+R+9Z05RXJOBXUsW1xatcUwjAY3lLu/iuScCvJ7SW0GXVlUXVq1xTTN/cOghfcGH5E2w++I1Kot3vFzceP6vy++5xrlli6gXM1MOvOxXlq1RQiR946by6tXkpw7vNfJmko698qL1NzUVFq1RQgx4DdIL2z7lDqfephyD2l05dlH6ELjRj9EvdoSNiMozA7qtQlVSAjx34H6IkJdqlBXROi86oBtjwgdUYUOR4T2qEJmREhXnVTrI0IvqEJLIg7YalWoXAUKqSwXrrZIzsZIzvSfT5woCTr2zdckOftAchZcbZGcTZCc7ZacUfu+vQWhTCYzAjq9vZEkZyQ5E5KzkdUWGzlgJ9GFjetLgtrerXcgkpztl5yN80IZVwJdWvVMQcizqiAAdPHZR90QSc7+rbZIzuZ7vqTcfZXUdvp0KOR9/j78bQvlaiq9EEnOahzokM+X1P7FnlBoy5Ytw69P4yd+CEnOWlKSs9GSs0G/hI41bxQ1WNtffj4IupaSnI0P+JJyD1bT8aNHlbr24ZYWys2rCoKGnFPXGYS1N+1S6nFnPtaDEJKcnXUgBCVdfrHWF9q2bdswqGPZ4jBId6DZIUnUnm0J7Qgnd5lhCEnOKhyoTHJ2NSjx0qurQifTCytqw5CLkrPR7gH7dkhy6HaZ5OzbkLarvTPDlJDkRQWg+UG9TXI22W9S/conWUrOrisAjbVPkbft3qDZe55P8qsqmx6SsxU+bRcGQWWSs19ciX9Izm5WhG6UnPW52vY4M3fQje81V3JR1RbJ2Vr32Cl0h50kOWuVnHVIzm4vErpJcvaj5MySnKlVWyRnw7bHLF1L9WbTWm823dabTZP9V7N0bUQ7yVnp1RZL16p69k0eshHqzaapZ9/kIUvX4q22WLqW7cpMJzfUlZlOlq5l44YGrQ3VwyBrQzVZujYYNzRg6Rr1tkz8G2qZSJaukaVrA7GfOkvX6LemqdSbTdNvTVMdKPZTV2fpGl3dNIt6s2m6ummWA9XFDZXbP0zdn93pIGTpWnncUMrStYMugOz3qSSgWg9UmxSUtnSt30b67feJQClL1xpsqMH5LClomg1NSxpKWbpW736v0v6vAQCo4CbBrd8RBQAAAABJRU5ErkJggg==") no-repeat 50% -48px; - opacity: .5; - -webkit-transition: -webkit-transform .2s; - -moz-transition: -moz-transform .2s; - transition: transform .2s; - -webkit-transform-origin: 50% 0; - -moz-transform-origin: 50% 0; - transform-origin: 50% 0; } - #rocket:hover { - background-position: 50% -62px; } - #rocket:hover i { - background-position: 50% 100%; - -webkit-animation: flaming .7s infinite; - -moz-animation: flaming .7s infinite; - animation: flaming .7s infinite; } - #rocket.show { - visibility: visible; - opacity: 1; } - #rocket.launch { - background-position: 50% -62px; - opacity: 0; - -webkit-transform: translateY(-500px); - -moz-transform: translateY(-500px); - -ms-transform: translateY(-500px); - transform: translateY(-500px); - pointer-events: none; } - #rocket.launch i { - background-position: 50% 100%; - -webkit-transform: scale(1.4, 3.2); - -moz-transform: scale(1.4, 3.2); - transform: scale(1.4, 3.2); } } - -/* ******************************************************* -* Process timelime, (homepage) -******************************************************* */ -#process { - padding: 80px 0; - background-color: #fff; } - -#process .col-md-2 i { - font-size: 50px; - position: relative; - top: 10px; } - -#process .timeline-centered { - position: relative; - margin-bottom: 30px; } - -#process .timeline-centered::before, #process .timeline-centered::after, -#process .timeline-centered::before, #process .timeline-centered::after { - content: " "; - display: table; } - -#process .timeline-centered::after { - clear: both; } - -#process .timeline-centered::before { - content: ''; - position: absolute; - display: block; - width: 4px; - background: #f5f5f6; - /*left: 50%;*/ - top: 50px; - bottom: 50px; - margin-left: 10px; } - -#process .timeline-centered .timeline-entry { - position: relative; - /*width: 50%; - float: right;*/ - margin-top: 5px; - margin-left: 20px; - margin-bottom: 10px; - clear: both; } - -#process .timeline-centered .timeline-entry::before, -#process .timeline-centered .timeline-entry::after { - content: " "; - display: table; } - -#process .timeline-centered .timeline-entry::after { - clear: both; } - -#process .timeline-centered .timeline-entry.begin { - margin-bottom: 0; } - -#process .timeline-centered .timeline-entry.left-aligned { - float: left; } - -#process .timeline-centered .timeline-entry.left-aligned .timeline-entry-inner { - margin-left: 0; - margin-right: -18px; } - -#process .timeline-centered .timeline-entry.left-aligned .timeline-entry-inner .timeline-time { - left: auto; - right: -100px; - text-align: left; } - -#process span.number { - font-family: 'Georgia', serif, Helvetica, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans CN", "WenQuanYi Micro Hei", Arial, sans-serif; - font-style: italic; - font-size: 20px; - line-height: 0; - color: #E7E7E5; - position: relative; - top: -4px; } - -#process .timeline-centered .timeline-entry.left-aligned .timeline-entry-inner .timeline-icon { - float: right; } - -#process .timeline-centered .timeline-entry.left-aligned .timeline-entry-inner .timeline-label { - margin-left: 0; - margin-right: 70px; } - -#process .timeline-centered .timeline-entry.left-aligned .timeline-entry-inner .timeline-label::after { - left: auto; - right: 0; - margin-left: 0; - margin-right: -9px; - -moz-transform: rotate(180deg); - -o-transform: rotate(180deg); - -webkit-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg); } - -.timeline-label p { - font-family: Helvetica, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans CN", "WenQuanYi Micro Hei", Arial, sans-serif; - margin-bottom: 3px; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner { - position: relative; - margin-left: -20px; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner::before, -#process .timeline-centered .timeline-entry .timeline-entry-inner::after { - content: " "; - display: table; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner::after { - clear: both; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-time { - position: absolute; - left: -100px; - text-align: right; - padding: 10px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-time > span { - display: block; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-time > span:first-child { - font-size: 15px; - font-weight: bold; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-time > span:last-child { - font-size: 12px; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon { - background: #fff; - color: #737881; - display: block; - width: 40px; - height: 40px; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; - -webkit-border-radius: 20px; - -moz-border-radius: 20px; - border-radius: 20px; - text-align: center; - border: 4px solid #F5F5F6; - line-height: 40px; - font-size: 15px; - float: left; - position: absolute; - top: 50%; - margin-top: -20px; - margin-left: -9px; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-primary { - background-color: #303641; - color: #fff; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label { - position: relative; - background: #eee; - padding: 30px; - margin-left: 60px; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; } - -#process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label::after { - content: ''; - display: block; - position: absolute; - width: 0; - height: 0; - border-style: solid; - border-width: 9px 9px 9px 0; - border-color: transparent #eee transparent transparent; - left: 0; - top: 50%; - margin-top: -9px; - margin-left: -9px; } - -#process .line { - position: absolute; - display: block; - width: 4px; - background: #eee; - top: -3%; - right: -30px; - bottom: -3%; } - -#process .present, -#process .born { - font-size: 14px; - font-family: 'Georgia', serif, Helvetica, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans CN", "WenQuanYi Micro Hei", Arial, sans-serif; - font-style: italic; - color: #333; - padding: 10px; - background-color: #eee; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; } - -#process .present::after, -#process .born::after { - left: 100%; - top: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - border-color: rgba(136, 183, 213, 0); - border-left-color: #eee; - border-width: 10px; - margin-top: -10px; } - -#process .present { - position: absolute; - top: -3%; - right: 0; - margin-top: -20px; - line-height: 100%; } - -#process .born { - position: absolute; - bottom: -3%; - right: 0; - margin-bottom: -20px; - line-height: 100%; } - -#process .dot_tp { - position: absolute; - top: -3%; - right: -35px; - background-color: transparent; - height: 15px; - width: 15px; - margin-top: -13px; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border-radius: 50%; - border: 3px solid #eee; } - -#process .dot_bt { - position: absolute; - bottom: -3%; - right: -35px; - background-color: transparent; - height: 15px; - width: 15px; - margin-bottom: -13px; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border-radius: 50%; - border: 3px solid #eee; } - -@media (max-width: 768px) { - #process .line { - right: 10px; } - #process .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label { - margin-right: 30px; - margin-left: 45px; - padding: 20px; } - #process .timeline-centered .timeline-entry { - margin-right: 20px; } - #process .dot_tp, - #process .dot_bt { - right: 5px; } - #process .present, - #process .born { - right: 35px; } } - -/* read more*/ -.readmore a { - font-size: 14px; - color: #444; - margin: -10px 0; - padding: 5px 10px; - border: 1px solid #ddd; - border-radius: 5px; - float: right; } - .readmore a:after { - font-family: "FontAwesome"; - content: "\f101"; - padding-left: 0.3em; } - .readmore a:hover { - background: #F8F8F8; - border-bottom-color: #D26911; } - -/* syntax highlight*/ -figure.highlight, -.codeblock { - background: #f7f8f8; - margin: 10px 0; - line-height: 1.1em; - color: #333; - padding-top: 15px; - overflow: hidden; } - figure.highlight table, - .codeblock table { - display: block; - width: 100%; } - figure.highlight pre, - figure.highlight .gutter, - figure.highlight .code, - figure.highlight .tag, - .codeblock pre, - .codeblock .gutter, - .codeblock .code, - .codeblock .tag { - background-color: inherit; - font-family: Menlo, Consolas, monospace; - border: none; - padding: 0; - margin: 0; - cursor: text; } - figure.highlight .gutter, - figure.highlight .code, - .codeblock .gutter, - .codeblock .code { - vertical-align: top; } - figure.highlight.plain .gutter, - .codeblock.plain .gutter { - display: none; } - figure.highlight figcaption, - .codeblock figcaption { - font-size: 13px; - padding: 0 15px 20px; - margin: 0; - background: #f7f8f8; - color: #999999; } - figure.highlight figcaption a, - .codeblock figcaption a { - float: right; - color: #01579f; } - figure.highlight .gutter, - .codeblock .gutter { - background: #f7f8f8; - border-right: 1px solid #e6e6e6; - padding: 0.3em 15px; } - figure.highlight .code, - .codeblock .code { - padding: 0.3em 15px 0.3em 1em; - width: 100%; } - figure.highlight .code pre, - .codeblock .code pre { - max-width: 700px; - overflow-x: auto; - overflow-y: hidden; } - figure.highlight .line, - .codeblock .line { - height: 1.3em; - font-size: 13px; } - -.gist .line, -.gist .line-number { - font-family: Menlo, Consolas, monospace; - font-size: 1em; - margin: 0 0 5px 0; } - -.highlight .comment { - color: #969896; } - -.highlight .string { - color: #183691; } - -.highlight .keyword { - color: #a71d5d; } - -.highlight.apacheconf .code .common, -.highlight.apacheconf .code .nomarkup, -.highlight.apacheconf .code .attribute, -.highlight.apacheconf .code .variable, -.highlight.apacheconf .code .cbracket, -.highlight.apacheconf .code .keyword { - color: #0086b3; } - -.highlight.apacheconf .code .sqbracket { - color: #df5000; } - -.highlight.apacheconf .code .section, -.highlight.apacheconf .code .tag { - color: #63a35c; } - -.highlight.bash .code .shebang { - color: #969896; } - -.highlight.bash .code .literal, -.highlight.bash .code .built_in { - color: #0086b3; } - -.highlight.bash .code .variable { - color: #333; } - -.highlight.bash .code .title { - color: #795da3; } - -.highlight.coffeescript .code .title { - color: #795da3; } - -.highlight.coffeescript .code .literal, -.highlight.coffeescript .code .built_in, -.highlight.coffeescript .code .number { - color: #0086b3; } - -.highlight.coffeescript .code .reserved, -.highlight.coffeescript .code .attribute { - color: #1d3e81; } - -.highlight.coffeescript .code .subst, -.highlight.coffeescript .code .regexp, -.highlight.coffeescript .code .attribute { - color: #df5000; } - -.highlight.cpp .code .preprocessor, -.highlight.c .code .preprocessor { - color: #df5000; } - -.highlight.cpp .code .meta-keyword, -.highlight.c .code .meta-keyword { - color: #a71d5d; } - -.highlight.cpp .code .title, -.highlight.c .code .title { - color: #795da3; } - -.highlight.cpp .code .number, -.highlight.cpp .code .built_in, -.highlight.c .code .number, -.highlight.c .code .built_in { - color: #0086b3; } - -.highlight.cs .code .preprocessor, -.highlight.cs .code .preprocessor .keyword { - color: #333; } - -.highlight.cs .code .title { - color: #795da3; } - -.highlight.cs .code .number, -.highlight.cs .code .built_in { - color: #0086b3; } - -.highlight.cs .code .xmlDocTag, -.highlight.cs .code .doctag { - color: #63a35c; } - -.highlight.css .code .at_rule, -.highlight.css .code .important, -.highlight.css .code .meta { - color: #a71d5d; } - -.highlight.css .code .attribute, -.highlight.css .code .hexcolor, -.highlight.css .code .number, -.highlight.css .code .function { - color: #0086b3; } - -.highlight.css .code .attr_selector, -.highlight.css .code .value { - color: #333; } - -.highlight.css .code .id, -.highlight.css .code .class, -.highlight.css .code .pseudo, -.highlight.css .code .selector-pseudo { - color: #795da3; } - -.highlight.css .code .tag, -.highlight.css .code .selector-tag { - color: #63a35c; } - -.highlight.diff .code .chunk, -.highlight.diff .code .meta { - color: #795da3; - font-weight: bold; } - -.highlight.diff .code .addition { - color: #55a532; - background-color: #eaffea; } - -.highlight.diff .code .deletion { - color: #bd2c00; - background-color: #ffecec; } - -.highlight.http .code .attribute, -.highlight.http .code .attr { - color: #183691; } - -.highlight.http .code .literal { - color: #0086b3; } - -.highlight.http .code .request { - color: #a71d5d; } - -.highlight.ini .code .title, -.highlight.ini .code .section { - color: #795da3; } - -.highlight.ini .code .setting, -.highlight.ini .code .attr { - color: #a71d5d; } - -.highlight.ini .code .value, -.highlight.ini .code .keyword { - color: #333; } - -.highlight.java .code .title { - color: #795da3; } - -.highlight.java .code .javadoc { - color: #969896; } - -.highlight.java .code .meta, -.highlight.java .code .annotation, -.highlight.java .code .javadoctag { - color: #a71d5d; } - -.highlight.java .code .number { - color: #0086b3; } - -.highlight.java .code .params { - color: #1d3e81; } - -.highlight.js .code .built_in, -.highlight.js .code .title { - color: #795da3; } - -.highlight.js .code .javadoc { - color: #969896; } - -.highlight.js .code .tag, -.highlight.js .code .javadoctag { - color: #a71d5d; } - -.highlight.js .code .tag .title { - color: #333; } - -.highlight.js .code .regexp { - color: #df5000; } - -.highlight.js .code .literal, -.highlight.js .code .number { - color: #0086b3; } - -.highlight.json .code .attribute { - color: #183691; } - -.highlight.json .code .number, -.highlight.json .code .literal { - color: #0086b3; } - -.highlight.mak .code .constant { - color: #333; } - -.highlight.mak .code .title { - color: #795da3; } - -.highlight.mak .code .keyword, -.highlight.mak .code .meta-keyword { - color: #0086b3; } - -.highlight.md .code .value, -.highlight.md .code .link_label, -.highlight.md .code .strong, -.highlight.md .code .emphasis, -.highlight.md .code .blockquote, -.highlight.md .code .quote, -.highlight.md .code .section { - color: #183691; } - -.highlight.md .code .link_reference, -.highlight.md .code .symbol, -.highlight.md .code .code { - color: #0086b3; } - -.highlight.md .code .link_url, -.highlight.md .code .link { - text-decoration: underline; } - -.highlight.nginx .code .title, -.highlight.nginx .code .attribute { - color: #a71d5d; } - -.highlight.nginx .code .built_in, -.highlight.nginx .code .literal { - color: #0086b3; } - -.highlight.nginx .code .regexp { - color: #183691; } - -.highlight.nginx .code .variable { - color: #333; } - -.highlight.objectivec .code .preprocessor, -.highlight.objectivec .code .meta { - color: #a71d5d; } - .highlight.objectivec .code .preprocessor .title, - .highlight.objectivec .code .meta .title { - color: #df5000; } - -.highlight.objectivec .code .meta-string { - color: #183691; } - -.highlight.objectivec .code .title { - color: #795da3; } - -.highlight.objectivec .code .literal, -.highlight.objectivec .code .number, -.highlight.objectivec .code .built_in { - color: #0086b3; } - -.highlight.perl .code .sub { - color: #795da3; } - -.highlight.perl .code .title { - color: #795da3; } - -.highlight.perl .code .regexp { - color: #df5000; } - -.highlight.php .code .phpdoc, -.highlight.php .code .doctag { - color: #a71d5d; } - -.highlight.php .code .regexp { - color: #df5000; } - -.highlight.php .code .literal, -.highlight.php .code .number { - color: #0086b3; } - -.highlight.php .code .title { - color: #795da3; } - -.highlight.python .code .decorator, -.highlight.python .code .title, -.highlight.python .code .meta { - color: #795da3; } - -.highlight.python .code .number { - color: #0086b3; } - -.highlight.ruby .code .parent, -.highlight.ruby .code .title { - color: #795da3; } - -.highlight.ruby .code .prompt, -.highlight.ruby .code .constant, -.highlight.ruby .code .number, -.highlight.ruby .code .subst .keyword, -.highlight.ruby .code .symbol { - color: #0086b3; } - -.highlight.sql .built_in { - color: #a71d5d; } - -.highlight.sql .number { - color: #0086b3; } - -.highlight.xml .tag, .highlight.html .tag { - color: #333; } - -.highlight.xml .value, .highlight.html .value { - color: #183691; } - -.highlight.xml .attribute, -.highlight.xml .attr, .highlight.html .attribute, -.highlight.html .attr { - color: #795da3; } - -.highlight.xml .title, -.highlight.xml .name, .highlight.html .title, -.highlight.html .name { - color: #63a35c; } - -.highlight.puppet .title { - color: #795da3; } - -.highlight.puppet .function { - color: #0086b3; } - -.highlight.puppet .name { - color: #a71d5d; } - -.highlight.puppet .attr { - color: #0086b3; } - -.highlight.less .tag, -.highlight.less .at_rule { - color: #a71d5d; } - -.highlight.less .number, -.highlight.less .hexcolor, -.highlight.less .function, -.highlight.less .attribute { - color: #0086b3; } - -.highlight.less .built_in { - color: #df5000; } - -.highlight.less .id, -.highlight.less .pseudo, -.highlight.less .class, -.highlight.less .selector-id, -.highlight.less .selector-class, -.highlight.less .selector-tag { - color: #795da3; } - -.highlight.scss .tag, -.highlight.scss .at_rule, -.highlight.scss .important { - color: #a71d5d; } - -.highlight.scss .number, -.highlight.scss .hexcolor, -.highlight.scss .function, -.highlight.scss .attribute { - color: #0086b3; } - -.highlight.scss .variable { - color: #333; } - -.highlight.scss .built_in { - color: #df5000; } - -.highlight.scss .id, -.highlight.scss .pseudo, -.highlight.scss .class, -.highlight.scss .preprocessor, -.highlight.scss .selector-class, -.highlight.scss .selector-id { - color: #795da3; } - -.highlight.scss .tag, -.highlight.scss .selector-tag { - color: #63a35c; } - -.highlight.stylus .at_rule { - color: #a71d5d; } - -.highlight.stylus .tag, -.highlight.stylus .selector-tag { - color: #63a35c; } - -.highlight.stylus .number, -.highlight.stylus .hexcolor, -.highlight.stylus .attribute, -.highlight.stylus .params { - color: #0086b3; } - -.highlight.stylus .class, -.highlight.stylus .id, -.highlight.stylus .pseudo, -.highlight.stylus .title, -.highlight.stylus .selector-id, -.highlight.stylus .selector-pseudo, -.highlight.stylus .selector-class { - color: #795da3; } - -.highlight.go .typename { - color: #a71d5d; } - -.highlight.go .built_in, -.highlight.go .constant { - color: #0086b3; } - -.highlight.swift .preprocessor { - color: #a71d5d; } - -.highlight.swift .title { - color: #795da3; } - -.highlight.swift .built_in, -.highlight.swift .number, -.highlight.swift .type { - color: #0086b3; } - -.highlight.yml .line, -.highlight.yml .attr { - color: #63a35c; } - -.highlight.yml .line, -.highlight.yml .string, -.highlight.yml .type, -.highlight.yml .literal, -.highlight.yml .meta { - color: #183691; } - -.highlight.yml .number { - color: #0086b3; } - -/* post navigator*/ -.post-nav { - overflow: hidden; - margin-top: 15px; - margin-bottom: 20px; - padding: 10px; - white-space: nowrap; - border-top: 1px solid #eee; } - .post-nav a { - display: inline-block; - line-height: 25px; - font-size: 15px; - color: #555; - border-bottom: none; - float: left; } - .post-nav a.pre { - float: left; } - .post-nav a.pre:before { - font-family: "FontAwesome"; - content: "\f0d9"; - padding-right: 0.3em; } - .post-nav a.next { - float: right; } - .post-nav a.next:after { - font-family: "FontAwesome"; - content: "\f0da"; - padding-left: 0.3em; } - .post-nav a:hover { - border-bottom: none; - color: #222; } - -/* toc*/ -.toc-article { - border: 1px solid #bbb; - border-radius: 7px; - margin: 1.1em 0 0 2em; - padding: 0.7em 0.7em 0 0.7em; - max-width: 40%; } - -.toc-title { - font-size: 120%; } - -#toc { - line-height: 1em; - float: right; } - #toc .toc { - padding: 0; - margin: 0.5em; - line-height: 1.8em; } - #toc .toc li { - list-style-type: none; } - #toc .toc-child { - margin-left: 1em; - padding-left: 0; } - -/* table*/ -table { - margin: auto auto 15px; - width: 100%; - background: transparent; - border-collapse: collapse; - border-spacing: 0; - text-align: left; } - table th { - font-weight: bold; - padding: 5px 10px; - border-bottom: 2px solid #909ba2; } - table td { - padding: 5px 10px; } - table tr:nth-child(2n) { - background: #f7f8f8; } - -/* article-share*/ -.article-share-link { - cursor: pointer; - float: right; - margin-left: 20px; } - .article-share-link:before { - font-family: "FontAwesome"; - content: "\f064"; - padding-right: 6px; } - -.article-share-box { - position: absolute; - display: none; - background: #fff; - box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.2); - border-radius: 3px; - margin-left: -145px; - overflow: hidden; - z-index: 1; } - .article-share-box.on { - display: block; } - -.article-share-input { - width: 100%; - background: none; - box-sizing: border-box; - font: 14px "Helvetica Neue", Helvetica, Arial, sans-serif; - padding: 0 15px; - color: #555; - outline: none; - border: 1px solid #ddd; - border-radius: 3px 3px 0 0; - height: 36px; - line-height: 36px; } - -.article-share-links { - clearfix: none; - background: #eee; } - -.article-share-element, .article-share-twitter, .article-share-facebook, .article-share-weibo, .article-share-qrcode { - width: 50px; - height: 36px; - display: block; - float: left; - position: relative; - color: #999; - text-shadow: 0 1px #fff; } - .article-share-element:before, .article-share-twitter:before, .article-share-facebook:before, .article-share-weibo:before, .article-share-qrcode:before { - font-size: 20px; - font-family: "FontAwesome"; - width: 20px; - height: 20px; - position: absolute; - top: 50%; - left: 50%; - margin-top: -10px; - margin-left: -10px; - text-align: center; } - .article-share-element:hover, .article-share-twitter:hover, .article-share-facebook:hover, .article-share-weibo:hover, .article-share-qrcode:hover { - color: #fff; } - -.article-share-twitter:before { - content: "\f099"; } - -.article-share-twitter:hover { - background: #00aced; } - -.article-share-facebook:before { - content: "\f09a"; } - -.article-share-facebook:hover { - background: #3b5998; } - -.article-share-weibo:before { - content: "\f18a"; } - -.article-share-weibo:hover { - background: #d44137; } - -.article-share-qrcode:before { - content: "\f029"; } - -.article-share-qrcode:hover, .article-share-qrcode:active { - background: #38ad5a; } - .article-share-qrcode:hover ~ .qrcode, .article-share-qrcode:active ~ .qrcode { - display: block; - text-align: center; } - -.qrcode { - display: none; } - -/* search result*/ -ul.search-result-list { - padding-left: 10px; } - -a.search-result-title { - font-weight: bold; - font-size: 15px; - color: #555; } - -p.search-result { - color: #444; - text-align: justify; } - -em.search-keyword { - font-weight: bold; - font-style: normal; - color: #01579f; } - -/* Disqus Button */ -.disqus_click_btn { - line-height: 30px; - margin: 0; - min-width: 50px; - padding: 0 14px; - display: inline-block; - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 14px; - font-weight: 400; - letter-spacing: 0; - overflow: hidden; - will-change: box-shadow; - transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1); - outline: 0; - cursor: pointer; - text-decoration: none; - text-align: center; - vertical-align: middle; - border: 0; - background: rgba(158, 158, 158, 0.2); - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); - color: #fff; - background-color: #999999; - text-shadow: 0; } - -.post-copyright { - margin: 2em 0 0; - padding: 0.5em 1em; - border-left: 3px solid #FF1700; - background-color: #F9F9F9; - list-style: none; } - .post-copyright li { - margin: 8px 0; } diff --git a/css/style.styl b/css/style.styl deleted file mode 100644 index c51f8e4..0000000 --- a/css/style.styl +++ /dev/null @@ -1,89 +0,0 @@ -@import "nib" -@import "_variables" -@import "_util/mixin" -@import "_util/grid" - -global-reset() - -input, button - margin: 0 - padding: 0 - &::-moz-focus-inner - border: 0 - padding: 0 - -@font-face - font-family: FontAwesome - font-style: normal - font-weight: normal - src: url(font-icon-path + ".eot?v=#" + font-icon-version) - src: url(font-icon-path + ".eot?#iefix&v=#" + font-icon-version) format("embedded-opentype"), - url(font-icon-path + ".woff?v=#" + font-icon-version) format("woff"), - url(font-icon-path + ".ttf?v=#" + font-icon-version) format("truetype"), - url(font-icon-path + ".svg#fontawesomeregular?v=#" + font-icon-version) format("svg") - -html, body, #container - height: 100% - -body - background: color-background - font: font-size font-sans - -webkit-text-size-adjust: 100% - -.outer - clearfix() - max-width: (column-width + gutter-width) * columns + gutter-width - margin: 0 auto - padding: 0 gutter-width - -.inner - column(columns) - -.left, .alignleft - float: left - -.right, .alignright - float: right - -.clear - clear: both - -#container - position: relative - -.mobile-nav-on - overflow: hidden - -#wrap - height: 100% - width: 100% - position: absolute - top: 0 - left: 0 - transition: 0.2s ease-out - z-index: 1 - background: color-background - .mobile-nav-on & - left: mobile-nav-width - -if sidebar and sidebar isnt bottom - #main - @media mq-normal - column(main-column) - -if sidebar is left - @media mq-normal - #main - float: right - -@import "_extend" -@import "_partial/header" -@import "_partial/article" -@import "_partial/comment" -@import "_partial/archive" -@import "_partial/footer" -@import "_partial/highlight" -@import "_partial/mobile" - -if sidebar - @import "_partial/sidebar" \ No newline at end of file diff --git a/donate/index.html b/donate/index.html deleted file mode 100644 index bbd5113..0000000 --- a/donate/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Donate-Page - - - - - - - - - -
Donate
- -
-
-
- - - - diff --git a/fancybox/blank.gif b/fancybox/blank.gif deleted file mode 100644 index 35d42e8..0000000 Binary files a/fancybox/blank.gif and /dev/null differ diff --git a/fancybox/fancybox_loading.gif b/fancybox/fancybox_loading.gif deleted file mode 100644 index a03a40c..0000000 Binary files a/fancybox/fancybox_loading.gif and /dev/null differ diff --git a/fancybox/fancybox_loading@2x.gif b/fancybox/fancybox_loading@2x.gif deleted file mode 100644 index 9205aeb..0000000 Binary files a/fancybox/fancybox_loading@2x.gif and /dev/null differ diff --git a/fancybox/fancybox_overlay.png b/fancybox/fancybox_overlay.png deleted file mode 100644 index a439139..0000000 Binary files a/fancybox/fancybox_overlay.png and /dev/null differ diff --git a/fancybox/fancybox_sprite.png b/fancybox/fancybox_sprite.png deleted file mode 100644 index fd8d5ca..0000000 Binary files a/fancybox/fancybox_sprite.png and /dev/null differ diff --git a/fancybox/fancybox_sprite@2x.png b/fancybox/fancybox_sprite@2x.png deleted file mode 100644 index d0e4779..0000000 Binary files a/fancybox/fancybox_sprite@2x.png and /dev/null differ diff --git a/fancybox/helpers/fancybox_buttons.png b/fancybox/helpers/fancybox_buttons.png deleted file mode 100644 index 0787207..0000000 Binary files a/fancybox/helpers/fancybox_buttons.png and /dev/null differ diff --git a/fancybox/helpers/jquery.fancybox-buttons.css b/fancybox/helpers/jquery.fancybox-buttons.css deleted file mode 100644 index a26273a..0000000 --- a/fancybox/helpers/jquery.fancybox-buttons.css +++ /dev/null @@ -1,97 +0,0 @@ -#fancybox-buttons { - position: fixed; - left: 0; - width: 100%; - z-index: 8050; -} - -#fancybox-buttons.top { - top: 10px; -} - -#fancybox-buttons.bottom { - bottom: 10px; -} - -#fancybox-buttons ul { - display: block; - width: 166px; - height: 30px; - margin: 0 auto; - padding: 0; - list-style: none; - border: 1px solid #111; - border-radius: 3px; - -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); - background: rgb(50,50,50); - background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); - background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); -} - -#fancybox-buttons ul li { - float: left; - margin: 0; - padding: 0; -} - -#fancybox-buttons a { - display: block; - width: 30px; - height: 30px; - text-indent: -9999px; - background-color: transparent; - background-image: url('fancybox_buttons.png'); - background-repeat: no-repeat; - outline: none; - opacity: 0.8; -} - -#fancybox-buttons a:hover { - opacity: 1; -} - -#fancybox-buttons a.btnPrev { - background-position: 5px 0; -} - -#fancybox-buttons a.btnNext { - background-position: -33px 0; - border-right: 1px solid #3e3e3e; -} - -#fancybox-buttons a.btnPlay { - background-position: 0 -30px; -} - -#fancybox-buttons a.btnPlayOn { - background-position: -30px -30px; -} - -#fancybox-buttons a.btnToggle { - background-position: 3px -60px; - border-left: 1px solid #111; - border-right: 1px solid #3e3e3e; - width: 35px -} - -#fancybox-buttons a.btnToggleOn { - background-position: -27px -60px; -} - -#fancybox-buttons a.btnClose { - border-left: 1px solid #111; - width: 35px; - background-position: -56px 0px; -} - -#fancybox-buttons a.btnDisabled { - opacity : 0.4; - cursor: default; -} \ No newline at end of file diff --git a/fancybox/helpers/jquery.fancybox-buttons.js b/fancybox/helpers/jquery.fancybox-buttons.js deleted file mode 100644 index 352bb5f..0000000 --- a/fancybox/helpers/jquery.fancybox-buttons.js +++ /dev/null @@ -1,122 +0,0 @@ - /*! - * Buttons helper for fancyBox - * version: 1.0.5 (Mon, 15 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * buttons: { - * position : 'top' - * } - * } - * }); - * - */ -;(function ($) { - //Shortcut for fancyBox object - var F = $.fancybox; - - //Add helper object - F.helpers.buttons = { - defaults : { - skipSingle : false, // disables if gallery contains single image - position : 'top', // 'top' or 'bottom' - tpl : '
' - }, - - list : null, - buttons: null, - - beforeLoad: function (opts, obj) { - //Remove self if gallery do not have at least two items - - if (opts.skipSingle && obj.group.length < 2) { - obj.helpers.buttons = false; - obj.closeBtn = true; - - return; - } - - //Increase top margin to give space for buttons - obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; - }, - - onPlayStart: function () { - if (this.buttons) { - this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); - } - }, - - onPlayEnd: function () { - if (this.buttons) { - this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); - } - }, - - afterShow: function (opts, obj) { - var buttons = this.buttons; - - if (!buttons) { - this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); - - buttons = { - prev : this.list.find('.btnPrev').click( F.prev ), - next : this.list.find('.btnNext').click( F.next ), - play : this.list.find('.btnPlay').click( F.play ), - toggle : this.list.find('.btnToggle').click( F.toggle ), - close : this.list.find('.btnClose').click( F.close ) - } - } - - //Prev - if (obj.index > 0 || obj.loop) { - buttons.prev.removeClass('btnDisabled'); - } else { - buttons.prev.addClass('btnDisabled'); - } - - //Next / Play - if (obj.loop || obj.index < obj.group.length - 1) { - buttons.next.removeClass('btnDisabled'); - buttons.play.removeClass('btnDisabled'); - - } else { - buttons.next.addClass('btnDisabled'); - buttons.play.addClass('btnDisabled'); - } - - this.buttons = buttons; - - this.onUpdate(opts, obj); - }, - - onUpdate: function (opts, obj) { - var toggle; - - if (!this.buttons) { - return; - } - - toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); - - //Size toggle button - if (obj.canShrink) { - toggle.addClass('btnToggleOn'); - - } else if (!obj.canExpand) { - toggle.addClass('btnDisabled'); - } - }, - - beforeClose: function () { - if (this.list) { - this.list.remove(); - } - - this.list = null; - this.buttons = null; - } - }; - -}(jQuery)); diff --git a/fancybox/helpers/jquery.fancybox-media.js b/fancybox/helpers/jquery.fancybox-media.js deleted file mode 100644 index 62737a5..0000000 --- a/fancybox/helpers/jquery.fancybox-media.js +++ /dev/null @@ -1,199 +0,0 @@ -/*! - * Media helper for fancyBox - * version: 1.0.6 (Fri, 14 Jun 2013) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * media: true - * } - * }); - * - * Set custom URL parameters: - * $(".fancybox").fancybox({ - * helpers : { - * media: { - * youtube : { - * params : { - * autoplay : 0 - * } - * } - * } - * } - * }); - * - * Or: - * $(".fancybox").fancybox({, - * helpers : { - * media: true - * }, - * youtube : { - * autoplay: 0 - * } - * }); - * - * Supports: - * - * Youtube - * http://www.youtube.com/watch?v=opj24KnzrWo - * http://www.youtube.com/embed/opj24KnzrWo - * http://youtu.be/opj24KnzrWo - * http://www.youtube-nocookie.com/embed/opj24KnzrWo - * Vimeo - * http://vimeo.com/40648169 - * http://vimeo.com/channels/staffpicks/38843628 - * http://vimeo.com/groups/surrealism/videos/36516384 - * http://player.vimeo.com/video/45074303 - * Metacafe - * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ - * http://www.metacafe.com/watch/7635964/ - * Dailymotion - * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people - * Twitvid - * http://twitvid.com/QY7MD - * Twitpic - * http://twitpic.com/7p93st - * Instagram - * http://instagr.am/p/IejkuUGxQn/ - * http://instagram.com/p/IejkuUGxQn/ - * Google maps - * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 - * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 - * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 - */ -;(function ($) { - "use strict"; - - //Shortcut for fancyBox object - var F = $.fancybox, - format = function( url, rez, params ) { - params = params || ''; - - if ( $.type( params ) === "object" ) { - params = $.param(params, true); - } - - $.each(rez, function(key, value) { - url = url.replace( '$' + key, value || '' ); - }); - - if (params.length) { - url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; - } - - return url; - }; - - //Add helper object - F.helpers.media = { - defaults : { - youtube : { - matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, - params : { - autoplay : 1, - autohide : 1, - fs : 1, - rel : 0, - hd : 1, - wmode : 'opaque', - enablejsapi : 1 - }, - type : 'iframe', - url : '//www.youtube.com/embed/$3' - }, - vimeo : { - matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, - params : { - autoplay : 1, - hd : 1, - show_title : 1, - show_byline : 1, - show_portrait : 0, - fullscreen : 1 - }, - type : 'iframe', - url : '//player.vimeo.com/video/$1' - }, - metacafe : { - matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, - params : { - autoPlay : 'yes' - }, - type : 'swf', - url : function( rez, params, obj ) { - obj.swf.flashVars = 'playerVars=' + $.param( params, true ); - - return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; - } - }, - dailymotion : { - matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, - params : { - additionalInfos : 0, - autoStart : 1 - }, - type : 'swf', - url : '//www.dailymotion.com/swf/video/$1' - }, - twitvid : { - matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, - params : { - autoplay : 0 - }, - type : 'iframe', - url : '//www.twitvid.com/embed.php?guid=$1' - }, - twitpic : { - matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, - type : 'image', - url : '//twitpic.com/show/full/$1/' - }, - instagram : { - matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, - type : 'image', - url : '//$1/p/$2/media/?size=l' - }, - google_maps : { - matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, - type : 'iframe', - url : function( rez ) { - return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); - } - } - }, - - beforeLoad : function(opts, obj) { - var url = obj.href || '', - type = false, - what, - item, - rez, - params; - - for (what in opts) { - if (opts.hasOwnProperty(what)) { - item = opts[ what ]; - rez = url.match( item.matcher ); - - if (rez) { - type = item.type; - params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); - - url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); - - break; - } - } - } - - if (type) { - obj.href = url; - obj.type = type; - - obj.autoHeight = false; - } - } - }; - -}(jQuery)); \ No newline at end of file diff --git a/fancybox/helpers/jquery.fancybox-thumbs.css b/fancybox/helpers/jquery.fancybox-thumbs.css deleted file mode 100644 index 63d2943..0000000 --- a/fancybox/helpers/jquery.fancybox-thumbs.css +++ /dev/null @@ -1,55 +0,0 @@ -#fancybox-thumbs { - position: fixed; - left: 0; - width: 100%; - overflow: hidden; - z-index: 8050; -} - -#fancybox-thumbs.bottom { - bottom: 2px; -} - -#fancybox-thumbs.top { - top: 2px; -} - -#fancybox-thumbs ul { - position: relative; - list-style: none; - margin: 0; - padding: 0; -} - -#fancybox-thumbs ul li { - float: left; - padding: 1px; - opacity: 0.5; -} - -#fancybox-thumbs ul li.active { - opacity: 0.75; - padding: 0; - border: 1px solid #fff; -} - -#fancybox-thumbs ul li:hover { - opacity: 1; -} - -#fancybox-thumbs ul li a { - display: block; - position: relative; - overflow: hidden; - border: 1px solid #222; - background: #111; - outline: none; -} - -#fancybox-thumbs ul li img { - display: block; - position: relative; - border: 0; - padding: 0; - max-width: none; -} \ No newline at end of file diff --git a/fancybox/helpers/jquery.fancybox-thumbs.js b/fancybox/helpers/jquery.fancybox-thumbs.js deleted file mode 100644 index 58c9719..0000000 --- a/fancybox/helpers/jquery.fancybox-thumbs.js +++ /dev/null @@ -1,165 +0,0 @@ - /*! - * Thumbnail helper for fancyBox - * version: 1.0.7 (Mon, 01 Oct 2012) - * @requires fancyBox v2.0 or later - * - * Usage: - * $(".fancybox").fancybox({ - * helpers : { - * thumbs: { - * width : 50, - * height : 50 - * } - * } - * }); - * - */ -;(function ($) { - //Shortcut for fancyBox object - var F = $.fancybox; - - //Add helper object - F.helpers.thumbs = { - defaults : { - width : 50, // thumbnail width - height : 50, // thumbnail height - position : 'bottom', // 'top' or 'bottom' - source : function ( item ) { // function to obtain the URL of the thumbnail image - var href; - - if (item.element) { - href = $(item.element).find('img').attr('src'); - } - - if (!href && item.type === 'image' && item.href) { - href = item.href; - } - - return href; - } - }, - - wrap : null, - list : null, - width : 0, - - init: function (opts, obj) { - var that = this, - list, - thumbWidth = opts.width, - thumbHeight = opts.height, - thumbSource = opts.source; - - //Build list structure - list = ''; - - for (var n = 0; n < obj.group.length; n++) { - list += '
  • '; - } - - this.wrap = $('
    ').addClass(opts.position).appendTo('body'); - this.list = $('').appendTo(this.wrap); - - //Load each thumbnail - $.each(obj.group, function (i) { - var el = obj.group[ i ], - href = thumbSource( el ); - - if (!href) { - return; - } - - $("").load(function () { - var width = this.width, - height = this.height, - widthRatio, heightRatio, parent; - - if (!that.list || !width || !height) { - return; - } - - //Calculate thumbnail width/height and center it - widthRatio = width / thumbWidth; - heightRatio = height / thumbHeight; - - parent = that.list.children().eq(i).find('a'); - - if (widthRatio >= 1 && heightRatio >= 1) { - if (widthRatio > heightRatio) { - width = Math.floor(width / heightRatio); - height = thumbHeight; - - } else { - width = thumbWidth; - height = Math.floor(height / widthRatio); - } - } - - $(this).css({ - width : width, - height : height, - top : Math.floor(thumbHeight / 2 - height / 2), - left : Math.floor(thumbWidth / 2 - width / 2) - }); - - parent.width(thumbWidth).height(thumbHeight); - - $(this).hide().appendTo(parent).fadeIn(300); - - }) - .attr('src', href) - .attr('title', el.title); - }); - - //Set initial width - this.width = this.list.children().eq(0).outerWidth(true); - - this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); - }, - - beforeLoad: function (opts, obj) { - //Remove self if gallery do not have at least two items - if (obj.group.length < 2) { - obj.helpers.thumbs = false; - - return; - } - - //Increase bottom margin to give space for thumbs - obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); - }, - - afterShow: function (opts, obj) { - //Check if exists and create or update list - if (this.list) { - this.onUpdate(opts, obj); - - } else { - this.init(opts, obj); - } - - //Set active element - this.list.children().removeClass('active').eq(obj.index).addClass('active'); - }, - - //Center list - onUpdate: function (opts, obj) { - if (this.list) { - this.list.stop(true).animate({ - 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) - }, 150); - } - }, - - beforeClose: function () { - if (this.wrap) { - this.wrap.remove(); - } - - this.wrap = null; - this.list = null; - this.width = 0; - } - } - -}(jQuery)); \ No newline at end of file diff --git a/fancybox/jquery.fancybox.css b/fancybox/jquery.fancybox.css deleted file mode 100644 index c75d051..0000000 --- a/fancybox/jquery.fancybox.css +++ /dev/null @@ -1,273 +0,0 @@ -/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ -.fancybox-wrap, -.fancybox-skin, -.fancybox-outer, -.fancybox-inner, -.fancybox-image, -.fancybox-wrap iframe, -.fancybox-wrap object, -.fancybox-nav, -.fancybox-nav span, -.fancybox-tmp -{ - padding: 0; - margin: 0; - border: 0; - outline: none; - vertical-align: top; -} - -.fancybox-wrap { - position: absolute; - top: 0; - left: 0; - z-index: 8020; -} - -.fancybox-skin { - position: relative; - background: #f9f9f9; - color: #444; - text-shadow: none; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.fancybox-opened { - z-index: 8030; -} - -.fancybox-opened .fancybox-skin { - -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); - box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); -} - -.fancybox-outer, .fancybox-inner { - position: relative; -} - -.fancybox-inner { - overflow: hidden; -} - -.fancybox-type-iframe .fancybox-inner { - -webkit-overflow-scrolling: touch; -} - -.fancybox-error { - color: #444; - font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; - margin: 0; - padding: 15px; - white-space: nowrap; -} - -.fancybox-image, .fancybox-iframe { - display: block; - width: 100%; - height: 100%; -} - -.fancybox-image { - max-width: 100%; - max-height: 100%; -} - -#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { - background-image: url(fancybox_sprite.png); -} - -#fancybox-loading { - position: fixed; - top: 50%; - left: 50%; - margin-top: -22px; - margin-left: -22px; - background-position: 0 -108px; - opacity: 0.8; - cursor: pointer; - z-index: 8060; -} - -#fancybox-loading div { - width: 44px; - height: 44px; - background: url(fancybox_loading.gif) center center no-repeat; -} - -.fancybox-close { - position: absolute; - top: -18px; - right: -18px; - width: 36px; - height: 36px; - cursor: pointer; - z-index: 8040; -} - -.fancybox-nav { - position: absolute; - top: 0; - width: 40%; - height: 100%; - cursor: pointer; - text-decoration: none; - background: transparent url(blank.gif); /* helps IE */ - -webkit-tap-highlight-color: rgba(0,0,0,0); - z-index: 8040; -} - -.fancybox-prev { - left: 0; -} - -.fancybox-next { - right: 0; -} - -.fancybox-nav span { - position: absolute; - top: 50%; - width: 36px; - height: 34px; - margin-top: -18px; - cursor: pointer; - z-index: 8040; - visibility: hidden; -} - -.fancybox-prev span { - left: 10px; - background-position: 0 -36px; -} - -.fancybox-next span { - right: 10px; - background-position: 0 -72px; -} - -.fancybox-nav:hover span { - visibility: visible; -} - -.fancybox-tmp { - position: absolute; - top: -99999px; - left: -99999px; - max-width: 99999px; - max-height: 99999px; - overflow: visible !important; -} - -/* Overlay helper */ - -.fancybox-lock { - overflow: visible !important; - width: auto; -} - -.fancybox-lock body { - overflow: hidden !important; -} - -.fancybox-lock-test { - overflow-y: hidden !important; -} - -.fancybox-overlay { - position: absolute; - top: 0; - left: 0; - overflow: hidden; - display: none; - z-index: 8010; - background: url(fancybox_overlay.png); -} - -.fancybox-overlay-fixed { - position: fixed; - bottom: 0; - right: 0; -} - -.fancybox-lock .fancybox-overlay { - overflow: auto; - overflow-y: scroll; -} - -/* Title helper */ - -.fancybox-title { - visibility: hidden; - font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; - position: relative; - text-shadow: none; - z-index: 8050; -} - -.fancybox-opened .fancybox-title { - visibility: visible; -} - -.fancybox-title-float-wrap { - position: absolute; - bottom: 0; - right: 50%; - margin-bottom: -35px; - z-index: 8050; - text-align: center; -} - -.fancybox-title-float-wrap .child { - display: inline-block; - margin-right: -100%; - padding: 2px 20px; - background: transparent; /* Fallback for web browsers that doesn't support RGBa */ - background: rgba(0, 0, 0, 0.8); - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; - text-shadow: 0 1px 2px #222; - color: #FFF; - font-weight: bold; - line-height: 24px; - white-space: nowrap; -} - -.fancybox-title-outside-wrap { - position: relative; - margin-top: 10px; - color: #fff; -} - -.fancybox-title-inside-wrap { - padding-top: 10px; -} - -.fancybox-title-over-wrap { - position: absolute; - bottom: 0; - left: 0; - color: #fff; - padding: 10px; - background: #000; - background: rgba(0, 0, 0, .8); -} - -/*Retina graphics!*/ -@media only screen and (-webkit-min-device-pixel-ratio: 1.5), - only screen and (min--moz-device-pixel-ratio: 1.5), - only screen and (min-device-pixel-ratio: 1.5){ - - #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { - background-image: url(fancybox_sprite@2x.png); - background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/ - } - - #fancybox-loading div { - background-image: url(fancybox_loading@2x.gif); - background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/ - } -} \ No newline at end of file diff --git a/fancybox/jquery.fancybox.js b/fancybox/jquery.fancybox.js deleted file mode 100644 index 7a0f8ac..0000000 --- a/fancybox/jquery.fancybox.js +++ /dev/null @@ -1,2017 +0,0 @@ -/*! - * fancyBox - jQuery Plugin - * version: 2.1.5 (Fri, 14 Jun 2013) - * requires jQuery v1.6 or later - * - * Examples at http://fancyapps.com/fancybox/ - * License: www.fancyapps.com/fancybox/#license - * - * Copyright 2012 Janis Skarnelis - janis@fancyapps.com - * - */ - -;(function (window, document, $, undefined) { - "use strict"; - - var H = $("html"), - W = $(window), - D = $(document), - F = $.fancybox = function () { - F.open.apply( this, arguments ); - }, - IE = navigator.userAgent.match(/msie/i), - didUpdate = null, - isTouch = document.createTouch !== undefined, - - isQuery = function(obj) { - return obj && obj.hasOwnProperty && obj instanceof $; - }, - isString = function(str) { - return str && $.type(str) === "string"; - }, - isPercentage = function(str) { - return isString(str) && str.indexOf('%') > 0; - }, - isScrollable = function(el) { - return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight))); - }, - getScalar = function(orig, dim) { - var value = parseInt(orig, 10) || 0; - - if (dim && isPercentage(orig)) { - value = F.getViewport()[ dim ] / 100 * value; - } - - return Math.ceil(value); - }, - getValue = function(value, dim) { - return getScalar(value, dim) + 'px'; - }; - - $.extend(F, { - // The current version of fancyBox - version: '2.1.5', - - defaults: { - padding : 15, - margin : 20, - - width : 800, - height : 600, - minWidth : 100, - minHeight : 100, - maxWidth : 9999, - maxHeight : 9999, - pixelRatio: 1, // Set to 2 for retina display support - - autoSize : true, - autoHeight : false, - autoWidth : false, - - autoResize : true, - autoCenter : !isTouch, - fitToView : true, - aspectRatio : false, - topRatio : 0.5, - leftRatio : 0.5, - - scrolling : 'auto', // 'auto', 'yes' or 'no' - wrapCSS : '', - - arrows : true, - closeBtn : true, - closeClick : false, - nextClick : false, - mouseWheel : true, - autoPlay : false, - playSpeed : 3000, - preload : 3, - modal : false, - loop : true, - - ajax : { - dataType : 'html', - headers : { 'X-fancyBox': true } - }, - iframe : { - scrolling : 'auto', - preload : true - }, - swf : { - wmode: 'transparent', - allowfullscreen : 'true', - allowscriptaccess : 'always' - }, - - keys : { - next : { - 13 : 'left', // enter - 34 : 'up', // page down - 39 : 'left', // right arrow - 40 : 'up' // down arrow - }, - prev : { - 8 : 'right', // backspace - 33 : 'down', // page up - 37 : 'right', // left arrow - 38 : 'down' // up arrow - }, - close : [27], // escape key - play : [32], // space - start/stop slideshow - toggle : [70] // letter "f" - toggle fullscreen - }, - - direction : { - next : 'left', - prev : 'right' - }, - - scrollOutside : true, - - // Override some properties - index : 0, - type : null, - href : null, - content : null, - title : null, - - // HTML templates - tpl: { - wrap : '
    ', - image : '', - iframe : '', - error : '

    The requested content cannot be loaded.
    Please try again later.

    ', - closeBtn : '', - next : '', - prev : '' - }, - - // Properties for each animation type - // Opening fancyBox - openEffect : 'fade', // 'elastic', 'fade' or 'none' - openSpeed : 250, - openEasing : 'swing', - openOpacity : true, - openMethod : 'zoomIn', - - // Closing fancyBox - closeEffect : 'fade', // 'elastic', 'fade' or 'none' - closeSpeed : 250, - closeEasing : 'swing', - closeOpacity : true, - closeMethod : 'zoomOut', - - // Changing next gallery item - nextEffect : 'elastic', // 'elastic', 'fade' or 'none' - nextSpeed : 250, - nextEasing : 'swing', - nextMethod : 'changeIn', - - // Changing previous gallery item - prevEffect : 'elastic', // 'elastic', 'fade' or 'none' - prevSpeed : 250, - prevEasing : 'swing', - prevMethod : 'changeOut', - - // Enable default helpers - helpers : { - overlay : true, - title : true - }, - - // Callbacks - onCancel : $.noop, // If canceling - beforeLoad : $.noop, // Before loading - afterLoad : $.noop, // After loading - beforeShow : $.noop, // Before changing in current item - afterShow : $.noop, // After opening - beforeChange : $.noop, // Before changing gallery item - beforeClose : $.noop, // Before closing - afterClose : $.noop // After closing - }, - - //Current state - group : {}, // Selected group - opts : {}, // Group options - previous : null, // Previous element - coming : null, // Element being loaded - current : null, // Currently loaded element - isActive : false, // Is activated - isOpen : false, // Is currently open - isOpened : false, // Have been fully opened at least once - - wrap : null, - skin : null, - outer : null, - inner : null, - - player : { - timer : null, - isActive : false - }, - - // Loaders - ajaxLoad : null, - imgPreload : null, - - // Some collections - transitions : {}, - helpers : {}, - - /* - * Static methods - */ - - open: function (group, opts) { - if (!group) { - return; - } - - if (!$.isPlainObject(opts)) { - opts = {}; - } - - // Close if already active - if (false === F.close(true)) { - return; - } - - // Normalize group - if (!$.isArray(group)) { - group = isQuery(group) ? $(group).get() : [group]; - } - - // Recheck if the type of each element is `object` and set content type (image, ajax, etc) - $.each(group, function(i, element) { - var obj = {}, - href, - title, - content, - type, - rez, - hrefParts, - selector; - - if ($.type(element) === "object") { - // Check if is DOM element - if (element.nodeType) { - element = $(element); - } - - if (isQuery(element)) { - obj = { - href : element.data('fancybox-href') || element.attr('href'), - title : $('
    ').text( element.data('fancybox-title') || element.attr('title') ).html(), - isDom : true, - element : element - }; - - if ($.metadata) { - $.extend(true, obj, element.metadata()); - } - - } else { - obj = element; - } - } - - href = opts.href || obj.href || (isString(element) ? element : null); - title = opts.title !== undefined ? opts.title : obj.title || ''; - - content = opts.content || obj.content; - type = content ? 'html' : (opts.type || obj.type); - - if (!type && obj.isDom) { - type = element.data('fancybox-type'); - - if (!type) { - rez = element.prop('class').match(/fancybox\.(\w+)/); - type = rez ? rez[1] : null; - } - } - - if (isString(href)) { - // Try to guess the content type - if (!type) { - if (F.isImage(href)) { - type = 'image'; - - } else if (F.isSWF(href)) { - type = 'swf'; - - } else if (href.charAt(0) === '#') { - type = 'inline'; - - } else if (isString(element)) { - type = 'html'; - content = element; - } - } - - // Split url into two pieces with source url and content selector, e.g, - // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id" - if (type === 'ajax') { - hrefParts = href.split(/\s+/, 2); - href = hrefParts.shift(); - selector = hrefParts.shift(); - } - } - - if (!content) { - if (type === 'inline') { - if (href) { - content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7 - - } else if (obj.isDom) { - content = element; - } - - } else if (type === 'html') { - content = href; - - } else if (!type && !href && obj.isDom) { - type = 'inline'; - content = element; - } - } - - $.extend(obj, { - href : href, - type : type, - content : content, - title : title, - selector : selector - }); - - group[ i ] = obj; - }); - - // Extend the defaults - F.opts = $.extend(true, {}, F.defaults, opts); - - // All options are merged recursive except keys - if (opts.keys !== undefined) { - F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false; - } - - F.group = group; - - return F._start(F.opts.index); - }, - - // Cancel image loading or abort ajax request - cancel: function () { - var coming = F.coming; - - if (coming && false === F.trigger('onCancel')) { - return; - } - - F.hideLoading(); - - if (!coming) { - return; - } - - if (F.ajaxLoad) { - F.ajaxLoad.abort(); - } - - F.ajaxLoad = null; - - if (F.imgPreload) { - F.imgPreload.onload = F.imgPreload.onerror = null; - } - - if (coming.wrap) { - coming.wrap.stop(true, true).trigger('onReset').remove(); - } - - F.coming = null; - - // If the first item has been canceled, then clear everything - if (!F.current) { - F._afterZoomOut( coming ); - } - }, - - // Start closing animation if is open; remove immediately if opening/closing - close: function (event) { - F.cancel(); - - if (false === F.trigger('beforeClose')) { - return; - } - - F.unbindEvents(); - - if (!F.isActive) { - return; - } - - if (!F.isOpen || event === true) { - $('.fancybox-wrap').stop(true).trigger('onReset').remove(); - - F._afterZoomOut(); - - } else { - F.isOpen = F.isOpened = false; - F.isClosing = true; - - $('.fancybox-item, .fancybox-nav').remove(); - - F.wrap.stop(true, true).removeClass('fancybox-opened'); - - F.transitions[ F.current.closeMethod ](); - } - }, - - // Manage slideshow: - // $.fancybox.play(); - toggle slideshow - // $.fancybox.play( true ); - start - // $.fancybox.play( false ); - stop - play: function ( action ) { - var clear = function () { - clearTimeout(F.player.timer); - }, - set = function () { - clear(); - - if (F.current && F.player.isActive) { - F.player.timer = setTimeout(F.next, F.current.playSpeed); - } - }, - stop = function () { - clear(); - - D.unbind('.player'); - - F.player.isActive = false; - - F.trigger('onPlayEnd'); - }, - start = function () { - if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) { - F.player.isActive = true; - - D.bind({ - 'onCancel.player beforeClose.player' : stop, - 'onUpdate.player' : set, - 'beforeLoad.player' : clear - }); - - set(); - - F.trigger('onPlayStart'); - } - }; - - if (action === true || (!F.player.isActive && action !== false)) { - start(); - } else { - stop(); - } - }, - - // Navigate to next gallery item - next: function ( direction ) { - var current = F.current; - - if (current) { - if (!isString(direction)) { - direction = current.direction.next; - } - - F.jumpto(current.index + 1, direction, 'next'); - } - }, - - // Navigate to previous gallery item - prev: function ( direction ) { - var current = F.current; - - if (current) { - if (!isString(direction)) { - direction = current.direction.prev; - } - - F.jumpto(current.index - 1, direction, 'prev'); - } - }, - - // Navigate to gallery item by index - jumpto: function ( index, direction, router ) { - var current = F.current; - - if (!current) { - return; - } - - index = getScalar(index); - - F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ]; - F.router = router || 'jumpto'; - - if (current.loop) { - if (index < 0) { - index = current.group.length + (index % current.group.length); - } - - index = index % current.group.length; - } - - if (current.group[ index ] !== undefined) { - F.cancel(); - - F._start(index); - } - }, - - // Center inside viewport and toggle position type to fixed or absolute if needed - reposition: function (e, onlyAbsolute) { - var current = F.current, - wrap = current ? current.wrap : null, - pos; - - if (wrap) { - pos = F._getPosition(onlyAbsolute); - - if (e && e.type === 'scroll') { - delete pos.position; - - wrap.stop(true, true).animate(pos, 200); - - } else { - wrap.css(pos); - - current.pos = $.extend({}, current.dim, pos); - } - } - }, - - update: function (e) { - var type = (e && e.originalEvent && e.originalEvent.type), - anyway = !type || type === 'orientationchange'; - - if (anyway) { - clearTimeout(didUpdate); - - didUpdate = null; - } - - if (!F.isOpen || didUpdate) { - return; - } - - didUpdate = setTimeout(function() { - var current = F.current; - - if (!current || F.isClosing) { - return; - } - - F.wrap.removeClass('fancybox-tmp'); - - if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) { - F._setDimension(); - } - - if (!(type === 'scroll' && current.canShrink)) { - F.reposition(e); - } - - F.trigger('onUpdate'); - - didUpdate = null; - - }, (anyway && !isTouch ? 0 : 300)); - }, - - // Shrink content to fit inside viewport or restore if resized - toggle: function ( action ) { - if (F.isOpen) { - F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView; - - // Help browser to restore document dimensions - if (isTouch) { - F.wrap.removeAttr('style').addClass('fancybox-tmp'); - - F.trigger('onUpdate'); - } - - F.update(); - } - }, - - hideLoading: function () { - D.unbind('.loading'); - - $('#fancybox-loading').remove(); - }, - - showLoading: function () { - var el, viewport; - - F.hideLoading(); - - el = $('
    ').click(F.cancel).appendTo('body'); - - // If user will press the escape-button, the request will be canceled - D.bind('keydown.loading', function(e) { - if ((e.which || e.keyCode) === 27) { - e.preventDefault(); - - F.cancel(); - } - }); - - if (!F.defaults.fixed) { - viewport = F.getViewport(); - - el.css({ - position : 'absolute', - top : (viewport.h * 0.5) + viewport.y, - left : (viewport.w * 0.5) + viewport.x - }); - } - - F.trigger('onLoading'); - }, - - getViewport: function () { - var locked = (F.current && F.current.locked) || false, - rez = { - x: W.scrollLeft(), - y: W.scrollTop() - }; - - if (locked && locked.length) { - rez.w = locked[0].clientWidth; - rez.h = locked[0].clientHeight; - - } else { - // See http://bugs.jquery.com/ticket/6724 - rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width(); - rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height(); - } - - return rez; - }, - - // Unbind the keyboard / clicking actions - unbindEvents: function () { - if (F.wrap && isQuery(F.wrap)) { - F.wrap.unbind('.fb'); - } - - D.unbind('.fb'); - W.unbind('.fb'); - }, - - bindEvents: function () { - var current = F.current, - keys; - - if (!current) { - return; - } - - // Changing document height on iOS devices triggers a 'resize' event, - // that can change document height... repeating infinitely - W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update); - - keys = current.keys; - - if (keys) { - D.bind('keydown.fb', function (e) { - var code = e.which || e.keyCode, - target = e.target || e.srcElement; - - // Skip esc key if loading, because showLoading will cancel preloading - if (code === 27 && F.coming) { - return false; - } - - // Ignore key combinations and key events within form elements - if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) { - $.each(keys, function(i, val) { - if (current.group.length > 1 && val[ code ] !== undefined) { - F[ i ]( val[ code ] ); - - e.preventDefault(); - return false; - } - - if ($.inArray(code, val) > -1) { - F[ i ] (); - - e.preventDefault(); - return false; - } - }); - } - }); - } - - if ($.fn.mousewheel && current.mouseWheel) { - F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) { - var target = e.target || null, - parent = $(target), - canScroll = false; - - while (parent.length) { - if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) { - break; - } - - canScroll = isScrollable( parent[0] ); - parent = $(parent).parent(); - } - - if (delta !== 0 && !canScroll) { - if (F.group.length > 1 && !current.canShrink) { - if (deltaY > 0 || deltaX > 0) { - F.prev( deltaY > 0 ? 'down' : 'left' ); - - } else if (deltaY < 0 || deltaX < 0) { - F.next( deltaY < 0 ? 'up' : 'right' ); - } - - e.preventDefault(); - } - } - }); - } - }, - - trigger: function (event, o) { - var ret, obj = o || F.coming || F.current; - - if (obj) { - if ($.isFunction( obj[event] )) { - ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); - } - - if (ret === false) { - return false; - } - - if (obj.helpers) { - $.each(obj.helpers, function (helper, opts) { - if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) { - F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj); - } - }); - } - } - - D.trigger(event); - }, - - isImage: function (str) { - return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); - }, - - isSWF: function (str) { - return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i); - }, - - _start: function (index) { - var coming = {}, - obj, - href, - type, - margin, - padding; - - index = getScalar( index ); - obj = F.group[ index ] || null; - - if (!obj) { - return false; - } - - coming = $.extend(true, {}, F.opts, obj); - - // Convert margin and padding properties to array - top, right, bottom, left - margin = coming.margin; - padding = coming.padding; - - if ($.type(margin) === 'number') { - coming.margin = [margin, margin, margin, margin]; - } - - if ($.type(padding) === 'number') { - coming.padding = [padding, padding, padding, padding]; - } - - // 'modal' propery is just a shortcut - if (coming.modal) { - $.extend(true, coming, { - closeBtn : false, - closeClick : false, - nextClick : false, - arrows : false, - mouseWheel : false, - keys : null, - helpers: { - overlay : { - closeClick : false - } - } - }); - } - - // 'autoSize' property is a shortcut, too - if (coming.autoSize) { - coming.autoWidth = coming.autoHeight = true; - } - - if (coming.width === 'auto') { - coming.autoWidth = true; - } - - if (coming.height === 'auto') { - coming.autoHeight = true; - } - - /* - * Add reference to the group, so it`s possible to access from callbacks, example: - * afterLoad : function() { - * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); - * } - */ - - coming.group = F.group; - coming.index = index; - - // Give a chance for callback or helpers to update coming item (type, title, etc) - F.coming = coming; - - if (false === F.trigger('beforeLoad')) { - F.coming = null; - - return; - } - - type = coming.type; - href = coming.href; - - if (!type) { - F.coming = null; - - //If we can not determine content type then drop silently or display next/prev item if looping through gallery - if (F.current && F.router && F.router !== 'jumpto') { - F.current.index = index; - - return F[ F.router ]( F.direction ); - } - - return false; - } - - F.isActive = true; - - if (type === 'image' || type === 'swf') { - coming.autoHeight = coming.autoWidth = false; - coming.scrolling = 'visible'; - } - - if (type === 'image') { - coming.aspectRatio = true; - } - - if (type === 'iframe' && isTouch) { - coming.scrolling = 'scroll'; - } - - // Build the neccessary markup - coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' ); - - $.extend(coming, { - skin : $('.fancybox-skin', coming.wrap), - outer : $('.fancybox-outer', coming.wrap), - inner : $('.fancybox-inner', coming.wrap) - }); - - $.each(["Top", "Right", "Bottom", "Left"], function(i, v) { - coming.skin.css('padding' + v, getValue(coming.padding[ i ])); - }); - - F.trigger('onReady'); - - // Check before try to load; 'inline' and 'html' types need content, others - href - if (type === 'inline' || type === 'html') { - if (!coming.content || !coming.content.length) { - return F._error( 'content' ); - } - - } else if (!href) { - return F._error( 'href' ); - } - - if (type === 'image') { - F._loadImage(); - - } else if (type === 'ajax') { - F._loadAjax(); - - } else if (type === 'iframe') { - F._loadIframe(); - - } else { - F._afterLoad(); - } - }, - - _error: function ( type ) { - $.extend(F.coming, { - type : 'html', - autoWidth : true, - autoHeight : true, - minWidth : 0, - minHeight : 0, - scrolling : 'no', - hasError : type, - content : F.coming.tpl.error - }); - - F._afterLoad(); - }, - - _loadImage: function () { - // Reset preload image so it is later possible to check "complete" property - var img = F.imgPreload = new Image(); - - img.onload = function () { - this.onload = this.onerror = null; - - F.coming.width = this.width / F.opts.pixelRatio; - F.coming.height = this.height / F.opts.pixelRatio; - - F._afterLoad(); - }; - - img.onerror = function () { - this.onload = this.onerror = null; - - F._error( 'image' ); - }; - - img.src = F.coming.href; - - if (img.complete !== true) { - F.showLoading(); - } - }, - - _loadAjax: function () { - var coming = F.coming; - - F.showLoading(); - - F.ajaxLoad = $.ajax($.extend({}, coming.ajax, { - url: coming.href, - error: function (jqXHR, textStatus) { - if (F.coming && textStatus !== 'abort') { - F._error( 'ajax', jqXHR ); - - } else { - F.hideLoading(); - } - }, - success: function (data, textStatus) { - if (textStatus === 'success') { - coming.content = data; - - F._afterLoad(); - } - } - })); - }, - - _loadIframe: function() { - var coming = F.coming, - iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) - .attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling) - .attr('src', coming.href); - - // This helps IE - $(coming.wrap).bind('onReset', function () { - try { - $(this).find('iframe').hide().attr('src', '//about:blank').end().empty(); - } catch (e) {} - }); - - if (coming.iframe.preload) { - F.showLoading(); - - iframe.one('load', function() { - $(this).data('ready', 1); - - // iOS will lose scrolling if we resize - if (!isTouch) { - $(this).bind('load.fb', F.update); - } - - // Without this trick: - // - iframe won't scroll on iOS devices - // - IE7 sometimes displays empty iframe - $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show(); - - F._afterLoad(); - }); - } - - coming.content = iframe.appendTo( coming.inner ); - - if (!coming.iframe.preload) { - F._afterLoad(); - } - }, - - _preloadImages: function() { - var group = F.group, - current = F.current, - len = group.length, - cnt = current.preload ? Math.min(current.preload, len - 1) : 0, - item, - i; - - for (i = 1; i <= cnt; i += 1) { - item = group[ (current.index + i ) % len ]; - - if (item.type === 'image' && item.href) { - new Image().src = item.href; - } - } - }, - - _afterLoad: function () { - var coming = F.coming, - previous = F.current, - placeholder = 'fancybox-placeholder', - current, - content, - type, - scrolling, - href, - embed; - - F.hideLoading(); - - if (!coming || F.isActive === false) { - return; - } - - if (false === F.trigger('afterLoad', coming, previous)) { - coming.wrap.stop(true).trigger('onReset').remove(); - - F.coming = null; - - return; - } - - if (previous) { - F.trigger('beforeChange', previous); - - previous.wrap.stop(true).removeClass('fancybox-opened') - .find('.fancybox-item, .fancybox-nav') - .remove(); - } - - F.unbindEvents(); - - current = coming; - content = coming.content; - type = coming.type; - scrolling = coming.scrolling; - - $.extend(F, { - wrap : current.wrap, - skin : current.skin, - outer : current.outer, - inner : current.inner, - current : current, - previous : previous - }); - - href = current.href; - - switch (type) { - case 'inline': - case 'ajax': - case 'html': - if (current.selector) { - content = $('
    ').html(content).find(current.selector); - - } else if (isQuery(content)) { - if (!content.data(placeholder)) { - content.data(placeholder, $('
    ').insertAfter( content ).hide() ); - } - - content = content.show().detach(); - - current.wrap.bind('onReset', function () { - if ($(this).find(content).length) { - content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false); - } - }); - } - break; - - case 'image': - content = current.tpl.image.replace(/\{href\}/g, href); - break; - - case 'swf': - content = ''; - embed = ''; - - $.each(current.swf, function(name, val) { - content += ''; - embed += ' ' + name + '="' + val + '"'; - }); - - content += ''; - break; - } - - if (!(isQuery(content) && content.parent().is(current.inner))) { - current.inner.append( content ); - } - - // Give a chance for helpers or callbacks to update elements - F.trigger('beforeShow'); - - // Set scrolling before calculating dimensions - current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); - - // Set initial dimensions and start position - F._setDimension(); - - F.reposition(); - - F.isOpen = false; - F.coming = null; - - F.bindEvents(); - - if (!F.isOpened) { - $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove(); - - } else if (previous.prevMethod) { - F.transitions[ previous.prevMethod ](); - } - - F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ](); - - F._preloadImages(); - }, - - _setDimension: function () { - var viewport = F.getViewport(), - steps = 0, - canShrink = false, - canExpand = false, - wrap = F.wrap, - skin = F.skin, - inner = F.inner, - current = F.current, - width = current.width, - height = current.height, - minWidth = current.minWidth, - minHeight = current.minHeight, - maxWidth = current.maxWidth, - maxHeight = current.maxHeight, - scrolling = current.scrolling, - scrollOut = current.scrollOutside ? current.scrollbarWidth : 0, - margin = current.margin, - wMargin = getScalar(margin[1] + margin[3]), - hMargin = getScalar(margin[0] + margin[2]), - wPadding, - hPadding, - wSpace, - hSpace, - origWidth, - origHeight, - origMaxWidth, - origMaxHeight, - ratio, - width_, - height_, - maxWidth_, - maxHeight_, - iframe, - body; - - // Reset dimensions so we could re-check actual size - wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp'); - - wPadding = getScalar(skin.outerWidth(true) - skin.width()); - hPadding = getScalar(skin.outerHeight(true) - skin.height()); - - // Any space between content and viewport (margin, padding, border, title) - wSpace = wMargin + wPadding; - hSpace = hMargin + hPadding; - - origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width; - origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height; - - if (current.type === 'iframe') { - iframe = current.content; - - if (current.autoHeight && iframe.data('ready') === 1) { - try { - if (iframe[0].contentWindow.document.location) { - inner.width( origWidth ).height(9999); - - body = iframe.contents().find('body'); - - if (scrollOut) { - body.css('overflow-x', 'hidden'); - } - - origHeight = body.outerHeight(true); - } - - } catch (e) {} - } - - } else if (current.autoWidth || current.autoHeight) { - inner.addClass( 'fancybox-tmp' ); - - // Set width or height in case we need to calculate only one dimension - if (!current.autoWidth) { - inner.width( origWidth ); - } - - if (!current.autoHeight) { - inner.height( origHeight ); - } - - if (current.autoWidth) { - origWidth = inner.width(); - } - - if (current.autoHeight) { - origHeight = inner.height(); - } - - inner.removeClass( 'fancybox-tmp' ); - } - - width = getScalar( origWidth ); - height = getScalar( origHeight ); - - ratio = origWidth / origHeight; - - // Calculations for the content - minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth); - maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth); - - minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight); - maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight); - - // These will be used to determine if wrap can fit in the viewport - origMaxWidth = maxWidth; - origMaxHeight = maxHeight; - - if (current.fitToView) { - maxWidth = Math.min(viewport.w - wSpace, maxWidth); - maxHeight = Math.min(viewport.h - hSpace, maxHeight); - } - - maxWidth_ = viewport.w - wMargin; - maxHeight_ = viewport.h - hMargin; - - if (current.aspectRatio) { - if (width > maxWidth) { - width = maxWidth; - height = getScalar(width / ratio); - } - - if (height > maxHeight) { - height = maxHeight; - width = getScalar(height * ratio); - } - - if (width < minWidth) { - width = minWidth; - height = getScalar(width / ratio); - } - - if (height < minHeight) { - height = minHeight; - width = getScalar(height * ratio); - } - - } else { - width = Math.max(minWidth, Math.min(width, maxWidth)); - - if (current.autoHeight && current.type !== 'iframe') { - inner.width( width ); - - height = inner.height(); - } - - height = Math.max(minHeight, Math.min(height, maxHeight)); - } - - // Try to fit inside viewport (including the title) - if (current.fitToView) { - inner.width( width ).height( height ); - - wrap.width( width + wPadding ); - - // Real wrap dimensions - width_ = wrap.width(); - height_ = wrap.height(); - - if (current.aspectRatio) { - while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) { - if (steps++ > 19) { - break; - } - - height = Math.max(minHeight, Math.min(maxHeight, height - 10)); - width = getScalar(height * ratio); - - if (width < minWidth) { - width = minWidth; - height = getScalar(width / ratio); - } - - if (width > maxWidth) { - width = maxWidth; - height = getScalar(width / ratio); - } - - inner.width( width ).height( height ); - - wrap.width( width + wPadding ); - - width_ = wrap.width(); - height_ = wrap.height(); - } - - } else { - width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_))); - height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_))); - } - } - - if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) { - width += scrollOut; - } - - inner.width( width ).height( height ); - - wrap.width( width + wPadding ); - - width_ = wrap.width(); - height_ = wrap.height(); - - canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight; - canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight)); - - $.extend(current, { - dim : { - width : getValue( width_ ), - height : getValue( height_ ) - }, - origWidth : origWidth, - origHeight : origHeight, - canShrink : canShrink, - canExpand : canExpand, - wPadding : wPadding, - hPadding : hPadding, - wrapSpace : height_ - skin.outerHeight(true), - skinSpace : skin.height() - height - }); - - if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) { - inner.height('auto'); - } - }, - - _getPosition: function (onlyAbsolute) { - var current = F.current, - viewport = F.getViewport(), - margin = current.margin, - width = F.wrap.width() + margin[1] + margin[3], - height = F.wrap.height() + margin[0] + margin[2], - rez = { - position: 'absolute', - top : margin[0], - left : margin[3] - }; - - if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) { - rez.position = 'fixed'; - - } else if (!current.locked) { - rez.top += viewport.y; - rez.left += viewport.x; - } - - rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); - rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio))); - - return rez; - }, - - _afterZoomIn: function () { - var current = F.current; - - if (!current) { - return; - } - - F.isOpen = F.isOpened = true; - - F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0); - - F.update(); - - // Assign a click event - if ( current.closeClick || (current.nextClick && F.group.length > 1) ) { - F.inner.css('cursor', 'pointer').bind('click.fb', function(e) { - if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { - e.preventDefault(); - - F[ current.closeClick ? 'close' : 'next' ](); - } - }); - } - - // Create a close button - if (current.closeBtn) { - $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) { - e.preventDefault(); - - F.close(); - }); - } - - // Create navigation arrows - if (current.arrows && F.group.length > 1) { - if (current.loop || current.index > 0) { - $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); - } - - if (current.loop || current.index < F.group.length - 1) { - $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); - } - } - - F.trigger('afterShow'); - - // Stop the slideshow if this is the last item - if (!current.loop && current.index === current.group.length - 1) { - - F.play( false ); - - } else if (F.opts.autoPlay && !F.player.isActive) { - F.opts.autoPlay = false; - - F.play(true); - } - }, - - _afterZoomOut: function ( obj ) { - obj = obj || F.current; - - $('.fancybox-wrap').trigger('onReset').remove(); - - $.extend(F, { - group : {}, - opts : {}, - router : false, - current : null, - isActive : false, - isOpened : false, - isOpen : false, - isClosing : false, - wrap : null, - skin : null, - outer : null, - inner : null - }); - - F.trigger('afterClose', obj); - } - }); - - /* - * Default transitions - */ - - F.transitions = { - getOrigPosition: function () { - var current = F.current, - element = current.element, - orig = current.orig, - pos = {}, - width = 50, - height = 50, - hPadding = current.hPadding, - wPadding = current.wPadding, - viewport = F.getViewport(); - - if (!orig && current.isDom && element.is(':visible')) { - orig = element.find('img:first'); - - if (!orig.length) { - orig = element; - } - } - - if (isQuery(orig)) { - pos = orig.offset(); - - if (orig.is('img')) { - width = orig.outerWidth(); - height = orig.outerHeight(); - } - - } else { - pos.top = viewport.y + (viewport.h - height) * current.topRatio; - pos.left = viewport.x + (viewport.w - width) * current.leftRatio; - } - - if (F.wrap.css('position') === 'fixed' || current.locked) { - pos.top -= viewport.y; - pos.left -= viewport.x; - } - - pos = { - top : getValue(pos.top - hPadding * current.topRatio), - left : getValue(pos.left - wPadding * current.leftRatio), - width : getValue(width + wPadding), - height : getValue(height + hPadding) - }; - - return pos; - }, - - step: function (now, fx) { - var ratio, - padding, - value, - prop = fx.prop, - current = F.current, - wrapSpace = current.wrapSpace, - skinSpace = current.skinSpace; - - if (prop === 'width' || prop === 'height') { - ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start); - - if (F.isClosing) { - ratio = 1 - ratio; - } - - padding = prop === 'width' ? current.wPadding : current.hPadding; - value = now - padding; - - F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) ); - F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) ); - } - }, - - zoomIn: function () { - var current = F.current, - startPos = current.pos, - effect = current.openEffect, - elastic = effect === 'elastic', - endPos = $.extend({opacity : 1}, startPos); - - // Remove "position" property that breaks older IE - delete endPos.position; - - if (elastic) { - startPos = this.getOrigPosition(); - - if (current.openOpacity) { - startPos.opacity = 0.1; - } - - } else if (effect === 'fade') { - startPos.opacity = 0.1; - } - - F.wrap.css(startPos).animate(endPos, { - duration : effect === 'none' ? 0 : current.openSpeed, - easing : current.openEasing, - step : elastic ? this.step : null, - complete : F._afterZoomIn - }); - }, - - zoomOut: function () { - var current = F.current, - effect = current.closeEffect, - elastic = effect === 'elastic', - endPos = {opacity : 0.1}; - - if (elastic) { - endPos = this.getOrigPosition(); - - if (current.closeOpacity) { - endPos.opacity = 0.1; - } - } - - F.wrap.animate(endPos, { - duration : effect === 'none' ? 0 : current.closeSpeed, - easing : current.closeEasing, - step : elastic ? this.step : null, - complete : F._afterZoomOut - }); - }, - - changeIn: function () { - var current = F.current, - effect = current.nextEffect, - startPos = current.pos, - endPos = { opacity : 1 }, - direction = F.direction, - distance = 200, - field; - - startPos.opacity = 0.1; - - if (effect === 'elastic') { - field = direction === 'down' || direction === 'up' ? 'top' : 'left'; - - if (direction === 'down' || direction === 'right') { - startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance); - endPos[ field ] = '+=' + distance + 'px'; - - } else { - startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance); - endPos[ field ] = '-=' + distance + 'px'; - } - } - - // Workaround for http://bugs.jquery.com/ticket/12273 - if (effect === 'none') { - F._afterZoomIn(); - - } else { - F.wrap.css(startPos).animate(endPos, { - duration : current.nextSpeed, - easing : current.nextEasing, - complete : F._afterZoomIn - }); - } - }, - - changeOut: function () { - var previous = F.previous, - effect = previous.prevEffect, - endPos = { opacity : 0.1 }, - direction = F.direction, - distance = 200; - - if (effect === 'elastic') { - endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px'; - } - - previous.wrap.animate(endPos, { - duration : effect === 'none' ? 0 : previous.prevSpeed, - easing : previous.prevEasing, - complete : function () { - $(this).trigger('onReset').remove(); - } - }); - } - }; - - /* - * Overlay helper - */ - - F.helpers.overlay = { - defaults : { - closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay - speedOut : 200, // duration of fadeOut animation - showEarly : true, // indicates if should be opened immediately or wait until the content is ready - css : {}, // custom CSS properties - locked : !isTouch, // if true, the content will be locked into overlay - fixed : true // if false, the overlay CSS position property will not be set to "fixed" - }, - - overlay : null, // current handle - fixed : false, // indicates if the overlay has position "fixed" - el : $('html'), // element that contains "the lock" - - // Public methods - create : function(opts) { - var parent; - - opts = $.extend({}, this.defaults, opts); - - if (this.overlay) { - this.close(); - } - - parent = F.coming ? F.coming.parent : opts.parent; - - this.overlay = $('
    ').appendTo( parent && parent.lenth ? parent : 'body' ); - this.fixed = false; - - if (opts.fixed && F.defaults.fixed) { - this.overlay.addClass('fancybox-overlay-fixed'); - - this.fixed = true; - } - }, - - open : function(opts) { - var that = this; - - opts = $.extend({}, this.defaults, opts); - - if (this.overlay) { - this.overlay.unbind('.overlay').width('auto').height('auto'); - - } else { - this.create(opts); - } - - if (!this.fixed) { - W.bind('resize.overlay', $.proxy( this.update, this) ); - - this.update(); - } - - if (opts.closeClick) { - this.overlay.bind('click.overlay', function(e) { - if ($(e.target).hasClass('fancybox-overlay')) { - if (F.isActive) { - F.close(); - } else { - that.close(); - } - - return false; - } - }); - } - - this.overlay.css( opts.css ).show(); - }, - - close : function() { - W.unbind('resize.overlay'); - - if (this.el.hasClass('fancybox-lock')) { - $('.fancybox-margin').removeClass('fancybox-margin'); - - this.el.removeClass('fancybox-lock'); - - W.scrollTop( this.scrollV ).scrollLeft( this.scrollH ); - } - - $('.fancybox-overlay').remove().hide(); - - $.extend(this, { - overlay : null, - fixed : false - }); - }, - - // Private, callbacks - - update : function () { - var width = '100%', offsetWidth; - - // Reset width/height so it will not mess - this.overlay.width(width).height('100%'); - - // jQuery does not return reliable result for IE - if (IE) { - offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); - - if (D.width() > offsetWidth) { - width = D.width(); - } - - } else if (D.width() > W.width()) { - width = D.width(); - } - - this.overlay.width(width).height(D.height()); - }, - - // This is where we can manipulate DOM, because later it would cause iframes to reload - onReady : function (opts, obj) { - var overlay = this.overlay; - - $('.fancybox-overlay').stop(true, true); - - if (!overlay) { - this.create(opts); - } - - if (opts.locked && this.fixed && obj.fixed) { - obj.locked = this.overlay.append( obj.wrap ); - obj.fixed = false; - } - - if (opts.showEarly === true) { - this.beforeShow.apply(this, arguments); - } - }, - - beforeShow : function(opts, obj) { - if (obj.locked && !this.el.hasClass('fancybox-lock')) { - if (this.fixPosition !== false) { - $('*').filter(function(){ - return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") ); - }).addClass('fancybox-margin'); - } - - this.el.addClass('fancybox-margin'); - - this.scrollV = W.scrollTop(); - this.scrollH = W.scrollLeft(); - - this.el.addClass('fancybox-lock'); - - W.scrollTop( this.scrollV ).scrollLeft( this.scrollH ); - } - - this.open(opts); - }, - - onUpdate : function() { - if (!this.fixed) { - this.update(); - } - }, - - afterClose: function (opts) { - // Remove overlay if exists and fancyBox is not opening - // (e.g., it is not being open using afterClose callback) - if (this.overlay && !F.coming) { - this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this )); - } - } - }; - - /* - * Title helper - */ - - F.helpers.title = { - defaults : { - type : 'float', // 'float', 'inside', 'outside' or 'over', - position : 'bottom' // 'top' or 'bottom' - }, - - beforeShow: function (opts) { - var current = F.current, - text = current.title, - type = opts.type, - title, - target; - - if ($.isFunction(text)) { - text = text.call(current.element, current); - } - - if (!isString(text) || $.trim(text) === '') { - return; - } - - title = $('
    ' + text + '
    '); - - switch (type) { - case 'inside': - target = F.skin; - break; - - case 'outside': - target = F.wrap; - break; - - case 'over': - target = F.inner; - break; - - default: // 'float' - target = F.skin; - - title.appendTo('body'); - - if (IE) { - title.width( title.width() ); - } - - title.wrapInner(''); - - //Increase bottom margin so this title will also fit into viewport - F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) ); - break; - } - - title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target); - } - }; - - // jQuery plugin initialization - $.fn.fancybox = function (options) { - var index, - that = $(this), - selector = this.selector || '', - run = function(e) { - var what = $(this).blur(), idx = index, relType, relVal; - - if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) { - relType = options.groupAttr || 'data-fancybox-group'; - relVal = what.attr(relType); - - if (!relVal) { - relType = 'rel'; - relVal = what.get(0)[ relType ]; - } - - if (relVal && relVal !== '' && relVal !== 'nofollow') { - what = selector.length ? $(selector) : that; - what = what.filter('[' + relType + '="' + relVal + '"]'); - idx = what.index(this); - } - - options.index = idx; - - // Stop an event from bubbling if everything is fine - if (F.open(what, options) !== false) { - e.preventDefault(); - } - } - }; - - options = options || {}; - index = options.index || 0; - - if (!selector || options.live === false) { - that.unbind('click.fb-start').bind('click.fb-start', run); - - } else { - D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); - } - - this.filter('[data-fancybox-start=1]').trigger('click'); - - return this; - }; - - // Tests that need a body at doc ready - D.ready(function() { - var w1, w2; - - if ( $.scrollbarWidth === undefined ) { - // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth - $.scrollbarWidth = function() { - var parent = $('
    ').appendTo('body'), - child = parent.children(), - width = child.innerWidth() - child.height( 99 ).innerWidth(); - - parent.remove(); - - return width; - }; - } - - if ( $.support.fixedPosition === undefined ) { - $.support.fixedPosition = (function() { - var elem = $('
    ').appendTo('body'), - fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 ); - - elem.remove(); - - return fixed; - }()); - } - - $.extend(F.defaults, { - scrollbarWidth : $.scrollbarWidth(), - fixed : $.support.fixedPosition, - parent : $('body') - }); - - //Get real width of page scroll-bar - w1 = $(window).width(); - - H.addClass('fancybox-lock-test'); - - w2 = $(window).width(); - - H.removeClass('fancybox-lock-test'); - - $("").appendTo("head"); - }); - -}(window, document, jQuery)); \ No newline at end of file diff --git a/fancybox/jquery.fancybox.pack.js b/fancybox/jquery.fancybox.pack.js deleted file mode 100644 index 2db1280..0000000 --- a/fancybox/jquery.fancybox.pack.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ -(function(s,H,f,w){var K=f("html"),q=f(s),p=f(H),b=f.fancybox=function(){b.open.apply(this,arguments)},J=navigator.userAgent.match(/msie/i),C=null,t=H.createTouch!==w,u=function(a){return a&&a.hasOwnProperty&&a instanceof f},r=function(a){return a&&"string"===f.type(a)},F=function(a){return r(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, -openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, -isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=u(a)?f(a).get():[a]),f.each(a,function(e,c){var l={},g,h,k,n,m;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),u(c)?(l={href:c.data("fancybox-href")||c.attr("href"),title:f("
    ").text(c.data("fancybox-title")||c.attr("title")).html(),isDom:!0,element:c}, -f.metadata&&f.extend(!0,l,c.metadata())):l=c);g=d.href||l.href||(r(c)?c:null);h=d.title!==w?d.title:l.title||"";n=(k=d.content||l.content)?"html":d.type||l.type;!n&&l.isDom&&(n=c.data("fancybox-type"),n||(n=(n=c.prop("class").match(/fancybox\.(\w+)/))?n[1]:null));r(g)&&(n||(b.isImage(g)?n="image":b.isSWF(g)?n="swf":"#"===g.charAt(0)?n="inline":r(c)&&(n="html",k=c)),"ajax"===n&&(m=g.split(/\s+/,2),g=m.shift(),m=m.shift()));k||("inline"===n?g?k=f(r(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):l.isDom&&(k=c): -"html"===n?k=g:n||g||!l.isDom||(n="inline",k=c));f.extend(l,{href:g,type:n,content:k,title:h,selector:m});a[e]=l}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==w&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1===b.trigger("onCancel")||(b.hideLoading(),a&&(b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(), -b.coming=null,b.current||b._afterZoomOut(a)))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&& -(b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==w&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,l;c&&(l=b._getPosition(d),a&&"scroll"===a.type?(delete l.position,c.stop(!0,!0).animate(l,200)):(c.css(l),e.pos=f.extend({},e.dim,l)))}, -update:function(a){var d=a&&a.originalEvent&&a.originalEvent.type,e=!d||"orientationchange"===d;e&&(clearTimeout(C),C=null);b.isOpen&&!C&&(C=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),C=null)},e&&!t?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,t&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"), -b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}));b.trigger("onLoading")},getViewport:function(){var a=b.current&& -b.current.locked||!1,d={x:q.scrollLeft(),y:q.scrollTop()};a&&a.length?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=t&&s.innerWidth?s.innerWidth:q.width(),d.h=t&&s.innerHeight?s.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&u(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(t?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c= -e.which||e.keyCode,l=e.target||e.srcElement;if(27===c&&b.coming)return!1;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||l&&(l.type||f(l).is("[contenteditable]"))||f.each(d,function(d,l){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!k&&1g||0>l)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&& -b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)})}p.trigger(a)},isImage:function(a){return r(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return r(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=m(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c, -c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"=== -c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&t&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(t?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady"); -if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width= -this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming, -d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",t?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);t||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload|| -b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,l,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()); -b.unbindEvents();e=a.content;c=a.type;l=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):u(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", -!1)}));break;case "image":e=a.tpl.image.replace(/\{href\}/g,g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}u(e)&&e.parent().is(a.inner)||a.inner.append(e);b.trigger("beforeShow"); -a.inner.css("overflow","yes"===l?"scroll":"no"===l?"hidden":l);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(!b.isOpened)f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();else if(d.prevMethod)b.transitions[d.prevMethod]();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,l=b.skin,g=b.inner,h=b.current,c=h.width,k=h.height,n=h.minWidth,v=h.minHeight,p=h.maxWidth, -q=h.maxHeight,t=h.scrolling,r=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,z=m(y[1]+y[3]),s=m(y[0]+y[2]),w,A,u,D,B,G,C,E,I;e.add(l).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=m(l.outerWidth(!0)-l.width());w=m(l.outerHeight(!0)-l.height());A=z+y;u=s+w;D=F(c)?(a.w-A)*m(c)/100:c;B=F(k)?(a.h-u)*m(k)/100:k;if("iframe"===h.type){if(I=h.content,h.autoHeight&&1===I.data("ready"))try{I[0].contentWindow.document.location&&(g.width(D).height(9999),G=I.contents().find("body"),r&&G.css("overflow-x", -"hidden"),B=G.outerHeight(!0))}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=m(D);k=m(B);E=D/B;n=m(F(n)?m(n,"w")-A:n);p=m(F(p)?m(p,"w")-A:p);v=m(F(v)?m(v,"h")-u:v);q=m(F(q)?m(q,"h")-u:q);G=p;C=q;h.fitToView&&(p=Math.min(a.w-A,p),q=Math.min(a.h-u,q));A=a.w-z;s=a.h-s;h.aspectRatio?(c>p&&(c=p,k=m(c/E)),k>q&&(k=q,c=m(k*E)),cA||z>s)&&c>n&&k>v&&!(19p&&(c=p,k=m(c/E)),g.width(c).height(k),e.width(c+y),a=e.width(),z=e.height();else c=Math.max(n,Math.min(c,c-(a-A))),k=Math.max(v,Math.min(k,k-(z-s)));r&&"auto"===t&&kA||z>s)&&c>n&&k>v;c=h.aspectRatio?cv&&k
    ').appendTo(d&&d.lenth?d:"body");this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay", -function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){q.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%"); -J?(b=Math.max(H.documentElement.offsetWidth,H.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>q.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&this.fixed&&b.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&f("*").filter(function(){return"fixed"=== -f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=q.scrollTop(),this.scrollH=q.scrollLeft(),this.el.addClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float", -position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(r(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),J&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(m(d.css("margin-bottom")))}d["top"===a.position?"prependTo": -"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",l=function(g){var h=f(this).blur(),k=d,l,m;g.ctrlKey||g.altKey||g.shiftKey||g.metaKey||h.is(".fancybox-wrap")||(l=a.groupAttr||"data-fancybox-group",m=h.attr(l),m||(l="rel",m=h.get(0)[l]),m&&""!==m&&"nofollow"!==m&&(h=c.length?f(c):e,h=h.filter("["+l+'="'+m+'"]'),k=h.index(this)),a.index=k,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')", -"click.fb-start",l):e.unbind("click.fb-start").bind("click.fb-start",l);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===w&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});f.support.fixedPosition===w&&(f.support.fixedPosition=function(){var a=f('
    ').appendTo("body"), -b=20===a[0].offsetTop||15===a[0].offsetTop;a.remove();return b}());f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(s).width();K.addClass("fancybox-lock-test");d=f(s).width();K.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery); \ No newline at end of file diff --git a/feed.xml b/feed.xml new file mode 100644 index 0000000..a6628bd --- /dev/null +++ b/feed.xml @@ -0,0 +1,30 @@ +--- +layout: null +--- + + + + {{ site.title | xml_escape }} + {{ site.description | xml_escape }} + {{ site.url }}{{ site.baseurl }}/ + + {{ site.time | date_to_rfc822 }} + {{ site.time | date_to_rfc822 }} + Jekyll v{{ jekyll.version }} + {% for post in site.posts limit:10 %} + + {{ post.title | xml_escape }} + {{ post.content | xml_escape }} + {{ post.date | date_to_rfc822 }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {% for tag in post.tags %} + {{ tag | xml_escape }} + {% endfor %} + {% for cat in post.categories %} + {{ cat | xml_escape }} + {% endfor %} + + {% endfor %} + + diff --git a/img/AliPayQR.png b/img/AliPayQR.png deleted file mode 100644 index e54760e..0000000 Binary files a/img/AliPayQR.png and /dev/null differ diff --git a/img/BTCQR.png b/img/BTCQR.png deleted file mode 100644 index b7cd7d4..0000000 Binary files a/img/BTCQR.png and /dev/null differ diff --git a/img/WeChatQR.png b/img/WeChatQR.png deleted file mode 100644 index 2fab71e..0000000 Binary files a/img/WeChatQR.png and /dev/null differ diff --git a/img/alipay.svg b/img/alipay.svg deleted file mode 100644 index 2e78967..0000000 --- a/img/alipay.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - diff --git a/img/bitcoin.svg b/img/bitcoin.svg deleted file mode 100644 index dc64d87..0000000 --- a/img/bitcoin.svg +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/img/github.svg b/img/github.svg deleted file mode 100644 index 7d9f99f..0000000 --- a/img/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/img/like.svg b/img/like.svg deleted file mode 100644 index 44adab3..0000000 --- a/img/like.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/img/paypal.svg b/img/paypal.svg deleted file mode 100644 index cdacb58..0000000 --- a/img/paypal.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - diff --git a/img/wechat.svg b/img/wechat.svg deleted file mode 100644 index c5d50af..0000000 --- a/img/wechat.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/index.html b/index.html index ba32159..83d9398 100644 --- a/index.html +++ b/index.html @@ -1,2 +1,23 @@ -Hash's Blog | 健忘者的备忘录

    Mac+Hexo+Github搭建个人博客-(基础)

    最近记忆力比较差,所以通过写一些文章来帮助记忆。写文章稍微正规一些好,搭一个个人博客来严格要求下自己。以搭建博客作为第一篇文章。

    -

    环境要求

    操作系统:MAC

    Read More

    \ No newline at end of file +--- +layout: default +--- + +
    + +

    Posts

    + +
      + {% for post in site.posts %} +
    • + + +

      + {{ post.title }} +

      +
    • + {% endfor %} +
    + +

    subscribe via RSS

    + +
    diff --git a/js/codeblock-resizer.js b/js/codeblock-resizer.js deleted file mode 100644 index 96fd57f..0000000 --- a/js/codeblock-resizer.js +++ /dev/null @@ -1,51 +0,0 @@ -+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/js/donate.js b/js/donate.js deleted file mode 100644 index da3989b..0000000 --- a/js/donate.js +++ /dev/null @@ -1,78 +0,0 @@ -(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/js/fancybox.js b/js/fancybox.js deleted file mode 100644 index 3535a34..0000000 --- a/js/fancybox.js +++ /dev/null @@ -1,19 +0,0 @@ -$(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/js/gitment.browser.js b/js/gitment.browser.js deleted file mode 100644 index 06e1322..0000000 --- a/js/gitment.browser.js +++ /dev/null @@ -1,3751 +0,0 @@ -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/js/script.js b/js/script.js deleted file mode 100644 index 1e58767..0000000 --- a/js/script.js +++ /dev/null @@ -1,137 +0,0 @@ -(function($){ - // Search - var $searchWrap = $('#search-form-wrap'), - isSearchAnim = false, - searchAnimDuration = 200; - - var startSearchAnim = function(){ - isSearchAnim = true; - }; - - var stopSearchAnim = function(callback){ - setTimeout(function(){ - isSearchAnim = false; - callback && callback(); - }, searchAnimDuration); - }; - - $('#nav-search-btn').on('click', function(){ - if (isSearchAnim) return; - - startSearchAnim(); - $searchWrap.addClass('on'); - stopSearchAnim(function(){ - $('.search-form-input').focus(); - }); - }); - - $('.search-form-input').on('blur', function(){ - startSearchAnim(); - $searchWrap.removeClass('on'); - stopSearchAnim(); - }); - - // 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'), - encodedUrl = encodeURIComponent(url), - id = 'article-share-box-' + $this.attr('data-id'), - 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'); - }); - - // Caption - $('.article-entry').each(function(i){ - $(this).find('img').each(function(){ - if ($(this).parent().hasClass('fancybox')) return; - - var alt = this.alt; - - if (alt) $(this).after('' + alt + ''); - - $(this).wrap(''); - }); - - $(this).find('.fancybox').each(function(){ - $(this).attr('rel', 'article' + i); - }); - }); - - if ($.fancybox){ - $('.fancybox').fancybox(); - } - - // Mobile nav - var $container = $('#container'), - isMobileNavAnim = false, - mobileNavAnimDuration = 200; - - var startMobileNavAnim = function(){ - isMobileNavAnim = true; - }; - - var stopMobileNavAnim = function(){ - setTimeout(function(){ - isMobileNavAnim = false; - }, mobileNavAnimDuration); - } - - $('#main-nav-toggle').on('click', function(){ - if (isMobileNavAnim) return; - - startMobileNavAnim(); - $container.toggleClass('mobile-nav-on'); - stopMobileNavAnim(); - }); - - $('#wrap').on('click', function(){ - if (isMobileNavAnim || !$container.hasClass('mobile-nav-on')) return; - - $container.removeClass('mobile-nav-on'); - }); -})(jQuery); \ No newline at end of file diff --git a/js/search.js b/js/search.js deleted file mode 100644 index bba51fb..0000000 --- a/js/search.js +++ /dev/null @@ -1,86 +0,0 @@ -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/js/share.js b/js/share.js deleted file mode 100644 index f358213..0000000 --- a/js/share.js +++ /dev/null @@ -1,60 +0,0 @@ -(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/js/smartresize.js b/js/smartresize.js deleted file mode 100644 index 7def5e7..0000000 --- a/js/smartresize.js +++ /dev/null @@ -1,32 +0,0 @@ -+(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/js/totop.js b/js/totop.js deleted file mode 100644 index afa66d9..0000000 --- a/js/totop.js +++ /dev/null @@ -1,12 +0,0 @@ -$(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; -});