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

Commit e9bfd04

Browse files
committed
投稿処理まで完了。
1 parent 3cea305 commit e9bfd04

9 files changed

Lines changed: 108 additions & 20 deletions

File tree

Core.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
A:Not([Href]) {
2-
Cursor: Pointer;
1+
Body {
2+
Background: URL("Assets/Images/Back.jpg");
33
}
44

55
*.mdl-grid > *.mdl-cell {
66
Padding: 4vmin;
77
}
88

9+
A:Not([Href]) {
10+
Cursor: Pointer;
11+
}
12+
913

1014

1115
*[Data-TagID="ProfilePhoto"] {

Dialog.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ Dialog[ID^="Dialogs"] Div.mdl-textfield {
3232

3333
#Dialogs_Profile_InfoViewer_Content_Info_Link Img {
3434
Width: 1em;
35+
}
36+
37+
38+
39+
#Dialogs_Thread_Poster_Content_Value_Input {
40+
Resize: None;
3541
}

Dialog.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ window.addEventListener("DOMContentLoaded", () => {
1111

1212

1313

14-
DOM("#Dialogs_Profile_ConfirmDelete_Btns_Yes").addEventListener("click", () => {
14+
DOM("#Dialogs_Profile_DeleteConfirmer_Btns_Yes").addEventListener("click", () => {
1515
if (DOM("#Dialogs_Profile_ConfirmDelete_Content_Email_Input").value == base.user.email) {
1616
base.delete();
1717
} else {
@@ -51,4 +51,37 @@ window.addEventListener("DOMContentLoaded", () => {
5151
});
5252
});
5353
});
54+
55+
DOM("#Dialogs_Thread_Poster_Content_Value_Input").addEventListener("input", (event) => {
56+
if (event.target.value.replace(/\s/g, "").length == 0) {
57+
DOM("#Dialogs_Thread_Poster_Btns_OK").classList.add("mdl-button--disabled");
58+
} else {
59+
DOM("#Dialogs_Thread_Poster_Btns_OK").classList.remove("mdl-button--disabled");
60+
}
61+
});
62+
63+
DOM("#Dialogs_Thread_Poster_Btns_OK").addEventListener("click", (event) => {
64+
if (!DOM("#Dialogs_Thread_Poster_Btns_OK").classList.contains("mdl-button--disabled")) {
65+
DOM("#Screens_Loading").removeAttribute("Disabled");
66+
67+
base.Database.transaction("threads/" + DOM("#Dialogs_Thread_Poster_Content_TID").value + "/data", (res) => {
68+
console.log(res);
69+
70+
base.Database.set("threads/" + DOM("#Dialogs_Thread_Poster_Content_TID").value + "/data/" + res.length, {
71+
uid: base.user.uid,
72+
content: DOM("#Dialogs_Thread_Poster_Content_Value_Input").value,
73+
createdAt: new Date().getTime()
74+
});
75+
76+
DOM("#Screens_Loading").setAttribute("Disabled", "");
77+
DOM("#Dialogs_Thread_Poster").close();
78+
});
79+
}
80+
});
81+
82+
DOM("#Dialogs_Thread_Poster_Btns_Cancel").addEventListener("click", () => {
83+
DOM("#Dialogs_Thread_Poster_Btns_OK").classList.add("mdl-button--disabled"),
84+
DOM("#Dialogs_Thread_Poster_Content_Value").classList.remove("is-dirty"),
85+
DOM("#Dialogs_Thread_Poster_Content_Value_Input").value = "";
86+
});
5487
});

Profile/Profile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ window.addEventListener("DOMContentLoaded", () => {
6969
});
7070

7171
DOM("#Profile_Info_Btns_Delete").addEventListener("click", () => {
72-
doc.querySelector("#Dialogs_Profile_ConfirmDelete").showModal();
72+
doc.querySelector("#Dialogs_Profile_DeleteConfirmer").showModal();
7373
});
7474
});

Thread/Thread.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
Width: 100%;
33
}
44

5-
#Thread_Search > A[Disabled] {
5+
#Thread > Div[Disabled] {
6+
Display: None;
7+
}
8+
9+
#Thread A {
10+
Text-Decoration: None;
11+
Cursor: Pointer;
12+
}
13+
14+
#Thread A[Disabled] {
615
Display: None;
716
}

