Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexo-theme-next

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-theme-next - npm Package Compare versions

Comparing version 6.3.0 to 6.4.0

54

.github/CONTRIBUTING.md

@@ -23,2 +23,3 @@ <div align="right">Language: :us:

* [Coding Standards](#coding-standards)
* [Labels Rules](#labels-rules)
* [Commit Messages Rules](#commit-messages-rules)

@@ -125,2 +126,55 @@

### Labels Rules
We use "labels" in the issue tracker to help classify pull requests and issues. Using labels enables maintainers and users to quickly find issues they should look into, either because they experience them, or because it meets their area of expertise.
If you are unsure what a label is about or which labels you should apply to a PR or issue, look no further!
Issues related: `types`+`contents`+`results`
- By types
- `Irrelevant`: An irrelevant issue for Next
- `Duplicate`: An issue which had been mentioned
- `Bug`: A detected bug that needs to be confirmed
- `Discussion`: An issue that needs to be discussed
- `Question`: An issue about questions
- `Feature-Request`: An issue that wants a new feature
- `Backlog`: An issue that is to be completed and later compensated
- By contents
- `Roadmap`: An issue about future development
- `Hexo`: An issue related to Hexo
- `Scheme [1] - Mist`: An issue related to Scheme Mist
- `Scheme [2] - Muse`: An issue related to Scheme Muse
- `Scheme [3] - Pisces`: An issue related to Scheme Pisces
- `Scheme [4] - Gemini`: An issue related to Scheme Gemini
- `3rd party service`: An issue related to 3rd party service
- `Docs`: Need to add instruction document
- `Configurations`: An issue related to configurations
- `CSS`: An issue related to CSS
- `Custom`: An issue related to custom things
- `Optimization`: An issue that needs to be optimized
- By results
- `Wontfix`: An issue that will not to be fixed
- `Need More Info`: Need more information for solving the issue
- `Need Confirm`: Need confirmation from the developers or user about the bug or solution
- `Can't Reproduce`: An issue that can’t be reproduced
- `Verified`: An issue that has been verified
- `Help wanted`: An issue that needs help
- `Wait for Answer`: An issue that needs to be answered by the developers or user
- `Resolved Maybe`: An issue that has been resolved maybe
- `Solved`: An issue that has been solved
- `Stale`: This issue has been automatically marked as stale because lack of recent activity
Pull requests related:
- `Breaking Change`: A Pull requests that makes breaking change
- `Bugfix`: A Pull requests that fixes the related bug
- `Docs`: A Pull requests that Instruction document has been added
- `Feature`: A Pull requests that provides a new feature
- `Configurations`: A Pull requests related to configurations
- `Optimization`: A Pull requests that optimizates the Next
- `i18n`: A Pull requests that makes new languages translation
- `Performance`: A Pull requests that improves the performance
- `Discussion`: A Pull requests that needs to be discussed
### Commit Messages Rules

@@ -127,0 +181,0 @@

52

docs/ru/README.md

@@ -9,11 +9,10 @@ <div align="right">Язык: <a title="Английский" href="../../README.md">:us:</a>

[![gitter-image]][gitter-url]
[![riot-image]][riot-url]
[![t-chat-image]][t-chat-url]
[![t-news-image]][t-news-url]
[![lang-image]][lang-url]
[![travis-image]][travis-url]
[![rel-image]][releases-url]
[![hexo-image]][hexo-url]
[![lic-image]][lic-url]
<p align="center">
<a href="https://www.codacy.com/app/theme-next/hexo-theme-next?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=theme-next/hexo-theme-next&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/72f7fe7609c2438a92069f448e5a341a" title="Project Grade"></a>
<a href="https://travis-ci.org/theme-next/hexo-theme-next?branch=master"><img src="https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master" title="Travis CI [Linux]"></a>
<a href="https://crwd.in/theme-next"><img src="https://d322cqt584bo4o.cloudfront.net/theme-next/localized.svg" title="Добавить или улучшить перевод за несколько секунд!"></a>
<a href="https://github.com/theme-next/hexo-theme-next/releases"><img src="https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg"></a>
<a href="http://hexo.io"><img src="https://img.shields.io/badge/hexo-%3E%3D%203.5.0-blue.svg"></a>
<a href="https://github.com/theme-next/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-blue.svg"></a>
</p>

@@ -79,2 +78,11 @@ ## Демо

## Обратная связь
* Задать вопрос на [Stack Overflow][stack-url].
* Запросить новую возможность на [GitHub][contributing-url].
* Голосовать за [популярные запросы возможностей][feat-req-vote-url].
* Сообщить об ошибке в разделе [GitHub Issues][issues-url].
* Вступить в наши [Gitter][gitter-url] / [Riot][riot-url] / [Telegram][t-chat-url] чаты.
* Подписаться на новости через [канал Telegram'а][t-news-url].
## Сторонние приложения

@@ -87,28 +95,14 @@

[lang-image]: https://d322cqt584bo4o.cloudfront.net/theme-next/localized.svg "Добавить или улучшить перевод за несколько секунд!"
[lang-url]: https://crwd.in/theme-next
[stack-url]: https://stackoverflow.com/questions/tagged/theme-next
[contributing-url]: https://github.com/theme-next/hexo-theme-next/blob/master/.github/CONTRIBUTING.md
[feat-req-vote-url]: https://github.com/theme-next/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc
[issues-url]: https://github.com/theme-next/hexo-theme-next/issues
[gitter-image]: https://img.shields.io/badge/gitter-chat-orange.svg "Вступить в нашу комнату Gitter'а"
[gitter-url]: https://gitter.im/theme-next
[riot-image]: https://img.shields.io/badge/riot-chat-DCAB08.svg "Вступить в нашу комнату Riot'а"
[riot-url]: https://riot.im/app/#/room/#NexT:matrix.org
[t-chat-image]: https://img.shields.io/badge/telegram-chat-BAB210.svg "Вступить в нашу группу Telegram'а"
[t-chat-url]: https://t.me/theme_next
[t-news-image]: https://img.shields.io/badge/telegram-news-98B919.svg "Подписаться на канал Telegram'а с новостями"
[t-news-url]: https://t.me/theme_next_news
[travis-image]: https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master
[travis-url]: https://travis-ci.org/theme-next/hexo-theme-next?branch=master "Travis CI [Linux]"
[hexo-image]: https://img.shields.io/badge/hexo-%3E%3D%203.5.0-blue.svg
[hexo-url]: http://hexo.io
[lic-image]: https://img.shields.io/badge/license-%20AGPL-blue.svg
[lic-url]: https://github.com/theme-next/hexo-theme-next/blob/master/LICENSE.md
<!--[rel-image]: https://img.shields.io/github/release/theme-next/hexo-theme-next.svg-->
[rel-image]: https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg
<!--[rel-image]: https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg-->
<!--[mnt-image]: https://img.shields.io/maintenance/yes/2018.svg-->

@@ -118,3 +112,3 @@

[releases-latest-url]: https://github.com/theme-next/hexo-theme-next/releases/latest
[releases-url]: https://github.com/theme-next/hexo-theme-next/releases
<!--[releases-url]: https://github.com/theme-next/hexo-theme-next/releases-->
[tags-url]: https://github.com/theme-next/hexo-theme-next/tags

@@ -121,0 +115,0 @@ [commits-url]: https://github.com/theme-next/hexo-theme-next/commits/master

@@ -23,2 +23,3 @@ <div align="right">语言:<a title="英语" href="../../.github/CONTRIBUTING.md">:us:</a>

* [编码规范](#coding-standards)
* [标签规范](#labels-rules)
* [提交信息规范](#commit-messages-rules)

@@ -127,2 +128,56 @@

<a name="labels-rules"></a>
### 标签规范
为了方便维护人员和用户能够快速找到他们想要查看的问题,我们使用“标签”功能对拉取请求和问题进行分类。
如果您不确定某个标签的含义,或者不知道将哪些标签应用于拉取请求或问题,千万别错过这个。
Issues 的标签:使用`类型`+`内容`+`结果`的组合
- 类型
- `Irrelevant`: 与主题 Next 无关的 Issue
- `Duplicate`: 已经存在同样 Issue
- `Bug`: 提出了 Bug,等待确认
- `Discussion`: 需要讨论的 Issue
- `Question`: 有关咨询的 Issue
- `Feature-Request`: 提出了特性需求的 Issue
- `Backlog`: 待解决的 Issue
- 内容
- `Roadmap`: 与主题 Next 发展相关的 Issue
- `Hexo`: 与 Hexo 相关的 Issue
- `Scheme [1] - Mist`: 与样式 Mist 相关的 Issue
- `Scheme [2] - Muse`: 与样式 Muse 相关的 Issue
- `Scheme [3] - Pisces`: 与样式 Pisces 相关的 Issue
- `Scheme [4] - Gemini`: 与样式 Gemini 相关的 Issue
- `3rd party service`: 与第三方服务相关的 Issue
- `Docs`: 需要添加文档说明的 Issue
- `Configurations`: 与主题 Next 设置相关的 Issue
- `CSS`: 与主题 Next CSS 文件相关的 Issue
- `Custom`: 与主题 Next 个性化相关的 Issue
- `Optimization`: 需要进行优化的 Issue
- 结果
- `Wontfix`: 不能或不被修复的 Issue
- `Need More Info`: 需要更多信息的 Issue
- `Need Confirm`: 需要开发人员或用户确认的 Issue
- `Can't Reproduce`: 不能被重现的 Issue
- `Verified`: 已经被确认的 Issue
- `Help wanted`: 需要帮助的 Issue
- `Wait for Answer`: 需要开发人员或用户回复的 Issue
- `Resolved Maybe`: 可能已经解决的 Issue
- `Solved`: 已经解决的 Issue
- `Stale`: 由于长期无人回应被封存的 Issue
Pull requests 的标签:
- `Breaking Change`: 涉及主题 Next 重大架构的 Pull request
- `Bugfix`: 修复 Bug 的 Pull request
- `Docs`: 添加了文档说明的 Pull request
- `Feature`: 添加了新特性的 Pull request
- `Configurations`: 涉及主题 Next 配置的 Pull request
- `Optimization`: 优化了主题 Next 的 Pull request
- `i18n`: 更新了翻译的 Pull request
- `Performance`: 提高了主题 Next 性能的 Pull request
- `Discussion`: 需要进行讨论的 Pull request
<a name="commit-messages-rules"></a>

@@ -129,0 +184,0 @@ ### 提交信息规范

@@ -9,11 +9,10 @@ <div align="right">语言: <a title="英语" href="../../README.md">:us:</a>

[![gitter-image]][gitter-url]
[![riot-image]][riot-url]
[![t-chat-image]][t-chat-url]
[![t-news-image]][t-news-url]
[![lang-image]][lang-url]
[![travis-image]][travis-url]
[![rel-image]][releases-url]
[![hexo-image]][hexo-url]
[![lic-image]][lic-url]
<p align="center">
<a href="https://www.codacy.com/app/theme-next/hexo-theme-next?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=theme-next/hexo-theme-next&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/72f7fe7609c2438a92069f448e5a341a" title="Project Grade"></a>
<a href="https://travis-ci.org/theme-next/hexo-theme-next?branch=master"><img src="https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master" title="Travis CI [Linux]"></a>
<a href="https://crwd.in/theme-next"><img src="https://d322cqt584bo4o.cloudfront.net/theme-next/localized.svg" title="请花几秒钟来添加或修正翻译!"></a>
<a href="https://github.com/theme-next/hexo-theme-next/releases"><img src="https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg"></a>
<a href="http://hexo.io"><img src="https://img.shields.io/badge/hexo-%3E%3D%203.5.0-blue.svg"></a>
<a href="https://github.com/theme-next/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-blue.svg"></a>
</p>

@@ -96,2 +95,11 @@ ## 即时预览

## Feedback
* Ask a question on [Stack Overflow][stack-url].
* Request a new feature on [GitHub][contributing-url].
* Vote for [popular feature requests][feat-req-vote-url].
* Report a bug in [GitHub Issues][issues-url].
* Join to our [Gitter][gitter-url] / [Riot][riot-url] / [Telegram][t-chat-url] chats.
* Follow us with [Telegram Channel][t-news-url] for latest news.
## 第三方應用程序

@@ -104,28 +112,14 @@

[lang-image]: https://d322cqt584bo4o.cloudfront.net/theme-next/localized.svg "请花几秒钟来添加或修正翻译!"
[lang-url]: https://crwd.in/theme-next
[stack-url]: https://stackoverflow.com/questions/tagged/theme-next
[contributing-url]: https://github.com/theme-next/hexo-theme-next/blob/master/docs/zh-CN/CONTRIBUTING.md
[feat-req-vote-url]: https://github.com/theme-next/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc
[issues-url]: https://github.com/theme-next/hexo-theme-next/issues
[gitter-image]: https://img.shields.io/badge/gitter-chat-orange.svg "Join to our Gitter room"
[gitter-url]: https://gitter.im/theme-next
[riot-image]: https://img.shields.io/badge/riot-chat-DCAB08.svg "Join to our Riot room"
[riot-url]: https://riot.im/app/#/room/#NexT:matrix.org
[t-chat-image]: https://img.shields.io/badge/telegram-chat-BAB210.svg "Join to our Telegram group"
[t-chat-url]: https://t.me/theme_next
[t-news-image]: https://img.shields.io/badge/telegram-news-98B919.svg "Join to our Telegram news channel"
[t-news-url]: https://t.me/theme_next_news
[travis-image]: https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master
[travis-url]: https://travis-ci.org/theme-next/hexo-theme-next?branch=master "Travis CI [Linux]"
[hexo-image]: https://img.shields.io/badge/hexo-%3E%3D%203.5.0-blue.svg
[hexo-url]: http://hexo.io
[lic-image]: https://img.shields.io/badge/license-%20AGPL-blue.svg
[lic-url]: https://github.com/theme-next/hexo-theme-next/blob/master/LICENSE.md
<!--[rel-image]: https://img.shields.io/github/release/theme-next/hexo-theme-next.svg-->
[rel-image]: https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg
<!--[rel-image]: https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg-->
<!--[mnt-image]: https://img.shields.io/maintenance/yes/2018.svg-->

@@ -135,3 +129,3 @@

[releases-latest-url]: https://github.com/theme-next/hexo-theme-next/releases/latest
[releases-url]: https://github.com/theme-next/hexo-theme-next/releases
<!--[releases-url]: https://github.com/theme-next/hexo-theme-next/releases-->
[tags-url]: https://github.com/theme-next/hexo-theme-next/tags

@@ -138,0 +132,0 @@ [commits-url]: https://github.com/theme-next/hexo-theme-next/commits/master

@@ -29,2 +29,8 @@ <h1 align="center">从 NexT v5.1.x 更新</h1>

4. 更新语言配置
从 v6.0.3版本起,`zh-Hans`改名为`zh-CN`:https://github.com/theme-next/hexo-theme-next/releases/tag/v6.0.3
升级到v6.0.3及以后版本的用户,需要显式修改`_config.xml`里的language配置,否则语言显示不正确。
关于第三方库的启用,参见[这里](https://github.com/theme-next/hexo-theme-next/blob/master/docs/zh-CN/INSTALLATION.md#插件)。
{
"name": "hexo-theme-next",
"version": "6.3.0",
"version": "6.4.0",
"description": "Elegant and powerful theme for Hexo",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,11 +9,10 @@ <div align="right">Language: :us:

[![gitter-image]][gitter-url]
[![riot-image]][riot-url]
[![t-chat-image]][t-chat-url]
[![t-news-image]][t-news-url]
[![lang-image]][lang-url]
[![travis-image]][travis-url]
[![rel-image]][releases-url]
[![hexo-image]][hexo-url]
[![lic-image]][lic-url]
<p align="center">
<a href="https://www.codacy.com/app/theme-next/hexo-theme-next?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=theme-next/hexo-theme-next&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/72f7fe7609c2438a92069f448e5a341a" title="Project Grade"></a>
<a href="https://travis-ci.org/theme-next/hexo-theme-next?branch=master"><img src="https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master" title="Travis CI [Linux]"></a>
<a href="https://crwd.in/theme-next"><img src="https://d322cqt584bo4o.cloudfront.net/theme-next/localized.svg" title="Add or improve translation in few seconds!"></a>
<a href="https://github.com/theme-next/hexo-theme-next/releases"><img src="https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg"></a>
<a href="http://hexo.io"><img src="https://img.shields.io/badge/hexo-%3E%3D%203.5.0-blue.svg"></a>
<a href="https://github.com/theme-next/hexo-theme-next/blob/master/LICENSE.md"><img src="https://img.shields.io/badge/license-%20AGPL-blue.svg"></a>
</p>

@@ -96,2 +95,11 @@ ## Live Preview

## Feedback
* Ask a question on [Stack Overflow][stack-url].
* Request a new feature on [GitHub][contributing-url].
* Vote for [popular feature requests][feat-req-vote-url].
* Report a bug in [GitHub Issues][issues-url].
* Join to our [Gitter][gitter-url] / [Riot][riot-url] / [Telegram][t-chat-url] chats.
* Follow us with [Telegram Channel][t-news-url] for latest news.
## Third party applications

@@ -104,28 +112,14 @@

[lang-image]: https://d322cqt584bo4o.cloudfront.net/theme-next/localized.svg "Add or improve translation in few seconds!"
[lang-url]: https://crwd.in/theme-next
[stack-url]: https://stackoverflow.com/questions/tagged/theme-next
[contributing-url]: https://github.com/theme-next/hexo-theme-next/blob/master/.github/CONTRIBUTING.md
[feat-req-vote-url]: https://github.com/theme-next/hexo-theme-next/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc
[issues-url]: https://github.com/theme-next/hexo-theme-next/issues
[gitter-image]: https://img.shields.io/badge/gitter-chat-orange.svg "Join to our Gitter room"
[gitter-url]: https://gitter.im/theme-next
[riot-image]: https://img.shields.io/badge/riot-chat-DCAB08.svg "Join to our Riot room"
[riot-url]: https://riot.im/app/#/room/#NexT:matrix.org
[t-chat-image]: https://img.shields.io/badge/telegram-chat-BAB210.svg "Join to our Telegram group"
[t-chat-url]: https://t.me/theme_next
[t-news-image]: https://img.shields.io/badge/telegram-news-98B919.svg "Join to our Telegram news channel"
[t-news-url]: https://t.me/theme_next_news
[travis-image]: https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master
[travis-url]: https://travis-ci.org/theme-next/hexo-theme-next?branch=master "Travis CI [Linux]"
[hexo-image]: https://img.shields.io/badge/hexo-%3E%3D%203.5.0-blue.svg
[hexo-url]: http://hexo.io
[lic-image]: https://img.shields.io/badge/license-%20AGPL-blue.svg
[lic-url]: https://github.com/theme-next/hexo-theme-next/blob/master/LICENSE.md
<!--[rel-image]: https://img.shields.io/github/release/theme-next/hexo-theme-next.svg-->
[rel-image]: https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg
<!--[rel-image]: https://badge.fury.io/gh/theme-next%2Fhexo-theme-next.svg-->
<!--[mnt-image]: https://img.shields.io/maintenance/yes/2018.svg-->

@@ -135,3 +129,3 @@

[releases-latest-url]: https://github.com/theme-next/hexo-theme-next/releases/latest
[releases-url]: https://github.com/theme-next/hexo-theme-next/releases
<!--[releases-url]: https://github.com/theme-next/hexo-theme-next/releases-->
[tags-url]: https://github.com/theme-next/hexo-theme-next/tags

@@ -138,0 +132,0 @@ [commits-url]: https://github.com/theme-next/hexo-theme-next/commits/master

@@ -0,1 +1,3 @@

/* global hexo */
'use strict';

@@ -8,3 +10,4 @@

hexo.extend.helper.register('next_env', function(type) {
var env = require('../package.json');
var path = require('path');
var env = require(path.normalize('../package.json'));
return env[type];

@@ -11,0 +14,0 @@ });

/**
* button.js | global hexo script.
*
* Usage:
*
* {% button /path/to/url/, text, icon [class], title %}
* {% btn /path/to/url/, text, icon [class], title %}
* button.js | https://theme-next.org/docs/tag-plugins/button/
*/
/* global hexo */
'use strict';

@@ -14,5 +11,5 @@

args = args.join(' ').split(',');
var url = args[0];
var text = args[1] || '';
var icon = args[2] || '';
var url = args[0];
var text = args[1] || '';
var icon = args[2] || '';
var title = args[3] || '';

@@ -19,0 +16,0 @@

/**
* center-quote.js | global hexo script.
*
* Usage:
*
* {% centerquote %}Something{% endcenterquote %}
* {% cq %}Something{% endcq %}
* center-quote.js | https://theme-next.org/docs/tag-plugins/
*/
/* global hexo */
'use strict';
function centerQuote (args, content) {
return '<blockquote class="blockquote-center">' +
hexo.render.renderSync({text: content, engine: 'markdown'}) +
'</blockquote>';
function centerQuote(args, content) {
return '<blockquote class="blockquote-center">'
+ hexo.render.renderSync({text: content, engine: 'markdown'})
+ '</blockquote>';
}

@@ -17,0 +14,0 @@

/**
* exturl.js | global hexo script.
*
* Usage:
*
* {% exturl text url "title" %}
* {% extlink text url "title" %}
*
* If title not defined, url will be used as title.
* exturl.js | https://theme-next.org/docs/tag-plugins/exturl/
*/
/* global hexo */
'use strict';
/*jshint camelcase: false */
var util = require('hexo-util');
/*jshint camelcase: true */
var htmlTag = util.htmlTag;
var rUrl = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/;
/* eslint-disable */
var rUrl = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\w]*))?)/;
// Create Base64 Object
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}};
/* eslint-enable */
function extURL(args, content) {
function extURL(args) {
var exturl = 'exturl';
var url = '';
var text = ['<i class="fa fa-external-link"></i>'];
var title = '';
var item = '';
var i = 0;
var len = args.length;
var url = '';
var text = [];
var title = '';
var item = '';
var i = 0;
var len = args.length;

@@ -51,3 +46,2 @@ // Find link URL and text

if (args.length) {
var shift = args[0];
title = args.join(' ');

@@ -59,8 +53,8 @@ } else {

var attrs = {
class: exturl,
class : exturl,
'data-url': url,
title: title
title : title
};
return htmlTag('span', attrs, text.join(' '));
return htmlTag('span', attrs, text.join(' ') + '<i class="fa fa-external-link"></i>');
}

@@ -67,0 +61,0 @@

/**
* full-image.js | global hexo script.
*
* Usage:
*
* {% fullimage /path/to/image, alt, title %}
* {% fi /path/to/image, alt, title %}
* full-image.js | https://theme-next.org/docs/tag-plugins/full-image/
*/
/* global hexo */
'use strict';

@@ -14,15 +11,17 @@

args = args.join(' ').split(',');
var src = args[0];
var alt = args[1] || '';
var mixed = args[0].split('@');
var img = mixed[0];
var src = mixed[1] === 'lazy' ? '/images/loading.gif" data-original="' + img : img;
var alt = args[1] || '';
var title = args[2] || '';
var width = args[3] || '';
if (!src) {
if (!img) {
hexo.log.warn('Image src can NOT be empty');
}
alt = alt.trim();
title = title.trim();
var image = ['<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject"><img itemprop="url image" src="' + src + '" class="full-image"'];
alt.length > 0 && image.push('alt="' + alt + '"');
title.length > 0 && image.push('title="' + title + '"');
alt.length > 0 && image.push('alt="' + alt.trim() + '"');
title.length > 0 && image.push('title="' + title.trim() + '"');
width.length > 0 && image.push('style="max-width: none; width:' + width + ';"');
image.push('/><meta itemprop="width" content="auto"><meta itemprop="height" content="auto"></span>');

@@ -29,0 +28,0 @@

/**
* group-pictures.js | global hexo script.
* group-pictures.js
*

@@ -13,21 +13,9 @@ * Usage:

/* global hexo */
'use strict';
function groupPicture(args, content) {
args = args[0].split('-');
var group = parseInt(args[0]);
var layout = parseInt(args[1]);
content = hexo.render.renderSync({text: content, engine: 'markdown'});
var pictures = content.match(/<img[\s\S]*?>/g);
return '<div class="group-picture">' +
templates.dispatch(pictures, group, layout) +
'</div>';
}
var templates = {
dispatch: function (pictures, group, layout) {
dispatch: function(pictures, group, layout) {
var fn = 'group' + group + 'Layout' + layout;

@@ -47,3 +35,3 @@ fn = templates[fn] || templates.defaults;

*/
group2Layout1: function (pictures) {
group2Layout1: function(pictures) {
return this.getHTML([

@@ -62,3 +50,3 @@ pictures.slice(0, 1),

*/
group2Layout2: function (pictures) {
group2Layout2: function(pictures) {
return this.getHTML(pictures);

@@ -74,3 +62,3 @@ },

*/
group3Layout1: function (pictures) {
group3Layout1: function(pictures) {
return this.getHTML(pictures);

@@ -87,3 +75,3 @@ },

*/
group3Layout2: function (pictures) {
group3Layout2: function(pictures) {
return this.getHTML([

@@ -103,3 +91,3 @@ pictures.slice(0, 1),

*/
group3Layout3: function (pictures) {
group3Layout3: function(pictures) {
return this.getHTML([

@@ -120,3 +108,3 @@ pictures.slice(0, 2),

*/
group4Layout1: function (pictures) {
group4Layout1: function(pictures) {
return this.getHTML([

@@ -137,3 +125,3 @@ pictures.slice(0, 1),

*/
group4Layout2: function (pictures) {
group4Layout2: function(pictures) {
return this.getHTML([

@@ -153,3 +141,3 @@ pictures.slice(0, 1),

*/
group4Layout3: function (pictures) {
group4Layout3: function(pictures) {
return this.getHTML([

@@ -169,3 +157,3 @@ pictures.slice(0, 2),

*/
group4Layout4: function (pictures) {
group4Layout4: function(pictures) {
return this.getHTML([

@@ -186,3 +174,3 @@ pictures.slice(0, 3),

*/
group5Layout1: function (pictures) {
group5Layout1: function(pictures) {
return this.getHTML([

@@ -204,3 +192,3 @@ pictures.slice(0, 1),

*/
group5Layout2: function (pictures) {
group5Layout2: function(pictures) {
return this.getHTML([

@@ -221,3 +209,3 @@ pictures.slice(0, 2),

*/
group5Layout3: function (pictures) {
group5Layout3: function(pictures) {
return this.getHTML([

@@ -237,3 +225,3 @@ pictures.slice(0, 2),

*/
group5Layout4: function (pictures) {
group5Layout4: function(pictures) {
return this.getHTML([

@@ -254,3 +242,3 @@ pictures.slice(0, 3),

*/
group6Layout1: function (pictures) {
group6Layout1: function(pictures) {
return this.getHTML([

@@ -272,3 +260,3 @@ pictures.slice(0, 1),

*/
group6Layout2: function (pictures) {
group6Layout2: function(pictures) {
return this.getHTML([

@@ -290,3 +278,3 @@ pictures.slice(0, 1),

*/
group6Layout3: function (pictures) {
group6Layout3: function(pictures) {
return this.getHTML([

@@ -308,3 +296,3 @@ pictures.slice(0, 2),

*/
group6Layout4: function (pictures) {
group6Layout4: function(pictures) {
return this.getHTML([

@@ -325,3 +313,3 @@ pictures.slice(0, 2),

*/
group6Layout5: function (pictures) {
group6Layout5: function(pictures) {
return this.getHTML([

@@ -343,3 +331,3 @@ pictures.slice(0, 3),

*/
group7Layout1: function (pictures) {
group7Layout1: function(pictures) {
return this.getHTML([

@@ -362,3 +350,3 @@ pictures.slice(0, 1),

*/
group7Layout2: function (pictures) {
group7Layout2: function(pictures) {
return this.getHTML([

@@ -380,3 +368,3 @@ pictures.slice(0, 1),

*/
group7Layout3: function (pictures) {
group7Layout3: function(pictures) {
return this.getHTML([

@@ -398,3 +386,3 @@ pictures.slice(0, 2),

*/
group7Layout4: function (pictures) {
group7Layout4: function(pictures) {
return this.getHTML([

@@ -416,3 +404,3 @@ pictures.slice(0, 2),

*/
group7Layout5: function (pictures) {
group7Layout5: function(pictures) {
return this.getHTML([

@@ -435,3 +423,3 @@ pictures.slice(0, 3),

*/
group8Layout1: function (pictures) {
group8Layout1: function(pictures) {
return this.getHTML([

@@ -455,3 +443,3 @@ pictures.slice(0, 1),

*/
group8Layout2: function (pictures) {
group8Layout2: function(pictures) {
return this.getHTML([

@@ -474,3 +462,3 @@ pictures.slice(0, 1),

*/
group8Layout3: function (pictures) {
group8Layout3: function(pictures) {
return this.getHTML([

@@ -494,3 +482,3 @@ pictures.slice(0, 1),

*/
group8Layout4: function (pictures) {
group8Layout4: function(pictures) {
return this.getHTML([

@@ -513,3 +501,3 @@ pictures.slice(0, 2),

*/
group8Layout5: function (pictures) {
group8Layout5: function(pictures) {
return this.getHTML([

@@ -531,3 +519,3 @@ pictures.slice(0, 2),

*/
group8Layout6: function (pictures) {
group8Layout6: function(pictures) {
return this.getHTML([

@@ -549,3 +537,3 @@ pictures.slice(0, 3),

*/
group8Layout7: function (pictures) {
group8Layout7: function(pictures) {
return this.getHTML([

@@ -568,3 +556,3 @@ pictures.slice(0, 3),

*/
group9Layout1: function (pictures) {
group9Layout1: function(pictures) {
return this.getHTML([

@@ -588,3 +576,3 @@ pictures.slice(0, 1),

*/
group9Layout2: function (pictures) {
group9Layout2: function(pictures) {
return this.getHTML([

@@ -608,3 +596,3 @@ pictures.slice(0, 1),

*/
group9Layout3: function (pictures) {
group9Layout3: function(pictures) {
return this.getHTML([

@@ -628,3 +616,3 @@ pictures.slice(0, 2),

*/
group9Layout4: function (pictures) {
group9Layout4: function(pictures) {
return this.getHTML([

@@ -648,3 +636,3 @@ pictures.slice(0, 2),

*/
group9Layout5: function (pictures) {
group9Layout5: function(pictures) {
return this.getHTML([

@@ -668,3 +656,3 @@ pictures.slice(0, 2),

*/
group9Layout6: function (pictures) {
group9Layout6: function(pictures) {
return this.getHTML([

@@ -687,3 +675,3 @@ pictures.slice(0, 3),

*/
group9Layout7: function (pictures) {
group9Layout7: function(pictures) {
return this.getHTML([

@@ -706,3 +694,3 @@ pictures.slice(0, 3),

*/
group10Layout1: function (pictures) {
group10Layout1: function(pictures) {
return this.getHTML([

@@ -726,3 +714,3 @@ pictures.slice(0, 1),

*/
group10Layout2: function (pictures) {
group10Layout2: function(pictures) {
return this.getHTML([

@@ -746,3 +734,3 @@ pictures.slice(0, 2),

*/
group10Layout3: function (pictures) {
group10Layout3: function(pictures) {
return this.getHTML([

@@ -766,3 +754,3 @@ pictures.slice(0, 2),

*/
group10Layout4: function (pictures) {
group10Layout4: function(pictures) {
return this.getHTML([

@@ -786,3 +774,3 @@ pictures.slice(0, 2),

*/
group10Layout5: function (pictures) {
group10Layout5: function(pictures) {
return this.getHTML([

@@ -806,3 +794,3 @@ pictures.slice(0, 3),

*/
group10Layout6: function (pictures) {
group10Layout6: function(pictures) {
return this.getHTML([

@@ -826,3 +814,3 @@ pictures.slice(0, 3),

*/
group10Layout7: function (pictures) {
group10Layout7: function(pictures) {
return this.getHTML([

@@ -845,5 +833,5 @@ pictures.slice(0, 3),

*/
defaults: function (pictures) {
defaults: function(pictures) {
var ROW_SIZE = 3;
var rows = pictures.length / ROW_SIZE + 1;
var rows = pictures.length / (ROW_SIZE + 1);
var pictureArr = [];

@@ -858,3 +846,3 @@

getHTML: function (rows) {
getHTML: function(rows) {
var rowHTML = '';

@@ -869,11 +857,9 @@

getRowHTML: function (pictures) {
getRowHTML: function(pictures) {
return (
'<div class="group-picture-row">' +
this.getColumnHTML(pictures) +
'</div>'
'<div class="group-picture-row">' + this.getColumnHTML(pictures) + '</div>'
);
},
getColumnHTML: function (pictures) {
getColumnHTML: function(pictures) {
var columns = [];

@@ -890,3 +876,15 @@ var columnWidth = 100 / pictures.length;

function groupPicture(args, content) {
args = args[0].split('-');
var group = parseInt(args[0], 10);
var layout = parseInt(args[1], 10);
content = hexo.render.renderSync({text: content, engine: 'markdown'});
var pictures = content.match(/<img[\s\S]*?>/g);
return '<div class="group-picture">' + templates.dispatch(pictures, group, layout) + '</div>';
}
hexo.extend.tag.register('grouppicture', groupPicture, {ends: true});
hexo.extend.tag.register('gp', groupPicture, {ends: true});
/**
* include.js | global hexo script.
*
* Usage:
*
* {% include_raw '_data/path/to/file.html' %}
*
* Path is relative to your site source directory.
* include-raw.js | https://theme-next.org/docs/tag-plugins/
*/
/* global hexo */
'use strict';
var pathFn = require('path');
/*jshint camelcase: false */
var fs = require('hexo-fs');
/*jshint camelcase: true */
function include_raw (args) {
function includeRaw(args) {
var path = pathFn.join(hexo.source_dir, args[0]);

@@ -34,4 +28,4 @@

});
};
}
hexo.extend.tag.register('include_raw', include_raw, {ends: false, async: true});
hexo.extend.tag.register('include_raw', includeRaw, {ends: false, async: true});
/**
* label.js | global hexo script.
*
* Usage:
*
* {% label [class]@Text %}
*
* [class] : default | primary | success | info | warning | danger.
* If not defined, default class will be selected.
* label.js | https://theme-next.org/docs/tag-plugins/label/
*/
/* global hexo */
'use strict';
function postLabel (args) {
function postLabel(args) {
args = args.join(' ').split('@');
var classes = args[0] || 'default';
var text = args[1] || '';
var text = args[1] || '';
classes = classes.trim();
!text && hexo.log.warn('Label text must be defined!');
return '<span class="label ' + classes + '">' + text + '</span>';
return '<span class="label ' + classes.trim() + '">' + text + '</span>';
}
hexo.extend.tag.register('label', postLabel, { ends: false });
/**
* note.js | global hexo script.
*
* ATTENTION! No need to write this tag in 1 line if u don't want see probally bugs.
*
* Usage:
*
* {% note [class] %}
* Any content (support inline tags too).
* {% endnote %}
*
* [class] : default | primary | success | info | warning | danger.
* May be not defined.
* note.js | https://theme-next.org/docs/tag-plugins/note/
*/
/* global hexo */
'use strict';
function bscallOut (args, content) {
return '<div class="note ' + args.join(' ') + '">' + hexo.render.renderSync({text: content, engine: 'markdown'}).trim() + '</div>';
function postNote(args, content) {
return '<div class="note ' + args.join(' ') + '">'
+ hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')
+ '</div>';
}
hexo.extend.tag.register('note', bscallOut, {ends: true});
hexo.extend.tag.register('note', postNote, {ends: true});
hexo.extend.tag.register('subnote', postNote, {ends: true});
/**
* tabs.js | global hexo script.
*
* Usage:
*
* {% tabs [Unique name], [index] %}
* <!-- tab [Tab caption]@[icon] -->
* Any content (support inline tags too).
* <!-- endtab -->
* {% endtabs %}
*
* [Unique name] : Unique name of tabs block tag without comma.
* Will be used in #id's as prefix for each tab with their index numbers.
* If there are whitespaces in name, for generate #id all whitespaces will replaced by dashes.
* Only for current url of post/page must be unique!
* [index] : Index number of active tab.
* If not defined, first tab (1) will be selected.
* If index is -1, no tab will be selected. It's will be something like spoiler.
* May be not defined.
* [Tab caption] : Caption of current tab.
* If not caption specified, unique name with tab index suffix will be used as caption of tab.
* If not caption specified, but specified icon, caption will empty.
* May be not defined.
* [icon] : Font awesome icon.
* May be not defined.
* tabs.js | https://theme-next.org/docs/tag-plugins/tabs/
*/
/* global hexo */
'use strict';
function postTabs (args, content) {
var tabBlock = /<!--\s*tab (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtab\s*-->/g;
function postTabs(args, content) {
var tabBlock = /<!--\s*tab (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtab\s*-->/g;
var args = args.join(' ').split(',');
var tabName = args[0];
var tabActive = args[1] || '';
args = args.join(' ').split(',');
var tabName = args[0];
var tabActive = Number(args[1]) || 0;
var matches = [];
var match;
var tabId = 0;
var tabNav = '';
var tabContent = '';
var matches = [];
var match;
var tabId = 0;
var tabNav = '';
var tabContent = '';
!tabName && hexo.log.warn('Tabs block must have unique name!');
!tabName && hexo.log.warn('Tabs block must have unique name!');
while (match = tabBlock.exec(content)) {
matches.push(match[1]);
matches.push(match[2]);
}
while ((match = tabBlock.exec(content)) !== null) {
matches.push(match[1]);
matches.push(match[2]);
}
for (var i = 0; i < matches.length; i += 2) {
var tabParameters = matches[i].split('@');
var postContent = matches[i + 1];
var tabCaption = tabParameters[0] || '';
var tabIcon = tabParameters[1] || '';
var tabHref = '';
for (var i = 0; i < matches.length; i += 2) {
var tabParameters = matches[i].split('@');
var postContent = matches[i + 1];
var tabCaption = tabParameters[0] || '';
var tabIcon = tabParameters[1] || '';
var tabHref = '';
postContent = hexo.render.renderSync({text: postContent, engine: 'markdown'});
postContent = hexo.render.renderSync({text: postContent, engine: 'markdown'}).trim();
tabId += 1;
tabHref = (tabName + ' ' + tabId).toLowerCase().split(' ').join('-');
tabId += 1;
tabHref = (tabName + ' ' + tabId).toLowerCase().split(' ').join('-');
((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = tabName + ' ' + tabId);
((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = tabName + ' ' + tabId);
var isOnlyicon = (tabIcon.length > 0 && tabCaption.length === 0) ? 'style="text-align: center;' : '';
tabIcon.length > 0 && (tabIcon = '<i class="fa fa-' + tabIcon.trim() + '"' + isOnlyicon + '"></i>');
var isOnlyicon = tabIcon.length > 0 && tabCaption.length === 0 ? 'style="text-align: center;' : '';
tabIcon.length > 0 && (tabIcon = '<i class="fa fa-' + tabIcon.trim() + '"' + isOnlyicon + '"></i>');
var isActive = ((tabActive.length > 0 && tabActive == tabId) || (tabActive.length === 0 && tabId == 1)) ? ' active' : '';
tabNav += '<li class="tab' + isActive + '"><a href="#' + tabHref + '">' + tabIcon + tabCaption + '</a></li>';
tabContent += '<div class="tab-pane' + isActive + '" id="' + tabHref + '">' + postContent + '</div>';
}
var isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : '';
tabNav += '<li class="tab' + isActive + '"><a href="#' + tabHref + '">' + tabIcon + tabCaption.trim() + '</a></li>';
tabContent += '<div class="tab-pane' + isActive + '" id="' + tabHref + '">' + postContent + '</div>';
}
tabNav = '<ul class="nav-tabs">' + tabNav + '</ul>';
tabContent = '<div class="tab-content">' + tabContent + '</div>';
tabNav = '<ul class="nav-tabs">' + tabNav + '</ul>';
tabContent = '<div class="tab-content">' + tabContent + '</div>';
return '<div class="tabs" id="' + tabName.toLowerCase().split(' ').join('-') + '">' + tabNav + tabContent + '</div>';
}
return '<div class="tabs" id="' + tabName.toLowerCase().split(' ').join('-') + '">' + tabNav + tabContent + '</div>';
}
hexo.extend.tag.register('tabs', postTabs, {ends: true});
hexo.extend.tag.register('tabs', postTabs, {ends: true});
hexo.extend.tag.register('subtabs', postTabs, {ends: true});
hexo.extend.tag.register('subsubtabs', postTabs, {ends: true});

@@ -9,4 +9,9 @@ /* ========================================================================

/**
* Customized by Ivan.Nginx
*
* - Refactored with eslint-config-theme-next style.
*/
+function ($) {
(function($) {
'use strict';

@@ -17,20 +22,20 @@

var Affix = function (element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options)
var Affix = function(element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options);
this.$target = $(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this));
this.$element = $(element)
this.affixed = null
this.unpin = null
this.pinnedOffset = null
this.$element = $(element);
this.affixed = null;
this.unpin = null;
this.pinnedOffset = null;
this.checkPosition()
}
this.checkPosition();
};
Affix.VERSION = '3.3.5'
Affix.VERSION = '3.3.5';
Affix.RESET = 'affix affix-top affix-bottom'
Affix.RESET = 'affix affix-top affix-bottom';

@@ -40,65 +45,67 @@ Affix.DEFAULTS = {

target: window
}
};
Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var targetHeight = this.$target.height()
Affix.prototype.getState = function(scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop();
var position = this.$element.offset();
var targetHeight = this.$target.height();
if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
if (offsetTop != null && this.affixed === 'top') return scrollTop < offsetTop ? 'top' : false;
if (this.affixed == 'bottom') {
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
if (this.affixed === 'bottom') {
if (offsetTop != null) return scrollTop + this.unpin <= position.top ? false : 'bottom';
return scrollTop + targetHeight <= scrollHeight - offsetBottom ? false : 'bottom';
}
var initializing = this.affixed == null
var colliderTop = initializing ? scrollTop : position.top
var colliderHeight = initializing ? targetHeight : height
var initializing = this.affixed == null;
var colliderTop = initializing ? scrollTop : position.top;
var colliderHeight = initializing ? targetHeight : height;
if (offsetTop != null && scrollTop <= offsetTop) return 'top'
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
if (offsetTop != null && scrollTop <= offsetTop) return 'top';
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom';
return false
}
return false;
};
Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
return (this.pinnedOffset = position.top - scrollTop)
}
Affix.prototype.getPinnedOffset = function() {
if (this.pinnedOffset) return this.pinnedOffset;
this.$element.removeClass(Affix.RESET).addClass('affix');
var scrollTop = this.$target.scrollTop();
var position = this.$element.offset();
return (this.pinnedOffset = position.top - scrollTop);
};
Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPositionWithEventLoop = function() {
setTimeout($.proxy(this.checkPosition, this), 1);
};
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
Affix.prototype.checkPosition = function() {
if (!this.$element.is(':visible')) return;
var height = this.$element.height()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
var scrollHeight = Math.max($(document).height(), $(document.body).height())
var height = this.$element.height();
var offset = this.options.offset;
var offsetTop = offset.top;
var offsetBottom = offset.bottom;
var scrollHeight = Math.max($(document).height(), $(document.body).height());
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
/* eslint-disable */
if (typeof offset !== 'object') offsetBottom = offsetTop = offset;
if (typeof offsetTop === 'function') offsetTop = offset.top(this.$element);
if (typeof offsetBottom === 'function') offsetBottom = offset.bottom(this.$element);
/* eslint-enable */
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom);
if (this.affixed != affix) {
if (this.unpin != null) this.$element.css('top', '')
if (this.affixed !== affix) {
if (this.unpin != null) this.$element.css('top', '');
var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')
var affixType = 'affix' + (affix ? '-' + affix : '');
var e = new $.Event(affixType + '.bs.affix');
this.$element.trigger(e)
this.$element.trigger(e);
if (e.isDefaultPrevented()) return
if (e.isDefaultPrevented()) return;
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.affixed = affix;
this.unpin = affix === 'bottom' ? this.getPinnedOffset() : null;

@@ -108,13 +115,12 @@ this.$element

.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix');
}
if (affix == 'bottom') {
if (affix === 'bottom') {
this.$element.offset({
top: scrollHeight - height - offsetBottom
})
});
}
}
};
// AFFIX PLUGIN DEFINITION

@@ -124,44 +130,44 @@ // =======================

function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option
return this.each(function() {
var $this = $(this);
var data = $this.data('bs.affix');
var options = typeof option === 'object' && option;
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
if (!data) $this.data('bs.affix', data = new Affix(this, options));
if (typeof option === 'string') data[option]();
});
}
var old = $.fn.affix
var old = $.fn.affix;
$.fn.affix = Plugin
$.fn.affix.Constructor = Affix
$.fn.affix = Plugin;
$.fn.affix.Constructor = Affix;
// AFFIX NO CONFLICT
// =================
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
$.fn.affix.noConflict = function() {
$.fn.affix = old;
return this;
};
// AFFIX DATA-API
// ==============
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
$(window).on('load', function() {
$('[data-spy="affix"]').each(function() {
var $spy = $(this);
var data = $spy.data();
data.offset = data.offset || {}
data.offset = data.offset || {};
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
if (data.offsetTop != null) data.offset.top = data.offsetTop
/* eslint-disable */
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom;
if (data.offsetTop != null) data.offset.top = data.offsetTop;
/* eslint-enable */
Plugin.call($spy, data)
})
})
Plugin.call($spy, data);
});
});
}(jQuery);
}(jQuery));

@@ -1,9 +0,8 @@

/* global instantsearch: true */
/*jshint camelcase: false */
/* global instantsearch, CONFIG */
$(document).ready(function () {
$(document).ready(function() {
var algoliaSettings = CONFIG.algolia;
var isAlgoliaSettingsValid = algoliaSettings.applicationID &&
algoliaSettings.apiKey &&
algoliaSettings.indexName;
var isAlgoliaSettingsValid = algoliaSettings.applicationID
&& algoliaSettings.apiKey
&& algoliaSettings.indexName;

@@ -16,6 +15,6 @@ if (!isAlgoliaSettingsValid) {

var search = instantsearch({
appId: algoliaSettings.applicationID,
apiKey: algoliaSettings.apiKey,
indexName: algoliaSettings.indexName,
searchFunction: function (helper) {
appId : algoliaSettings.applicationID,
apiKey : algoliaSettings.apiKey,
indexName : algoliaSettings.indexName,
searchFunction: function(helper) {
var searchInput = $('#algolia-search-input').find('input');

@@ -32,3 +31,3 @@

instantsearch.widgets.searchBox({
container: '#algolia-search-input',
container : '#algolia-search-input',
placeholder: algoliaSettings.labels.input_placeholder

@@ -38,18 +37,18 @@ }),

instantsearch.widgets.hits({
container: '#algolia-hits',
container : '#algolia-hits',
hitsPerPage: algoliaSettings.hits.per_page || 10,
templates: {
item: function (data) {
var link = data.permalink ? data.permalink : (CONFIG.root + data.path);
templates : {
item: function(data) {
var link = data.permalink ? data.permalink : CONFIG.root + data.path;
return (
'<a href="' + link + '" class="algolia-hit-item-link">' +
data._highlightResult.title.value +
'</a>'
'<a href="' + link + '" class="algolia-hit-item-link">'
+ data._highlightResult.title.value
+ '</a>'
);
},
empty: function (data) {
empty: function(data) {
return (
'<div id="algolia-hits-empty">' +
algoliaSettings.labels.hits_empty.replace(/\$\{query}/, data.query) +
'</div>'
'<div id="algolia-hits-empty">'
+ algoliaSettings.labels.hits_empty.replace(/\$\{query}/, data.query)
+ '</div>'
);

@@ -66,12 +65,12 @@ }

templates: {
body: function (data) {
body: function(data) {
var stats = algoliaSettings.labels.hits_stats
.replace(/\$\{hits}/, data.nbHits)
.replace(/\$\{time}/, data.processingTimeMS);
.replace(/\$\{hits}/, data.nbHits)
.replace(/\$\{time}/, data.processingTimeMS);
return (
stats +
'<span class="algolia-powered">' +
' <img src="' + CONFIG.root + 'images/algolia_logo.svg" alt="Algolia" />' +
'</span>' +
'<hr />'
stats
+ '<span class="algolia-powered">'
+ ' <img src="' + CONFIG.root + 'images/algolia_logo.svg" alt="Algolia" />'
+ '</span>'
+ '<hr />'
);

@@ -83,16 +82,16 @@ }

instantsearch.widgets.pagination({
container: '#algolia-pagination',
scrollTo: false,
container : '#algolia-pagination',
scrollTo : false,
showFirstLast: false,
labels: {
first: '<i class="fa fa-angle-double-left"></i>',
last: '<i class="fa fa-angle-double-right"></i>',
labels : {
first : '<i class="fa fa-angle-double-left"></i>',
last : '<i class="fa fa-angle-double-right"></i>',
previous: '<i class="fa fa-angle-left"></i>',
next: '<i class="fa fa-angle-right"></i>'
next : '<i class="fa fa-angle-right"></i>'
},
cssClasses: {
root: 'pagination',
item: 'pagination-item',
link: 'page-number',
active: 'current',
root : 'pagination',
item : 'pagination-item',
link : 'page-number',
active : 'current',
disabled: 'disabled-item'

@@ -114,3 +113,3 @@ }

$('.popup-btn-close').click(function(){
$('.popup-btn-close').click(function() {
$('.popup').hide();

@@ -117,0 +116,0 @@ $('.algolia-pop-overlay').remove();

@@ -1,8 +0,8 @@

/* global NexT: true */
/* global NexT, CONFIG */
$(document).ready(function () {
$(document).ready(function() {
$(document).trigger('bootstrap:before');
/**
/**
* Register JS handlers by condition option.

@@ -19,3 +19,3 @@ * Need to add config option in Front-End at 'layout/_partials/head.swig' file.

// Mobile top menu bar.
$('.site-nav-toggle button').on('click', function () {
$('.site-nav-toggle button').on('click', function() {
var $siteNav = $('.site-nav');

@@ -27,3 +27,3 @@ var ON_CLASS_NAME = 'site-nav-on';

$siteNav.stop()[animateAction]('fast', function () {
$siteNav.stop()[animateAction]('fast', function() {
$siteNav[animateCallback](ON_CLASS_NAME);

@@ -30,0 +30,0 @@ });

@@ -1,9 +0,8 @@

/* global NexT: true */
$(document).ready(function() {
$(document).ready(function () {
// Create Base64 Object
/* eslint-disable */
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}};
$('.exturl').on('click', function () {
$('.exturl').on('click', function() {
var $exturl = $(this).attr('data-url');

@@ -10,0 +9,0 @@ var $decurl = Base64.decode($exturl);

@@ -1,4 +0,4 @@

/* global NexT: true */
/* global NexT, CONFIG */
$(document).ready(function () {
$(document).ready(function() {
NexT.motion = {};

@@ -8,17 +8,17 @@

lines: [],
push: function (line) {
push : function(line) {
this.lines.push(line);
},
init: function () {
this.lines.forEach(function (line) {
init: function() {
this.lines.forEach(function(line) {
line.init();
});
},
arrow: function () {
this.lines.forEach(function (line) {
arrow: function() {
this.lines.forEach(function(line) {
line.arrow();
});
},
close: function () {
this.lines.forEach(function (line) {
close: function() {
this.lines.forEach(function(line) {
line.close();

@@ -33,7 +33,7 @@ });

init: {
width: '100%',
width : '100%',
opacity: 1,
left: 0,
left : 0,
rotateZ: 0,
top: 0
top : 0
}

@@ -43,12 +43,12 @@ }, settings.status);

SidebarToggleLine.prototype.init = function () {
SidebarToggleLine.prototype.init = function() {
this.transform('init');
};
SidebarToggleLine.prototype.arrow = function () {
SidebarToggleLine.prototype.arrow = function() {
this.transform('arrow');
};
SidebarToggleLine.prototype.close = function () {
SidebarToggleLine.prototype.close = function() {
this.transform('close');
};
SidebarToggleLine.prototype.transform = function (status) {
SidebarToggleLine.prototype.transform = function(status) {
this.el.velocity('stop').velocity(this.status[status]);

@@ -58,3 +58,3 @@ };

var sidebarToggleLine1st = new SidebarToggleLine({
el: '.sidebar-toggle-line-first',
el : '.sidebar-toggle-line-first',
status: {

@@ -66,3 +66,3 @@ arrow: {width: '50%', rotateZ: '-45deg', top: '2px'},

var sidebarToggleLine2nd = new SidebarToggleLine({
el: '.sidebar-toggle-line-middle',
el : '.sidebar-toggle-line-middle',
status: {

@@ -74,3 +74,3 @@ arrow: {width: '90%'},

var sidebarToggleLine3rd = new SidebarToggleLine({
el: '.sidebar-toggle-line-last',
el : '.sidebar-toggle-line-last',
status: {

@@ -86,3 +86,3 @@ arrow: {width: '50%', rotateZ: '45deg', top: '-2px'},

var SIDEBAR_WIDTH = '320px';
var SIDEBAR_WIDTH = CONFIG.sidebar.width ? CONFIG.sidebar.width : '320px';
var SIDEBAR_DISPLAY_DURATION = 200;

@@ -92,7 +92,7 @@ var xPos, yPos;

var sidebarToggleMotion = {
toggleEl: $('.sidebar-toggle'),
dimmerEl: $('#sidebar-dimmer'),
sidebarEl: $('.sidebar'),
toggleEl : $('.sidebar-toggle'),
dimmerEl : $('#sidebar-dimmer'),
sidebarEl : $('.sidebar'),
isSidebarVisible: false,
init: function () {
init : function() {
this.toggleEl.on('click', this.clickHandler.bind(this));

@@ -104,6 +104,6 @@ this.dimmerEl.on('click', this.clickHandler.bind(this));

this.sidebarEl.on('touchend', this.touchendHandler.bind(this));
this.sidebarEl.on('touchmove', function(e){e.preventDefault();});
this.sidebarEl.on('touchmove', function(e) { e.preventDefault(); });
$(document)
.on('sidebar.isShowing', function () {
.on('sidebar.isShowing', function() {
NexT.utils.isDesktop() && $('body').velocity('stop').velocity(

@@ -114,10 +114,10 @@ {paddingRight: SIDEBAR_WIDTH},

})
.on('sidebar.isHiding', function () {
.on('sidebar.isHiding', function() {
});
},
clickHandler: function () {
clickHandler: function() {
this.isSidebarVisible ? this.hideSidebar() : this.showSidebar();
this.isSidebarVisible = !this.isSidebarVisible;
},
mouseEnterHandler: function () {
mouseEnterHandler: function() {
if (this.isSidebarVisible) {

@@ -128,3 +128,3 @@ return;

},
mouseLeaveHandler: function () {
mouseLeaveHandler: function() {
if (this.isSidebarVisible) {

@@ -142,7 +142,7 @@ return;

var _yPos = e.originalEvent.changedTouches[0].clientY;
if (_xPos-xPos > 30 && Math.abs(_yPos-yPos) < 20) {
this.clickHandler();
if (_xPos - xPos > 30 && Math.abs(_yPos - yPos) < 20) {
this.clickHandler();
}
},
showSidebar: function () {
showSidebar: function() {
var self = this;

@@ -153,23 +153,23 @@

this.sidebarEl.velocity('stop').velocity({
width: SIDEBAR_WIDTH
}, {
display: 'block',
duration: SIDEBAR_DISPLAY_DURATION,
begin: function () {
$('.sidebar .motion-element').velocity(
'transition.slideRightIn',
{
stagger: 50,
drag: true,
complete: function () {
self.sidebarEl.trigger('sidebar.motion.complete');
}
width: SIDEBAR_WIDTH
}, {
display : 'block',
duration: SIDEBAR_DISPLAY_DURATION,
begin : function() {
$('.sidebar .motion-element').velocity(
'transition.slideRightIn',
{
stagger : 50,
drag : true,
complete: function() {
self.sidebarEl.trigger('sidebar.motion.complete');
}
);
},
complete: function () {
self.sidebarEl.addClass('sidebar-active');
self.sidebarEl.trigger('sidebar.didShow');
}
}
);
},
complete: function() {
self.sidebarEl.addClass('sidebar-active');
self.sidebarEl.trigger('sidebar.didShow');
}
}
);

@@ -179,3 +179,3 @@

},
hideSidebar: function () {
hideSidebar: function() {
NexT.utils.isDesktop() && $('body').velocity('stop').velocity({paddingRight: 0});

@@ -191,3 +191,3 @@ this.sidebarEl.find('.motion-element').velocity('stop').css('display', 'none');

// Prevent adding TOC to Overview if Overview was selected when close & open sidebar.
if (!!$('.post-toc-wrap')) {
if (!$('.post-toc-wrap')) {
if ($('.site-overview-wrap').css('display') === 'block') {

@@ -204,9 +204,9 @@ $('.post-toc-wrap').removeClass('motion-element');

NexT.motion.integrator = {
queue: [],
queue : [],
cursor: -1,
add: function (fn) {
add : function(fn) {
this.queue.push(fn);
return this;
},
next: function () {
next: function() {
this.cursor++;

@@ -216,3 +216,3 @@ var fn = this.queue[this.cursor];

},
bootstrap: function () {
bootstrap: function() {
this.next();

@@ -222,4 +222,4 @@ }

NexT.motion.middleWares = {
logo: function (integrator) {
NexT.motion.middleWares = {
logo: function(integrator) {
var sequence = [];

@@ -238,4 +238,27 @@ var $brand = $('.brand');

NexT.utils.isMist() && hasElement([$logoLineTop, $logoLineBottom]) &&
sequence.push(
/**
* Check if $elements exist.
* @param {jQuery|Array} $elements
* @returns {boolean}
*/
function hasElement($elements) {
$elements = Array.isArray($elements) ? $elements : [$elements];
return $elements.every(function($element) {
return $element.length > 0;
});
}
function getMistLineSettings(element, translateX) {
return {
e: $(element),
p: {translateX: translateX},
o: {
duration : 500,
sequenceQueue: false
}
};
}
NexT.utils.isMist() && hasElement([$logoLineTop, $logoLineBottom])
&& sequence.push(
getMistLineSettings($logoLineTop, '100%'),

@@ -262,36 +285,14 @@ getMistLineSettings($logoLineBottom, '-100%')

if (sequence.length > 0) {
sequence[sequence.length - 1].o.complete = function () {
sequence[sequence.length - 1].o.complete = function() {
integrator.next();
};
/* eslint-disable */
$.Velocity.RunSequence(sequence);
/* eslint-enable */
} else {
integrator.next();
}
function getMistLineSettings (element, translateX) {
return {
e: $(element),
p: {translateX: translateX},
o: {
duration: 500,
sequenceQueue: false
}
};
}
/**
* Check if $elements exist.
* @param {jQuery|Array} $elements
* @returns {boolean}
*/
function hasElement ($elements) {
$elements = Array.isArray($elements) ? $elements : [$elements];
return $elements.every(function ($element) {
return $element.length > 0;
});
}
},
menu: function (integrator) {
menu: function(integrator) {

@@ -303,5 +304,5 @@ if (CONFIG.motion.async) {

$('.menu-item').velocity('transition.slideDownIn', {
display: null,
display : null,
duration: 200,
complete: function () {
complete: function() {
integrator.next();

@@ -312,3 +313,4 @@ }

postList: function (integrator) {
postList: function(integrator) {
//var $post = $('.post');

@@ -327,14 +329,8 @@ var $postBlock = $('.post-block, .pagination, .comments');

hasPost ? postMotion() : integrator.next();
if (CONFIG.motion.async) {
integrator.next();
}
function postMotion () {
function postMotion() {
var postMotionOptions = window.postMotionOptions || {
stagger: 100,
drag: true
};
postMotionOptions.complete = function () {
stagger: 100,
drag : true
};
postMotionOptions.complete = function() {
// After motion complete need to remove transform from sidebar to let affix work on Pisces | Gemini.

@@ -365,5 +361,11 @@ if (CONFIG.motion.transition.sidebar && (NexT.utils.isPisces() || NexT.utils.isGemini())) {

}
hasPost ? postMotion() : integrator.next();
if (CONFIG.motion.async) {
integrator.next();
}
},
sidebar: function (integrator) {
sidebar: function(integrator) {
if (CONFIG.sidebar.display === 'always') {

@@ -370,0 +372,0 @@ NexT.utils.displaySidebar();

@@ -1,8 +0,6 @@

/* global NexT: true */
/* global NexT, CONFIG */
$(document).ready(function () {
$(document).ready(function() {
initScrollSpy();
function initScrollSpy () {
function initScrollSpy() {
var tocSelector = '.post-toc';

@@ -12,4 +10,9 @@ var $tocElement = $(tocSelector);

function removeCurrentActiveClass() {
$(tocSelector + ' ' + activeCurrentSelector)
.removeClass(activeCurrentSelector.substring(1));
}
$tocElement
.on('activate.bs.scrollspy', function () {
.on('activate.bs.scrollspy', function() {
var $currentActiveElement = $(tocSelector + ' .active').last();

@@ -26,12 +29,8 @@

$('body').scrollspy({ target: tocSelector });
function removeCurrentActiveClass () {
$(tocSelector + ' ' + activeCurrentSelector)
.removeClass(activeCurrentSelector.substring(1));
}
}
initScrollSpy();
});
$(document).ready(function () {
$(document).ready(function() {
var html = $('html');

@@ -41,3 +40,3 @@ var TAB_ANIMATE_DURATION = 200;

$('.sidebar-nav li').on('click', function () {
$('.sidebar-nav li').on('click', function() {
var item = $(this);

@@ -53,4 +52,4 @@ var activeTabClassName = 'sidebar-nav-active';

hasVelocity ?
currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function () {
hasVelocity
? currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function() {
target

@@ -60,4 +59,4 @@ .velocity('stop')

.addClass(activePanelClassName);
}) :
currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function () {
})
: currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function() {
currentTarget.hide();

@@ -67,3 +66,3 @@ target

.css({'opacity': 0, 'display': 'block'})
.animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function () {
.animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function() {
currentTarget.removeClass(activePanelClassName);

@@ -79,3 +78,3 @@ target.addClass(activePanelClassName);

// TOC item animation navigate & prevent #item selector in adress bar.
$('.post-toc a').on('click', function (e) {
$('.post-toc a').on('click', function(e) {
e.preventDefault();

@@ -85,8 +84,8 @@ var targetSelector = NexT.utils.escapeSelector(this.getAttribute('href'));

hasVelocity ?
html.velocity('stop').velocity('scroll', {
offset: offset + 'px',
hasVelocity
? html.velocity('stop').velocity('scroll', {
offset : offset + 'px',
mobileHA: false
}) :
$('html, body').stop().animate({
})
: $('html, body').stop().animate({
scrollTop: offset

@@ -101,4 +100,4 @@ }, 500);

// There's no definition sidebar in the page front-matter
var isSidebarCouldDisplay = CONFIG.sidebar.display === 'post' ||
CONFIG.sidebar.display === 'always';
var isSidebarCouldDisplay = CONFIG.sidebar.display === 'post'
|| CONFIG.sidebar.display === 'always';
var hasTOC = $tocContent.length > 0 && $tocContent.html().trim().length > 0;

@@ -108,7 +107,8 @@ display = isSidebarCouldDisplay && hasTOC;

if (display) {
CONFIG.motion.enable ?
(NexT.motion.middleWares.sidebar = function () {
NexT.utils.displaySidebar();
}) : NexT.utils.displaySidebar();
CONFIG.motion.enable
? NexT.motion.middleWares.sidebar = function() {
NexT.utils.displaySidebar();
}
: NexT.utils.displaySidebar();
}
});

@@ -1,14 +0,28 @@

$(document).ready(function () {
/* global NexT, CONFIG */
$(document).ready(function() {
var sidebarInner = $('.sidebar-inner');
initAffix();
resizeListener();
function getHeaderOffset() {
return $('.header-inner').height() + CONFIG.sidebar.offset;
}
function initAffix () {
var headerOffset = getHeaderOffset(),
footerOffset = getFooterOffset(),
sidebarHeight = $('#sidebar').height() + NexT.utils.getSidebarb2tHeight(),
contentHeight = $('#content').height();
function getFooterOffset() {
var footerInner = $('.footer-inner');
var footerMargin = footerInner.outerHeight(true) - footerInner.outerHeight();
var footerOffset = footerInner.outerHeight(true) + footerMargin;
return footerOffset;
}
function setSidebarMarginTop(headerOffset) {
return $('#sidebar').css({ 'margin-top': headerOffset });
}
function initAffix() {
var headerOffset = getHeaderOffset();
var footerOffset = getFooterOffset();
var sidebarHeight = $('#sidebar').height() + NexT.utils.getSidebarb2tHeight();
var contentHeight = $('#content').height();
// Not affix if sidebar taller then content (to prevent bottom jumping).

@@ -18,3 +32,3 @@ if (headerOffset + sidebarHeight < contentHeight) {

offset: {
top: headerOffset - CONFIG.sidebar.offset,
top : headerOffset - CONFIG.sidebar.offset,
bottom: footerOffset

@@ -28,6 +42,12 @@ }

function resizeListener () {
function recalculateAffixPosition() {
$(window).off('.affix');
sidebarInner.removeData('bs.affix').removeClass('affix affix-top affix-bottom');
initAffix();
}
function resizeListener() {
var mql = window.matchMedia('(min-width: 991px)');
mql.addListener(function(e){
if(e.matches){
mql.addListener(function(e) {
if (e.matches) {
recalculateAffixPosition();

@@ -38,23 +58,5 @@ }

function getHeaderOffset () {
return $('.header-inner').height() + CONFIG.sidebar.offset;
}
initAffix();
resizeListener();
function getFooterOffset () {
var footerInner = $('.footer-inner'),
footerMargin = footerInner.outerHeight(true) - footerInner.outerHeight(),
footerOffset = footerInner.outerHeight(true) + footerMargin;
return footerOffset;
}
function setSidebarMarginTop (headerOffset) {
return $('#sidebar').css({ 'margin-top': headerOffset });
}
function recalculateAffixPosition () {
$(window).off('.affix');
sidebarInner.removeData('bs.affix').removeClass('affix affix-top affix-bottom');
initAffix();
}
});
$(document).ready(function() {
/* global Cookies */
// Set relative link path (without domain)
var rpath = window.location.href.replace(window.location.origin, "");
var rpath = window.location.href.replace(window.location.origin, '');
// Write position in cookie
var timeout;
$(window).on("scroll", function() {
$(window).on('scroll', function() {
clearTimeout(timeout);
timeout = setTimeout(function () {
Cookies.set("scroll-cookie", ($(window).scrollTop() + "|" + rpath), { expires: 365, path: '' });
timeout = setTimeout(function() {
Cookies.set('scroll-cookie', $(window).scrollTop() + '|' + rpath, { expires: 365, path: '' });
}, 250);

@@ -16,9 +18,9 @@ });

// Read position from cookie
if (Cookies.get("scroll-cookie") !== undefined) {
var cvalues = Cookies.get("scroll-cookie").split('|');
if (cvalues[1] == rpath) {
$(window).scrollTop(cvalues[0]);
}
if (Cookies.get('scroll-cookie') !== undefined) {
var cvalues = Cookies.get('scroll-cookie').split('|');
if (cvalues[1] === rpath) {
$(window).scrollTop(cvalues[0]);
}
}
});

@@ -10,10 +10,12 @@ /* ========================================================================

/**
* Custom by iissnan
* Customized by iissnan & Ivan.Nginx
*
* - Add a `clear.bs.scrollspy` event.
* - Esacpe targets selector.
* - Refactored with eslint-config-theme-next style.
*/
/* global NexT */
+function ($) {
(function($) {
'use strict';

@@ -23,40 +25,39 @@

// ==========================
function ScrollSpy(element, options) {
this.$body = $(document.body)
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
this.selector = (this.options.target || '') + ' .nav li > a'
this.offsets = []
this.targets = []
this.activeTarget = null
this.scrollHeight = 0
this.$body = $(document.body);
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element);
this.options = $.extend({}, ScrollSpy.DEFAULTS, options);
this.selector = (this.options.target || '') + ' .nav li > a';
this.offsets = [];
this.targets = [];
this.activeTarget = null;
this.scrollHeight = 0;
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
this.refresh()
this.process()
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this));
this.refresh();
this.process();
}
ScrollSpy.VERSION = '3.3.2'
ScrollSpy.VERSION = '3.3.2';
ScrollSpy.DEFAULTS = {
offset: 10
}
};
ScrollSpy.prototype.getScrollHeight = function () {
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
}
ScrollSpy.prototype.getScrollHeight = function() {
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight);
};
ScrollSpy.prototype.refresh = function () {
var that = this
var offsetMethod = 'offset'
var offsetBase = 0
ScrollSpy.prototype.refresh = function() {
var that = this;
var offsetMethod = 'offset';
var offsetBase = 0;
this.offsets = []
this.targets = []
this.scrollHeight = this.getScrollHeight()
this.offsets = [];
this.targets = [];
this.scrollHeight = this.getScrollHeight();
if (!$.isWindow(this.$scrollElement[0])) {
offsetMethod = 'position'
offsetBase = this.$scrollElement.scrollTop()
offsetMethod = 'position';
offsetBase = this.$scrollElement.scrollTop();
}

@@ -66,6 +67,6 @@

.find(this.selector)
.map(function () {
var $el = $(this)
var href = $el.data('target') || $el.attr('href')
var $href = /^#./.test(href) && $(NexT.utils.escapeSelector(href)) // Need to escape selector.
.map(function() {
var $el = $(this);
var href = $el.data('target') || $el.attr('href');
var $href = /^#./.test(href) && $(NexT.utils.escapeSelector(href)); // Need to escape selector.

@@ -75,56 +76,58 @@ return ($href

&& $href.is(':visible')
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null;
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
that.offsets.push(this[0])
that.targets.push(this[1])
.sort(function(a, b) {
return a[0] - b[0];
})
.each(function() {
that.offsets.push(this[0]);
that.targets.push(this[1]);
});
}
};
ScrollSpy.prototype.process = function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight = this.getScrollHeight()
var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
var offsets = this.offsets
var targets = this.targets
var activeTarget = this.activeTarget
var i
ScrollSpy.prototype.process = function() {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset;
var scrollHeight = this.getScrollHeight();
var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height();
var offsets = this.offsets;
var targets = this.targets;
var activeTarget = this.activeTarget;
var i;
if (this.scrollHeight != scrollHeight) {
this.refresh()
if (this.scrollHeight !== scrollHeight) {
this.refresh();
}
if (scrollTop >= maxScroll) {
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
return activeTarget !== (i = targets[targets.length - 1]) && this.activate(i);
}
if (activeTarget && scrollTop < offsets[0]) {
$(this.selector).trigger('clear.bs.scrollspy') // Add a custom event.
this.activeTarget = null
return this.clear()
$(this.selector).trigger('clear.bs.scrollspy'); // Add a custom event.
this.activeTarget = null;
return this.clear();
}
for (i = offsets.length; i--;) {
activeTarget != targets[i]
activeTarget !== targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activate(targets[i])
&& this.activate(targets[i]);
}
}
};
ScrollSpy.prototype.activate = function (target) {
this.activeTarget = target
ScrollSpy.prototype.activate = function(target) {
this.activeTarget = target;
this.clear()
this.clear();
var selector = this.selector +
'[data-target="' + target + '"],' +
this.selector + '[href="' + target + '"]'
var selector = this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]';
var active = $(selector)
.parents('li')
.addClass('active')
.addClass('active');

@@ -134,54 +137,48 @@ if (active.parent('.dropdown-menu').length) {

.closest('li.dropdown')
.addClass('active')
.addClass('active');
}
active.trigger('activate.bs.scrollspy')
}
active.trigger('activate.bs.scrollspy');
};
ScrollSpy.prototype.clear = function () {
ScrollSpy.prototype.clear = function() {
$(this.selector)
.parentsUntil(this.options.target, '.active')
.removeClass('active')
}
.removeClass('active');
};
// SCROLLSPY PLUGIN DEFINITION
// ===========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.scrollspy')
var options = typeof option == 'object' && option
return this.each(function() {
var $this = $(this);
var data = $this.data('bs.scrollspy');
var options = typeof option === 'object' && option;
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
if (typeof option == 'string') data[option]()
})
if (!data) $this.data('bs.scrollspy', data = new ScrollSpy(this, options));
if (typeof option === 'string') data[option]();
});
}
var old = $.fn.scrollspy
var old = $.fn.scrollspy;
$.fn.scrollspy = Plugin
$.fn.scrollspy.Constructor = ScrollSpy
$.fn.scrollspy = Plugin;
$.fn.scrollspy.Constructor = ScrollSpy;
// SCROLLSPY NO CONFLICT
// =====================
$.fn.scrollspy.noConflict = function() {
$.fn.scrollspy = old;
return this;
};
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
// SCROLLSPY DATA-API
// ==================
$(window).on('load.bs.scrollspy.data-api', function() {
$('[data-spy="scroll"]').each(function() {
var $spy = $(this);
Plugin.call($spy, $spy.data());
});
});
$(window).on('load.bs.scrollspy.data-api', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
Plugin.call($spy, $spy.data())
})
})
}(jQuery);
}(jQuery));

@@ -1,12 +0,13 @@

/* global NexT: true */
/* global NexT, CONFIG */
NexT.utils = NexT.$u = {
/**
* Wrap images with fancybox support.
*/
wrapImageWithFancyBox: function () {
wrapImageWithFancyBox: function() {
$('.content img')
.not('[hidden]')
.not('.group-picture img, .post-gallery img')
.each(function () {
.each(function() {
var $image = $(this);

@@ -17,3 +18,3 @@ var imageTitle = $image.attr('title');

if ($imageWrapLink.length < 1) {
var imageLink = ($image.attr('data-original')) ? this.getAttribute('data-original') : this.getAttribute('src');
var imageLink = $image.attr('data-original') ? this.getAttribute('data-original') : this.getAttribute('src');
$imageWrapLink = $image.wrap('<a data-fancybox="group" href="' + imageLink + '"></a>').parent('a');

@@ -42,7 +43,7 @@ }

lazyLoadPostsImages: function () {
lazyLoadPostsImages: function() {
$('#posts').find('img').lazyload({
//placeholder: '/images/loading.gif',
effect: 'fadeIn',
threshold : 0
effect : 'fadeIn',
threshold: 0
});

@@ -54,3 +55,3 @@ },

*/
registerTabsTag: function () {
registerTabsTag: function() {
var tNav = '.tabs ul.nav-tabs ';

@@ -69,6 +70,6 @@

$(tNav + '.tab').on('click', function (href) {
$(tNav + '.tab').on('click', function(href) {
href.preventDefault();
// Prevent selected tab to select again.
if(!$(this).hasClass('active')){
if (!$(this).hasClass('active')) {

@@ -89,6 +90,6 @@ // Add & Remove active class on `nav-tabs` & `tab-content`.

registerESCKeyEvent: function () {
$(document).on('keyup', function (event) {
var shouldDismissSearchPopup = event.which === 27 &&
$('.search-popup').is(':visible');
registerESCKeyEvent: function() {
$(document).on('keyup', function(event) {
var shouldDismissSearchPopup = event.which === 27
&& $('.search-popup').is(':visible');
if (shouldDismissSearchPopup) {

@@ -102,7 +103,7 @@ $('.search-popup').hide();

registerBackToTop: function () {
registerBackToTop: function() {
var THRESHOLD = 50;
var $top = $('.back-to-top');
$(window).on('scroll', function () {
$(window).on('scroll', function() {
$top.toggleClass('back-to-top-on', window.pageYOffset > THRESHOLD);

@@ -112,9 +113,9 @@

var contentVisibilityHeight = NexT.utils.getContentVisibilityHeight();
var scrollPercent = (scrollTop) / (contentVisibilityHeight);
var scrollPercentRounded = Math.round(scrollPercent*100);
var scrollPercentMaxed = (scrollPercentRounded > 100) ? 100 : scrollPercentRounded;
var scrollPercent = scrollTop / contentVisibilityHeight;
var scrollPercentRounded = Math.round(scrollPercent * 100);
var scrollPercentMaxed = scrollPercentRounded > 100 ? 100 : scrollPercentRounded;
$('#scrollpercent>span').html(scrollPercentMaxed);
});
$top.on('click', function () {
$top.on('click', function() {
$('body').velocity('scroll');

@@ -128,3 +129,3 @@ });

*/
embeddedVideoTransformer: function () {
embeddedVideoTransformer: function() {
var $iframes = $('iframe');

@@ -140,5 +141,16 @@

];
var pattern = new RegExp( SUPPORTED_PLAYERS.join('|') );
var pattern = new RegExp(SUPPORTED_PLAYERS.join('|'));
$iframes.each(function () {
function getDimension($element) {
return {
width : $element.width(),
height: $element.height()
};
}
function getAspectRadio(width, height) {
return height / width * 100;
}
$iframes.each(function() {
var iframe = this;

@@ -159,7 +171,6 @@ var $iframe = $(this);

position: 'absolute',
top: '0',
left: '0'
top : '0',
left : '0'
});
// Wrap the iframe in a new <div> which uses a dynamically fetched padding-top property

@@ -184,4 +195,4 @@ // based on the video's w/h dimensions

newDimension = getDimension($iframe);
var shouldRecalculateAspect = newDimension.width > oldDimension.width ||
newDimension.height < oldDimension.height;
var shouldRecalculateAspect = newDimension.width > oldDimension.width
|| newDimension.height < oldDimension.height;

@@ -196,15 +207,5 @@ // 163 Music Player has a fixed height, so we need to reset the aspect radio

function getDimension($element) {
return {
width: $element.width(),
height: $element.height()
};
}
function getAspectRadio(width, height) {
return height / width * 100;
}
},
hasMobileUA: function () {
hasMobileUA: function() {
var nav = window.navigator;

@@ -217,11 +218,11 @@ var ua = nav.userAgent;

isTablet: function () {
isTablet: function() {
return window.screen.width < 992 && window.screen.width > 767 && this.hasMobileUA();
},
isMobile: function () {
isMobile: function() {
return window.screen.width < 767 && this.hasMobileUA();
},
isDesktop: function () {
isDesktop: function() {
return !this.isTablet() && !this.isMobile();

@@ -236,7 +237,7 @@ },

*/
escapeSelector: function (selector) {
return selector.replace(/[!"$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g, '\\$&');
escapeSelector: function(selector) {
return selector.replace(/[!"$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, '\\$&');
},
displaySidebar: function () {
displaySidebar: function() {
if (!this.isDesktop() || this.isPisces() || this.isGemini()) {

@@ -248,15 +249,15 @@ return;

isMist: function () {
isMist: function() {
return CONFIG.scheme === 'Mist';
},
isPisces: function () {
isPisces: function() {
return CONFIG.scheme === 'Pisces';
},
isGemini: function () {
isGemini: function() {
return CONFIG.scheme === 'Gemini';
},
getScrollbarWidth: function () {
getScrollbarWidth: function() {
var $div = $('<div />').addClass('scrollbar-measure').prependTo('body');

@@ -271,40 +272,29 @@ var div = $div[0];

getContentVisibilityHeight: function () {
var docHeight = $('#content').height(),
winHeight = $(window).height(),
contentVisibilityHeight = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight);
getContentVisibilityHeight: function() {
var docHeight = $('#content').height();
var winHeight = $(window).height();
var contentVisibilityHeight = docHeight > winHeight ? docHeight - winHeight : $(document).height() - winHeight;
return contentVisibilityHeight;
},
getSidebarb2tHeight: function () {
getSidebarb2tHeight: function() {
//var sidebarb2tHeight = (CONFIG.sidebar.b2t) ? document.getElementsByClassName('back-to-top')[0].clientHeight : 0;
var sidebarb2tHeight = (CONFIG.sidebar.b2t) ? $('.back-to-top').height() : 0;
//var sidebarb2tHeight = (CONFIG.sidebar.b2t) ? 24 : 0;
var sidebarb2tHeight = CONFIG.sidebar.b2t ? $('.back-to-top').height() : 0;
return sidebarb2tHeight;
},
getSidebarSchemePadding: function () {
var sidebarNavHeight = ($('.sidebar-nav').css('display') == 'block') ? $('.sidebar-nav').outerHeight(true) : 0,
sidebarInner = $('.sidebar-inner'),
sidebarPadding = sidebarInner.innerWidth() - sidebarInner.width(),
sidebarSchemePadding = this.isPisces() || this.isGemini() ?
((sidebarPadding * 2) + sidebarNavHeight + (CONFIG.sidebar.offset * 2) + this.getSidebarb2tHeight()) :
((sidebarPadding * 2) + (sidebarNavHeight / 2));
getSidebarSchemePadding: function() {
var sidebarNavHeight = $('.sidebar-nav').css('display') === 'block' ? $('.sidebar-nav').outerHeight(true) : 0;
var sidebarInner = $('.sidebar-inner');
var sidebarPadding = sidebarInner.innerWidth() - sidebarInner.width();
var sidebarSchemePadding = this.isPisces() || this.isGemini()
? (sidebarPadding * 2) + sidebarNavHeight + (CONFIG.sidebar.offset * 2) + this.getSidebarb2tHeight()
: (sidebarPadding * 2) + (sidebarNavHeight / 2);
return sidebarSchemePadding;
}
/**
* Affix behaviour for Sidebar.
*
* @returns {Boolean}
*/
// needAffix: function () {
// return this.isPisces() || this.isGemini();
// }
};
$(document).ready(function () {
$(document).ready(function() {
initSidebarDimension();
/**

@@ -314,9 +304,15 @@ * Init Sidebar & TOC inner dimensions on all pages and for all schemes.

*/
function initSidebarDimension () {
function updateSidebarHeight(height) {
height = height || 'auto';
$('.site-overview, .post-toc').css('max-height', height);
}
function initSidebarDimension() {
var updateSidebarHeightTimer;
$(window).on('resize', function () {
$(window).on('resize', function() {
updateSidebarHeightTimer && clearTimeout(updateSidebarHeightTimer);
updateSidebarHeightTimer = setTimeout(function () {
updateSidebarHeightTimer = setTimeout(function() {
var sidebarWrapperHeight = document.body.clientHeight - NexT.utils.getSidebarSchemePadding();

@@ -330,8 +326,8 @@

var scrollbarWidth = NexT.utils.getScrollbarWidth();
if ($('.site-overview-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) {
$('.site-overview').css('width', 'calc(100% + ' + scrollbarWidth + 'px)');
}
if ($('.post-toc-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) {
$('.post-toc').css('width', 'calc(100% + ' + scrollbarWidth + 'px)');
}
if ($('.site-overview-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) {
$('.site-overview').css('width', 'calc(100% + ' + scrollbarWidth + 'px)');
}
if ($('.post-toc-wrap').height() > (document.body.clientHeight - NexT.utils.getSidebarSchemePadding())) {
$('.post-toc').css('width', 'calc(100% + ' + scrollbarWidth + 'px)');
}

@@ -342,7 +338,4 @@ // Initialize Sidebar & TOC Height.

function updateSidebarHeight (height) {
height = height || 'auto';
$('.site-overview, .post-toc').css('max-height', height);
}
initSidebarDimension();
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc