Skip to content
This repository was archived by the owner on May 13, 2018. It is now read-only.

Commit fa3a1ea

Browse files
committed
更新ボタン追加。
1 parent 8c05f35 commit fa3a1ea

7 files changed

Lines changed: 81 additions & 50 deletions

File tree

DBConstuction.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Root
4545

4646
> 1
4747
> ...
48-
48+
49+
> password: HashString
4950
> 2
5051
> ...

Dialog.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ window.addEventListener("DOMContentLoaded", () => {
2020

2121

2222
DOM("#Dialogs_Profile_DeleteConfirmer_Btns_Yes").addEventListener("click", () => {
23-
if (DOM("#Dialogs_Profile_ConfirmDelete_Content_Email_Input").value == base.user.email) {
23+
if (DOM("#Dialogs_Profile_DeleteConfirmer_Content_Email_Input").value == base.user.email) {
2424
base.delete();
2525
} else {
26-
DOM("#Dialogs_Profile_ConfirmDelete_Content_Email").classList.add("is-invalid");
26+
DOM("#Dialogs_Profile_DeleteConfirmer_Content_Email").classList.add("is-invalid");
2727
}
2828
});
2929

@@ -90,7 +90,9 @@ window.addEventListener("DOMContentLoaded", () => {
9090
plusCount: 0,
9191
createdAt: now
9292
}
93-
]
93+
],
94+
95+
password: ""
9496
});
9597

9698
DOM("#Dialogs_Thread_InfoInputer").close();

Main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ window.addEventListener("DOMContentLoaded", () => {
7474

7575

7676

77+
DOM("$IFrame#Page").addEventListener("load", () => {
78+
!DOM("#Drawer") || DOM("#Drawer").classList.remove("is-visible"),
79+
!DOM("$Div.mdl-layout__obfuscator") || DOM("$Div.mdl-layout__obfuscator").classList.remove("is-visible");
80+
81+
DOM("#Screens_Loading").setAttribute("Disabled", "");
82+
});
83+
7784
DOM("#Header_SignInOut").addEventListener("click", () => {
7885
switch (DOM("#Header_SignInOut").textContent) {
7986
case "Sign In":
@@ -89,8 +96,4 @@ window.addEventListener("DOMContentLoaded", () => {
8996
break;
9097
}
9198
});
92-
93-
DOM("$IFrame#Page").addEventListener("load", () => {
94-
DOM("#Screens_Loading").setAttribute("Disabled", "");
95-
});
9699
});

Thread/Thread.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@
1313

1414
#Thread A[Disabled] {
1515
Display: None;
16+
}
17+
18+
#Thread_Tab_Reload {
19+
Display: Inline-Flex;
20+
Align-Items: Center;
1621
}

Thread/Thread.js

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,53 @@
1+
class Util {
2+
static refreshThreadList () {
3+
base.Database.get(base.Database.ONCE, "threads", (res) => {
4+
res = res.filter((thread, index, parent) => {
5+
if (thread !== "!SYSTEM") {
6+
thread.tid = index;
7+
return true;
8+
}
9+
});
10+
11+
for (let i = 0; i < res.length; i++) {
12+
let thread = DOM("A", {
13+
classes: ["mdl-list__item"],
14+
15+
attributes: {
16+
Href: "Viewer/?tid=" + res[i].tid
17+
},
18+
19+
children: [
20+
DOM("Span", {
21+
classes: ["mdl-list__item-primary-content"],
22+
23+
children: [
24+
DOM("I", {
25+
classes: ["mdl-list__item-avatar", "material-icons"],
26+
text: "person"
27+
}),
28+
29+
DOM("Span", {
30+
text: res[i].title
31+
})
32+
]
33+
})
34+
]
35+
});
36+
37+
DOM("#Thread_Search").appendChild(thread);
38+
if (base.user) if (res[i].jobs.Owner.hasOwnProperty(base.user.uid)) DOM("#Thread_Admin").appendChild(thread);
39+
}
40+
});
41+
}
42+
}
43+
144
window.addEventListener("DOMContentLoaded", () => {
245
if (!base.user) {
346
DOM("$#Thread_Tab_Admin").setAttribute("Disabled", ""),
447
DOM("$#Thread_Admin").setAttribute("Disabled", "");
548
}
649

7-
base.Database.get(base.Database.ONCE, "threads", (res) => {
8-
res = res.filter((thread, index, parent) => {
9-
if (thread !== "!SYSTEM") {
10-
thread.tid = index;
11-
return true;
12-
}
13-
});
14-
15-
for (let i = 0; i < res.length; i++) {
16-
let thread = DOM("A", {
17-
classes: ["mdl-list__item"],
18-
19-
attributes: {
20-
Href: "Viewer/?tid=" + res[i].tid
21-
},
22-
23-
children: [
24-
DOM("Span", {
25-
classes: ["mdl-list__item-primary-content"],
26-
27-
children: [
28-
DOM("I", {
29-
classes: ["mdl-list__item-avatar", "material-icons"],
30-
text: "person"
31-
}),
32-
33-
DOM("Span", {
34-
text: res[i].title
35-
})
36-
]
37-
})
38-
]
39-
});
40-
41-
DOM("#Thread_Search").appendChild(thread);
42-
if (base.user) if (res[i].jobs.Owner.hasOwnProperty(base.user.uid)) DOM("#Thread_Admin").appendChild(thread);
43-
}
44-
});
50+
Util.refreshThreadList();
4551

4652

4753

@@ -69,6 +75,13 @@ window.addEventListener("DOMContentLoaded", () => {
6975
});
7076
});
7177

