Skip to content
This repository was archived by the owner on May 13, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DBConstuction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Root

> 1
> ...


> password: HashString
> 2
> ...
8 changes: 5 additions & 3 deletions Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
});

Expand Down Expand Up @@ -90,7 +90,9 @@ window.addEventListener("DOMContentLoaded", () => {
plusCount: 0,
createdAt: now
}
]
],

password: ""
});

DOM("#Dialogs_Thread_InfoInputer").close();
Expand Down
11 changes: 7 additions & 4 deletions Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -89,8 +96,4 @@ window.addEventListener("DOMContentLoaded", () => {
break;
}
});

DOM("$IFrame#Page").addEventListener("load", () => {
DOM("#Screens_Loading").setAttribute("Disabled", "");
});
});
5 changes: 5 additions & 0 deletions Thread/Thread.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@

#Thread A[Disabled] {
Display: None;
}

#Thread_Tab_Reload {
Display: Inline-Flex;
Align-Items: Center;
}
89 changes: 51 additions & 38 deletions Thread/Thread.js
Original file line number Diff line number Diff line change
@@ -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();



Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions Thread/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
<Div ID = "Thread_Tab" Class = "mdl-tabs__tab-bar">
<A ID = "Thread_Tab_Search" Class = "mdl-tabs__tab is-active" Href = "#Thread_Search">スレッド検索</A>
<A ID = "Thread_Tab_Admin" Class = "mdl-tabs__tab" Href = "#Thread_Admin">管理中のスレッド</A>

<A ID = "Thread_Tab_Reload" Class = "mdl-tabs__tab">
<I Class = "material-icons">refresh</I>
</A>

<Div Class = "mdl-tooltip" For = "Thread_Tab_Reload">Refresh thread list</Div>
</Div>


Expand Down
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@
処理を続行するにはメールアドレスを入力してください。

<Div ID = "Dialogs_Profile_DeleteConfirmer_Content_Email" Class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<Input ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input" Class = "mdl-textfield__input" Type = "Email" Value = "" />
<Input ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input" Class = "mdl-textfield__input" Type = "Email" Value = "" Required = "Required" />
<Label ID = "Dialogs_Profile_DeleteConfirmer_Content_Email_Label" Class = "mdl-textfield__label" For = "Dialogs_Profile_DeleteConfirmer_Content_Email_Input">メールアドレス...</Label>

<Span Class = "mdl-textfield__error">無効なメールアドレスです</Span>
</Div>
</Div>
Expand Down Expand Up @@ -175,18 +176,18 @@
<Dialog ID = "Dialogs_Thread_InfoInputer" Class = "mdl-dialog">
<Div ID = "Dialogs_Thread_InfoInputer_Content" Class = "mdl-dialog__content">
<Div ID = "Dialogs_Thread_InfoInputer_Content_Name" Class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<Input ID = "Dialogs_Thread_InfoInputer_Content_Name_Input" Class = "mdl-textfield__input" Type = "Text" Value = "" />
<Input ID = "Dialogs_Thread_InfoInputer_Content_Name_Input" Class = "mdl-textfield__input" Type = "Text" Value = "" Required = "Required" />
<Label ID = "Dialogs_Thread_InfoInputer_Content_Name_Label" Class = "mdl-textfield__label" For = "Dialogs_Thread_InfoInputer_Content_Name_Input">スレッド名...</Label>
</Div>

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

<Div ID = "Dialogs_Thread_InfoInputer_Content_Detail" Class = "mdl-textfield mdl-js-textfield">
<Textarea ID = "Dialogs_Thread_InfoInputer_Content_Detail_Input" Class = "mdl-textfield__input" Rows = "10" MaxLength = "500"></Textarea>
<Label Class = "mdl-textfield__label" For = "Dialogs_Thread_InfoInputer_Content_Detail_Input">詳細...</Label>
<Label Class = "mdl-textfield__label" For = "Dialogs_Thread_InfoInputer_Content_Detail_Input">詳細...(任意)</Label>
</Div>
</Div>

Expand Down