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

Commit f671bb9

Browse files
committed
外見上importを綺麗に。
1 parent 0e3358a commit f671bb9

20 files changed

Lines changed: 857 additions & 16 deletions

firebase.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"apiKey": "AIzaSyA62uPkN6WNV41oWWzOdiITMbBF9RDYOhM",
3+
"authDomain": "simple-thread.firebaseapp.com",
4+
"databaseURL": "https://simple-thread.firebaseio.com",
5+
"projectId": "simple-thread",
6+
"storageBucket": "simple-thread.appspot.com",
7+
"messagingSenderId": 646527306803,
8+
9+
"client_id": "646527306803-1ecjnmee3pddu6tkakrevs7lkka1daql.apps.googleusercontent.com",
10+
11+
"scope": [
12+
"https://www.googleapis.com/auth/plus.login",
13+
"https://www.googleapis.com/auth/drive.readonly",
14+
"https://www.googleapis.com/auth/photos"
15+
]
16+
}

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
<Main ID = "Top">
2424
<Img ID = "Top-Logo" Src = "/SimpleThread/images/Logo.png" />
2525

26-
<P ID = "Top-Introduce" Data-Locales = "top.introduce">
26+
<Div ID = "Top-Introduce" Data-Locales = "top.introduce">
2727
Simple Threadへようこそ!
2828
当サービスでは "Be Simple, Be Free" をモットーに、他サービスと比べ自由に話せるスレ板を提供しますΣd(´・ω・`)
29-
</P>
29+
</Div>
3030
</Main>
3131
</Body>
3232
</HTML>

info/index.html

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,55 @@
33
<HTML>
44
<Head>
55
<Meta Charset = "UTF-8" />
6+
<Meta Name = "Viewport" Content = "Width=Device-Width, Initial-Scale=1, User-Scalable=No" />
67
<Title>サーバー情報 | Simple Thread</Title>
7-
8+
89
<Script Src = "/SimpleThread/libraries/material-components-web.min.js"></Script>
910
<Link Rel = "StyleSheet" Href = "/SimpleThread/libraries/material-components-web.min.css" />
1011

1112
<Script Src = "/SimpleThread/libraries/DOM Extender v3.4.js"></Script>
1213
<Script Src = "/SimpleThread/libraries/common/common.js"></Script>
1314
<Link Rel = "StyleSheet" Href = "/SimpleThread/libraries/common/common.css" />
15+
16+
<Link Rel = "StyleSheet" Href = "info.css" />
1417
</Head>
1518

1619
<Body>
17-
<Main>
18-
20+
<Main ID = "Info">
21+
<Img ID = "Info-Logo" Src = "/SimpleThread/images/Logo.png" />
22+
23+
<H2 Class = "mdc-typography--headline" Data-Locales = "common.serverInfo">Server Info</H2>
24+
25+
<Table Class = "mdc-elevation--z3">
26+
<THead>
27+
<Tr>
28+
<Th Data-Locales = "info.name">項目</Th>
29+
<Th Data-Locales = "info.value"></Th>
30+
</Tr>
31+
</THead>
32+
33+
<TBody>
34+
<Tr>
35+
<Td Data-Locales = "info.name.serviceName">サービス名称</Td>
36+
<Td Data-Locales = "common.title">Simple Thread</Td>
37+
</Tr>
38+
39+
<Tr>
40+
<Td Data-Locales = "info.name.users">ユーザー数</Td>
41+
<Td ID = "Info-Users">0</Td>
42+
</Tr>
43+
44+
<Tr>
45+
<Td Data-Locales = "info.name.threads">スレッド数</Td>
46+
<Td ID = "Info-Threads">0</Td>
47+
</Tr>
48+
49+
<Tr>
50+
<Td Data-Locales = "info.name.lastUpdated">最終更新日</Td>
51+
<Td>2018/02/01</Td>
52+
</Tr>
53+
</TBody>
54+
</Table>
1955
</Main>
2056
</Body>
2157
</HTML>

info/info.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#Info-Logo {
2+
Width: 100%;
3+
Margin-Bottom: 2em;
4+
}
5+
6+
#Info > Table {
7+
Width: 100%;
8+
Border: Thin Solid LightGray;
9+
}
10+
11+
#Info > Table Th, #Info > Table Td {
12+
Padding: 1em;
13+
Text-Align: Left;
14+
}

info/info.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
window.addEventListener("DOMContentLoaded", () => {
2+
3+
});

libraries/DBLoader.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
class DBLoader extends FirebasePlus {
2+
constructor (configUrl = "firebase.json", onload = () => {}) {
3+
let cfgLoader = new JSONLoader();
4+
5+
super(cfgLoader.load(configUrl), onload);
6+
}
7+
8+
9+
10+
delete () {
11+
this.reauth().then(() => {
12+
this.Database.get(this.Database.ONCE, "threads/", res => {
13+
res.forEach((thread, threadIndex) => {
14+
if (thread.data) {
15+
for (let uid in thread.jobs.Owner) {
16+
if (uid === this.user.uid) {
17+
this.Database.delete(`threads/${threadIndex}/`);
18+
return;
19+
}
20+
}
21+
22+
thread.data.forEach((post, postIndex) => {
23+
if (post.uid == this.user.uid) this.Database.delete(`threads/${threadIndex}/data/${postIndex}/`);
24+
});
25+
}
26+
});
27+
});
28+
29+
this.accessToken = "",
30+
this.idToken = "",
31+
this.signInType = "",
32+
this.signInScope = [];
33+
34+
this.Database.delete("users/" + this.user.uid);
35+
this.user.delete();
36+
37+
location.reload();
38+
});
39+
}
40+
}

libraries/Encrypter.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Encrypter {
2+
/**
3+
* 文字列をHash(SHA-512)で暗号化する
4+
* @memberof Encrypter
5+
* @static
6+
*
7+
* @param {String} [text=""]
8+
* @param {String} [type="HEX"]
9+
* @returns {String}
10+
*/
11+
static encrypt (text = "", type = "HEX") {
12+
let encrypter = new jsSHA("SHA-512", "TEXT");
13+
encrypter.update(text);
14+
15+
return encrypter.getHash(type);
16+
}
17+
}

libraries/FileLoader.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
class FileLoader {
2+
constructor () {}
3+
4+
/**
5+
* 指定されたurlからファイルを読み込む
6+
* @memberof FileLoader
7+
*
8+
* @param {String} url
9+
*/
10+
load (url) {
11+
try {
12+
let reader = new XMLHttpRequest();
13+
reader.open("GET", url || location.href, false);
14+
reader.send(null);
15+
16+
this.currentData = reader.response;
17+
} catch (error) {
18+
this.currentData = null;
19+
console.error(error);
20+
}
21+
22+
return this.currentData;
23+
}
24+
}

0 commit comments

Comments
 (0)