From 9d2eb6f18bf15f8218f94816420173ee49285b16 Mon Sep 17 00:00:00 2001 From: Cutls Date: Fri, 21 Jun 2019 23:17:56 +0900 Subject: [PATCH] Fix: moreLoading --- app/js/post/status.js | 2 +- app/js/tl/misskeyparse.js | 68 ++++++++++++++++---------------- app/js/tl/parse.js | 70 +++++++++++++++++---------------- app/js/tl/tl.js | 5 +++ app/view/en/index.html | 4 +- app/view/ja/index.html | 4 +- app/view/make/index.sample.html | 2 +- app/view/ps/index.html | 4 +- 8 files changed, 84 insertions(+), 75 deletions(-) diff --git a/app/js/post/status.js b/app/js/post/status.js index d98ecd11..f5fc97eb 100644 --- a/app/js/post/status.js +++ b/app/js/post/status.js @@ -183,7 +183,7 @@ function block(acct_id) { } //ミュート -function mute(acct_id) { +function muteDo(acct_id) { if (!acct_id) { var acct_id = $('#his-data').attr("use-acct"); } diff --git a/app/js/tl/misskeyparse.js b/app/js/tl/misskeyparse.js index bbc0a937..1c83e7fa 100644 --- a/app/js/tl/misskeyparse.js +++ b/app/js/tl/misskeyparse.js @@ -50,14 +50,14 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { native = "yes"; } //クライアント強調 - var emp = localStorage.getItem("client_emp"); - if (emp) { - var emp = JSON.parse(emp); + var empCli = localStorage.getItem("client_emp"); + if (empCli) { + var empCli = JSON.parse(empCli); } //クライアントミュート - var mute = localStorage.getItem("client_mute"); - if (mute) { - var mute = JSON.parse(mute); + var muteCli = localStorage.getItem("client_mute"); + if (muteCli) { + var muteCli = JSON.parse(muteCli); } //ユーザー強調 var useremp = localStorage.getItem("user_emp"); @@ -65,17 +65,19 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { var useremp = JSON.parse(useremp); } //ワード強調 - var wordemp = localStorage.getItem("word_emp"); - if (wordemp) { - var wordemp = JSON.parse(wordemp); + var wordempList = localStorage.getItem("word_emp"); + if (wordempList) { + var wordempList = JSON.parse(wordempList); } //ワードミュート - var wordmute = localStorage.getItem("word_mute"); - if (wordmute) { - var wordmute = JSON.parse(wordmute); - wordmute = wordmute.concat(mutefilter); + var wordmuteList = localStorage.getItem("word_mute"); + if (wordmuteList) { + var wordmuteList = JSON.parse(wordmuteList); + if (wordmuteList) { + wordmuteList = wordmuteList.concat(mutefilter); + } } else { - wordmute = mutefilter; + wordmuteList = mutefilter; } //Ticker var tickerck = localStorage.getItem("ticker_ok"); @@ -349,16 +351,16 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { viashow = "via-hide"; } //強調チェック - Object.keys(emp).forEach(function (key6) { - var cli = emp[key6]; - if (cli == via) { + Object.keys(empCli).forEach(function (key6) { + var empCliList = empCli[key6]; + if (empCliList == via) { boostback = "emphasized"; } }); //ミュートチェック - Object.keys(mute).forEach(function (key7) { - var cli = mute[key7]; - if (cli == via) { + Object.keys(muteCli).forEach(function (key7) { + var muteCliList = muteCli[key7]; + if (muteCliList == via) { boostback = "hide"; } }); @@ -581,16 +583,16 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { //アバター var avatar = toot.user.avatarUrl; //ワードミュート - if (wordmute) { - Object.keys(wordmute).forEach(function (key8) { - var worde = wordmute[key8]; + if (wordmuteList) { + Object.keys(wordmuteList).forEach(function (key8) { + var worde = wordmuteList[key8]; if (worde) { if (worde.tag) { - var word = worde.tag; + var wordList = worde.tag; } else { - var word = worde + var wordList = worde } - var regExp = new RegExp(word.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); + var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); if ($.strip_tagstemp(content).match(regExp)) { boostback = "hide by_filter"; } @@ -598,13 +600,13 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { }); } //ワード強調 - if (wordemp) { - Object.keys(wordemp).forEach(function (key9) { - var word = wordemp[key9]; - if (word) { - var word = word.tag; - var regExp = new RegExp(word.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); - content = content.replace(regExp, '' + word + ""); + if (wordempList) { + Object.keys(wordempList).forEach(function (key9) { + var wordList = wordempList[key9]; + if (wordList) { + var wordList = wordList.tag; + var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); + content = content.replace(regExp, '' + wordList + ""); } }); } diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 77b2d709..76867886 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -52,14 +52,14 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { native = "yes"; } //クライアント強調 - var emp = localStorage.getItem("client_emp"); - if (emp) { - var emp = JSON.parse(emp); + var empCli = localStorage.getItem("client_emp"); + if (empCli) { + var empCli = JSON.parse(empCli); } //クライアントミュート - var mute = localStorage.getItem("client_mute"); - if (mute) { - var mute = JSON.parse(mute); + var muteCli = localStorage.getItem("client_mute"); + if (muteCli) { + var muteCli = JSON.parse(muteCli); } //ユーザー強調 var useremp = localStorage.getItem("user_emp"); @@ -67,17 +67,19 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var useremp = JSON.parse(useremp); } //ワード強調 - var wordemp = localStorage.getItem("word_emp"); - if (wordemp) { - var wordemp = JSON.parse(wordemp); + var wordempList = localStorage.getItem("word_emp"); + if (wordempList) { + var wordempList = JSON.parse(wordempList); } //ワードミュート - var wordmute = localStorage.getItem("word_mute"); - if (wordmute) { - var wordmute = JSON.parse(wordmute); - wordmute = wordmute.concat(mutefilter); + var wordmuteList = localStorage.getItem("word_mute"); + if (wordmuteList) { + var wordmuteList = JSON.parse(wordmuteList); + if (wordmuteList) { + wordmuteList = wordmuteList.concat(mutefilter); + } } else { - wordmute = mutefilter; + wordmuteList = mutefilter; } //Ticker var tickerck = localStorage.getItem("ticker_ok"); @@ -431,16 +433,16 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } else { var via = escapeHTML(toot.application.name); //強調チェック - Object.keys(emp).forEach(function (key6) { - var cli = emp[key6]; - if (cli == via) { + Object.keys(empCli).forEach(function (key6) { + var empCliList = empCli[key6]; + if (empCliList == via) { boostback = "emphasized"; } }); //ミュートチェック - Object.keys(mute).forEach(function (key7) { - var cli = mute[key7]; - if (cli == via) { + Object.keys(muteCli).forEach(function (key7) { + var muteCliList = muteCli[key7]; + if (muteCliList == via) { boostback = "hide"; } }); @@ -724,17 +726,17 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var avatar = toot.account.avatar_static; } //ワードミュート - if (wordmute) { - Object.keys(wordmute).forEach(function (key8) { - var worde = wordmute[key8]; + if (wordmuteList) { + Object.keys(wordmuteList).forEach(function (key8) { + var worde = wordmuteList[key8]; + console.log(worde) if (worde) { if (worde.tag) { - var word = worde.tag; + var wordList = worde.tag; } else { - var word = worde + var wordList = worde } - var regExp = new RegExp(word.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); - console.log(regExp) + var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); if ($.strip_tags(content).match(regExp)) { boostback = "hide by_filter"; } @@ -742,13 +744,13 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { }); } //ワード強調 - if (wordemp) { - Object.keys(wordemp).forEach(function (key9) { - var word = wordemp[key9]; - if (word) { - var word = word.tag; - var regExp = new RegExp(word.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); - content = content.replace(regExp, '' + word + ""); + if (wordempList) { + Object.keys(wordempList).forEach(function (key9) { + var wordList = wordempList[key9]; + if (wordList) { + var wordList = wordList.tag; + var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g"); + content = content.replace(regExp, '' + wordList + ""); } }); } diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index 323a1f75..bc82f9bc 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -425,6 +425,11 @@ function moreload(type, tlid) { todo(error); console.error(error); }).then(function (json) { + if (localStorage.getItem("filter_" + acct_id) != "undefined") { + var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type); + } else { + var mute = []; + } if (misskey) { var templete = misskeyParse(json, '', acct_id, tlid, "", mute); } else { diff --git a/app/view/en/index.html b/app/view/en/index.html index e528881a..3b757378 100644 --- a/app/view/en/index.html +++ b/app/view/en/index.html @@ -36,7 +36,7 @@