Thread/Thread.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
window.addEventListener("DOMContentLoaded", () => {
2+
if (!base.user) {
3+
DOM("$#Thread_Tab_Admin").setAttribute("Disabled", ""),
4+
DOM("$#Thread_Admin").setAttribute("Disabled", "");
5+
}
6+
27
base.Database.get(base.Database.ONCE, "threads", (res) => {
3-
res = res.filter((thread) => {
4-
if (thread !== "System") return true;
8+
res = res.filter((thread, index, parent) => {
9+
if (thread !== "System") {
10+
thread.tid = index;
11+
return true;
12+
}
513
});
614

715
for (let i = 0; i < res.length; i++) {
816
let thread = DOM("A", {
917
classes: ["mdl-list__item"],
1018

19+
attributes: {
20+
Href: "Viewer/?tid=" + res[i].tid
21+
},
22+
1123
children: [
1224
DOM("Span", {
1325
classes: ["mdl-list__item-primary-content"],
@@ -27,6 +39,7 @@ window.addEventListener("DOMContentLoaded", () => {
2739
});
2840

2941
DOM("#Thread_Search").appendChild(thread);
42+
if (base.user) if (res[i].jobs.Owner.hasOwnProperty(base.user.uid)) DOM("#Thread_Admin").appendChild(thread);
3043
}
3144
});
3245

Thread/Viewer/Viewer.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ window.addEventListener("DOMContentLoaded", () => {
22
let querys = location.querySort();
33

44
if (!querys.TID) {
5-
location.href = "/SimpleThread/Error/406/"
5+
location.href = "/SimpleThread/Error/406/";
66
}
77

8-
base.Database.get(base.Database.ONCE, "threads/" + querys.TID + "/data", (res) => {
8+
base.Database.get(base.Database.INTERVAL, "threads/" + querys.TID + "/data", (res) => {
99
console.info(res);
1010

1111
for (let i = 0; i < res.length; i++) {
@@ -16,10 +16,15 @@ window.addEventListener("DOMContentLoaded", () => {
1616

1717

1818
let doc = parent.document;
19-
19+
doc.querySelector("#Dialogs_Thread_Poster_Content_TID").value = querys.TID;
20+
2021
DOM('@A[Data-TagID="ProfilePhoto--Btn"]').forEach((btn) => {
2122
btn.addEventListener("click", () => {
2223
doc.querySelector("#Dialogs_Profile_InfoViewer").showModal();
2324
});
2425
});
26+
27+
DOM("#FlowPanel_Btns_CreatePost").addEventListener("click", () => {
28+
doc.querySelector("#Dialogs_Thread_Poster").showModal();
29+
});
2530
});

Thread/Viewer/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<Div ID = "Thread" Class = "mdl-cell mdl-cell--2-offset mdl-cell--8-col mdl-shadow--4dp mdl-color--white mdl-color-text--grey-800">
3939
<Div UUID = "Thread_Post" Class = "mdl-card mdl-shadow--2dp" Data-UID = "N4YbrYALWxeHLmhYx4bMfNDi7f22">
4040
<Div UUID = "Thread_Post_Header" Class = "mdl-card__title mdl-card--border">
41-
<A Data-TagID = "ProfilePhoto--Btn" Class = "mdl-button mdl-js-button mdl-button--icon mdl-js-ripple-effect"></A>
41+
<A Data-TagID = "ProfilePhoto--Btn" Class = "mdl-button mdl-js-button mdl-button--icon mdl-js-ripple-effect" Data-UID = "N4YbrYALWxeHLmhYx4bMfNDi7f22"></A>
4242
<Span UUID = "Thread_Post_Header_Actor" Class = "mdl-card__title-text">プログラなーいGenboo</Span>
4343
<Div Class = "mdl-layout-spacer"></Div>
4444

index.html

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,23 @@
115115
</Div>
116116
</Dialog>
117117

118-
<Dialog ID = "Dialogs_Profile_ConfirmDelete" Class = "mdl-dialog">
119-
<Div ID = "Dialogs_Profile_ConfirmDelete_Content" Class = "mdl-dialog__content">
118+
119+
120+
<Dialog ID = "Dialogs_Profile_DeleteConfirmer" Class = "mdl-dialog">
121+
<Div ID = "Dialogs_Profile_DeleteConfirmer_Content" Class = "mdl-dialog__content">
120122
本当にアカウントを削除しますか?<Br />
121123
処理を続行するにはメールアドレスを入力してください。
122124

123-
<Div ID = "Dialogs_Profile_ConfirmDelete_Content_Email" Class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
124-
<Input ID = "Dialogs_Profile_ConfirmDelete_Content_Email_Input" Class = "mdl-textfield__input" Type = "Email" Value = "" />
125-
<Label ID = "Dialogs_Profile_ConfirmDelete_Content_Email_Label" Class = "mdl-textfield__label" For = "Dialogs_Profile_ConfirmDelete_Content_Email_Input">メールアドレス...</Label>
125+
<Div ID = "Dialogs_Profile_DeleteConfirmer_Content_Email" Class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
126+
<Input ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input" Class = "mdl-textfield__input" Type = "Email" Value = "" />
127+
<Label ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Label" Class = "mdl-textfield__label" For = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input">メールアドレス...</Label>
126128
<Span Class = "mdl-textfield__error">無効なメールアドレスです</Span>
127129
</Div>
128130
</Div>
129131

130-
<Div ID = "Dialogs_Profile_ConfirmDelete_Btns" Class = "mdl-dialog__actions">
131-
<Button ID = "Dialogs_Profile_ConfirmDelete_Btns_Yes" Class = "mdl-button mdl-js-button mdl-js-ripple-effect" Type = "Button">はい</Button>
132-
<Button ID = "Dialogs_Profile_ConfirmDelete_Btns_No" Class = "mdl-button mdl-js-button mdl-js-ripple-effect" Data-Action = "Dialog_Close" Type = "Button">いいえ</Button>
132+
<Div ID = "Dialogs_Profile_DeleteConfirmer_Btns" Class = "mdl-dialog__actions">
133+
<Button ID = "Dialogs_Profile_DeleteConfirmer_Btns_Yes" Class = "mdl-button mdl-js-button mdl-js-ripple-effect" Type = "Button">はい</Button>
134+
<Button ID = "Dialogs_Profile_DeleteConfirmer_Btns_No" Class = "mdl-button mdl-js-button mdl-js-ripple-effect" Data-Action = "Dialog_Close" Type = "Button">いいえ</Button>
133135
</Div>
134136
</Dialog>
135137

@@ -138,7 +140,7 @@
138140
<Div ID = "Dialogs_Profile_InfoViewer_Content_Photo" Data-TagID = "ProfilePhoto"></Div>
139141

140142
<Div ID = "Dialogs_Profile_InfoViewer_Content_Info">
141-
<Span ID = "Dialogs_Profile_InfoViewer_Content_Info_Name" Class = "mdl-layout__title">Genbu Hase</Span>
143+
<Span ID = "Dialogs_Profile_InfoViewer_Content_Info_Name" Class = "mdl-layout__title">プログラなーいGenboo</Span>
142144

143145
<Div ID = "Dialogs_Profile_InfoViewer_Content_Info_Detail">
144146
Google+で色々やってる暇人です。<Br />
@@ -191,6 +193,22 @@
191193
<Button ID = "Dialogs_Thread_InfoInputer_Btns_Cancel" Class = "mdl-button mdl-js-button mdl-js-ripple-effect" Data-Action = "Dialog_Close" Type = "Button">キャンセル</Button>
192194
</Div>
193195
</Dialog>
196+
197+
<Dialog ID = "Dialogs_Thread_Poster" Class = "mdl-dialog">
198+
<Div ID = "Dialogs_Thread_Poster_Content" Class = "mdl-dialog__content">
199+
<Div ID = "Dialogs_Thread_Poster_Content_Value" Class = "mdl-textfield mdl-js-textfield">
200+
<Textarea ID = "Dialogs_Thread_Poster_Content_Value_Input" Class = "mdl-textfield__input" Rows = "15" MaxLength = "500"></Textarea>
201+
<Label Class = "mdl-textfield__label" For = "Dialogs_Thread_Poster_Content_Value_Input">最近の出来事を共有してみましょう</Label>
202+
</Div>
203+
204+
<Input ID = "Dialogs_Thread_Poster_Content_TID" Type = "Hidden" Value = "" />
205+
</Div>
206+
207+
<Div ID = "Dialogs_Thread_Poster_Btns" Class = "mdl-dialog__actions">
208+
<Button ID = "Dialogs_Thread_Poster_Btns_OK" Class = "mdl-button mdl-js-button mdl-button--disabled mdl-js-ripple-effect" Type = "Button">投稿</Button>
209+
<Button ID = "Dialogs_Thread_Poster_Btns_Cancel" Class = "mdl-button mdl-js-button mdl-js-ripple-effect" Data-Action = "Dialog_Close" Type = "Button">キャンセル</Button>
210+
</Div>
211+
</Dialog>
194212
</Div>
195213
</Div>
196214
</Body>

0 commit comments

Comments
 (0)