mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-20 19:02:33 +00:00
Code style update
This commit is contained in:
parent
97035e6f56
commit
2ea722f0ed
@ -200,7 +200,7 @@ language_switcher: false
|
|||||||
|
|
||||||
footer:
|
footer:
|
||||||
# Specify the year when the site was setup. If not defined, current year will be used.
|
# Specify the year when the site was setup. If not defined, current year will be used.
|
||||||
#since: 2020
|
#since: 2021
|
||||||
|
|
||||||
# Icon between year and copyright info.
|
# Icon between year and copyright info.
|
||||||
icon:
|
icon:
|
||||||
@ -387,7 +387,7 @@ back2top:
|
|||||||
reading_progress:
|
reading_progress:
|
||||||
enable: false
|
enable: false
|
||||||
# Available values: left | right
|
# Available values: left | right
|
||||||
startAt: left
|
start_at: left
|
||||||
# Available values: top | bottom
|
# Available values: top | bottom
|
||||||
position: top
|
position: top
|
||||||
reversed: false
|
reversed: false
|
||||||
@ -560,11 +560,6 @@ quicklink:
|
|||||||
# Default (true) will attempt to use the fetch() API if supported (rather than link[rel=prefetch]).
|
# Default (true) will attempt to use the fetch() API if supported (rather than link[rel=prefetch]).
|
||||||
priority: true
|
priority: true
|
||||||
|
|
||||||
# For more flexibility you can add some patterns (RegExp, Function, or Array) to ignores.
|
|
||||||
# See: https://github.com/GoogleChromeLabs/quicklink#custom-ignore-patterns
|
|
||||||
# This option is deprecated. Use `CONFIG.quicklink.ignores` in your custom scripts instead.
|
|
||||||
ignores:
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
# Comments Settings
|
# Comments Settings
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
width: var(--progress);
|
width: var(--progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hexo-config('reading_progress.startAt') == 'right') {
|
if (hexo-config('reading_progress.start_at') == 'right') {
|
||||||
right: 0;
|
right: 0;
|
||||||
} else {
|
} else {
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@ -6,14 +6,14 @@ if (!window.NexT) window.NexT = {};
|
|||||||
const staticConfig = {};
|
const staticConfig = {};
|
||||||
let variableConfig = {};
|
let variableConfig = {};
|
||||||
|
|
||||||
const parse = (text) => {
|
const parse = text => {
|
||||||
const jsonString = new DOMParser()
|
const jsonString = new DOMParser()
|
||||||
.parseFromString(text, 'text/html').documentElement
|
.parseFromString(text, 'text/html').documentElement
|
||||||
.textContent;
|
.textContent;
|
||||||
return JSON.parse(jsonString || '{}');
|
return JSON.parse(jsonString || '{}');
|
||||||
};
|
};
|
||||||
|
|
||||||
const update = (name) => {
|
const update = name => {
|
||||||
const targetEle = document.querySelector(`.${className}[data-name="${name}"]`);
|
const targetEle = document.querySelector(`.${className}[data-name="${name}"]`);
|
||||||
if (!targetEle) return;
|
if (!targetEle) return;
|
||||||
const parsedConfig = parse(targetEle.text);
|
const parsedConfig = parse(targetEle.text);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ firebase.initializeApp({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const appendCountTo = (el) => {
|
const appendCountTo = el => {
|
||||||
return count => {
|
return count => {
|
||||||
el.innerText = count;
|
el.innerText = count;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,12 +2,12 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
const leancloudSelector = (url) => {
|
const leancloudSelector = url => {
|
||||||
url = encodeURI(url);
|
url = encodeURI(url);
|
||||||
return document.getElementById(url).querySelector('.leancloud-visitors-count');
|
return document.getElementById(url).querySelector('.leancloud-visitors-count');
|
||||||
};
|
};
|
||||||
|
|
||||||
const addCount = (Counter) => {
|
const addCount = Counter => {
|
||||||
const visitors = document.querySelector('.leancloud_visitors');
|
const visitors = document.querySelector('.leancloud_visitors');
|
||||||
const url = decodeURI(visitors.id);
|
const url = decodeURI(visitors.id);
|
||||||
const title = visitors.dataset.flagTitle;
|
const title = visitors.dataset.flagTitle;
|
||||||
@ -46,7 +46,7 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const showTime = (Counter) => {
|
const showTime = Counter => {
|
||||||
const visitors = document.querySelectorAll('.leancloud_visitors');
|
const visitors = document.querySelectorAll('.leancloud_visitors');
|
||||||
const entries = [...visitors].map(element => {
|
const entries = [...visitors].map(element => {
|
||||||
return decodeURI(element.id);
|
return decodeURI(element.id);
|
||||||
@ -66,7 +66,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { app_id, app_key, server_url } = CONFIG.leancloud_visitors;
|
const { app_id, app_key, server_url } = CONFIG.leancloud_visitors;
|
||||||
const fetchData = (api_server) => {
|
const fetchData = api_server => {
|
||||||
const Counter = (method, url, data) => {
|
const Counter = (method, url, data) => {
|
||||||
return fetch(`${api_server}/1.1${url}`, {
|
return fetch(`${api_server}/1.1${url}`, {
|
||||||
method,
|
method,
|
||||||
|
|||||||
@ -392,7 +392,7 @@ NexT.utils = {
|
|||||||
if (legacyCallback) {
|
if (legacyCallback) {
|
||||||
return this.loadComments(selector).then(legacyCallback);
|
return this.loadComments(selector).then(legacyCallback);
|
||||||
}
|
}
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
const element = document.querySelector(selector);
|
const element = document.querySelector(selector);
|
||||||
if (!CONFIG.comments.lazyload || !element) {
|
if (!CONFIG.comments.lazyload || !element) {
|
||||||
resolve();
|
resolve();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user