Code style update

This commit is contained in:
Mimi 2021-06-06 01:14:28 +08:00
parent 97035e6f56
commit 2ea722f0ed
16 changed files with 32 additions and 37 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -23,7 +23,7 @@ firebase.initializeApp({
});
};
const appendCountTo = (el) => {
const appendCountTo = el => {
return count => {
el.innerText = count;
};

View File

@ -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,

View File

@ -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();