mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
Code style update
This commit is contained in:
parent
97035e6f56
commit
2ea722f0ed
@ -200,7 +200,7 @@ language_switcher: false
|
||||
|
||||
footer:
|
||||
# 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:
|
||||
@ -387,7 +387,7 @@ back2top:
|
||||
reading_progress:
|
||||
enable: false
|
||||
# Available values: left | right
|
||||
startAt: left
|
||||
start_at: left
|
||||
# Available values: top | bottom
|
||||
position: top
|
||||
reversed: false
|
||||
@ -560,11 +560,6 @@ quicklink:
|
||||
# Default (true) will attempt to use the fetch() API if supported (rather than link[rel=prefetch]).
|
||||
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
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
width: var(--progress);
|
||||
}
|
||||
|
||||
if (hexo-config('reading_progress.startAt') == 'right') {
|
||||
if (hexo-config('reading_progress.start_at') == 'right') {
|
||||
right: 0;
|
||||
} else {
|
||||
left: 0;
|
||||
|
||||
@ -6,14 +6,14 @@ if (!window.NexT) window.NexT = {};
|
||||
const staticConfig = {};
|
||||
let variableConfig = {};
|
||||
|
||||
const parse = (text) => {
|
||||
const parse = text => {
|
||||
const jsonString = new DOMParser()
|
||||
.parseFromString(text, 'text/html').documentElement
|
||||
.textContent;
|
||||
return JSON.parse(jsonString || '{}');
|
||||
};
|
||||
|
||||
const update = (name) => {
|
||||
const update = name => {
|
||||
const targetEle = document.querySelector(`.${className}[data-name="${name}"]`);
|
||||
if (!targetEle) return;
|
||||
const parsedConfig = parse(targetEle.text);
|
||||
|
||||
@ -23,7 +23,7 @@ firebase.initializeApp({
|
||||
});
|
||||
};
|
||||
|
||||
const appendCountTo = (el) => {
|
||||
const appendCountTo = el => {
|
||||
return count => {
|
||||
el.innerText = count;
|
||||
};
|
||||
|
||||
@ -2,12 +2,12 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
(function() {
|
||||
const leancloudSelector = (url) => {
|
||||
const leancloudSelector = url => {
|
||||
url = encodeURI(url);
|
||||
return document.getElementById(url).querySelector('.leancloud-visitors-count');
|
||||
};
|
||||
|
||||
const addCount = (Counter) => {
|
||||
const addCount = Counter => {
|
||||
const visitors = document.querySelector('.leancloud_visitors');
|
||||
const url = decodeURI(visitors.id);
|
||||
const title = visitors.dataset.flagTitle;
|
||||
@ -46,7 +46,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
const showTime = (Counter) => {
|
||||
const showTime = Counter => {
|
||||
const visitors = document.querySelectorAll('.leancloud_visitors');
|
||||
const entries = [...visitors].map(element => {
|
||||
return decodeURI(element.id);
|
||||
@ -66,7 +66,7 @@
|
||||
};
|
||||
|
||||
const { app_id, app_key, server_url } = CONFIG.leancloud_visitors;
|
||||
const fetchData = (api_server) => {
|
||||
const fetchData = api_server => {
|
||||
const Counter = (method, url, data) => {
|
||||
return fetch(`${api_server}/1.1${url}`, {
|
||||
method,
|
||||
|
||||
@ -392,7 +392,7 @@ NexT.utils = {
|
||||
if (legacyCallback) {
|
||||
return this.loadComments(selector).then(legacyCallback);
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
return new Promise(resolve => {
|
||||
const element = document.querySelector(selector);
|
||||
if (!CONFIG.comments.lazyload || !element) {
|
||||
resolve();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user