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

Commit 7aa9969

Browse files
authored
Merge pull request #12 from GenbuProject/v2
リンクURLを認識してリンク化するように。
2 parents ff90380 + bc77420 commit 7aa9969

4 files changed

Lines changed: 20 additions & 8 deletions

File tree

Core.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ window.addEventListener("DOMContentLoaded", () => {
1313
});
1414
});
1515

16+
parent.document.querySelector("IFrame#Page").contentWindow.addEventListener("beforeunload", () => {
17+
parent.document.querySelectorAll("Dialog[Open]").forEach((dialog) => {
18+
dialog.close();
19+
});
20+
21+
parent.document.querySelector("#Screens_Loading").removeAttribute("Disabled");
22+
});
23+
1624

1725

1826
document.head.appendChild(DOM("Style", { id: "CustomTag_Manager" }));
@@ -47,7 +55,7 @@ window.addEventListener("DOMContentLoaded", () => {
4755
});
4856

4957
Notification.requestPermission(function (state) {
50-
switch (state) {
58+
/*switch (state) {
5159
case "default":
5260
break;
5361
@@ -58,5 +66,5 @@ Notification.requestPermission(function (state) {
5866
case "denied":
5967
console.warn("通知の許可が確認されません");
6068
break;
61-
}
69+
}*/
6270
});

Dialog.js

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

77
if (dialog.querySelector('Button[Data-Action="Dialog_Submit"]')) {
88
dialog.addEventListener("keydown", (event) => {
9-
console.log(event);
9+
if (event.ctrlKey && event.keyCode == 13) dialog.querySelector('Button[Data-Action="Dialog_Submit"]').click();
1010
});
1111
}
1212
});
@@ -127,6 +127,8 @@ window.addEventListener("DOMContentLoaded", () => {
127127
DOM("#Dialogs_Thread_Poster_Content_Value_Input").value = "";
128128

129129
DOM("#Screens_Loading").setAttribute("Disabled", "");
130+
DOM("#Page").contentDocument.querySelector("#FlowPanel_Btns_CreatePost").removeAttribute("Disabled");
131+
130132
DOM("#Dialogs_Thread_Poster").close();
131133
});
132134
}
@@ -136,5 +138,7 @@ window.addEventListener("DOMContentLoaded", () => {
136138
DOM("#Dialogs_Thread_Poster_Btns_OK").classList.add("mdl-button--disabled"),
137139
DOM("#Dialogs_Thread_Poster_Content_Value").classList.remove("is-dirty"),
138140
DOM("#Dialogs_Thread_Poster_Content_Value_Input").value = "";
141+
142+
DOM("#Page").contentDocument.querySelector("#FlowPanel_Btns_CreatePost").removeAttribute("Disabled");
139143
});
140144
});

Main.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ window.addEventListener("DOMContentLoaded", () => {
8888
}
8989
});
9090

91-
DOM("$IFrame#Page").contentWindow.addEventListener("beforeunload", () => {
92-
DOM("#Screens_Loading").removeAttribute("Disabled");
93-
});
94-
9591
DOM("$IFrame#Page").addEventListener("load", () => {
9692
DOM("#Screens_Loading").setAttribute("Disabled", "");
9793
});

Thread/Viewer/Viewer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ window.addEventListener("DOMContentLoaded", () => {
182182
post.querySelector('Span[UUID="Thread_Post_Header_Actor"]').textContent = userRes.userName;
183183
});
184184

185+
URL.filter(post.querySelector('Div[UUID="Thread_Post_Content"]').textContent).forEach((urlString) => {
186+
post.querySelector('Div[UUID="Thread_Post_Content"]').innerHTML = post.querySelector('Div[UUID="Thread_Post_Content"]').innerHTML.replace(urlString, `<A Href = "${urlString}" Target = "_blank">${urlString}</A>`);
187+
});
188+
185189
DOM("#Thread").appendChild(post);
186190
}
187191
} else {
@@ -194,6 +198,6 @@ window.addEventListener("DOMContentLoaded", () => {
194198
DOM("#FlowPanel_Btns_CreatePost").addEventListener("click", () => {
195199
doc.querySelector("#Dialogs_Thread_Poster").showModal();
196200

197-
//DOM("#FlowPanel").style.display = "Block";
201+
DOM("#FlowPanel_Btns_CreatePost").setAttribute("Disabled", "");
198202
});
199203
});

0 commit comments

Comments
 (0)