WIP: use-strict

This commit is contained in:
cutls 2019-11-24 23:53:35 +09:00
parent 2583c3b80a
commit bae73521e9
31 changed files with 53 additions and 26 deletions

View File

@ -62,7 +62,7 @@ function load() {
<i class="material-icons">refresh</i>${lang.lang_manager_refresh} <i class="material-icons">refresh</i>${lang.lang_manager_refresh}
</a> </a>
<a class="waves-effect disTar pointer red-text" onclick="multiDel('${key}')"> <a class="waves-effect disTar pointer red-text" onclick="multiDel('${key}')">
<i class="material-icons">delete</i>${lang.lang_manager_delete}" <i class="material-icons">delete</i>${lang.lang_manager_delete}
</a><br />${lang.lang_manager_color} </a><br />${lang.lang_manager_color}
<div id="colorsel_${key}" class="colorsel"></div> <div id="colorsel_${key}" class="colorsel"></div>
</div> </div>
@ -317,7 +317,7 @@ function support() {
Object.keys(idata).forEach(function(key) { Object.keys(idata).forEach(function(key) {
var instance = idata[key] var instance = idata[key]
if (instance == 'instance') { if (instance == 'instance') {
templete = var templete =
'<a onclick="login(\'' + '<a onclick="login(\'' +
key + key +
'\')" class="collection-item pointer transparent">' + '\')" class="collection-item pointer transparent">' +
@ -951,7 +951,7 @@ function multisel() {
var list = key * 1 + 1 var list = key * 1 + 1
if (key == last) { if (key == last) {
sel = 'selected' sel = 'selected'
mainb = '(' + lang.lang_manager_def + ')' var mainb = '(' + lang.lang_manager_def + ')'
var domain = localStorage.getItem('domain_' + key) var domain = localStorage.getItem('domain_' + key)
var profimg = localStorage.getItem('prof_' + key) var profimg = localStorage.getItem('prof_' + key)
var domain = localStorage.getItem('domain_' + key) var domain = localStorage.getItem('domain_' + key)
@ -962,7 +962,7 @@ function multisel() {
sel = '' sel = ''
mainb = '' mainb = ''
} }
template = ` var template = `
<option value="${key}" data-icon="${acct.prof}" class="left circle" ${sel}> <option value="${key}" data-icon="${acct.prof}" class="left circle" ${sel}>
${acct.user}@${acct.domain}${mainb} ${acct.user}@${acct.domain}${mainb}
</option> </option>
@ -978,7 +978,7 @@ function mainacct() {
M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 }) M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 })
} }
function colorpicker(key) { function colorpicker(key) {
temp = `<div onclick="coloradd('${key}','def','def')" class="pointer exc">${lang.lang_manager_none}</div> var temp = `<div onclick="coloradd('${key}','def','def')" class="pointer exc">${lang.lang_manager_none}</div>
<div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer"></div> <div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer"></div>
<div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer"></div> <div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer"></div>
<div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer"></div> <div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer"></div>

View File

@ -11,7 +11,7 @@ $(document).on('click', 'a', e => {
if (url) { if (url) {
urls = url.match(/https?:\/\/(.+)/) urls = url.match(/https?:\/\/(.+)/)
//トゥートのURLぽかったら //トゥートのURLぽかったら
toot = url.match(/https:\/\/([^+_]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/) var toot = url.match(/https:\/\/([^+_]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/)
if (!toot) { if (!toot) {
//Pleroma対策 //Pleroma対策
toot = url.match(/https:\/\/([^+_]+)\/users\/([a-zA-Z0-9_]+)\/statuses\/([0-9]+)/) toot = url.match(/https:\/\/([^+_]+)\/users\/([a-zA-Z0-9_]+)\/statuses\/([0-9]+)/)

View File

@ -4,7 +4,7 @@ const shell = electron.shell
var ipc = electron.ipcRenderer var ipc = electron.ipcRenderer
onmessage = function(e) { onmessage = function(e) {
if (e.data[0] == 'openUrl') { if (e.data[0] == 'openUrl') {
urls = e.data[1].match(/https?:\/\/(.+)/) var urls = e.data[1].match(/https?:\/\/(.+)/)
if (urls) { if (urls) {
shell.openExternal(e.data[1]) shell.openExternal(e.data[1])
} }

View File

@ -173,7 +173,7 @@ function additionalIndv(tlid, acct_id, id) {
console.error(error) console.error(error)
}) })
.then(function(json) { .then(function(json) {
cards = json.card var cards = json.card
var analyze = cardHtml(cards, acct_id, id) var analyze = cardHtml(cards, acct_id, id)
$('[toot-id=' + id + '] .additional').html(analyze) $('[toot-id=' + id + '] .additional').html(analyze)
if (json.title) { if (json.title) {

View File

@ -1,3 +1,4 @@
'use strict'
/*メディアフィルター機能*/ /*メディアフィルター機能*/
//各TL上方のMedia[On/Off] //各TL上方のMedia[On/Off]
function mediaToggle(tlid) { function mediaToggle(tlid) {

View File

@ -1,3 +1,4 @@
'use strict'
function listMenu() { function listMenu() {
$('#left-menu div').removeClass('active') $('#left-menu div').removeClass('active')
$('#listMenu').addClass('active') $('#listMenu').addClass('active')

View File

@ -1,3 +1,4 @@
'use strict'
function escapeHTMLtemp(str) { function escapeHTMLtemp(str) {
if (!str) { if (!str) {
return ""; return "";

View File

@ -1,3 +1,4 @@
'use strict'
//Integrated TL //Integrated TL
async function mixtl(acct_id, tlid, type, delc, voice) { async function mixtl(acct_id, tlid, type, delc, voice) {
localStorage.setItem('now', type) localStorage.setItem('now', type)

View File

@ -1,3 +1,4 @@
'use strict'
//通知 //通知
//取得+Streaming接続 //取得+Streaming接続
function notf(acct_id, tlid, sys) { function notf(acct_id, tlid, sys) {

View File

@ -1,3 +1,4 @@
'use strict'
//Integrated TL //Integrated TL
function mixtl(acct_id, tlid, type, delc, voice) { function mixtl(acct_id, tlid, type, delc, voice) {
localStorage.removeItem('morelock') localStorage.removeItem('morelock')

View File

@ -1,3 +1,4 @@
'use strict'
//オブジェクトパーサー(トゥート) //オブジェクトパーサー(トゥート)
function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var splitter = new GraphemeSplitter() var splitter = new GraphemeSplitter()
@ -539,11 +540,11 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
.match( .match(
/https?:\/\/([^+_]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/ /https?:\/\/([^+_]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
) )
urlsck = content.match(/(https?):\/\/([^<>]*?)\/([^"]*)/g) var urlsck = content.match(/(https?):\/\/([^<>]*?)\/([^"]*)/g)
if (urlsck) { if (urlsck) {
for (var urlct = 0; urlct < urlsck.length; urlct++) { for (var urlct = 0; urlct < urlsck.length; urlct++) {
var urlindv = urlsck[urlct] var urlindv = urlsck[urlct]
urlCont = urlindv.match(/(https?):\/\/([^a-zA-Z0-9.-]*?)\.(.+?)\/([^"]*)/) var urlCont = urlindv.match(/(https?):\/\/([^a-zA-Z0-9.-]*?)\.(.+?)\/([^"]*)/)
if (urlCont) { if (urlCont) {
urlindv = urlindv.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&') urlindv = urlindv.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&')
var encoded = encodeURI(urlCont[4]) var encoded = encodeURI(urlCont[4])

View File

@ -1,3 +1,4 @@
'use strict'
//アンケートのトグル //アンケートのトグル
function pollToggle() { function pollToggle() {
if ($('#poll').hasClass('hide')) { if ($('#poll').hasClass('hide')) {

View File

@ -1,8 +1,9 @@
$voise = null 'use strict'
isBouyomi = localStorage.getItem('voice_bouyomi') var $voise = null
$voiseName = lang.lang_speech var isBouyomi = localStorage.getItem('voice_bouyomi')
$voices = speechSynthesis.getVoices() var $voiseName = lang.lang_speech
$synthes = new SpeechSynthesisUtterance() var $voices = speechSynthesis.getVoices()
var $synthes = new SpeechSynthesisUtterance()
$voise = $.grep($voices, function(n, i) { $voise = $.grep($voices, function(n, i) {
return n.name == $voiseName return n.name == $voiseName
})[0] })[0]
@ -12,14 +13,14 @@ speechSynthesis.cancel()
if (!localStorage.getItem('voice_vol')) { if (!localStorage.getItem('voice_vol')) {
localStorage.setItem('voice_vol', 1) localStorage.setItem('voice_vol', 1)
} }
voiceRate = localStorage.getItem('voice_speed') var voiceRate = localStorage.getItem('voice_speed')
$synthes.rate = voiceRate $synthes.rate = voiceRate
voicePitch = localStorage.getItem('voice_pitch') var voicePitch = localStorage.getItem('voice_pitch')
$synthes.pitch = voicePitch $synthes.pitch = voicePitch
voiceVol = localStorage.getItem('voice_vol') var voiceVol = localStorage.getItem('voice_vol')
$synthes.volume = voiceVol $synthes.volume = voiceVol
function say(msgr) { function say(msgr) {
msg = voiceParse(msgr) var msg = voiceParse(msgr)
var voice = localStorage.getItem('voicebank') var voice = localStorage.getItem('voicebank')
var obj = JSON.parse(voice) var obj = JSON.parse(voice)
if (!obj) { if (!obj) {
@ -31,7 +32,7 @@ function say(msgr) {
localStorage.setItem('voicebank', json) localStorage.setItem('voicebank', json)
} }
} }
$repeat = setInterval(function() { var $repeat = setInterval(function() {
if (!speechSynthesis.speaking) { if (!speechSynthesis.speaking) {
var voice = localStorage.getItem('voicebank') var voice = localStorage.getItem('voicebank')
if (voice) { if (voice) {
@ -72,7 +73,7 @@ $repeat = setInterval(function() {
} }
}, 300) }, 300)
function voiceParse(msg) { function voiceParse(msg) {
msg = $.strip_tags(msg) var msg = $.strip_tags(msg)
msg = msg.replace(/#/g, '') msg = msg.replace(/#/g, '')
msg = msg.replace(/'/g, '') msg = msg.replace(/'/g, '')
msg = msg.replace(/"/g, '') msg = msg.replace(/"/g, '')

View File

@ -1,3 +1,4 @@
'use strict'
//検索 //検索
//検索ボックストグル //検索ボックストグル
function searchMenu() { function searchMenu() {

View File

@ -1,3 +1,4 @@
'use strict'
//タグ表示 //タグ表示
if (location.search) { if (location.search) {
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/) var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/)

View File

@ -1,5 +1,6 @@
'use strict'
//TL取得 //TL取得
moreloading = false var moreloading = false
var errorct = 0 var errorct = 0
function tl(type, data, acct_id, tlid, delc, voice, mode) { function tl(type, data, acct_id, tlid, delc, voice, mode) {
scrollevent() scrollevent()

View File

@ -1,3 +1,4 @@
'use strict'
/*イメージビューワー*/ /*イメージビューワー*/
//postのimg.jsとは異なります。 //postのimg.jsとは異なります。
function imgv(id, key, acct_id) { function imgv(id, key, acct_id) {
@ -76,7 +77,7 @@ function imgCont(type) {
} }
function imageXhr(id, key, murl) { function imageXhr(id, key, murl) {
var startTime = new Date() var startTime = new Date()
xhr = new XMLHttpRequest() var xhr = new XMLHttpRequest()
xhr.open('GET', murl, true) xhr.open('GET', murl, true)
xhr.responseType = 'arraybuffer' xhr.responseType = 'arraybuffer'
xhr.addEventListener( xhr.addEventListener(
@ -104,7 +105,7 @@ function imageXhr(id, key, murl) {
) )
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4 && this.status == 200) {
r = new FileReader() var r = new FileReader()
r.readAsDataURL(this.response) r.readAsDataURL(this.response)
r.onload = function() { r.onload = function() {
var b64 = r.result var b64 = r.result

View File

@ -1,3 +1,4 @@
'use strict'
//レイアウトの設定 //レイアウトの設定
var websocketOld = [] var websocketOld = []
@ -706,7 +707,7 @@ function setToggleTag(tlid) {
} }
} }
function colorpicker(key) { function colorpicker(key) {
temp = `<div onclick="coloradd('${key}','def','def')" class="pointer">Default</div> var temp = `<div onclick="coloradd('${key}','def','def')" class="pointer">Default</div>
<div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer">Red</div> <div onclick="coloradd('${key}','f44336','white')" class="red white-text pointer">Red</div>
<div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer">Pink</div> <div onclick="coloradd('${key}','e91e63','white')" class="pink white-text pointer">Pink</div>
<div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer">Purple</div> <div onclick="coloradd('${key}','9c27b0','white')" class="purple white-text pointer">Purple</div>

View File

@ -1,3 +1,4 @@
'use strict'
function menu() { function menu() {
localStorage.setItem("menu-done", true); localStorage.setItem("menu-done", true);
$("#fukidashi").addClass("hide") $("#fukidashi").addClass("hide")

View File

@ -1,3 +1,4 @@
'use strict'
function pip(id) { function pip(id) {
$("#pip-content").html($("[toot-id=" + id + "] .additional").html()); $("#pip-content").html($("[toot-id=" + id + "] .additional").html());
$("#pip").removeClass("hide"); $("#pip").removeClass("hide");

View File

@ -1,3 +1,4 @@
'use strict'
/*ささやきボックス(Cr民並感)*/ /*ささやきボックス(Cr民並感)*/
//✕隠す //✕隠す
function hide() { function hide() {

View File

@ -1,3 +1,4 @@
'use strict'
var r = document.getElementById("radio"); var r = document.getElementById("radio");
function Rtoggle() { function Rtoggle() {
if ($("#radio").hasClass("play")) { if ($("#radio").hasClass("play")) {

View File

@ -1,3 +1,4 @@
'use strict'
//スクロールで続きを読む //スクロールで続きを読む
function scrollevent() { function scrollevent() {
$('.tl-box').scroll(function() { $('.tl-box').scroll(function() {

View File

@ -1,3 +1,4 @@
'use strict'
//設定(setting.html)で読む //設定(setting.html)で読む
var envView = new Vue({ var envView = new Vue({
el: "#envView", el: "#envView",

View File

@ -1,3 +1,4 @@
'use strict'
//ソートデータ読み込み //ソートデータ読み込み
function sortLoad () { function sortLoad () {
$("#sort").html(""); $("#sort").html("");

View File

@ -1,3 +1,4 @@
'use strict'
function spotifyConnect() { function spotifyConnect() {
var auth = "https://accounts.spotify.com/authorize?client_id=0f18e54abe0b4aedb4591e353d3aff69&redirect_uri=https://thedesk.top/spotify-connect&response_type=code&scope=user-read-currently-playing"; var auth = "https://accounts.spotify.com/authorize?client_id=0f18e54abe0b4aedb4591e353d3aff69&redirect_uri=https://thedesk.top/spotify-connect&response_type=code&scope=user-read-currently-playing";
var platform = localStorage.getItem("platform"); var platform = localStorage.getItem("platform");

View File

@ -1,3 +1,4 @@
'use strict'
//テーマ適用 //テーマ適用
function themes(theme) { function themes(theme) {
if (!theme) { if (!theme) {

View File

@ -1,3 +1,4 @@
'use strict'
//左下のメッセージ //左下のメッセージ
var todcTrigger = null var todcTrigger = null
function todo(mes) { function todo(mes) {
@ -128,7 +129,7 @@ function trendTagonTip() {
}) })
} }
//Spotify //Spotify
spotint = null var spotint = null
function spotifytips() { function spotifytips() {
if (spotint) clearInterval(spotint) if (spotint) clearInterval(spotint)
var start = var start =

View File

@ -1,3 +1,4 @@
'use strict'
//ユーザーデータ表示 //ユーザーデータ表示
//タイムライン //タイムライン
function utl(user, more, acct_id) { function utl(user, more, acct_id) {

View File

@ -1,3 +1,4 @@
'use strict'
//プロフ編集 //プロフ編集
//文字系 //文字系
function profedit() { function profedit() {

View File

@ -1,3 +1,4 @@
'use strict'
//ユーザーデータ表示 //ユーザーデータ表示
localStorage.removeItem("history"); localStorage.removeItem("history");
//コード受信 //コード受信