From 0bf3f69a286d32331a950a44327ad8db54264d38 Mon Sep 17 00:00:00 2001 From: cutls Date: Thu, 9 Jul 2020 17:03:22 +0900 Subject: [PATCH] initial --- app/css/master.css | 5 ++++- app/js/common/version.js | 4 ++-- app/js/login/login.js | 6 +++--- app/js/login/manager.js | 10 +++++----- app/js/platform/end.js | 2 +- app/js/platform/first.js | 3 +++ app/js/post/bb-md.js | 2 +- app/js/post/img.js | 6 +++--- app/js/post/status.js | 10 +++++----- app/js/tl/datails.js | 6 +++--- app/js/tl/misskeyparse.js | 4 ++-- app/js/tl/parse.js | 12 ++++++------ app/js/tl/speech.js | 4 ++-- app/js/tl/tag.js | 6 +++--- app/js/tl/tl.js | 2 +- app/js/ui/img.js | 2 +- app/js/ui/settings.js | 16 ++++++++-------- app/js/ui/sort.js | 2 +- app/js/ui/spotify.js | 10 +++++----- app/js/userdata/showOnTL.js | 4 ++-- 20 files changed, 61 insertions(+), 55 deletions(-) diff --git a/app/css/master.css b/app/css/master.css index e88a82ef..38b5c168 100644 --- a/app/css/master.css +++ b/app/css/master.css @@ -12,7 +12,10 @@ html { font-size: 13px; } .waves-effect:hover { - filter: brightness(120%); + filter: brightness(80%); +} +.waves-effect:focus { + filter: brightness(70%); } .titlebar, .menubar-menu-container, diff --git a/app/js/common/version.js b/app/js/common/version.js index e2e7fdb6..b2c15054 100644 --- a/app/js/common/version.js +++ b/app/js/common/version.js @@ -204,7 +204,7 @@ function verck(ver, jp) { } } if (showVer) { - M.toast({ + Mtoast({ html: escapeHTML(obj.text) + toot + @@ -265,7 +265,7 @@ function infowebsocket() { if (showVer) { console.log(obj.text) console.log(escapeHTML(obj.text)) - M.toast({ + Mtoast({ html: escapeHTML(obj.text) + toot + diff --git a/app/js/login/login.js b/app/js/login/login.js index 3c210063..273c2467 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -197,7 +197,7 @@ function getdata() { .then(function(json) { if (json.error) { console.error('Error:' + json.error) - M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) + Mtoast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) return } var avatar = json['avatar'] @@ -255,7 +255,7 @@ function getdataAdv(domain, at) { .then(function(json) { if (json.error) { console.error('Error:' + json.error) - M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) + Mtoast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) return } var avatar = json['avatar'] @@ -321,7 +321,7 @@ function refresh(target, loadskip) { .then(function(json) { if (json.error) { console.error('Error:' + json.error) - M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) + Mtoast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) return } var avatar = json['avatar'] diff --git a/app/js/login/manager.js b/app/js/login/manager.js index 139677cc..626c02bf 100644 --- a/app/js/login/manager.js +++ b/app/js/login/manager.js @@ -640,7 +640,7 @@ function code(code) { $('#code').val('') } if (!code || code == '') { - M.toast({ html: lang.lang_fatalerroroccured + 'Error: no code', displayLength: 5000 }) + Mtoast({ html: lang.lang_fatalerroroccured + 'Error: no code', displayLength: 5000 }) return false } var url = localStorage.getItem('domain_tmp') @@ -757,7 +757,7 @@ function getdata(domain, at) { .then(function(json) { if (json.error) { console.error('Error:' + json.error) - M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) + Mtoast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) return } var avatar = json['avatar'] @@ -830,7 +830,7 @@ function atSetup(type) { } } if (!i || i == '') { - M.toast({ html: lang.lang_fatalerroroccured + 'Error: access token', displayLength: 5000 }) + Mtoast({ html: lang.lang_fatalerroroccured + 'Error: access token', displayLength: 5000 }) return false } var obj = JSON.parse(multi) @@ -883,7 +883,7 @@ function refresh(target) { .then(function(json) { if (json.error) { console.error('Error:' + json.error) - M.toast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) + Mtoast({ html: lang.lang_fatalerroroccured + 'Error:' + json.error, displayLength: 5000 }) return } var avatar = json['avatar'] @@ -1012,7 +1012,7 @@ function multisel() { function mainacct() { var acct_id = $('#main-acct-sel').val() localStorage.setItem('main', acct_id) - M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 }) + Mtoast({ html: lang.lang_manager_mainAcct, displayLength: 3000 }) } function colorpicker(key) { temp = `
${lang.lang_manager_none}
diff --git a/app/js/platform/end.js b/app/js/platform/end.js index 1d759ae7..240bdb22 100644 --- a/app/js/platform/end.js +++ b/app/js/platform/end.js @@ -153,7 +153,7 @@ onmessage = function(e) { var showTxt = `${lang.lang_img_DLDone}${ e.data[1][0] }` - M.toast({ html: showTxt, displayLength: 5000 }) + Mtoast({ html: showTxt, displayLength: 5000 }) } else if (e.data[0] == 'parseColumn') { parseColumn(e.data[1]) } else if (e.data[0] == 'exportSettingsCore') { diff --git a/app/js/platform/first.js b/app/js/platform/first.js index d8b892b5..a1db96ea 100644 --- a/app/js/platform/first.js +++ b/app/js/platform/first.js @@ -225,6 +225,9 @@ function evalAttr(json, attr, lenCk) { return false } } +function Mtoast(obj) { + return true +} function statusModel(now) { if (!now) { var now = new Date().toString() diff --git a/app/js/post/bb-md.js b/app/js/post/bb-md.js index 562b0049..39bab776 100644 --- a/app/js/post/bb-md.js +++ b/app/js/post/bb-md.js @@ -45,7 +45,7 @@ function mdCheck() { $('#trendtag').html('') } if (localStorage.getItem('mode_' + domain) == 'misskey') { - M.toast({ html: lang.lang_bbmd_misskey, displayLength: 5000 }) + Mtoast({ html: lang.lang_bbmd_misskey, displayLength: 5000 }) } if (idata[domain + '_letters']) { $('#textarea').attr('data-length', idata[domain + '_letters']) diff --git a/app/js/post/img.js b/app/js/post/img.js index e46ca9f6..d1b1eea3 100644 --- a/app/js/post/img.js +++ b/app/js/post/img.js @@ -156,7 +156,7 @@ async function media(b64, type, no, stamped) { $('.toot-btn-group').prop('disabled', false) //$('select').formSelect() $('#mec').text(lang.lang_there) - M.toast({ html: '' + lang.lang_postimg_sync + '', displayLength: 3000 }) + Mtoast({ html: '' + lang.lang_postimg_sync + '', displayLength: 3000 }) $('#imgup').text('') $('#imgsel').show() localStorage.removeItem('image') @@ -178,7 +178,7 @@ async function media(b64, type, no, stamped) { $('.toot-btn-group').prop('disabled', false) //$('select').formSelect() $('#mec').text(lang.lang_there) - M.toast({ html: this.status + ':' +json, displayLength: 2000 }) + Mtoast({ html: this.status + ':' +json, displayLength: 2000 }) $('#imgup').text('') $('#imgsel').show() } @@ -189,7 +189,7 @@ async function media(b64, type, no, stamped) { $('#post-acct-sel').prop('disabled', false) //$('select').formSelect() $('#imgsel').show() - M.toast({ html: lang.lang_postimg_failupload, displayLength: 5000 }) + Mtoast({ html: lang.lang_postimg_failupload, displayLength: 5000 }) return false } $('#imgup').text('') diff --git a/app/js/post/status.js b/app/js/post/status.js index a486aeee..ceec35ce 100644 --- a/app/js/post/status.js +++ b/app/js/post/status.js @@ -49,7 +49,7 @@ function fav(id, acct_id, remote) { $('.fav_' + id).addClass('yellow-text') } } else { - M.toast({ html: lang.lang_status_favWarn, displayLength: 1000 }) + Mtoast({ html: lang.lang_status_favWarn, displayLength: 1000 }) } } } @@ -240,7 +240,7 @@ async function acctResolve(acct_id, user) { if (idJson.accounts[0]) { var id = idJson.accounts[0].id } else { - M.toast({ html: lang.lang_fatalerroroccured, displayLength: 2000 }) + Mtoast({ html: lang.lang_fatalerroroccured, displayLength: 2000 }) } return id } @@ -580,7 +580,7 @@ function empUser() { if (!obj) { var obj = [] obj.push(id) - M.toast({ html: id + lang.lang_status_emphas, displayLength: 4000 }) + Mtoast({ html: id + lang.lang_status_emphas, displayLength: 4000 }) } else { var can Object.keys(obj).forEach(function(key) { @@ -590,7 +590,7 @@ function empUser() { } else { can = true obj.splice(key, 1) - M.toast({ html: id + lang.lang_status_unemphas, displayLength: 4000 }) + Mtoast({ html: id + lang.lang_status_unemphas, displayLength: 4000 }) } }) } @@ -634,7 +634,7 @@ function pinUser() { //URLコピー function tootUriCopy(url) { execCopy(url) - M.toast({ html: lang.lang_details_url, displayLength: 1500 }) + Mtoast({ html: lang.lang_details_url, displayLength: 1500 }) } //他のアカウントで… diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js index de76a427..8ce0b929 100644 --- a/app/js/tl/datails.js +++ b/app/js/tl/datails.js @@ -555,10 +555,10 @@ function cbCopy(mode) { ` ` execCopy(emb) - M.toast({ html: lang.lang_details_embed, displayLength: 1500 }) + Mtoast({ html: lang.lang_details_embed, displayLength: 1500 }) } else { if (execCopy(url)) { - M.toast({ html: lang.lang_details_url, displayLength: 1500 }) + Mtoast({ html: lang.lang_details_url, displayLength: 1500 }) } } } @@ -573,7 +573,7 @@ function staCopy(id) { html = html.replace(//g, '$1') html = $.strip_tags(html) if (execCopy(html)) { - M.toast({ html: lang.lang_details_txt, displayLength: 1500 }) + Mtoast({ html: lang.lang_details_txt, displayLength: 1500 }) } } //翻訳 diff --git a/app/js/tl/misskeyparse.js b/app/js/tl/misskeyparse.js index 32e95077..7f6c61b1 100644 --- a/app/js/tl/misskeyparse.js +++ b/app/js/tl/misskeyparse.js @@ -260,7 +260,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { } var domain = localStorage.getItem("domain_" + acct_id); if (popup > 0) { - M.toast({ html: "[" + domain + "]" + escapeHTMLtemp(toot.user.name) + what, displayLength: popup * 1000 }) + Mtoast({ html: "[" + domain + "]" + escapeHTMLtemp(toot.user.name) + what, displayLength: popup * 1000 }) } if (native == "yes") { var os = localStorage.getItem("platform"); @@ -888,7 +888,7 @@ function misskeyUserparse(obj, auth, acct_id, tlid, popup) { } var memory = localStorage.getItem("notice-mem"); if (popup >= 0 && obj.length < 5 && notftext != memory) { - M.toast({ html: escapeHTMLtemp(toot.name) + ":" + ftxt, displayLength: popup * 1000 }) + Mtoast({ html: escapeHTMLtemp(toot.name) + ":" + ftxt, displayLength: popup * 1000 }) $(".notf-icon_" + tlid).addClass("red-text"); localStorage.setItem("notice-mem", notftext); notftext = ""; diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 1a1a0b1d..dbf0edd9 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -315,7 +315,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } } if (popup > 0) { - M.toast({ + Mtoast({ html: '[' + domain + ']' + escapeHTML(toot.account.display_name) + what, displayLength: popup * 1000 }) @@ -1226,7 +1226,7 @@ function userparse(obj, auth, acct_id, tlid, popup) { } var memory = localStorage.getItem('notice-mem') if (popup >= 0 && obj.length < 5 && notftext != memory) { - M.toast({ html: escapeHTML(toot.display_name) + ':' + ftxt, displayLength: popup * 1000 }) + Mtoast({ html: escapeHTML(toot.display_name) + ':' + ftxt, displayLength: popup * 1000 }) $('.notf-icon_' + tlid).addClass('red-text') localStorage.setItem('notice-mem', notftext) notftext = '' @@ -1366,7 +1366,7 @@ function client(name) { if (!obj) { var obj = [] obj.push(name) - M.toast({ html: escapeHTML(name) + lang.lang_status_emphas, displayLength: 2000 }) + Mtoast({ html: escapeHTML(name) + lang.lang_status_emphas, displayLength: 2000 }) } else { var can Object.keys(obj).forEach(function(key) { @@ -1376,12 +1376,12 @@ function client(name) { } else { can = true obj.splice(key, 1) - M.toast({ html: escapeHTML(name) + lang.lang_status_unemphas, displayLength: 2000 }) + Mtoast({ html: escapeHTML(name) + lang.lang_status_unemphas, displayLength: 2000 }) } }) if (!can) { obj.push(name) - M.toast({ html: escapeHTML(name) + lang.lang_status_emphas, displayLength: 2000 }) + Mtoast({ html: escapeHTML(name) + lang.lang_status_emphas, displayLength: 2000 }) } else { } var json = JSON.stringify(obj) @@ -1398,7 +1398,7 @@ function client(name) { obj.push(name) var json = JSON.stringify(obj) localStorage.setItem('client_mute', json) - M.toast({ html: escapeHTML(name) + lang.lang_parse_mute, displayLength: 2000 }) + Mtoast({ html: escapeHTML(name) + lang.lang_parse_mute, displayLength: 2000 }) parseColumn() } }) diff --git a/app/js/tl/speech.js b/app/js/tl/speech.js index dccb8a41..ee77248e 100644 --- a/app/js/tl/speech.js +++ b/app/js/tl/speech.js @@ -143,14 +143,14 @@ function voiceSettings() { var awk = $('[name=bym]:checked').val() if (awk == 'yes') { localStorage.setItem('voice_bouyomi', 'yes') - M.toast({ html: 'Bouyomi Chan connection requires WebSocket Plugin', displayLength: 3000 }) + Mtoast({ html: 'Bouyomi Chan connection requires WebSocket Plugin', displayLength: 3000 }) } else { localStorage.removeItem('voice_bouyomi') } localStorage.setItem('voice_speed', $('#voicespeed').val() / 10) localStorage.setItem('voice_pitch', $('#voicepitch').val() / 50) localStorage.setItem('voice_vol', $('#voicevol').val() / 100) - M.toast({ html: lang.lang_speech_refresh, displayLength: 3000 }) + Mtoast({ html: lang.lang_speech_refresh, displayLength: 3000 }) } function voiceSettingLoad() { var flag = localStorage.getItem('voice_bouyomi') diff --git a/app/js/tl/tag.js b/app/js/tl/tag.js index c13b1d92..06d849eb 100644 --- a/app/js/tl/tag.js +++ b/app/js/tl/tag.js @@ -156,10 +156,10 @@ function autoToot(tag) { var nowPT = localStorage.getItem('stable') if (nowPT == tag) { localStorage.removeItem('stable') - M.toast({ html: lang.lang_tags_unrealtime, displayLength: 3000 }) + Mtoast({ html: lang.lang_tags_unrealtime, displayLength: 3000 }) } else { localStorage.setItem('stable', tag) - M.toast({ + Mtoast({ html: lang.lang_tags_tagwarn.replace('{{tag}}', tag).replace('{{tag}}', tag), displayLength: 3000 }) @@ -195,7 +195,7 @@ function tagFeature(name, acct_id) { }) .then(function(json) { console.log(json) - M.toast({ html: 'Complete: ' + escapeHTML(name), displayLength: 3000 }) + Mtoast({ html: 'Complete: ' + escapeHTML(name), displayLength: 3000 }) }) } //タグのフィルタ diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index f70ecc60..3a0703e5 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -1000,7 +1000,7 @@ function reconnector(tlid, type, acct_id, data, mode) { var mute = getFilterTypeByAcct(acct_id, type) reload(type, '', acct_id, tlid, data, mute, '', voice, mode) } - M.toast({ html: lang.lang_tl_reconnect, displayLength: 2000 }) + Mtoast({ html: lang.lang_tl_reconnect, displayLength: 2000 }) } function columnReload(tlid, type) { $('#notice_icon_' + tlid).addClass('red-text') diff --git a/app/js/ui/img.js b/app/js/ui/img.js index 65325eda..a8c42cf2 100644 --- a/app/js/ui/img.js +++ b/app/js/ui/img.js @@ -291,5 +291,5 @@ function stopVideo() { function copyImgUrl() { var murl = $('#imagemodal').attr('data-original') execCopy(murl) - M.toast({ html: lang.lang_img_copyDone, displayLength: 1500 }) + Mtoast({ html: lang.lang_img_copyDone, displayLength: 1500 }) } diff --git a/app/js/ui/settings.js b/app/js/ui/settings.js index 0e379c71..37c3b7e9 100644 --- a/app/js/ui/settings.js +++ b/app/js/ui/settings.js @@ -5,7 +5,7 @@ var envView = new Vue({ methods: { complete: function (i, val) { var ls = envView.config[i].storage - M.toast({ html: 'Complete', displayLength: 3000 }) + Mtoast({ html: 'Complete', displayLength: 3000 }) if (!val) { var id = envView.config[i].id var val = $('#' + id).val() @@ -39,7 +39,7 @@ var tlView = new Vue({ ls = ls.data } for (var j = 0; j < ls.length; j++) { - M.toast({ html: 'Complete', displayLength: 3000 }) + Mtoast({ html: 'Complete', displayLength: 3000 }) var id = ls[j].id var val = $('#' + id).val() localStorage.setItem(ls[j].storage, val) @@ -68,7 +68,7 @@ var postView = new Vue({ ls = ls.data } for (var j = 0; j < ls.length; j++) { - M.toast({ html: 'Complete', displayLength: 3000 }) + Mtoast({ html: 'Complete', displayLength: 3000 }) var id = ls[j].id var val = $('#' + id).val() localStorage.setItem(ls[j].storage, val) @@ -90,7 +90,7 @@ function settings() { $('#' + theme).prop('checked', true) } else { if (cd != localStorage.getItem('theme')) { - M.toast({ html: lang.lang_setting_theme.replace('{{set}}', ct), displayLength: 3000 }) + Mtoast({ html: lang.lang_setting_theme.replace('{{set}}', ct), displayLength: 3000 }) } //テーマはこの場で設定 themes(cd) @@ -99,14 +99,14 @@ function settings() { var fontd = $('#font').val() if (fontd) { if (fontd != localStorage.getItem('font')) { - M.toast({ html: lang.lang_setting_font.replace('{{set}}', fontd), displayLength: 3000 }) + Mtoast({ html: lang.lang_setting_font.replace('{{set}}', fontd), displayLength: 3000 }) } localStorage.setItem('font', fontd) themes() } else { if (localStorage.getItem('font')) { localStorage.removeItem('font') - M.toast({ html: lang.lang_setting_font.replace('{{set}}', '"default"'), displayLength: 3000 }) + Mtoast({ html: lang.lang_setting_font.replace('{{set}}', '"default"'), displayLength: 3000 }) themes() } } @@ -286,7 +286,7 @@ function notftest() { function oks(no) { var txt = $('#oks-' + no).val() localStorage.setItem('oks-' + no, txt) - M.toast({ html: lang.lang_setting_ksref, displayLength: 3000 }) + Mtoast({ html: lang.lang_setting_ksref, displayLength: 3000 }) } function oksload() { if (localStorage.getItem('oks-1')) { @@ -830,5 +830,5 @@ function lastFmSet() { } else { localStorage.removeItem('lastFmUser') } - M.toast({ html: 'Complete: last.fm', displayLength: 3000 }) + Mtoast({ html: 'Complete: last.fm', displayLength: 3000 }) } diff --git a/app/js/ui/sort.js b/app/js/ui/sort.js index 428dece6..14b9030a 100644 --- a/app/js/ui/sort.js +++ b/app/js/ui/sort.js @@ -104,7 +104,7 @@ function sort() { var json = JSON.stringify(newobj); localStorage.setItem("column", json); $("#sort").html(""); - M.toast({ html: "Sorted", displayLength: 3000 }) + Mtoast({ html: "Sorted", displayLength: 3000 }) sortLoad(); parseColumn(); sortMenu() diff --git a/app/js/ui/spotify.js b/app/js/ui/spotify.js index 0d140dea..fa1fa2f1 100644 --- a/app/js/ui/spotify.js +++ b/app/js/ui/spotify.js @@ -53,20 +53,20 @@ function spotifyFlagSave() { var awk = $('[name=awk]:checked').val() if (awk == 'yes') { localStorage.setItem('artwork', 'yes') - M.toast({ html: lang.lang_spotify_img, displayLength: 3000 }) + Mtoast({ html: lang.lang_spotify_img, displayLength: 3000 }) } else { localStorage.removeItem('artwork') - M.toast({ html: lang.lang_spotify_imgno, displayLength: 3000 }) + Mtoast({ html: lang.lang_spotify_imgno, displayLength: 3000 }) } } function aMusicFlagSave() { var awk = $('[name=amw]:checked').val() if (awk == 'yes') { localStorage.setItem('complete-artwork', 'yes') - M.toast({ html: lang.lang_spotify_img, displayLength: 3000 }) + Mtoast({ html: lang.lang_spotify_img, displayLength: 3000 }) } else { localStorage.removeItem('complete-artwork') - M.toast({ html: lang.lang_spotify_imgno, displayLength: 3000 }) + Mtoast({ html: lang.lang_spotify_imgno, displayLength: 3000 }) } } function nowplaying(mode) { @@ -267,7 +267,7 @@ async function npCore(arg) { function spotifySave() { var temp = $('#np-temp').val() localStorage.setItem('np-temp', temp) - M.toast({ html: lang.lang_spotify_np, displayLength: 3000 }) + Mtoast({ html: lang.lang_spotify_np, displayLength: 3000 }) } if (location.search) { var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/) diff --git a/app/js/userdata/showOnTL.js b/app/js/userdata/showOnTL.js index 21d412a6..ffee5d9b 100644 --- a/app/js/userdata/showOnTL.js +++ b/app/js/userdata/showOnTL.js @@ -99,7 +99,7 @@ function udg(user, acct_id) { } //moved設定時 if (json.moved) { - M.toast({ + Mtoast({ html: lang.lang_showontl_movetxt + '", displayLength: 4000 }); @@ -483,7 +483,7 @@ function setMain() { var acct_id = $("#his-data").attr("use-acct"); localStorage.setItem("main", acct_id); multiSelector(true); - M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 }); + Mtoast({ html: lang.lang_manager_mainAcct, displayLength: 3000 }); } //オールリセット function hisclose() {