This commit is contained in:
cutls 2020-07-10 14:21:24 +09:00
parent 5d01dafeb3
commit 489d95f23f
3 changed files with 7 additions and 10 deletions

View File

@ -160,7 +160,7 @@ setInterval(function () {
infowebsocket() infowebsocket()
} }
}, 10000) }, 10000)
function toastInterpret(obj) { async function toastInterpret(obj) {
if (obj.type == 'textv2') { if (obj.type == 'textv2') {
if (~obj.languages.indexOf(lang.language)) { if (~obj.languages.indexOf(lang.language)) {
let showVer = true let showVer = true

View File

@ -387,7 +387,8 @@ function ckdb(acct_id) {
var letters = domain + '_letters' var letters = domain + '_letters'
var quoteMarker = domain + '_quote' var quoteMarker = domain + '_quote'
if (idata) { if (idata) {
var json = JSON.parse(idata) //check and replace json to idata
var json = idata
if (json[quoteMarker] == 'enabled') { if (json[quoteMarker] == 'enabled') {
localStorage.setItem('quoters', 'true') localStorage.setItem('quoters', 'true')
localStorage.setItem('quote_' + acct_id, 'true') localStorage.setItem('quote_' + acct_id, 'true')

View File

@ -157,7 +157,7 @@ function spotifytips() {
setLog(start, 'JSON', error) setLog(start, 'JSON', error)
console.error(error) console.error(error)
}) })
.then(function(json) { .then(async function(json) {
var ms = json.progress_ms var ms = json.progress_ms
if(!ms) { if(!ms) {
tips('ver') tips('ver')
@ -175,7 +175,7 @@ function spotifytips() {
} }
} }
artisttxt = escapeHTML(artisttxt) artisttxt = escapeHTML(artisttxt)
sleep(last) await sleep(last)
var tms = item.duration_ms var tms = item.duration_ms
var per = (ms / item.duration_ms) * 100 var per = (ms / item.duration_ms) * 100
ms = ms / 1000 ms = ms / 1000
@ -251,10 +251,10 @@ function trendTagonTipInterval() {
} }
//時計 //時計
var clockint var clockint
function clock() { async function clock() {
var now = new Date() var now = new Date()
var last = 1000 - (now.getTime() % 1000) var last = 1000 - (now.getTime() % 1000)
sleep(last) await sleep(last)
clockint = setInterval(clockStart, 1000) clockint = setInterval(clockStart, 1000)
} }
function clockStart() { function clockStart() {
@ -286,10 +286,6 @@ function clockStart() {
'</span>' '</span>'
$('#tips-text').html(msg) $('#tips-text').html(msg)
} }
function sleep(waitMsec) {
var startMsec = new Date()
while (new Date() - startMsec < waitMsec);
}
function tipsToggle() { function tipsToggle() {
$('#tips').toggleClass('hide') $('#tips').toggleClass('hide')
$('#tips-menu').toggleClass('hide') $('#tips-menu').toggleClass('hide')