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

Commit 2fca911

Browse files
committed
もういい感じだよね!!!れ!れれ!!
1 parent e9bfd04 commit 2fca911

5 files changed

Lines changed: 113 additions & 10 deletions

File tree

Core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ window.addEventListener("DOMContentLoaded", () => {
2424
try {
2525
DOM("#CustomTag_Manager").textContent = (() => {
2626
return new Style({
27-
"*[Data-TagID='ProfilePhoto']": {
27+
'*[Data-TagID="ProfilePhoto"]': {
2828
"Background-Image": ["URL(", base.user.photoURL, ")"].join('"')
2929
},
3030

31-
"*[Data-TagID='ProfilePhoto--Btn']": {
31+
'*[Data-TagID="ProfilePhoto--Btn"]': {
3232
"Background-Image": ["URL(", base.user.photoURL, ")"].join('"')
3333
}
3434
}).textContent;

Thread/Viewer/Viewer.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Div[UUID="Thread_Post"] {
22
Width: 100%;
33
Min-Height: Auto;
4+
5+
Margin: 5vh 0;
46
}
57

68
Div[UUID="Thread_Post_Header"] > * {

Thread/Viewer/Viewer.js

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,117 @@ window.addEventListener("DOMContentLoaded", () => {
99
console.info(res);
1010

1111
for (let i = 0; i < res.length; i++) {
12-
12+
let rnd = new DOM.Randomizer(DOM.Randomizer.TYPE.LEVEL3).generate(16);
13+
14+
let post = DOM("Div", {
15+
classes: ["mdl-card", "mdl-shadow--2dp"],
16+
17+
attributes: {
18+
"UUID": "Thread_Post",
19+
"Data-UID": res[i].uid
20+
},
21+
22+
children: [
23+
DOM("Div", {
24+
classes: ["mdl-card__title", "mdl-card--border"],
25+
26+
attributes: {
27+
"UUID": "Thread_Post_Header"
28+
},
29+
30+
children: [
31+
DOM("A", {
32+
classes: ["mdl-button", "mdl-js-button", "mdl-button--icon", "mdl-js-ripple-effect"],
33+
34+
attributes: {
35+
"Data-TagID": "ProfilePhoto--Btn",
36+
"Data-UID": res[i].uid
37+
}
38+
}),
39+
40+
DOM("Span", {
41+
classes: ["mdl-card__title-text"],
42+
43+
attributes: {
44+
"UUID": "Thread_Post_Header_Actor"
45+
}
46+
}),
47+
48+
DOM("Div", {
49+
classes: ["mdl-layout-spacer"]
50+
}),
51+
52+
DOM("Span", {
53+
text: new Date(res[i].createdAt).toLocaleString(),
54+
55+
attributes: {
56+
"UUID": "Thread_Post_Header_CreatedAt"
57+
}
58+
}),
59+
]
60+
}),
61+
62+
DOM("Div", {
63+
classes: ["mdl-card__supporting-text"],
64+
text: res[i].content,
65+
66+
attributes: {
67+
"UUID": "Thread_Post_Content"
68+
}
69+
}),
70+
71+
DOM("Div", {
72+
classes: ["mdl-card__actions"],
73+
74+
attributes: {
75+
"UUID": "Thread_Post_Actions"
76+
},
77+
78+
children: [
79+
DOM("Label", {
80+
id: "Thread_Post_Actions_Plus_" + rnd,
81+
classes: ["mdl-icon-toggle", "mdl-js-icon-toggle", "mdl-js-ripple-effect"],
82+
83+
attributes: {
84+
"For": "Thread_Post_Actions_Plus_" + rnd + "_Input"
85+
},
86+
87+
children: [
88+
DOM("Input", {
89+
id: "Thread_Post_Actions_Plus_" + rnd + "_Input",
90+
classes: ["mdl-icon-toggle__input"],
91+
92+
attributes: {
93+
"Type": "Checkbox"
94+
}
95+
}),
96+
97+
DOM("Button", {
98+
id: "Thread_Post_Actions_Plus_" + rnd + "_Btn",
99+
classes: ["mdl-button", "mdl-js-button", "mdl-icon-toggle__label"],
100+
text: "+1"
101+
})
102+
]
103+
})
104+
]
105+
})
106+
]
107+
});
108+
109+
base.Database.get(base.Database.ONCE, "users/" + res[i].uid, (userRes) => {
110+
post.querySelector('Span[UUID="Thread_Post_Header_Actor"]').textContent = userRes.gplusName;
111+
post.querySelector('A[Data-TagID="ProfilePhoto--Btn"]').style.background = `URL("${userRes.gplusPhoto}") Center / Cover`;
112+
});
113+
114+
DOM("#Thread").appendChild(post);
13115
}
14116
});
15117

16118

17119

18120
let doc = parent.document;
19121
doc.querySelector("#Dialogs_Thread_Poster_Content_TID").value = querys.TID;
20-
122+
21123
DOM('@A[Data-TagID="ProfilePhoto--Btn"]').forEach((btn) => {
22124
btn.addEventListener("click", () => {
23125
doc.querySelector("#Dialogs_Profile_InfoViewer").showModal();

Thread/Viewer/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<Body Style = 'Background: URL("/SimpleThread/Assets/Images/Back.jpg")'>
3737
<Div Class = "mdl-grid">
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">
39-
<Div UUID = "Thread_Post" Class = "mdl-card mdl-shadow--2dp" Data-UID = "N4YbrYALWxeHLmhYx4bMfNDi7f22">
39+
<!--<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">
4141
<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>
@@ -50,13 +50,13 @@
5050
</Div>
5151
5252
<Div UUID = "Thread_Post_Actions" Class = "mdl-card__actions">
53-
<Label Class = "mdl-icon-toggle mdl-js-icon-toggle mdl-js-ripple-effect" For = "Input">
54-
<Input ID = "Input" Class = "mdl-icon-toggle__input" Type = "Checkbox" />
55-
<Button Class = "mdl-button mdl-js-button mdl-icon-toggle__label">+1</Button>
53+
<Label ID = "Thread_Post_Actions_Plus" Class = "mdl-icon-toggle mdl-js-icon-toggle mdl-js-ripple-effect" For = "Input">
54+
<Input ID = "Thread_Post_Actions_Plus_Input" Class = "mdl-icon-toggle__input" Type = "Checkbox" />
55+
<Button ID = "Thread_Post_Actions_Plus_Btn" Class = "mdl-button mdl-js-button mdl-icon-toggle__label">+1</Button>
5656
</Label>
5757
</Div>
5858
</Div>
59-
</Div>
59+
</Div>-->
6060
</Div>
6161

6262
<Div ID = "FlowPanel">

Thread/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
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-
<A Class = "mdl-tabs__tab" Href = "Viewer/?tid=1">スレッド(Debug)</A>
4342
</Div>
4443

4544

0 commit comments

Comments
 (0)