Skip to content

Commit 88f1f06

Browse files
resolve #123
1 parent 1e98ed2 commit 88f1f06

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1277
-798
lines changed

Client/ContentsViewer/ContentsViewerStandard.css

Lines changed: 147 additions & 202 deletions
Large diffs are not rendered by default.

Client/ContentsViewer/ContentsViewerStandard.js

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ document.addEventListener("DOMContentLoaded", function() {
8080
if (docOutlineNavi) {
8181
var totalID = 0;
8282
if (
83-
contentBody.children.length == 0 ||
84-
(totalID = CreateSectionTreeHelper(contentBody, docOutlineNavi, 0)) == 0
83+
contentBody.children.length != 0 &&
84+
(totalID = CreateSectionTreeHelper(contentBody, docOutlineNavi, 0)) != 0
8585
) {
86-
docOutlineNavi.textContent = " ありません";
86+
docOutlineNavi.removeChild(docOutlineNavi.firstChild);
8787
}
8888

8989
if (docOutlineEmbeded) {
@@ -350,10 +350,7 @@ function OnScroll() {
350350
sumOfScroll += window.pageYOffset - scrollPosPrev;
351351
if (Math.abs(sumOfScroll) > offsetYToHideHeader) {
352352
//一定量スクロールされたとき
353-
if (warningMessageBox != null) {
354-
warningMessageBox.style.animationName = "warning-message-box-slideout";
355-
warningMessageBox = null;
356-
}
353+
CloseWarningMessageBox();
357354
}
358355

359356
if (window.pageYOffset < offsetYToHideHeader) {
@@ -513,6 +510,13 @@ function OnClickSitemask() {
513510
CloseLeftColumn();
514511
}
515512

513+
function CloseWarningMessageBox() {
514+
if (warningMessageBox != null) {
515+
warningMessageBox.style.animationName = "warning-message-box-slideout";
516+
warningMessageBox = null;
517+
}
518+
}
519+
516520
var searchBoxInputTimer = null;
517521
function OnInputSearchBox(updateResultsImmediately = false) {
518522
if (searchBoxInputTimer) {
@@ -602,7 +606,8 @@ function UpdateSearchResults() {
602606
} else {
603607
var div = document.createElement("div");
604608
div.className = "search-results-header";
605-
div.textContent = "コンテンツが見つかりませんでした...";
609+
div.textContent = "Not Found...";
610+
// div.textContent = "コンテンツが見つかりませんでした...";
606611
searchResults.appendChild(div);
607612
}
608613
};
@@ -638,25 +643,17 @@ function NotBlankText(texts) {
638643
return texts[texts.length - 1];
639644
}
640645

641-
// function OpenWindow(url, name) {
642-
// win = window.open(url, name);
643-
644-
// // return;
645-
// // /* ウィンドウオブジェトを格納する変数 */
646-
// // var win;
647-
// // /* ウィンドウの存在確認をしてからウィンドウを開く */
648-
// // if (!win || win.closed) {
649-
// // /*
650-
// // ウィンドウオブジェクトを格納した変数が存在しない、
651-
// // ウィンドウが存在しない、ウィンドウが閉じられている
652-
// // 場合は、新ウィンドウを開く。
653-
// // */
654-
// // win = window.open(url, name);
655-
// // } else {
656-
// // /*
657-
// // 既にウィンドウが開かれている場合は
658-
// // そのウィンドウにフォーカスを当てる。
659-
// // */
660-
// // win.focus();
661-
// // }
662-
// }
646+
function OnClickLayerSelector(element, event) {
647+
648+
if (element.parentNode.hasAttribute('open')) {
649+
return;
650+
}
651+
652+
var closeClickHandler = function () {
653+
element.parentNode.removeAttribute('open');
654+
}
655+
656+
event.stopPropagation();
657+
element.parentNode.setAttribute('open', '');
658+
document.addEventListener('click', closeClickHandler, {once: true, capture: false});
659+
}

Client/FileManager/FileManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class FileElement {
5454
if (!this.options.hideDropField) {
5555
this.dropField = document.createElement("div");
5656
this.dropField.setAttribute("class", "drop-field");
57-
this.dropField.textContent = "ファイルをドラック&ドロップ";
57+
this.dropField.textContent = "Drag & Drop files";
5858
this.dropField.addEventListener("dragover", function(e) {
5959
e.preventDefault();
6060
});
@@ -169,7 +169,7 @@ class FileElement {
169169
}
170170

171171
if (FileElement.CopyText(text)) {
172-
alert("パスをコピーしました. \n" + text);
172+
alert("Copy the path. \n" + text);
173173
}
174174

175175
// var selection = window.getSelection();

Frontend/400.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
$vars['title'] = "Bad Request !";
1313
$vars['panelTitle'] = "400";
1414
$vars['panelContentOnIdle'] =
15-
"不正なリクエストを確認しました.<br/><br/>" .
16-
$vars['errorMessage'] . "<br/><br/>" .
17-
"<a href='" . CreateContentHREF($vars['rootContentPath']) . "'>TopPageに行く</a>" .
18-
"<div class='note'>* 品質向上のためこの問題は管理者に報告されます.</div>";
15+
Localization\Localize('400.panelContentOnIdle',
16+
"Bad Request Detected.<br/><br/>" .
17+
"{0}<br/><br/>" .
18+
"<a href='{1}'>Goto TopPage</a>" .
19+
"<div class='note'>* This error will be reported for the best user experience.</div>",
20+
$vars['errorMessage'], CreateContentHREF($vars['rootContentPath']));
1921

2022
$vars['panelContentOnGameover'] =
21-
"本来の目的にもどる↓" .
22-
"<a href='" . CreateContentHREF($vars['rootContentPath']) . "'>TopPageに行く</a><br/>or";
23+
Localization\Localize('400.panelContentOnGameover',
24+
"Back to the main objectives. ↓" .
25+
"<a href='{0}'>Goto TopPage</a><br/>or",
26+
CreateContentHREF($vars['rootContentPath']));
2327

2428
require(FRONTEND_DIR . '/error-page.php');

Frontend/403.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
$vars['title'] = "Forbidden...";
77
$vars['panelTitle'] = "403";
88
$vars['panelContentOnIdle'] =
9-
"対象のコンテンツに対するアクセス権がありません.<br/>" .
10-
"アクセス権を持つアカウントで再度ログインしてください.<br/>" .
11-
"<a href='" . ROOT_URI . "/Logout?token=" . H(Authenticator::GenerateCsrfToken()) . "&returnTo=" . urlencode($_SERVER["REQUEST_URI"]) ."'>" .
12-
"&gt;&gt;再ログイン&lt;&lt;</a>";
9+
Localization\Localize('403.panelContentOnIdle',
10+
"You do not have access privileges for this content.<br/>" .
11+
"Please login with another account having the access privileges and try again.<br/>" .
12+
"<a href='{0}'>&gt;&gt;Re-login&lt;&lt;</a>",
13+
ROOT_URI . "/Logout?token=" . H(Authenticator::GenerateCsrfToken()) . "&returnTo=" . urlencode($_SERVER["REQUEST_URI"]));
14+
1315
$vars['panelContentOnGameover'] =
14-
"本来の目的にもどる↓" .
15-
"<a href='" . ROOT_URI . "/Logout?token=" . H(Authenticator::GenerateCsrfToken()) . "&returnTo=" . urlencode($_SERVER["REQUEST_URI"]) ."'>" .
16-
"再ログインしてコンテンツにアクセスする</a><br/>or";
16+
Localization\Localize('403.panelContentOnGameover',
17+
"Back to the main objectives. ↓" .
18+
"<a href='{0}'>Re-login to access the content</a><br/>or",
19+
ROOT_URI . "/Logout?token=" . H(Authenticator::GenerateCsrfToken()) . "&returnTo=" . urlencode($_SERVER["REQUEST_URI"]));
1720

1821
require(FRONTEND_DIR . '/error-page.php');

Frontend/404.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,35 @@
22

33
require_once(MODULE_DIR . "/ContentsViewerUtils.php");
44
require_once(MODULE_DIR . "/Debug.php");
5-
require_once(FRONTEND_DIR . "/error-page-setup.php");
5+
require_once(MODULE_DIR . "/Utils.php");
6+
require_once(MODULE_DIR . "/ContentsDatabaseManager.php");
67

8+
require_once(FRONTEND_DIR . "/error-page-setup.php");
79

810
Debug::LogError("Not Found page Accessed(404):
911
REQUEST_URI: " . $_SERVER['REQUEST_URI']);
1012

13+
$query = ContentsDatabaseManager::ReduceURI($vars['subURI']);
14+
1115
$vars['header'] = "HTTP/1.1 404 Not Found";
1216
$vars['title'] = "Not Found...";
1317
$vars['panelTitle'] = "404";
1418
$vars['panelContentOnIdle'] =
15-
"存在しない or 移動した コンテンツにアクセスした可能性があります.<div style='display: flex; align-items: center;'>" .
16-
"<a style='flex-basis: 30%;' href='javascript:void(0);' onclick='OnClickSearchButton(&#39;" . H($vars['subURI']) . "&#39;)'>検索する</a>" .
17-
"<a style='flex-basis: 30%;' href='" . CreateContentHREF($vars['rootContentPath']) . "'>トップから探す</a>" .
18-
"<a style='flex-basis: 30%;' href='" . ROOT_URI . dirname($vars['subURI']) . "'>同階層から探す</a></div>" .
19-
"<div class='note'>* 品質向上のためこの問題は管理者に報告されます.</div>";
19+
Localization\Localize('404.panelContentOnIdle',
20+
"You may access the not-existed or moved content.<div style='display: flex; align-items: center;'>" .
21+
"<a style='flex-basis: 30%;' href='javascript:void(0);' onclick='OnClickSearchButton(&#39;{0}&#39;)'>Search</a>" .
22+
"<a style='flex-basis: 30%;' href='{1}'>Find from The Top</a>" .
23+
"<a style='flex-basis: 30%;' href='{2}'>Find from The Same Directory</a></div>" .
24+
"<div class='note'>* This error will be reported for the best user experience.</div>",
25+
H($query), CreateContentHREF($vars['rootContentPath']), ROOT_URI . dirname($vars['subURI']));
2026

2127
$vars['panelContentOnGameover'] =
22-
"本来の目的にもどる↓" .
28+
Localization\Localize('404.panelContentOnGameover',
29+
"Back to the main objectives. ↓" .
2330
"<div style='display: flex; align-items: center;'>" .
24-
"<a style='flex-basis: 30%;' href='javascript:void(0);' onclick='OnClickSearchButton(&#39;" . H($vars['subURI']) . "&#39;)'>検索する</a>" .
25-
"<a style='flex-basis: 30%;' href='" . CreateContentHREF($vars['rootContentPath']) . "'>トップから探す</a>" .
26-
"<a style='flex-basis: 30%;' href='" . ROOT_URI . dirname($vars['subURI']) . "'>同階層から探す</a></div> or";
31+
"<a style='flex-basis: 30%;' href='javascript:void(0);' onclick='OnClickSearchButton(&#39;{0}&#39;)'>Search</a>" .
32+
"<a style='flex-basis: 30%;' href='{1}'>Find from The Top</a>" .
33+
"<a style='flex-basis: 30%;' href='{2}'>Find from The Same Directory</a></div> or",
34+
H($query), CreateContentHREF($vars['rootContentPath']), ROOT_URI . dirname($vars['subURI']));
2735

2836
require(FRONTEND_DIR . '/error-page.php');

Frontend/500.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
$vars['title'] = "Internal Server Error";
1515
$vars['panelTitle'] = "500";
1616
$vars['panelContentOnIdle'] =
17-
"大変申し訳ございません. 内部エラーにあいました.<br/><br/>" .
18-
$vars['errorMessage'] . "<br/><br/>" .
19-
"<a href='" . CreateContentHREF($vars['rootContentPath']) . "'>TopPageに行く</a>" .
20-
"<div class='note'>* 品質向上のためこの問題は管理者に報告されます.</div>";
17+
Localization\Localize('500.panelContentOnIdle',
18+
"We are very sorry. Internal Server Error occured. <br/><br/>{0}<br/><br/>" .
19+
"<a href='{1}'>Goto TopPage</a>" .
20+
"<div class='note'>* This error will be reported for the best user experience.</div>",
21+
$vars['errorMessage'], CreateContentHREF($vars['rootContentPath']));
2122

2223
$vars['panelContentOnGameover'] =
23-
"本来の目的にもどる↓" .
24-
"<a href='" . CreateContentHREF($vars['rootContentPath']) . "'>TopPageに行く</a><br/>or";
24+
Localization\Localize('500.panelContentOnGameover',
25+
"Back to the main objectives. ↓" .
26+
"<a href='{0}'>Goto TopPage</a><br/>or",
27+
CreateContentHREF($vars['rootContentPath']));
2528

2629
require(FRONTEND_DIR . '/error-page.php');

0 commit comments

Comments
 (0)