Excute eslint

next
mashirozx 2021-08-01 10:06:35 +08:00
parent fd7afd8131
commit ad9d20a2d2
10 changed files with 266 additions and 123 deletions

View File

@ -5,12 +5,12 @@
/**
* Sakura initState
*/
declare var InitState: any
declare let InitState: any
/**
* reCaptcha
*/
declare var grecaptcha: any
declare let grecaptcha: any
interface Pagination {
page: number

View File

@ -68,7 +68,7 @@ export default defineComponent({
return { context: options[key].title, icon: options[key].icon, key }
})
let defaultCurrentTabIndex: number = 0
let defaultCurrentTabIndex = 0
if (window.location.hash) {
const locationHashMatch = window.location.hash.match(/^#(.*)/)
if (locationHashMatch && locationHashMatch[1] && tabKeys.indexOf(locationHashMatch[1]) > -1) {

View File

@ -389,7 +389,8 @@ const options: Options = {
title: 'Long string',
desc: 'Textarea for long string input.',
type: 'longString',
default: `"It is the unknown we fear when we look upon death and darkness, nothing more."\n-- Albus Dumbledore`,
default:
'"It is the unknown we fear when we look upon death and darkness, nothing more."\n-- Albus Dumbledore',
},
{
namespace: 'demo.switcher',

View File

@ -21,7 +21,7 @@ export const usePersistedState = <K, T>(
cachePeriod?: number
): [Ref<UnwrapRef<T>>, (arg: T) => void] => {
cachePeriod = cachePeriod ?? 24 * 60 * 60
let state = ref(defaultValue)
const state = ref(defaultValue)
const s = new storage()
let fetchingStorage = true

View File

@ -1,39 +1,75 @@
{
"messages.admin.invalidUrl": "Invalid URL",
"messages.admin.uplicateUrls": "Duplicate URLs",
"messages.popup.close": "Close",
"messages.popup.dismiss": "Dismiss",
"messages.popup.showDetails": "Show details",
"messages.wordpress.applicationPasswordsEndpointNotAvailable": "ApplicationPasswords is not avaliabe in your WordPress installation, please upgrade WordPress to v5.6.0 above, or enable the ApplicationPasswords feature in v5.6.0 above installation.",
"messages.wordpress.permalink.shouldIncludeFieldsInPost": "WordPress pages should use %slug% as the permalink.",
"messages.wordpress.permalink.shouldIncludeFieldsInSingle": "WordPress permalink should include at least one of %post_id%, %postname%. You may set them here: {baseUrl}/wp-admin/options-permalink.php",
"options.basic.site.logo.binds.button": "Use this image",
"options.basic.site.logo.binds.title": "Select image for site logo.",
"options.basic.site.logo.desc": "The site's Logo image, will display on navigation bar.",
"options.basic.site.logo.title": "Site logo",
"options.basic.site.title.desc": "The site title",
"options.basic.site.title.title": "Site title",
"options.thirdParty.reCaptcha.enable.desc": "Use reCAPTCHA for anti-spam check.",
"options.thirdParty.reCaptcha.enable.negativeLabel": "Disabled",
"options.thirdParty.reCaptcha.enable.positiveLabel": "Enabled",
"options.thirdParty.reCaptcha.enable.title": "Enable reCAPTCHA",
"options.thirdParty.reCaptcha.secretKey.title": "reCAPTCHA secret key",
"options.thirdParty.reCaptcha.siteKey.title": "reCAPTCHA site key",
"options.thirdParty.reCaptcha.version.desc": "Register your reCAPTCHA app '<a href=\"https://www.google.com/recaptcha/about/\" target=\"_blank\">here</a>', and choose a version.",
"options.thirdParty.reCaptcha.version.label.v2": "reCAPTCHA version 2",
"options.thirdParty.reCaptcha.version.label.v3": "reCAPTCHA version 3",
"options.thirdParty.reCaptcha.version.title": "reCAPTCHA version",
"posts.comment.composer.authorEmail.label": "Email *",
"posts.comment.composer.authorName.label": "Nickname *",
"posts.comment.composer.authorUrl.label": "Link",
"posts.comment.composer.captcha.toggleButton": "Captcha",
"posts.comment.composer.content.label": "You are a surprise that I will only meet once in my life",
"posts.comment.composer.submit.button": "Submit",
"posts.comment.composer.tips.markdownSupported": "Markdown Supported",
"posts.commentCount": "{commentCount, plural, =0 {No comment} =1 {One comment} other {{commentCount, number, ::compact-short} Comments}}",
"posts.postTimeOn": "Post on {publistTimeDate, date, long}",
"posts.postTimeSince": "Post {duration} ago",
"posts.readCount": "{readCount, plural, =0 {No one ever read} =1 {One read} other {{readCount, number, ::compact-short} Reads}}",
"posts.readMore": "Read More",
"posts.wordCount": "{wordCount, plural, =0 {No content} =1 {One word} other {{wordCount, number, ::compact-short} Words}}"
}
'admin.restore.title': 'Restore this option to default.',
'app.common.units.year': '{num, plural, =0 {just now} =1 {1 second} other {{num, number, ::compact-short} seconds}}',
'messages.admin.invalidUrl': 'Invalid URL',
'messages.admin.uplicateUrls': 'Duplicate URLs',
'messages.comment.submit.error': 'Comment post failure.',
'messages.comment.submit.success': 'Comment post successfully.',
'messages.commonMessages.javascriptErrorTitle': 'Opps, something when wrong!',
'messages.popup.close': 'Close',
'messages.popup.dismiss': 'Dismiss',
'messages.popup.showDetails': 'Show details',
'messages.postContent.cache.found': 'Fetching the latest post content...',
'messages.postList.cache.found': 'Fetching the latest post list...',
'messages.postList.reachLastPage': 'No more...',
'messages.posts.fetchPageError': 'Failed to fetch page content.',
'messages.posts.fetchPostError': 'Failed to fetch post content.',
'messages.wordpress.applicationPasswordsEndpointNotAvailable': 'ApplicationPasswords is not avaliabe in your WordPress installation, please upgrade WordPress to v5.6.0 above, or enable the ApplicationPasswords feature in v5.6.0 above installation.',
'messages.wordpress.permalink.shouldIncludeFieldsInPost': 'WordPress pages should use %slug% as the permalink.',
'messages.wordpress.permalink.shouldIncludeFieldsInSingle': 'WordPress permalink should include at least one of %post_id%, %postname%. You may set them here: {baseUrl}/wp-admin/options-permalink.php',
'options.basic.site.logo.binds.button': 'Use this image',
'options.basic.site.logo.binds.title': 'Select image for site logo.',
'options.basic.site.logo.desc': 'The site\'s Logo image, will display on navigation bar.',
'options.basic.site.logo.title': 'Site logo',
'options.basic.site.title.desc': 'The site title',
'options.basic.site.title.title': 'Site title',
'options.basicDesc': 'The basic options',
'options.basicTitle': 'Basic',
'options.homepage.cover.image.binds.button': 'Use this image',
'options.homepage.cover.image.binds.title': 'Select image for homepage cover.',
'options.homepage.cover.image.desc': 'Homepage cover images. Will enable slide show with multiple selections.',
'options.homepage.cover.image.title': 'Cover images',
'options.homepage.quote.title': 'Quote',
'options.homepage.signature.desc': 'The signature text (follows the quote).',
'options.homepage.signature.title': 'Signature',
'options.homepage.slogan.desc': 'The slogan text (with typewriter effect), recommend 10-20 characters.',
'options.homepage.slogan.title': 'Slogan',
'options.homepageDesc': 'Homepage options',
'options.homepageTitle': 'Homepage',
'options.social.facebook.desc': 'Your \'<a href="https://facebook.com" target="_blank">Facebook</a>\' username',
'options.social.facebook.title': 'Facebook username',
'options.social.github.desc': 'Your \'<a href="https://github.com" target="_blank">Github</a>\' username',
'options.social.github.title': 'Github username',
'options.social.gitlab.desc': 'Your \'<a href="https://gitlab.com" target="_blank">Gitlab</a>\' username',
'options.social.gitlab.title': 'Gitlab username',
'options.social.stackoverflow.desc': 'Your \'<a href="https://stackoverflow.com" target="_blank">Stackoverflow</a>\' username',
'options.social.stackoverflow.title': 'Stackoverflow username',
'options.social.twitter.desc': 'Your \'<a href="https://twitter.com" target="_blank">Twitter</a>\' username',
'options.social.twitter.title': 'Twitter username',
'options.social.weibo.desc': 'Your \'<a href="https://weibo.com" target="_blank">Weibo</a>\' username',
'options.social.weibo.title': 'Weibo username',
'options.thirdParty.reCaptcha.enable.desc': 'Use reCAPTCHA for anti-spam check.',
'options.thirdParty.reCaptcha.enable.negativeLabel': 'Disabled',
'options.thirdParty.reCaptcha.enable.positiveLabel': 'Enabled',
'options.thirdParty.reCaptcha.enable.title': 'Enable reCAPTCHA',
'options.thirdParty.reCaptcha.secretKey.title': 'reCAPTCHA secret key',
'options.thirdParty.reCaptcha.siteKey.title': 'reCAPTCHA site key',
'options.thirdParty.reCaptcha.version.desc': 'Register your reCAPTCHA app \'<a href="https://www.google.com/recaptcha/about/" target="_blank">here</a>\', and choose a version.',
'options.thirdParty.reCaptcha.version.label.v2': 'reCAPTCHA version 2',
'options.thirdParty.reCaptcha.version.label.v3': 'reCAPTCHA version 3',
'options.thirdParty.reCaptcha.version.title': 'reCAPTCHA version',
'posts.comment.composer.authorEmail.label': 'Email *',
'posts.comment.composer.authorName.label': 'Nickname *',
'posts.comment.composer.authorUrl.label': 'Link',
'posts.comment.composer.captcha.toggleButton': 'Captcha',
'posts.comment.composer.content.label': 'You are a surprise that I will only meet once in my life',
'posts.comment.composer.submit.button': 'Submit',
'posts.comment.composer.tips.markdownSupported': 'Markdown Supported',
'posts.commentCount': '{commentCount, plural, =0 {No comment} =1 {One comment} other {{commentCount, number, ::compact-short} Comments}}',
'posts.postTimeOn.brief': '{publistTimeDate, date, long}',
'posts.postTimeOn.full': 'Post on {publistTimeDate, date, long}',
'posts.postTimeSince': 'Post {duration} ago',
'posts.readCount': '{readCount, plural, =0 {No one ever read} =1 {One read} other {{readCount, number, ::compact-short} Reads}}',
'posts.readMore': 'Read More',
'posts.wordCount': '{wordCount, plural, =0 {No content} =1 {One word} other {{wordCount, number, ::compact-short} Words}}'
}

View File

@ -1,113 +1,221 @@
{
"messages.admin.invalidUrl": {
"defaultMessage": "Invalid URL"
'admin.restore.title': {
'defaultMessage': 'Restore this option to default.'
},
"messages.admin.uplicateUrls": {
"defaultMessage": "Duplicate URLs"
'app.common.units.year': {
'defaultMessage': '{num, plural, =0 {just now} =1 {1 second} other {{num, number, ::compact-short} seconds}}'
},
"messages.popup.close": {
"defaultMessage": "Close"
'messages.admin.invalidUrl': {
'defaultMessage': 'Invalid URL'
},
"messages.popup.dismiss": {
"defaultMessage": "Dismiss"
'messages.admin.uplicateUrls': {
'defaultMessage': 'Duplicate URLs'
},
"messages.popup.showDetails": {
"defaultMessage": "Show details"
'messages.comment.submit.error': {
'defaultMessage': 'Comment post failure.'
},
"messages.wordpress.applicationPasswordsEndpointNotAvailable": {
"defaultMessage": "ApplicationPasswords is not avaliabe in your WordPress installation, please upgrade WordPress to v5.6.0 above, or enable the ApplicationPasswords feature in v5.6.0 above installation."
'messages.comment.submit.success': {
'defaultMessage': 'Comment post successfully.'
},
"messages.wordpress.permalink.shouldIncludeFieldsInPost": {
"defaultMessage": "WordPress pages should use %slug% as the permalink."
'messages.commonMessages.javascriptErrorTitle': {
'defaultMessage': 'Opps, something when wrong!'
},
"messages.wordpress.permalink.shouldIncludeFieldsInSingle": {
"defaultMessage": "WordPress permalink should include at least one of %post_id%, %postname%. You may set them here: {baseUrl}/wp-admin/options-permalink.php"
'messages.popup.close': {
'defaultMessage': 'Close'
},
"options.basic.site.logo.binds.button": {
"defaultMessage": "Use this image"
'messages.popup.dismiss': {
'defaultMessage': 'Dismiss'
},
"options.basic.site.logo.binds.title": {
"defaultMessage": "Select image for site logo."
'messages.popup.showDetails': {
'defaultMessage': 'Show details'
},
"options.basic.site.logo.desc": {
"defaultMessage": "The site's Logo image, will display on navigation bar."
'messages.postContent.cache.found': {
'defaultMessage': 'Fetching the latest post content...'
},
"options.basic.site.logo.title": {
"defaultMessage": "Site logo"
'messages.postList.cache.found': {
'defaultMessage': 'Fetching the latest post list...'
},
"options.basic.site.title.desc": {
"defaultMessage": "The site title"
'messages.postList.reachLastPage': {
'defaultMessage': 'No more...'
},
"options.basic.site.title.title": {
"defaultMessage": "Site title"
'messages.posts.fetchPageError': {
'defaultMessage': 'Failed to fetch page content.'
},
"options.thirdParty.reCaptcha.enable.desc": {
"defaultMessage": "Use reCAPTCHA for anti-spam check."
'messages.posts.fetchPostError': {
'defaultMessage': 'Failed to fetch post content.'
},
"options.thirdParty.reCaptcha.enable.negativeLabel": {
"defaultMessage": "Disabled"
'messages.wordpress.applicationPasswordsEndpointNotAvailable': {
'defaultMessage': 'ApplicationPasswords is not avaliabe in your WordPress installation, please upgrade WordPress to v5.6.0 above, or enable the ApplicationPasswords feature in v5.6.0 above installation.'
},
"options.thirdParty.reCaptcha.enable.positiveLabel": {
"defaultMessage": "Enabled"
'messages.wordpress.permalink.shouldIncludeFieldsInPost': {
'defaultMessage': 'WordPress pages should use %slug% as the permalink.'
},
"options.thirdParty.reCaptcha.enable.title": {
"defaultMessage": "Enable reCAPTCHA"
'messages.wordpress.permalink.shouldIncludeFieldsInSingle': {
'defaultMessage': 'WordPress permalink should include at least one of %post_id%, %postname%. You may set them here: {baseUrl}/wp-admin/options-permalink.php'
},
"options.thirdParty.reCaptcha.secretKey.title": {
"defaultMessage": "reCAPTCHA secret key"
'options.basic.site.logo.binds.button': {
'defaultMessage': 'Use this image'
},
"options.thirdParty.reCaptcha.siteKey.title": {
"defaultMessage": "reCAPTCHA site key"
'options.basic.site.logo.binds.title': {
'defaultMessage': 'Select image for site logo.'
},
"options.thirdParty.reCaptcha.version.desc": {
"defaultMessage": "Register your reCAPTCHA app '<a href=\"https://www.google.com/recaptcha/about/\" target=\"_blank\">here</a>', and choose a version."
'options.basic.site.logo.desc': {
'defaultMessage': 'The site\'s Logo image, will display on navigation bar.'
},
"options.thirdParty.reCaptcha.version.label.v2": {
"defaultMessage": "reCAPTCHA version 2"
'options.basic.site.logo.title': {
'defaultMessage': 'Site logo'
},
"options.thirdParty.reCaptcha.version.label.v3": {
"defaultMessage": "reCAPTCHA version 3"
'options.basic.site.title.desc': {
'defaultMessage': 'The site title'
},
"options.thirdParty.reCaptcha.version.title": {
"defaultMessage": "reCAPTCHA version"
'options.basic.site.title.title': {
'defaultMessage': 'Site title'
},
"posts.comment.composer.authorEmail.label": {
"defaultMessage": "Email *"
'options.basicDesc': {
'defaultMessage': 'The basic options'
},
"posts.comment.composer.authorName.label": {
"defaultMessage": "Nickname *"
'options.basicTitle': {
'defaultMessage': 'Basic'
},
"posts.comment.composer.authorUrl.label": {
"defaultMessage": "Link"
'options.homepage.cover.image.binds.button': {
'defaultMessage': 'Use this image'
},
"posts.comment.composer.captcha.toggleButton": {
"defaultMessage": "Captcha"
'options.homepage.cover.image.binds.title': {
'defaultMessage': 'Select image for homepage cover.'
},
"posts.comment.composer.content.label": {
"defaultMessage": "You are a surprise that I will only meet once in my life"
'options.homepage.cover.image.desc': {
'defaultMessage': 'Homepage cover images. Will enable slide show with multiple selections.'
},
"posts.comment.composer.submit.button": {
"defaultMessage": "Submit"
'options.homepage.cover.image.title': {
'defaultMessage': 'Cover images'
},
"posts.comment.composer.tips.markdownSupported": {
"defaultMessage": "Markdown Supported"
'options.homepage.quote.title': {
'defaultMessage': 'Quote'
},
"posts.commentCount": {
"defaultMessage": "{commentCount, plural, =0 {No comment} =1 {One comment} other {{commentCount, number, ::compact-short} Comments}}"
'options.homepage.signature.desc': {
'defaultMessage': 'The signature text (follows the quote).'
},
"posts.postTimeOn": {
"defaultMessage": "Post on {publistTimeDate, date, long}"
'options.homepage.signature.title': {
'defaultMessage': 'Signature'
},
"posts.postTimeSince": {
"defaultMessage": "Post {duration} ago"
'options.homepage.slogan.desc': {
'defaultMessage': 'The slogan text (with typewriter effect), recommend 10-20 characters.'
},
"posts.readCount": {
"defaultMessage": "{readCount, plural, =0 {No one ever read} =1 {One read} other {{readCount, number, ::compact-short} Reads}}"
'options.homepage.slogan.title': {
'defaultMessage': 'Slogan'
},
"posts.readMore": {
"defaultMessage": "Read More"
'options.homepageDesc': {
'defaultMessage': 'Homepage options'
},
"posts.wordCount": {
"defaultMessage": "{wordCount, plural, =0 {No content} =1 {One word} other {{wordCount, number, ::compact-short} Words}}"
'options.homepageTitle': {
'defaultMessage': 'Homepage'
},
'options.social.facebook.desc': {
'defaultMessage': 'Your \'<a href="https://facebook.com" target="_blank">Facebook</a>\' username'
},
'options.social.facebook.title': {
'defaultMessage': 'Facebook username'
},
'options.social.github.desc': {
'defaultMessage': 'Your \'<a href="https://github.com" target="_blank">Github</a>\' username'
},
'options.social.github.title': {
'defaultMessage': 'Github username'
},
'options.social.gitlab.desc': {
'defaultMessage': 'Your \'<a href="https://gitlab.com" target="_blank">Gitlab</a>\' username'
},
'options.social.gitlab.title': {
'defaultMessage': 'Gitlab username'
},
'options.social.stackoverflow.desc': {
'defaultMessage': 'Your \'<a href="https://stackoverflow.com" target="_blank">Stackoverflow</a>\' username'
},
'options.social.stackoverflow.title': {
'defaultMessage': 'Stackoverflow username'
},
'options.social.twitter.desc': {
'defaultMessage': 'Your \'<a href="https://twitter.com" target="_blank">Twitter</a>\' username'
},
'options.social.twitter.title': {
'defaultMessage': 'Twitter username'
},
'options.social.weibo.desc': {
'defaultMessage': 'Your \'<a href="https://weibo.com" target="_blank">Weibo</a>\' username'
},
'options.social.weibo.title': {
'defaultMessage': 'Weibo username'
},
'options.thirdParty.reCaptcha.enable.desc': {
'defaultMessage': 'Use reCAPTCHA for anti-spam check.'
},
'options.thirdParty.reCaptcha.enable.negativeLabel': {
'defaultMessage': 'Disabled'
},
'options.thirdParty.reCaptcha.enable.positiveLabel': {
'defaultMessage': 'Enabled'
},
'options.thirdParty.reCaptcha.enable.title': {
'defaultMessage': 'Enable reCAPTCHA'
},
'options.thirdParty.reCaptcha.secretKey.title': {
'defaultMessage': 'reCAPTCHA secret key'
},
'options.thirdParty.reCaptcha.siteKey.title': {
'defaultMessage': 'reCAPTCHA site key'
},
'options.thirdParty.reCaptcha.version.desc': {
'defaultMessage': 'Register your reCAPTCHA app \'<a href="https://www.google.com/recaptcha/about/" target="_blank">here</a>\', and choose a version.'
},
'options.thirdParty.reCaptcha.version.label.v2': {
'defaultMessage': 'reCAPTCHA version 2'
},
'options.thirdParty.reCaptcha.version.label.v3': {
'defaultMessage': 'reCAPTCHA version 3'
},
'options.thirdParty.reCaptcha.version.title': {
'defaultMessage': 'reCAPTCHA version'
},
'posts.comment.composer.authorEmail.label': {
'defaultMessage': 'Email *'
},
'posts.comment.composer.authorName.label': {
'defaultMessage': 'Nickname *'
},
'posts.comment.composer.authorUrl.label': {
'defaultMessage': 'Link'
},
'posts.comment.composer.captcha.toggleButton': {
'defaultMessage': 'Captcha'
},
'posts.comment.composer.content.label': {
'defaultMessage': 'You are a surprise that I will only meet once in my life'
},
'posts.comment.composer.submit.button': {
'defaultMessage': 'Submit'
},
'posts.comment.composer.tips.markdownSupported': {
'defaultMessage': 'Markdown Supported'
},
'posts.commentCount': {
'defaultMessage': '{commentCount, plural, =0 {No comment} =1 {One comment} other {{commentCount, number, ::compact-short} Comments}}'
},
'posts.postTimeOn.brief': {
'defaultMessage': '{publistTimeDate, date, long}'
},
'posts.postTimeOn.full': {
'defaultMessage': 'Post on {publistTimeDate, date, long}'
},
'posts.postTimeSince': {
'defaultMessage': 'Post {duration} ago'
},
'posts.readCount': {
'defaultMessage': '{readCount, plural, =0 {No one ever read} =1 {One read} other {{readCount, number, ::compact-short} Reads}}'
},
'posts.readMore': {
'defaultMessage': 'Read More'
},
'posts.wordCount': {
'defaultMessage': '{wordCount, plural, =0 {No content} =1 {One word} other {{wordCount, number, ::compact-short} Words}}'
}
}

View File

@ -12,7 +12,7 @@ export interface Message {
closeTimeout?: number
}
export interface MessageOptions extends Omit<Message, 'id'> {}
export type MessageOptions = Omit<Message, 'id'>
export default function msg(): object {
const [messageList, setMessageList] = useState([] as Message[])

View File

@ -1,6 +1,6 @@
const getScrollbarWidth = () => {
let div1 = document.createElement('div')
let div2 = document.createElement('div')
const div1 = document.createElement('div')
const div2 = document.createElement('div')
div1.style.width = div2.style.width = div1.style.height = div2.style.height = '100px'
div1.style.overflow = 'scroll'
div2.style.overflow = 'hidden'

View File

@ -17,7 +17,7 @@ export default class timeFormater {
public getTimeFromNow() {
const gap = this.timestampFromNow
let num: number = 0
let num = 0
let unit: Unit = 'second'
if (gap < 60 * 1000) {
num = gap / 1000

View File

@ -12,13 +12,11 @@
<script lang="ts">
import { defineComponent } from 'vue'
import { useRoute } from '@/hooks'
import Base from '@/layouts/Base.vue'
import Content from '@/components/content/Content.vue'
export default defineComponent({
components: { Content, Base },
setup() {},
})
</script>