From fa3a1eabd5cbec00b2de20d1db55f2b6dc9ac70b Mon Sep 17 00:00:00 2001 From: Genbu Hase Date: Sun, 27 Aug 2017 17:50:58 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DBConstuction.txt | 3 +- Dialog.js | 8 +++-- Main.js | 11 +++--- Thread/Thread.css | 5 +++ Thread/Thread.js | 89 +++++++++++++++++++++++++++-------------------- Thread/index.html | 6 ++++ index.html | 9 ++--- 7 files changed, 81 insertions(+), 50 deletions(-) diff --git a/DBConstuction.txt b/DBConstuction.txt index fb12810..4d3de06 100644 --- a/DBConstuction.txt +++ b/DBConstuction.txt @@ -45,6 +45,7 @@ Root > 1 > ... - + + > password: HashString > 2 > ... \ No newline at end of file diff --git a/Dialog.js b/Dialog.js index 4393da1..aa4b2b0 100644 --- a/Dialog.js +++ b/Dialog.js @@ -20,10 +20,10 @@ window.addEventListener("DOMContentLoaded", () => { DOM("#Dialogs_Profile_DeleteConfirmer_Btns_Yes").addEventListener("click", () => { - if (DOM("#Dialogs_Profile_ConfirmDelete_Content_Email_Input").value == base.user.email) { + if (DOM("#Dialogs_Profile_DeleteConfirmer_Content_Email_Input").value == base.user.email) { base.delete(); } else { - DOM("#Dialogs_Profile_ConfirmDelete_Content_Email").classList.add("is-invalid"); + DOM("#Dialogs_Profile_DeleteConfirmer_Content_Email").classList.add("is-invalid"); } }); @@ -90,7 +90,9 @@ window.addEventListener("DOMContentLoaded", () => { plusCount: 0, createdAt: now } - ] + ], + + password: "" }); DOM("#Dialogs_Thread_InfoInputer").close(); diff --git a/Main.js b/Main.js index f9f9b91..fc4bf4a 100644 --- a/Main.js +++ b/Main.js @@ -74,6 +74,13 @@ window.addEventListener("DOMContentLoaded", () => { + DOM("$IFrame#Page").addEventListener("load", () => { + !DOM("#Drawer") || DOM("#Drawer").classList.remove("is-visible"), + !DOM("$Div.mdl-layout__obfuscator") || DOM("$Div.mdl-layout__obfuscator").classList.remove("is-visible"); + + DOM("#Screens_Loading").setAttribute("Disabled", ""); + }); + DOM("#Header_SignInOut").addEventListener("click", () => { switch (DOM("#Header_SignInOut").textContent) { case "Sign In": @@ -89,8 +96,4 @@ window.addEventListener("DOMContentLoaded", () => { break; } }); - - DOM("$IFrame#Page").addEventListener("load", () => { - DOM("#Screens_Loading").setAttribute("Disabled", ""); - }); }); \ No newline at end of file diff --git a/Thread/Thread.css b/Thread/Thread.css index 0648ef2..b4f7712 100644 --- a/Thread/Thread.css +++ b/Thread/Thread.css @@ -13,4 +13,9 @@ #Thread A[Disabled] { Display: None; +} + +#Thread_Tab_Reload { + Display: Inline-Flex; + Align-Items: Center; } \ No newline at end of file diff --git a/Thread/Thread.js b/Thread/Thread.js index d5b13e8..94cb8c9 100644 --- a/Thread/Thread.js +++ b/Thread/Thread.js @@ -1,47 +1,53 @@ +class Util { + static refreshThreadList () { + base.Database.get(base.Database.ONCE, "threads", (res) => { + res = res.filter((thread, index, parent) => { + if (thread !== "!SYSTEM") { + thread.tid = index; + return true; + } + }); + + for (let i = 0; i < res.length; i++) { + let thread = DOM("A", { + classes: ["mdl-list__item"], + + attributes: { + Href: "Viewer/?tid=" + res[i].tid + }, + + children: [ + DOM("Span", { + classes: ["mdl-list__item-primary-content"], + + children: [ + DOM("I", { + classes: ["mdl-list__item-avatar", "material-icons"], + text: "person" + }), + + DOM("Span", { + text: res[i].title + }) + ] + }) + ] + }); + + DOM("#Thread_Search").appendChild(thread); + if (base.user) if (res[i].jobs.Owner.hasOwnProperty(base.user.uid)) DOM("#Thread_Admin").appendChild(thread); + } + }); + } +} + window.addEventListener("DOMContentLoaded", () => { if (!base.user) { DOM("$#Thread_Tab_Admin").setAttribute("Disabled", ""), DOM("$#Thread_Admin").setAttribute("Disabled", ""); } - base.Database.get(base.Database.ONCE, "threads", (res) => { - res = res.filter((thread, index, parent) => { - if (thread !== "!SYSTEM") { - thread.tid = index; - return true; - } - }); - - for (let i = 0; i < res.length; i++) { - let thread = DOM("A", { - classes: ["mdl-list__item"], - - attributes: { - Href: "Viewer/?tid=" + res[i].tid - }, - - children: [ - DOM("Span", { - classes: ["mdl-list__item-primary-content"], - - children: [ - DOM("I", { - classes: ["mdl-list__item-avatar", "material-icons"], - text: "person" - }), - - DOM("Span", { - text: res[i].title - }) - ] - }) - ] - }); - - DOM("#Thread_Search").appendChild(thread); - if (base.user) if (res[i].jobs.Owner.hasOwnProperty(base.user.uid)) DOM("#Thread_Admin").appendChild(thread); - } - }); + Util.refreshThreadList(); @@ -69,6 +75,13 @@ window.addEventListener("DOMContentLoaded", () => { }); }); + DOM("#Thread_Tab_Reload").addEventListener("click", (event) => { + while (DOM("#Thread_Search").children.length > 1) DOM("#Thread_Search").children[1].remove(); + while (DOM("#Thread_Admin").children.length > 1) DOM("#Thread_Admin").children[1].remove(); + + Util.refreshThreadList(); + }); + let doc = parent.document; diff --git a/Thread/index.html b/Thread/index.html index c3e31ad..83d6c55 100644 --- a/Thread/index.html +++ b/Thread/index.html @@ -39,6 +39,12 @@
スレッド検索 管理中のスレッド + + + refresh + + +
Refresh thread list
diff --git a/index.html b/index.html index 732c019..81fff65 100644 --- a/index.html +++ b/index.html @@ -126,8 +126,9 @@ 処理を続行するにはメールアドレスを入力してください。
- + + 無効なメールアドレスです
@@ -175,18 +176,18 @@
- +
- +
- +