├── .all-contributorsrc
├── .eslintignore
├── .eslintrc
├── .github
└── workflows
│ └── pages.yml
├── .gitignore
├── LICENSE
├── README.md
├── _config.yml.example
├── languages
├── default.yml
├── en.yml
├── zh-CN.yml
└── zh-TW.yml
├── layout
├── _macro
│ ├── archive.ejs
│ └── post.ejs
├── _partial
│ ├── _footer
│ │ └── social.ejs
│ ├── _head
│ │ └── meta.ejs
│ ├── _post
│ │ ├── copyright.ejs
│ │ ├── reward.ejs
│ │ └── toc.ejs
│ ├── comments.ejs
│ ├── footer.ejs
│ ├── head.ejs
│ ├── header.ejs
│ ├── pagination.ejs
│ ├── slideout.ejs
│ └── title.ejs
├── _script
│ ├── _analytics
│ │ ├── baidu-analytics.ejs
│ │ └── google-analytics.ejs
│ ├── _comments
│ │ ├── changyan.ejs
│ │ ├── cusdis.ejs
│ │ ├── disqus.ejs
│ │ ├── gitalk.ejs
│ │ ├── livere.ejs
│ │ └── utterances.ejs
│ ├── analytics.ejs
│ ├── comments.ejs
│ ├── counter.ejs
│ ├── libs.ejs
│ ├── push.ejs
│ └── theme.ejs
├── archive.ejs
├── categories.ejs
├── index.ejs
├── layout.ejs
├── page.ejs
├── post.ejs
└── tags.ejs
├── package-lock.json
├── package.json
└── source
├── css
├── _base.scss
├── _common
│ ├── _animation.scss
│ ├── _normalize.scss
│ └── _utils.scss
├── _custom
│ └── _custom.scss
├── _partial
│ ├── _archive.scss
│ ├── _back-to-top.scss
│ ├── _categories.scss
│ ├── _footer.scss
│ ├── _footer
│ │ ├── _copyright.scss
│ │ └── _social.scss
│ ├── _header.scss
│ ├── _header
│ │ ├── _logo.scss
│ │ └── _menu.scss
│ ├── _iconfont.scss
│ ├── _mathjax.scss
│ ├── _mobile.scss
│ ├── _pagination.scss
│ ├── _post.scss
│ ├── _post
│ │ ├── _code.scss
│ │ ├── _content.scss
│ │ ├── _copyright.scss
│ │ ├── _footer.scss
│ │ ├── _header.scss
│ │ ├── _reward.scss
│ │ └── _toc.scss
│ ├── _slideout.scss
│ └── _tags.scss
├── _variables.scss
└── style.scss
├── favicon.ico
├── fonts
└── chancery
│ ├── apple-chancery-webfont.eot
│ ├── apple-chancery-webfont.svg
│ ├── apple-chancery-webfont.ttf
│ ├── apple-chancery-webfont.woff
│ └── apple-chancery-webfont.woff2
├── js
└── src
│ └── even.js
├── lib
├── fancybox
│ ├── blank.gif
│ ├── fancybox_loading.gif
│ ├── fancybox_loading@2x.gif
│ ├── fancybox_overlay.png
│ ├── fancybox_sprite.png
│ ├── fancybox_sprite@2x.png
│ ├── helpers
│ │ ├── fancybox_buttons.png
│ │ ├── jquery.fancybox-buttons.css
│ │ ├── jquery.fancybox-buttons.js
│ │ ├── jquery.fancybox-media.js
│ │ ├── jquery.fancybox-thumbs.css
│ │ └── jquery.fancybox-thumbs.js
│ ├── jquery.fancybox.css
│ ├── jquery.fancybox.js
│ └── jquery.fancybox.pack.js
├── jquery
│ └── jquery.min.js
└── slideout
│ ├── slideout.js
│ └── slideout.min.js
└── robots.txt
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "projectName": "hexo-theme-even",
3 | "projectOwner": "ahonn",
4 | "repoType": "github",
5 | "repoHost": "https://github.com",
6 | "files": [
7 | "README.md"
8 | ],
9 | "imageSize": 60,
10 | "commit": true,
11 | "commitConvention": "angular",
12 | "contributors": [
13 | {
14 | "login": "ahonn",
15 | "name": "Yuexun Jiang",
16 | "avatar_url": "https://avatars3.githubusercontent.com/u/9718515?v=4",
17 | "profile": "https://www.ahonn.me",
18 | "contributions": [
19 | "code",
20 | "doc",
21 | "design",
22 | "ideas"
23 | ]
24 | }
25 | ],
26 | "contributorsPerLine": 7
27 | }
28 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | source/lib
2 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true
4 | },
5 | "parserOptions": {
6 | "ecmaVersion": 5,
7 | "ecmaFeatures": {
8 | "impliedStrict": true
9 | }
10 | },
11 | "globals": {
12 | "$": true,
13 | "AV": true,
14 | "NProgress": true,
15 | "Even": true,
16 | "themeConfig": true,
17 | "Slideout": true
18 | },
19 | "extends": "eslint:recommended"
20 | }
21 |
--------------------------------------------------------------------------------
/.github/workflows/pages.yml:
--------------------------------------------------------------------------------
1 | name: GitHub Pages
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | - demo-source
8 |
9 | jobs:
10 | build:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Checkout branch
14 | uses: actions/checkout@master
15 | with:
16 | ref: demo-source
17 | - name: Use Node.js
18 | uses: actions/setup-node@master
19 | with:
20 | node-version: '18.x'
21 | - name: Cache NPM dependencies
22 | uses: actions/cache@v2
23 | with:
24 | path: node_modules
25 | key: ${{ runner.OS }}-npm-cache
26 | restore-keys: |
27 | ${{ runner.OS }}-npm-cache
28 | - name: Prepare source
29 | run: |
30 | npm install hexo-renderer-ejs hexo-renderer-dartsass --save
31 | git clone -b master https://github.com/ahonn/hexo-theme-even.git themes/even
32 | cp themes/even/_config.yml.example themes/even/_config.yml
33 | - name: Install Dependencies
34 | run: npm install
35 | - name: Build
36 | run: |
37 | npm i -g hexo-cli
38 | hexo generate
39 | - name: Upload Pages artifact
40 | uses: actions/upload-pages-artifact@v2
41 | with:
42 | path: ./public
43 | deploy:
44 | needs: build
45 | permissions:
46 | pages: write
47 | id-token: write
48 | environment:
49 | name: github-pages
50 | url: ${{ steps.deployment.outputs.page_url }}
51 | runs-on: ubuntu-latest
52 | steps:
53 | - name: Deploy to GitHub Pages
54 | id: deployment
55 | uses: actions/deploy-pages@v2
56 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /node_modules
3 | *.log
4 | /.vscode
5 | _config.yml
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015-current
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # hexo-theme-even
2 | A super simple theme for Hexo
3 |
4 |
5 |
6 | [](https://github.com/ahonn/hexo-theme-even/stargazers)
7 | [](https://github.com/ahonn/hexo-theme-even/network)
8 | [](https://github.com/ahonn/hexo-theme-even/issues)
9 | [](https://raw.githubusercontent.com/ahonn/hexo-theme-even/master/LICENSE)
10 |
11 | ## Screenshots
12 | 
13 |
14 | [🔯 Live Preview](https://ahonn.github.io/hexo-theme-even/)
15 |
16 | ## Installation
17 | ```bash
18 | $ npm install hexo-renderer-ejs hexo-renderer-dartsass --save
19 | $ git clone https://github.com/ahonn/hexo-theme-even themes/even
20 | $ cp themes/even/_config.yml.example themes/even/_config.yml
21 | ```
22 |
23 | Modify `yoursite/_config.yml`:
24 |
25 | ```yaml
26 | # Extensions
27 | ## Plugins: http://hexo.io/plugins/
28 | ## Themes: http://hexo.io/themes/
29 | theme: even
30 | ```
31 |
32 | For more options, check out the [document](https://github.com/ahonn/hexo-theme-even/wiki)
33 |
34 | ## Update
35 | You can update to latest master branch by the following command:
36 |
37 | ```base
38 | $ cd themes/even
39 | $ git pull
40 | ```
41 |
42 | ## Contributing
43 | Contribution is welcome, feel free to open an issue or pull request.
44 |
45 | ## Contributors
46 |
47 | This project exists thanks to all the people who contribute.
48 |
49 |
--------------------------------------------------------------------------------
/_config.yml.example:
--------------------------------------------------------------------------------
1 | # ===========================================
2 | # Site Information Settings
3 | # ===========================================
4 |
5 | # Site creation time
6 | since: 2015
7 |
8 | # Custom your favicon.ico in `site/source`
9 | favicon: /favicon.ico
10 |
11 | # Set feed link (false | default | your feed link)
12 | # false: disable
13 | # default: use `atom.xml`, generator for `hexo-generator-feed`
14 | rss: default
15 |
16 | # ===========================================
17 | # Menu Settings
18 | # ===========================================
19 | menu:
20 | Home: /
21 | # Archives: /archives/
22 | # Tags: /tags/
23 | # Categories: /categories/
24 | # About: /about/
25 |
26 | # ===========================================
27 | # Theme Settings
28 | # ===========================================
29 | # color: default | mint green | cobalt blue | hot pink | dark violet
30 | color: default
31 |
32 | # default page mode: default | archives
33 | mode: default
34 |
35 | toc: true
36 |
37 | # jQuery fancybox
38 | fancybox: true
39 |
40 | # LaTeX support (via MathJax)
41 | latex: false
42 |
43 | copyright:
44 | enable: true
45 | # https://creativecommons.org/
46 | license: '知识共享署名-非商业性使用 4.0 国际许可协议'
47 |
48 | reward:
49 | enable: false
50 | qrCode:
51 | wechat:
52 | alipay:
53 |
54 | # ===========================================
55 | # Social links Settings
56 | # ===========================================
57 | social:
58 | email: your@email.com
59 | stack-overflow:
60 | twitter:
61 | facebook:
62 | linkedin:
63 | google:
64 | github: https://github.com/ahonn
65 | weibo:
66 | zhihu:
67 | douban:
68 | pocket:
69 | tumblr:
70 | instagram:
71 |
72 | # ===========================================
73 | # Third Party Services Settings
74 | # ===========================================
75 |
76 | # LeanCloud
77 | leancloud:
78 | app_id:
79 | app_key:
80 | server_url:
81 | cdn:
82 |
83 | # Baidu Analytics
84 | baidu_analytics:
85 | # Baidu Verification
86 | baidu_verification:
87 |
88 | # Baidu push
89 | baidu_push:
90 |
91 | # Google Analytics
92 | google_analytics:
93 | # Google Verification
94 | google_verification:
95 |
96 | # Disqus
97 | disqus_shortname:
98 |
99 | #Changyan
100 | changyan:
101 | appid:
102 | appkey:
103 |
104 | #LiveRe
105 | livere_datauid:
106 |
107 | # Gitalk
108 | # Demo: https://gitalk.github.io
109 | # https://github.com/gitalk/gitalk
110 | gitalk:
111 | enable: false
112 | github_id: GitHub repo owner
113 | repo: GitHub repo
114 | client_id: GitHub Application Client ID
115 | client_secret: GitHub Application Client Secret
116 | admin_user: GitHub repo owner and collaborators, only these guys can initialize github issues
117 | distraction_free_mode: true # Facebook-like distraction free mode
118 | # Gitalk's display language depends on user's browser or system environment
119 | # If you want everyone visiting your site to see a uniform language, you can set a force language value
120 | # Available values: en, es-ES, fr, ru, zh-CN, zh-TW
121 | language:
122 |
123 | # utterances
124 | # Docs: https://utteranc.es/
125 | # Tips: Make sure you have installed [utterances app](https://github.com/apps/utterances) in your repo
126 | utterances:
127 | enable: false
128 | repo: owner/repo # Repository
129 | issueTerm: title # Blog post ↔️ issue mapping: pathname | url | title | og:title
130 | theme: github-light # Theme: github-light | github-dark | github-dark-orange | icy-dark | dark-blue | photon-dark
131 | label: utterances # Issue label
132 |
133 | # ===========================================
134 | # Version
135 | # ===========================================
136 | version: 3.0.0
137 |
--------------------------------------------------------------------------------
/languages/default.yml:
--------------------------------------------------------------------------------
1 | menu:
2 | home: Home
3 | archives: Archives
4 | tags: Tags
5 | categories: Categories
6 | about: About
7 |
8 | footer:
9 | powered: "Powered by %s"
10 | theme: Theme
11 |
12 | posts:
13 | prev: Prev
14 | next: Next
15 | prev_post: Prev
16 | next_post: Next
17 | toc: Contents
18 | readmore: Read more..
19 | visits: Visits
20 | reward: 'Reward'
21 |
22 | copyright:
23 | author: 'Author'
24 | link: 'Link'
25 | license: 'License'
26 |
27 | counter:
28 | archives:
29 | zero: No Posts
30 | one: 1 Post
31 | other: "%d Posts In Total"
32 |
33 | tagcloud:
34 | zero: No tags
35 | one: 1 Tag In Total
36 | other: "%d Tags In Total"
37 |
38 | categories:
39 | zero: No Categories
40 | one: 1 Category In Total
41 | other: "%d Categories In Total"
42 |
--------------------------------------------------------------------------------
/languages/en.yml:
--------------------------------------------------------------------------------
1 | menu:
2 | home: Home
3 | archives: Archives
4 | tags: Tags
5 | categories: Categories
6 | about: About
7 |
8 | footer:
9 | powered: "Powered by %s"
10 | theme: Theme
11 |
12 | posts:
13 | prev: Prev
14 | next: Next
15 | prev_post: Prev
16 | next_post: Next
17 | toc: Contents
18 | readmore: Read more..
19 | visits: Visits
20 | reward: 'Reward'
21 |
22 | copyright:
23 | author: 'Author'
24 | link: 'Link'
25 | license: 'License'
26 |
27 | counter:
28 | archives:
29 | zero: No Posts
30 | one: 1 Post
31 | other: "%d Posts In Total"
32 |
33 | tagcloud:
34 | zero: No tags
35 | one: 1 Tag In Total
36 | other: "%d Tags In Total"
37 |
38 | categories:
39 | zero: No Categories
40 | one: 1 Category In Total
41 | other: "%d Categories In Total"
42 |
--------------------------------------------------------------------------------
/languages/zh-CN.yml:
--------------------------------------------------------------------------------
1 | menu:
2 | home: 首页
3 | archives: 归档
4 | tags: 标签
5 | categories: 分类
6 | about: 关于
7 |
8 | footer:
9 | powered: "由 %s 强力驱动"
10 | theme: 主题
11 |
12 | posts:
13 | prev: 上一页
14 | next: 下一页
15 | prev_post: 上一篇
16 | next_post: 下一篇
17 | toc: 文章目录
18 | readmore: 阅读更多
19 | visits: '阅读次数'
20 | reward: '赞赏支持'
21 |
22 | copyright:
23 | author: '原文作者'
24 | link: '原文链接'
25 | license: '许可协议'
26 |
27 | counter:
28 | archives:
29 | zero: 暂无日志
30 | one: 目前共计 1 篇日志
31 | other: "目前共计 %d 篇日志"
32 |
33 | tagcloud:
34 | zero: 暂无标签
35 | one: 目前共计 1 个标签
36 | other: "目前共计 %d 个标签"
37 |
38 | categories:
39 | zero: 暂无分类
40 | one: 目前共计 1 个分类
41 | other: "目前共计 %d 个分类"
42 |
--------------------------------------------------------------------------------
/languages/zh-TW.yml:
--------------------------------------------------------------------------------
1 | menu:
2 | home: 首頁
3 | archives: 歸檔
4 | tags: 標籤
5 | categories: 分類
6 | about: 關於
7 |
8 | footer:
9 | powered: "由 %s 技術提供"
10 | theme: 主題
11 |
12 | posts:
13 | prev: 上一頁
14 | next: 下一頁
15 | prev_post: 上一篇
16 | next_post: 下一篇
17 | toc: 文章目錄
18 | readmore: 閱讀更多
19 | visits: '閱讀次數'
20 | reward: '讚賞支持'
21 |
22 | copyright:
23 | author: '原文作者'
24 | link: '原文鏈結'
25 | license: '授權'
26 |
27 | counter:
28 | archives:
29 | zero: 暫無文章
30 | one: 目前總計 1 篇文章
31 | other: "目前總計 %d 篇文章"
32 |
33 | tagcloud:
34 | zero: 暫無文章
35 | one: 目前總計 1 個標籤
36 | other: "目前總計 %d 個標籤"
37 |
38 | categories:
39 | zero: 暫無分類
40 | one: 目前總計 1 個分類
41 | other: "目前總計 %d 個分類"
42 |
--------------------------------------------------------------------------------
/layout/_macro/archive.ejs:
--------------------------------------------------------------------------------
1 | <%
2 | var isArchivesPage = !!page.archive;
3 | var isArchivesMode = theme.mode.toLowerCase() === 'archives';
4 | %>
5 |
6 |
7 | <% if (!page.prev) { %>
8 | <% if (page.tag) { %>
9 |
10 |
<%= page.tag %>
11 |
12 | <% } else if (page.category) { %>
13 |
14 |
<%= page.category %>
15 |
16 | <% } else if (isArchivesPage) { %>
17 |
18 |
19 | <%= _p("counter.archives", site.posts.length) %>
20 |
21 |
22 | <% } %>
23 | <% } %>
24 |
25 | <% var year; %>
26 | <% page.posts.forEach(function(post) { %>
27 | <% if (isArchivesPage || isArchivesMode) { %>
28 | <% post.year = date(post.date, 'YYYY'); %>
29 | <% if (post.year !== year) { %>
30 | <% year = post.year; %>
31 |
36 | <% } %>
37 | <% } %>
38 |
39 |
40 |
41 | <% if (isArchivesPage || isArchivesMode) { %>
42 | <%= date(post.date, 'MM-DD') %>
43 | <% } else { %>
44 | <%= date(post.date, 'YYYY-MM-DD') %>
45 | <% } %>
46 |
47 |
48 |
49 | <%= post.title %>
50 |
51 |
52 |
53 | <% }); %>
54 |
55 |
56 | <%- partial('../_partial/pagination.ejs') %>
--------------------------------------------------------------------------------
/layout/_macro/post.ejs:
--------------------------------------------------------------------------------
1 |
2 |
34 |
35 | <%- partial("../_partial/_post/toc.ejs") %>
36 |
37 |
38 | <% if (is_home()) { %>
39 | <% var excerpt = ""; %>
40 | <% if (post.description) { %>
41 | <% excerpt = '
' + post.description + '
'; %>
42 | <% } else if (post.excerpt) { %>
43 | <% excerpt = post.excerpt; %>
44 | <% } %>
45 |
46 | <% if (excerpt) { %>
47 | <%- excerpt %>
48 |
51 | <% } else { %>
52 | <%- post.content %>
53 | <% } %>
54 | <% } else { %>
55 | <%- post.content %>
56 | <% } %>
57 |
58 |
59 | <% if (!is_home()) { %>
60 | <%- partial("../_partial/_post/copyright.ejs") %>
61 | <%- partial("../_partial/_post/reward.ejs") %>
62 | <% } %>
63 |
64 | <% if (!is_home()) { %>
65 |
75 | <% } %>
76 |
77 |
--------------------------------------------------------------------------------
/layout/_partial/_footer/social.ejs:
--------------------------------------------------------------------------------
1 | <% if (theme.social) { %>
2 | ')
64 | };
65 |
66 | Even.prototype.scrollToc = function () {
67 | var SPACING = 20;
68 | var $toc = $('.post-toc');
69 | var $footer = $('.post-footer');
70 |
71 | if ($toc.length) {
72 | var minScrollTop = $toc.offset().top - SPACING;
73 | $(window).scroll(function () {
74 | var tocState = {
75 | start: {
76 | 'position': 'absolute',
77 | 'top': minScrollTop
78 | },
79 | process: {
80 | 'position': 'fixed',
81 | 'top': SPACING
82 | }
83 | }
84 | var scrollTop = $(window).scrollTop();
85 | if (scrollTop < minScrollTop) {
86 | $toc.css(tocState.start);
87 | } else {
88 | $toc.css(tocState.process);
89 |
90 | if($(".post-toc").css("display") != "none"){
91 | var maxTocTop = $footer.offset().top - $toc.height() - SPACING;
92 | var tocCenterThreshold = document.documentElement.scrollTop + window.innerHeight / 2;
93 | if ($(".toc-link.active").offset() != undefined && $(".toc-link.active").offset().top > tocCenterThreshold) {
94 | var distanceBetween = $(".post-toc").offset().top - $(".toc-link.active").offset().top;
95 | $(".post-toc").offset({
96 | top: Math.min(maxTocTop, tocCenterThreshold + distanceBetween),
97 | });
98 | }
99 | if (maxTocTop < $(".post-toc").offset().top) {
100 | $(".post-toc").offset({ top: maxTocTop });
101 | }
102 | }
103 | }
104 | })
105 | }
106 | };
107 |
108 | Even.prototype.tocFollow = function () {
109 | var HEADERFIX = 30;
110 | var $toclink = $('.toc-link'),
111 | $headerlink = $('.headerlink');
112 |
113 | $(window).scroll(function () {
114 | var headerlinkTop = $.map($headerlink, function (link) {
115 | return $(link).offset().top;
116 | });
117 | var scrollTop = $(window).scrollTop();
118 |
119 | for (var i = 0; i < $toclink.length; i++) {
120 | var isLastOne = i + 1 === $toclink.length,
121 | currentTop = headerlinkTop[i] - HEADERFIX,
122 | nextTop = isLastOne ? Infinity : headerlinkTop[i + 1] - HEADERFIX;
123 |
124 | if (currentTop < scrollTop && scrollTop <= nextTop) {
125 | $($toclink[i]).addClass('active');
126 | } else {
127 | $($toclink[i]).removeClass('active');
128 | }
129 | }
130 | });
131 | };
132 |
133 | Even.prototype.fancybox = function () {
134 | if ($.fancybox) {
135 | $('.post').each(function () {
136 | $(this).find('img').each(function () {
137 | var href = 'href="' + this.src + '"';
138 | var title = 'title="' + this.alt + '"';
139 | $(this).wrap('
');
140 | });
141 | });
142 |
143 | $('.fancybox').fancybox({
144 | openEffect: 'elastic',
145 | closeEffect: 'elastic'
146 | });
147 | }
148 | };
149 |
150 | Even.prototype.recordReadings = function () {
151 | if (typeof AV !== 'object') return;
152 |
153 | var $visits = $('.post-visits');
154 | var Counter = AV.Object.extend('Counter');
155 | if ($visits.length === 1) {
156 | addCounter(Counter);
157 | } else {
158 | showTime(Counter);
159 | }
160 |
161 | function updateVisits(dom, time) {
162 | var readText = dom.text().replace(/(\d+)/i, time)
163 | dom.text(readText);
164 | }
165 |
166 | function addCounter(Counter) {
167 | var query = new AV.Query(Counter);
168 |
169 | var url = $visits.data('url').trim();
170 | var title = $visits.data('title').trim();
171 |
172 | query.equalTo('url', url);
173 | query.find().then(function (results) {
174 | if (results.length > 0) {
175 | var counter = results[0];
176 | counter.save(null, {
177 | fetchWhenSave: true
178 | }).then(function (counter) {
179 | counter.increment('time', 1);
180 | return counter.save();
181 | }).then(function (counter) {
182 | updateVisits($visits, counter.get('time'));
183 | });
184 | } else {
185 | var newcounter = new Counter();
186 | newcounter.set('title', title);
187 | newcounter.set('url', url);
188 | newcounter.set('time', 1);
189 |
190 | var acl = new AV.ACL();
191 | acl.setWriteAccess('*', true)
192 | acl.setReadAccess('*', true)
193 | newcounter.setACL(acl)
194 |
195 | newcounter.save().then(function () {
196 | updateVisits($visits, newcounter.get('time'));
197 | });
198 | }
199 | }, function (error) {
200 | // eslint-disable-next-line
201 | console.log('Error:' + error.code + ' ' + error.message);
202 | });
203 | }
204 |
205 | function showTime(Counter) {
206 | let index = 0;
207 | $visits.each(function () {
208 | var $this = $(this);
209 | setTimeout(
210 | function() {
211 | var query = new AV.Query(Counter);
212 | var url = $this.data('url').trim();
213 |
214 | query.equalTo('url', url);
215 | query.find().then(function (results) {
216 | if (results.length === 0) {
217 | updateVisits($this, 0);
218 | } else {
219 | var counter = results[0];
220 | updateVisits($this, counter.get('time'));
221 | }
222 | }, function (error) {
223 | // eslint-disable-next-line
224 | console.log('Error:' + error.code + ' ' + error.message);
225 | });
226 | }, 100*(index++));
227 | })
228 | }
229 | };
230 |
231 | Even.prototype.backToTop = function () {
232 | var $backToTop = $('#back-to-top');
233 |
234 | $(window).scroll(function () {
235 | if ($(window).scrollTop() > 100) {
236 | $backToTop.fadeIn(1000);
237 | } else {
238 | $backToTop.fadeOut(1000);
239 | }
240 | });
241 |
242 | $backToTop.click(function () {
243 | $('body,html').animate({ scrollTop: 0 });
244 | });
245 | };
246 |
247 | Even.prototype.renderLaTeX = function () {
248 | var loopID = setInterval(function () {
249 | if(window.MathJax) {
250 | var jax = window.MathJax;
251 | jax.Hub.Config({ tex2jax: { inlineMath: [['$', '$'], ['\\(', '\\)']] }});
252 | jax.Hub.Queue(['Typeset', jax.Hub, $(document.body)[0]]);
253 | clearInterval(loopID);
254 | }
255 | }, 500);
256 | }
257 |
258 | var config = window.config;
259 | var even = new Even(config);
260 | even.setup();
261 | }(window))
262 |
--------------------------------------------------------------------------------
/source/lib/fancybox/blank.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/blank.gif
--------------------------------------------------------------------------------
/source/lib/fancybox/fancybox_loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_loading.gif
--------------------------------------------------------------------------------
/source/lib/fancybox/fancybox_loading@2x.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_loading@2x.gif
--------------------------------------------------------------------------------
/source/lib/fancybox/fancybox_overlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_overlay.png
--------------------------------------------------------------------------------
/source/lib/fancybox/fancybox_sprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_sprite.png
--------------------------------------------------------------------------------
/source/lib/fancybox/fancybox_sprite@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/fancybox_sprite@2x.png
--------------------------------------------------------------------------------
/source/lib/fancybox/helpers/fancybox_buttons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahonn/hexo-theme-even/0943a339232c04c7686b656a408972701e84e5f8/source/lib/fancybox/helpers/fancybox_buttons.png
--------------------------------------------------------------------------------
/source/lib/fancybox/helpers/jquery.fancybox-buttons.css:
--------------------------------------------------------------------------------
1 | #fancybox-buttons {
2 | position: fixed;
3 | left: 0;
4 | width: 100%;
5 | z-index: 8050;
6 | }
7 |
8 | #fancybox-buttons.top {
9 | top: 10px;
10 | }
11 |
12 | #fancybox-buttons.bottom {
13 | bottom: 10px;
14 | }
15 |
16 | #fancybox-buttons ul {
17 | display: block;
18 | width: 166px;
19 | height: 30px;
20 | margin: 0 auto;
21 | padding: 0;
22 | list-style: none;
23 | border: 1px solid #111;
24 | border-radius: 3px;
25 | -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
26 | -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
27 | box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
28 | background: rgb(50,50,50);
29 | 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%);
30 | 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)));
31 | 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%);
32 | 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%);
33 | 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%);
34 | background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
35 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
36 | }
37 |
38 | #fancybox-buttons ul li {
39 | float: left;
40 | margin: 0;
41 | padding: 0;
42 | }
43 |
44 | #fancybox-buttons a {
45 | display: block;
46 | width: 30px;
47 | height: 30px;
48 | text-indent: -9999px;
49 | background-color: transparent;
50 | background-image: url('fancybox_buttons.png');
51 | background-repeat: no-repeat;
52 | outline: none;
53 | opacity: 0.8;
54 | }
55 |
56 | #fancybox-buttons a:hover {
57 | opacity: 1;
58 | }
59 |
60 | #fancybox-buttons a.btnPrev {
61 | background-position: 5px 0;
62 | }
63 |
64 | #fancybox-buttons a.btnNext {
65 | background-position: -33px 0;
66 | border-right: 1px solid #3e3e3e;
67 | }
68 |
69 | #fancybox-buttons a.btnPlay {
70 | background-position: 0 -30px;
71 | }
72 |
73 | #fancybox-buttons a.btnPlayOn {
74 | background-position: -30px -30px;
75 | }
76 |
77 | #fancybox-buttons a.btnToggle {
78 | background-position: 3px -60px;
79 | border-left: 1px solid #111;
80 | border-right: 1px solid #3e3e3e;
81 | width: 35px
82 | }
83 |
84 | #fancybox-buttons a.btnToggleOn {
85 | background-position: -27px -60px;
86 | }
87 |
88 | #fancybox-buttons a.btnClose {
89 | border-left: 1px solid #111;
90 | width: 35px;
91 | background-position: -56px 0px;
92 | }
93 |
94 | #fancybox-buttons a.btnDisabled {
95 | opacity : 0.4;
96 | cursor: default;
97 | }
--------------------------------------------------------------------------------
/source/lib/fancybox/helpers/jquery.fancybox-buttons.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Buttons helper for fancyBox
3 | * version: 1.0.5 (Mon, 15 Oct 2012)
4 | * @requires fancyBox v2.0 or later
5 | *
6 | * Usage:
7 | * $(".fancybox").fancybox({
8 | * helpers : {
9 | * buttons: {
10 | * position : 'top'
11 | * }
12 | * }
13 | * });
14 | *
15 | */
16 | (function ($) {
17 | //Shortcut for fancyBox object
18 | var F = $.fancybox;
19 |
20 | //Add helper object
21 | F.helpers.buttons = {
22 | defaults : {
23 | skipSingle : false, // disables if gallery contains single image
24 | position : 'top', // 'top' or 'bottom'
25 | tpl : '
'
26 | },
27 |
28 | list : null,
29 | buttons: null,
30 |
31 | beforeLoad: function (opts, obj) {
32 | //Remove self if gallery do not have at least two items
33 |
34 | if (opts.skipSingle && obj.group.length < 2) {
35 | obj.helpers.buttons = false;
36 | obj.closeBtn = true;
37 |
38 | return;
39 | }
40 |
41 | //Increase top margin to give space for buttons
42 | obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
43 | },
44 |
45 | onPlayStart: function () {
46 | if (this.buttons) {
47 | this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
48 | }
49 | },
50 |
51 | onPlayEnd: function () {
52 | if (this.buttons) {
53 | this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
54 | }
55 | },
56 |
57 | afterShow: function (opts, obj) {
58 | var buttons = this.buttons;
59 |
60 | if (!buttons) {
61 | this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
62 |
63 | buttons = {
64 | prev : this.list.find('.btnPrev').click( F.prev ),
65 | next : this.list.find('.btnNext').click( F.next ),
66 | play : this.list.find('.btnPlay').click( F.play ),
67 | toggle : this.list.find('.btnToggle').click( F.toggle ),
68 | close : this.list.find('.btnClose').click( F.close )
69 | }
70 | }
71 |
72 | //Prev
73 | if (obj.index > 0 || obj.loop) {
74 | buttons.prev.removeClass('btnDisabled');
75 | } else {
76 | buttons.prev.addClass('btnDisabled');
77 | }
78 |
79 | //Next / Play
80 | if (obj.loop || obj.index < obj.group.length - 1) {
81 | buttons.next.removeClass('btnDisabled');
82 | buttons.play.removeClass('btnDisabled');
83 |
84 | } else {
85 | buttons.next.addClass('btnDisabled');
86 | buttons.play.addClass('btnDisabled');
87 | }
88 |
89 | this.buttons = buttons;
90 |
91 | this.onUpdate(opts, obj);
92 | },
93 |
94 | onUpdate: function (opts, obj) {
95 | var toggle;
96 |
97 | if (!this.buttons) {
98 | return;
99 | }
100 |
101 | toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
102 |
103 | //Size toggle button
104 | if (obj.canShrink) {
105 | toggle.addClass('btnToggleOn');
106 |
107 | } else if (!obj.canExpand) {
108 | toggle.addClass('btnDisabled');
109 | }
110 | },
111 |
112 | beforeClose: function () {
113 | if (this.list) {
114 | this.list.remove();
115 | }
116 |
117 | this.list = null;
118 | this.buttons = null;
119 | }
120 | };
121 |
122 | }(jQuery));
123 |
--------------------------------------------------------------------------------
/source/lib/fancybox/helpers/jquery.fancybox-media.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Media helper for fancyBox
3 | * version: 1.0.6 (Fri, 14 Jun 2013)
4 | * @requires fancyBox v2.0 or later
5 | *
6 | * Usage:
7 | * $(".fancybox").fancybox({
8 | * helpers : {
9 | * media: true
10 | * }
11 | * });
12 | *
13 | * Set custom URL parameters:
14 | * $(".fancybox").fancybox({
15 | * helpers : {
16 | * media: {
17 | * youtube : {
18 | * params : {
19 | * autoplay : 0
20 | * }
21 | * }
22 | * }
23 | * }
24 | * });
25 | *
26 | * Or:
27 | * $(".fancybox").fancybox({,
28 | * helpers : {
29 | * media: true
30 | * },
31 | * youtube : {
32 | * autoplay: 0
33 | * }
34 | * });
35 | *
36 | * Supports:
37 | *
38 | * Youtube
39 | * http://www.youtube.com/watch?v=opj24KnzrWo
40 | * http://www.youtube.com/embed/opj24KnzrWo
41 | * http://youtu.be/opj24KnzrWo
42 | * http://www.youtube-nocookie.com/embed/opj24KnzrWo
43 | * Vimeo
44 | * http://vimeo.com/40648169
45 | * http://vimeo.com/channels/staffpicks/38843628
46 | * http://vimeo.com/groups/surrealism/videos/36516384
47 | * http://player.vimeo.com/video/45074303
48 | * Metacafe
49 | * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
50 | * http://www.metacafe.com/watch/7635964/
51 | * Dailymotion
52 | * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
53 | * Twitvid
54 | * http://twitvid.com/QY7MD
55 | * Twitpic
56 | * http://twitpic.com/7p93st
57 | * Instagram
58 | * http://instagr.am/p/IejkuUGxQn/
59 | * http://instagram.com/p/IejkuUGxQn/
60 | * Google maps
61 | * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
62 | * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
63 | * 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
64 | */
65 | (function ($) {
66 | "use strict";
67 |
68 | //Shortcut for fancyBox object
69 | var F = $.fancybox,
70 | format = function( url, rez, params ) {
71 | params = params || '';
72 |
73 | if ( $.type( params ) === "object" ) {
74 | params = $.param(params, true);
75 | }
76 |
77 | $.each(rez, function(key, value) {
78 | url = url.replace( '$' + key, value || '' );
79 | });
80 |
81 | if (params.length) {
82 | url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
83 | }
84 |
85 | return url;
86 | };
87 |
88 | //Add helper object
89 | F.helpers.media = {
90 | defaults : {
91 | youtube : {
92 | matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
93 | params : {
94 | autoplay : 1,
95 | autohide : 1,
96 | fs : 1,
97 | rel : 0,
98 | hd : 1,
99 | wmode : 'opaque',
100 | enablejsapi : 1
101 | },
102 | type : 'iframe',
103 | url : '//www.youtube.com/embed/$3'
104 | },
105 | vimeo : {
106 | matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
107 | params : {
108 | autoplay : 1,
109 | hd : 1,
110 | show_title : 1,
111 | show_byline : 1,
112 | show_portrait : 0,
113 | fullscreen : 1
114 | },
115 | type : 'iframe',
116 | url : '//player.vimeo.com/video/$1'
117 | },
118 | metacafe : {
119 | matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
120 | params : {
121 | autoPlay : 'yes'
122 | },
123 | type : 'swf',
124 | url : function( rez, params, obj ) {
125 | obj.swf.flashVars = 'playerVars=' + $.param( params, true );
126 |
127 | return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
128 | }
129 | },
130 | dailymotion : {
131 | matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
132 | params : {
133 | additionalInfos : 0,
134 | autoStart : 1
135 | },
136 | type : 'swf',
137 | url : '//www.dailymotion.com/swf/video/$1'
138 | },
139 | twitvid : {
140 | matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
141 | params : {
142 | autoplay : 0
143 | },
144 | type : 'iframe',
145 | url : '//www.twitvid.com/embed.php?guid=$1'
146 | },
147 | twitpic : {
148 | matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
149 | type : 'image',
150 | url : '//twitpic.com/show/full/$1/'
151 | },
152 | instagram : {
153 | matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
154 | type : 'image',
155 | url : '//$1/p/$2/media/?size=l'
156 | },
157 | google_maps : {
158 | matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
159 | type : 'iframe',
160 | url : function( rez ) {
161 | return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
162 | }
163 | }
164 | },
165 |
166 | beforeLoad : function(opts, obj) {
167 | var url = obj.href || '',
168 | type = false,
169 | what,
170 | item,
171 | rez,
172 | params;
173 |
174 | for (what in opts) {
175 | if (opts.hasOwnProperty(what)) {
176 | item = opts[ what ];
177 | rez = url.match( item.matcher );
178 |
179 | if (rez) {
180 | type = item.type;
181 | params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
182 |
183 | url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
184 |
185 | break;
186 | }
187 | }
188 | }
189 |
190 | if (type) {
191 | obj.href = url;
192 | obj.type = type;
193 |
194 | obj.autoHeight = false;
195 | }
196 | }
197 | };
198 |
199 | }(jQuery));
--------------------------------------------------------------------------------
/source/lib/fancybox/helpers/jquery.fancybox-thumbs.css:
--------------------------------------------------------------------------------
1 | #fancybox-thumbs {
2 | position: fixed;
3 | left: 0;
4 | width: 100%;
5 | overflow: hidden;
6 | z-index: 8050;
7 | }
8 |
9 | #fancybox-thumbs.bottom {
10 | bottom: 2px;
11 | }
12 |
13 | #fancybox-thumbs.top {
14 | top: 2px;
15 | }
16 |
17 | #fancybox-thumbs ul {
18 | position: relative;
19 | list-style: none;
20 | margin: 0;
21 | padding: 0;
22 | }
23 |
24 | #fancybox-thumbs ul li {
25 | float: left;
26 | padding: 1px;
27 | opacity: 0.5;
28 | }
29 |
30 | #fancybox-thumbs ul li.active {
31 | opacity: 0.75;
32 | padding: 0;
33 | border: 1px solid #fff;
34 | }
35 |
36 | #fancybox-thumbs ul li:hover {
37 | opacity: 1;
38 | }
39 |
40 | #fancybox-thumbs ul li a {
41 | display: block;
42 | position: relative;
43 | overflow: hidden;
44 | border: 1px solid #222;
45 | background: #111;
46 | outline: none;
47 | }
48 |
49 | #fancybox-thumbs ul li img {
50 | display: block;
51 | position: relative;
52 | border: 0;
53 | padding: 0;
54 | max-width: none;
55 | }
--------------------------------------------------------------------------------
/source/lib/fancybox/helpers/jquery.fancybox-thumbs.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Thumbnail helper for fancyBox
3 | * version: 1.0.7 (Mon, 01 Oct 2012)
4 | * @requires fancyBox v2.0 or later
5 | *
6 | * Usage:
7 | * $(".fancybox").fancybox({
8 | * helpers : {
9 | * thumbs: {
10 | * width : 50,
11 | * height : 50
12 | * }
13 | * }
14 | * });
15 | *
16 | */
17 | (function ($) {
18 | //Shortcut for fancyBox object
19 | var F = $.fancybox;
20 |
21 | //Add helper object
22 | F.helpers.thumbs = {
23 | defaults : {
24 | width : 50, // thumbnail width
25 | height : 50, // thumbnail height
26 | position : 'bottom', // 'top' or 'bottom'
27 | source : function ( item ) { // function to obtain the URL of the thumbnail image
28 | var href;
29 |
30 | if (item.element) {
31 | href = $(item.element).find('img').attr('src');
32 | }
33 |
34 | if (!href && item.type === 'image' && item.href) {
35 | href = item.href;
36 | }
37 |
38 | return href;
39 | }
40 | },
41 |
42 | wrap : null,
43 | list : null,
44 | width : 0,
45 |
46 | init: function (opts, obj) {
47 | var that = this,
48 | list,
49 | thumbWidth = opts.width,
50 | thumbHeight = opts.height,
51 | thumbSource = opts.source;
52 |
53 | //Build list structure
54 | list = '';
55 |
56 | for (var n = 0; n < obj.group.length; n++) {
57 | list += '
';
58 | }
59 |
60 | this.wrap = $('
').addClass(opts.position).appendTo('body');
61 | this.list = $('
').appendTo(this.wrap);
62 |
63 | //Load each thumbnail
64 | $.each(obj.group, function (i) {
65 | var href = thumbSource( obj.group[ i ] );
66 |
67 | if (!href) {
68 | return;
69 | }
70 |
71 | $("
![]()
").load(function () {
72 | var width = this.width,
73 | height = this.height,
74 | widthRatio, heightRatio, parent;
75 |
76 | if (!that.list || !width || !height) {
77 | return;
78 | }
79 |
80 | //Calculate thumbnail width/height and center it
81 | widthRatio = width / thumbWidth;
82 | heightRatio = height / thumbHeight;
83 |
84 | parent = that.list.children().eq(i).find('a');
85 |
86 | if (widthRatio >= 1 && heightRatio >= 1) {
87 | if (widthRatio > heightRatio) {
88 | width = Math.floor(width / heightRatio);
89 | height = thumbHeight;
90 |
91 | } else {
92 | width = thumbWidth;
93 | height = Math.floor(height / widthRatio);
94 | }
95 | }
96 |
97 | $(this).css({
98 | width : width,
99 | height : height,
100 | top : Math.floor(thumbHeight / 2 - height / 2),
101 | left : Math.floor(thumbWidth / 2 - width / 2)
102 | });
103 |
104 | parent.width(thumbWidth).height(thumbHeight);
105 |
106 | $(this).hide().appendTo(parent).fadeIn(300);
107 |
108 | }).attr('src', href);
109 | });
110 |
111 | //Set initial width
112 | this.width = this.list.children().eq(0).outerWidth(true);
113 |
114 | 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)));
115 | },
116 |
117 | beforeLoad: function (opts, obj) {
118 | //Remove self if gallery do not have at least two items
119 | if (obj.group.length < 2) {
120 | obj.helpers.thumbs = false;
121 |
122 | return;
123 | }
124 |
125 | //Increase bottom margin to give space for thumbs
126 | obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
127 | },
128 |
129 | afterShow: function (opts, obj) {
130 | //Check if exists and create or update list
131 | if (this.list) {
132 | this.onUpdate(opts, obj);
133 |
134 | } else {
135 | this.init(opts, obj);
136 | }
137 |
138 | //Set active element
139 | this.list.children().removeClass('active').eq(obj.index).addClass('active');
140 | },
141 |
142 | //Center list
143 | onUpdate: function (opts, obj) {
144 | if (this.list) {
145 | this.list.stop(true).animate({
146 | 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
147 | }, 150);
148 | }
149 | },
150 |
151 | beforeClose: function () {
152 | if (this.wrap) {
153 | this.wrap.remove();
154 | }
155 |
156 | this.wrap = null;
157 | this.list = null;
158 | this.width = 0;
159 | }
160 | }
161 |
162 | }(jQuery));
--------------------------------------------------------------------------------
/source/lib/fancybox/jquery.fancybox.css:
--------------------------------------------------------------------------------
1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2 | .fancybox-wrap,
3 | .fancybox-skin,
4 | .fancybox-outer,
5 | .fancybox-inner,
6 | .fancybox-image,
7 | .fancybox-wrap iframe,
8 | .fancybox-wrap object,
9 | .fancybox-nav,
10 | .fancybox-nav span,
11 | .fancybox-tmp
12 | {
13 | padding: 0;
14 | margin: 0;
15 | border: 0;
16 | outline: none;
17 | vertical-align: top;
18 | }
19 |
20 | .fancybox-wrap {
21 | position: absolute;
22 | top: 0;
23 | left: 0;
24 | z-index: 8020;
25 | }
26 |
27 | .fancybox-skin {
28 | position: relative;
29 | background: #f9f9f9;
30 | color: #444;
31 | text-shadow: none;
32 | -webkit-border-radius: 4px;
33 | -moz-border-radius: 4px;
34 | border-radius: 4px;
35 | }
36 |
37 | .fancybox-opened {
38 | z-index: 8030;
39 | }
40 |
41 | .fancybox-opened .fancybox-skin {
42 | -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
43 | -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
44 | box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
45 | }
46 |
47 | .fancybox-outer, .fancybox-inner {
48 | position: relative;
49 | }
50 |
51 | .fancybox-inner {
52 | overflow: hidden;
53 | }
54 |
55 | .fancybox-type-iframe .fancybox-inner {
56 | -webkit-overflow-scrolling: touch;
57 | }
58 |
59 | .fancybox-error {
60 | color: #444;
61 | font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
62 | margin: 0;
63 | padding: 15px;
64 | white-space: nowrap;
65 | }
66 |
67 | .fancybox-image, .fancybox-iframe {
68 | display: block;
69 | width: 100%;
70 | height: 100%;
71 | }
72 |
73 | .fancybox-image {
74 | max-width: 100%;
75 | max-height: 100%;
76 | }
77 |
78 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
79 | background-image: url('fancybox_sprite.png');
80 | }
81 |
82 | #fancybox-loading {
83 | position: fixed;
84 | top: 50%;
85 | left: 50%;
86 | margin-top: -22px;
87 | margin-left: -22px;
88 | background-position: 0 -108px;
89 | opacity: 0.8;
90 | cursor: pointer;
91 | z-index: 8060;
92 | }
93 |
94 | #fancybox-loading div {
95 | width: 44px;
96 | height: 44px;
97 | background: url('fancybox_loading.gif') center center no-repeat;
98 | }
99 |
100 | .fancybox-close {
101 | position: absolute;
102 | top: -18px;
103 | right: -18px;
104 | width: 36px;
105 | height: 36px;
106 | cursor: pointer;
107 | z-index: 8040;
108 | }
109 |
110 | .fancybox-nav {
111 | position: absolute;
112 | top: 0;
113 | width: 40%;
114 | height: 100%;
115 | cursor: pointer;
116 | text-decoration: none;
117 | background: transparent url('blank.gif'); /* helps IE */
118 | -webkit-tap-highlight-color: rgba(0,0,0,0);
119 | z-index: 8040;
120 | }
121 |
122 | .fancybox-prev {
123 | left: 0;
124 | }
125 |
126 | .fancybox-next {
127 | right: 0;
128 | }
129 |
130 | .fancybox-nav span {
131 | position: absolute;
132 | top: 50%;
133 | width: 36px;
134 | height: 34px;
135 | margin-top: -18px;
136 | cursor: pointer;
137 | z-index: 8040;
138 | visibility: hidden;
139 | }
140 |
141 | .fancybox-prev span {
142 | left: 10px;
143 | background-position: 0 -36px;
144 | }
145 |
146 | .fancybox-next span {
147 | right: 10px;
148 | background-position: 0 -72px;
149 | }
150 |
151 | .fancybox-nav:hover span {
152 | visibility: visible;
153 | }
154 |
155 | .fancybox-tmp {
156 | position: absolute;
157 | top: -99999px;
158 | left: -99999px;
159 | visibility: hidden;
160 | max-width: 99999px;
161 | max-height: 99999px;
162 | overflow: visible !important;
163 | }
164 |
165 | /* Overlay helper */
166 |
167 | .fancybox-lock {
168 | overflow: hidden !important;
169 | width: auto;
170 | }
171 |
172 | .fancybox-lock body {
173 | overflow: hidden !important;
174 | }
175 |
176 | .fancybox-lock-test {
177 | overflow-y: hidden !important;
178 | }
179 |
180 | .fancybox-overlay {
181 | position: absolute;
182 | top: 0;
183 | left: 0;
184 | overflow: hidden;
185 | display: none;
186 | z-index: 8010;
187 | background: url('fancybox_overlay.png');
188 | }
189 |
190 | .fancybox-overlay-fixed {
191 | position: fixed;
192 | bottom: 0;
193 | right: 0;
194 | }
195 |
196 | .fancybox-lock .fancybox-overlay {
197 | overflow: auto;
198 | overflow-y: scroll;
199 | }
200 |
201 | /* Title helper */
202 |
203 | .fancybox-title {
204 | visibility: hidden;
205 | font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
206 | position: relative;
207 | text-shadow: none;
208 | z-index: 8050;
209 | }
210 |
211 | .fancybox-opened .fancybox-title {
212 | visibility: visible;
213 | }
214 |
215 | .fancybox-title-float-wrap {
216 | position: absolute;
217 | bottom: 0;
218 | right: 50%;
219 | margin-bottom: -35px;
220 | z-index: 8050;
221 | text-align: center;
222 | }
223 |
224 | .fancybox-title-float-wrap .child {
225 | display: inline-block;
226 | margin-right: -100%;
227 | padding: 2px 20px;
228 | background: transparent; /* Fallback for web browsers that doesn't support RGBa */
229 | background: rgba(0, 0, 0, 0.8);
230 | -webkit-border-radius: 15px;
231 | -moz-border-radius: 15px;
232 | border-radius: 15px;
233 | text-shadow: 0 1px 2px #222;
234 | color: #FFF;
235 | font-weight: bold;
236 | line-height: 24px;
237 | white-space: nowrap;
238 | }
239 |
240 | .fancybox-title-outside-wrap {
241 | position: relative;
242 | margin-top: 10px;
243 | color: #fff;
244 | }
245 |
246 | .fancybox-title-inside-wrap {
247 | padding-top: 10px;
248 | }
249 |
250 | .fancybox-title-over-wrap {
251 | position: absolute;
252 | bottom: 0;
253 | left: 0;
254 | color: #fff;
255 | padding: 10px;
256 | background: #000;
257 | background: rgba(0, 0, 0, .8);
258 | }
259 |
260 | /*Retina graphics!*/
261 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
262 | only screen and (min--moz-device-pixel-ratio: 1.5),
263 | only screen and (min-device-pixel-ratio: 1.5){
264 |
265 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
266 | background-image: url('fancybox_sprite@2x.png');
267 | background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
268 | }
269 |
270 | #fancybox-loading div {
271 | background-image: url('fancybox_loading@2x.gif');
272 | background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
273 | }
274 | }
--------------------------------------------------------------------------------
/source/lib/fancybox/jquery.fancybox.pack.js:
--------------------------------------------------------------------------------
1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2 | (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0
',image:'The requested content cannot be loaded.
Please try again later.
',closeBtn:'