78+
DOM("#Thread_Tab_Reload").addEventListener("click", (event) => {
79+
while (DOM("#Thread_Search").children.length > 1) DOM("#Thread_Search").children[1].remove();
80+
while (DOM("#Thread_Admin").children.length > 1) DOM("#Thread_Admin").children[1].remove();
81+
82+
Util.refreshThreadList();
83+
});
84+
7285

7386

7487
let doc = parent.document;

Thread/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
<Div ID = "Thread_Tab" Class = "mdl-tabs__tab-bar">
4040
<A ID = "Thread_Tab_Search" Class = "mdl-tabs__tab is-active" Href = "#Thread_Search">スレッド検索</A>
4141
<A ID = "Thread_Tab_Admin" Class = "mdl-tabs__tab" Href = "#Thread_Admin">管理中のスレッド</A>
42+
43+
<A ID = "Thread_Tab_Reload" Class = "mdl-tabs__tab">
44+
<I Class = "material-icons">refresh</I>
45+
</A>
46+
47+
<Div Class = "mdl-tooltip" For = "Thread_Tab_Reload">Refresh thread list</Div>
4248
</Div>
4349

4450

index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@
126126
処理を続行するにはメールアドレスを入力してください。
127127

128128
<Div ID = "Dialogs_Profile_DeleteConfirmer_Content_Email" Class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
129-
<Input ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input" Class = "mdl-textfield__input" Type = "Email" Value = "" />
129+
<Input ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input" Class = "mdl-textfield__input" Type = "Email" Value = "" Required = "Required" />
130130
<Label ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Label" Class = "mdl-textfield__label" For = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input">メールアドレス...</Label>
131+
131132
<Span Class = "mdl-textfield__error">無効なメールアドレスです</Span>
132133
</Div>
133134
</Div>
@@ -175,18 +176,18 @@
175176
<Dialog ID = "Dialogs_Thread_InfoInputer" Class = "mdl-dialog">
176177
<Div ID = "Dialogs_Thread_InfoInputer_Content" Class = "mdl-dialog__content">
177178
<Div ID = "Dialogs_Thread_InfoInputer_Content_Name" Class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
178-
<Input ID = "Dialogs_Thread_InfoInputer_Content_Name_Input" Class = "mdl-textfield__input" Type = "Text" Value = "" />
179+
<Input ID = "Dialogs_Thread_InfoInputer_Content_Name_Input" Class = "mdl-textfield__input" Type = "Text" Value = "" Required = "Required" />
179180
<Label ID = "Dialogs_Thread_InfoInputer_Content_Name_Label" Class = "mdl-textfield__label" For = "Dialogs_Thread_InfoInputer_Content_Name_Input">スレッド名...</Label>
180181
</Div>
181182

182183
<Div ID = "Dialogs_Thread_InfoInputer_Content_Overview" Class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
183-
<Input ID = "Dialogs_Thread_InfoInputer_Content_Overview_Input" Class = "mdl-textfield__input" Type = "Text" Value = "" />
184+
<Input ID = "Dialogs_Thread_InfoInputer_Content_Overview_Input" Class = "mdl-textfield__input" Type = "Text" Value = "" Required = "Required" />
184185
<Label ID = "Dialogs_Thread_InfoInputer_Content_Overview_Label" Class = "mdl-textfield__label" For = "Dialogs_Thread_InfoInputer_Content_Overview_Input">概要...</Label>
185186
</Div>
186187

187188
<Div ID = "Dialogs_Thread_InfoInputer_Content_Detail" Class = "mdl-textfield mdl-js-textfield">
188189
<Textarea ID = "Dialogs_Thread_InfoInputer_Content_Detail_Input" Class = "mdl-textfield__input" Rows = "10" MaxLength = "500"></Textarea>
189-
<Label Class = "mdl-textfield__label" For = "Dialogs_Thread_InfoInputer_Content_Detail_Input">詳細...</Label>
190+
<Label Class = "mdl-textfield__label" For = "Dialogs_Thread_InfoInputer_Content_Detail_Input">詳細...(任意)</Label>
190191
</Div>
191192
</Div>
192193

0 commit comments

Comments
 (0)