From 0e9bdef9ca5ea8305e4e76f866e9eb4e6791a9e6 Mon Sep 17 00:00:00 2001 From: Cutls Date: Sat, 6 Jul 2019 23:16:41 +0900 Subject: [PATCH] Add: set main account on showOnTL --- app/js/login/login.js | 8 +++++--- app/js/userdata/showOnTL.js | 13 +++++++++++++ app/view/en/index.html | 4 +++- app/view/ja/index.html | 4 +++- app/view/make/index.sample.html | 4 +++- app/view/make/language/index.en.json | 1 + app/view/make/language/index.ja.json | 1 + app/view/ps/index.html | 4 +++- 8 files changed, 32 insertions(+), 7 deletions(-) diff --git a/app/js/login/login.js b/app/js/login/login.js index 77b344c3..12d8f781 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -40,7 +40,7 @@ function ck() { if (obj[0].domain) { $("#tl").show(); ticker(); - multiSelector(); + multiSelector(false); verck(ver); $("#something-wrong img").attr("src", "../../img/thinkingdesk.png") } @@ -403,7 +403,7 @@ function ckdb(acct_id) { } //アカウントを選択…を実装 -function multiSelector() { +function multiSelector(parseC) { var multi = localStorage.getItem("multi"); if (!multi) { var obj = []; @@ -490,7 +490,9 @@ function multiSelector() { $("#add-acct-sel").append(''); } $('select').formSelect(); - parseColumn(true); + if(!parseC){ + parseColumn(true); + } } //バージョンエンコ diff --git a/app/js/userdata/showOnTL.js b/app/js/userdata/showOnTL.js index 64777b6b..b83feb2f 100644 --- a/app/js/userdata/showOnTL.js +++ b/app/js/userdata/showOnTL.js @@ -193,6 +193,9 @@ function udg(user, acct_id) { $("#his-emp-btn").hide(); $(".only-my-data").show(); $(".only-his-data").hide(); + if(localStorage.getItem("main")==acct_id){ + $("#his-main-acct").hide(); + } } else { relations(user, acct_id); $(".only-my-data").hide(); @@ -293,6 +296,9 @@ function misskeyUdg(user, acct_id) { $("#his-emp-btn").hide(); $(".only-my-data").show(); $(".only-his-data").hide(); + if(localStorage.getItem("main")==acct_id){ + $("#his-main-acct").hide(); + } } else { if (json.isFollowing) { //自分がフォローしている @@ -409,6 +415,12 @@ function profbrws() { var url = $("#his-openin").attr("data-href") postMessage(["openUrl", url], "*") } +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 }) +} //オールリセット function hisclose() { $('#his-data').modal('close'); @@ -464,6 +476,7 @@ function reset() { $("#his-openin").attr("data-href", ""); $("#his-float-timeline").show(); $("#his-float-blocked").hide(); + $("#his-main-acct").show(); $("#his-proof-prof").html("") } $('#my-data-nav .tab').on('click', function () { diff --git a/app/view/en/index.html b/app/view/en/index.html index f654269e..270eeb42 100644 --- a/app/view/en/index.html +++ b/app/view/en/index.html @@ -465,7 +465,9 @@ Feature on profile
Open in browser
+ onclick="profbrws()">Open in browser + Set it an main account

Get people resembling this user.
diff --git a/app/view/ja/index.html b/app/view/ja/index.html index 15e21438..ec4c64b3 100644 --- a/app/view/ja/index.html +++ b/app/view/ja/index.html @@ -465,7 +465,9 @@ 紹介する
ブラウザで開く
+ onclick="profbrws()">ブラウザで開く + メインアカウントに設定

似ているユーザーを取得できます。
diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html index 85ab5acc..8bc98699 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -465,7 +465,9 @@ @@endorse@@
@@openinbrowser@@
+ onclick="profbrws()">@@openinbrowser@@ + @@mainacct@@

@@likeUserDes@@
diff --git a/app/view/make/language/index.en.json b/app/view/make/language/index.en.json index cab2da6c..ae6f75fd 100644 --- a/app/view/make/language/index.en.json +++ b/app/view/make/language/index.en.json @@ -88,6 +88,7 @@ "likeHimOrHer":"Resembling", "endorse":"Feature on profile", "openinbrowser":"Open in browser", + "mainacct":"Set it an main account", "frc":"Suggest", "more":"More", "revoverJP":" to ", diff --git a/app/view/make/language/index.ja.json b/app/view/make/language/index.ja.json index efe81438..a81aa85d 100644 --- a/app/view/make/language/index.ja.json +++ b/app/view/make/language/index.ja.json @@ -89,6 +89,7 @@ "more":"もっと", "endorse":"紹介する", "openinbrowser":"ブラウザで開く", + "mainacct":"メインアカウントに設定", "revoverJP":"する", "warnUseOtherAcct":"(解除はできません。)", "revoverJPde":"で", diff --git a/app/view/ps/index.html b/app/view/ps/index.html index dfe3c8bd..e46bca2f 100644 --- a/app/view/ps/index.html +++ b/app/view/ps/index.html @@ -465,7 +465,9 @@ crwdns454:0crwdne454:0
crwdns455:0crwdne455:0
+ onclick="profbrws()">crwdns455:0crwdne455:0 + @@mainacct@@

crwdns469:0crwdne469:0