summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-05-20 22:49:00 +0200
committerRaindropsSys <contact@minteck.org>2023-05-20 22:49:00 +0200
commit7348d637ca1b4b5ad6bf840adb409eed7cc8d9ec (patch)
tree84f02d57c235106a0eb2bb494c2d9a735f0a37be
parente065ee34ea4702ebca9372966280f380f9ea00a4 (diff)
downloaddelta-7348d637ca1b4b5ad6bf840adb409eed7cc8d9ec.tar.gz
delta-7348d637ca1b4b5ad6bf840adb409eed7cc8d9ec.tar.bz2
delta-7348d637ca1b4b5ad6bf840adb409eed7cc8d9ec.zip
Updated 14 files and added 2 files (automated)
-rw-r--r--_edit/index.php97
-rw-r--r--_edit/save/index.php51
-rw-r--r--_icons/_mdi/preview.svg1
-rw-r--r--_icons/preview.svg1
-rw-r--r--admin/approve/index.php5
-rw-r--r--admin/reject/index.php5
-rw-r--r--admin/requests/index.php10
-rw-r--r--includes/editor.php14
-rw-r--r--includes/email.html2
-rw-r--r--includes/header.php5
-rw-r--r--includes/navigation.php2
-rw-r--r--lang/en.json15
-rw-r--r--lang/fr.json9
-rw-r--r--logo.svg12
-rw-r--r--request/index.php2
-rw-r--r--version2
16 files changed, 165 insertions, 68 deletions
diff --git a/_edit/index.php b/_edit/index.php
index c2b72ff..330e8b3 100644
--- a/_edit/index.php
+++ b/_edit/index.php
@@ -45,20 +45,35 @@ if (isset($id)) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
-if (!isset($_PROFILE["requests"][$id])):
?>
<form method="post" action="/_edit/save/?id=<?= $id ?>" id="main-form">
<div class="container">
<br><br>
+
+ <img src="/icons/save.svg" alt="" style="position: fixed; z-index: 99999999; opacity: 0; pointer-events: none;">
+ <img src="/icons/save.svg?p" alt="" style="position: fixed; z-index: 99999999; opacity: 0; pointer-events: none;">
+
<h1 id="btn-area-container" style="display: grid; grid-template-columns: 1fr max-content;">
<?php if ($id !== $_USER): ?>
<span><?= getNameFromId($id) ?></span>
<?php else: ?>
<span><?= $data["nick_name"] ?? $data["first_name"] . " " . $data["last_name"] ?><?php if (isset($data["nick_name"]) && trim($data["nick_name"]) !== ""): ?> <small><small><small>(<?= $data["first_name"] . " " . $data["last_name"] ?>)</small></small></small><?php endif; ?></span>
<?php endif; ?>
- <span id="btn-area" class="btn-group"><a style="height: 38px;" id="form-btn" title="<?= l("lang_edit_save") ?>" class="btn btn-outline-primary btn-with-img <?= $_PROFILE["blocked"] >= 2 ? "disabled" : "" ?>" data-bs-toggle="tooltip"><img src="/icons/save.svg<?= $_PROFILE["blocked"] >= 2 ? "" : "?p" ?>" style="width: 24px;"></a><a style="height: 38px;" href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : "articles" ?>/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_edit_cancel") ?>" data-bs-toggle="tooltip"><img src="/icons/close.svg" style="width: 24px;"></a></span>
+ <span id="btn-area" class="btn-group"><a style="height: 38px;" id="form-btn" title="<?= l("lang_edit_save") ?>" class="btn btn-outline-primary btn-with-img disabled" data-bs-toggle="tooltip"><img id="save-icon" src="/icons/save.svg" style="width: 24px;"></a><a style="height: 38px;" onclick="preview();" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_edit_preview") ?>" data-bs-toggle="tooltip"><img src="/icons/preview.svg" style="width: 24px;"></a><a style="height: 38px;" href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : "articles" ?>/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_edit_cancel") ?>" data-bs-toggle="tooltip"><img src="/icons/close.svg" style="width: 24px;"></a></span>
</h1>
+ <?php if (isset($_PROFILE["requests"][$id])): ?>
+ <div class="alert alert-secondary">
+ <p><b><?= l("lang_edit_alert_title") ?></b></p>
+ <?php
+
+ $request = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $_PROFILE["requests"][$id] . ".json")), true);
+
+ ?>
+ <?= str_replace("%1", timeAgo($request["date"]), l("lang_edit_alert_message")) ?>
+ </div>
+ <?php endif; ?>
+
<?php if ($self && $_PROFILE["blocked"] === 1): ?>
<div class="alert alert-danger"><p><?= l("lang_blocked_own") ?></p><?= l("lang_blocked_error") ?></div>
<?php elseif ($_PROFILE["blocked"] >= 2): ?>
@@ -66,12 +81,26 @@ if (!isset($_PROFILE["requests"][$id])):
<?php else: ?>
<div>
<!--suppress HtmlFormInputWithoutLabel -->
- <textarea name="contents" id="editor-box" style="display: none;"><?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?><?= $data["contents"] ?><?php endif; ?></textarea>
+ <textarea name="contents" id="editor-box" style="display: none;"><?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?><?= isset($_PROFILE["requests"][$id]) ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $_PROFILE["requests"][$id] . ".json"), true)["contents"] : $data["contents"] ?><?php endif; ?></textarea>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/editor.php"; ?>
<script>
+ let originalContent = document.getElementById("editor-box").innerText;
+
+ window.oneditorchange = (content) => {
+ if (content !== originalContent) {
+ document.getElementById("form-btn").classList.remove("disabled");
+ document.getElementById("save-icon").src = "/icons/save.svg?p";
+ startHook();
+ } else {
+ document.getElementById("form-btn").classList.add("disabled");
+ document.getElementById("save-icon").src = "/icons/save.svg";
+ stopHook();
+ }
+ }
+
document.getElementById("form-btn").onclick = (event) => {
new bootstrap.Modal(document.getElementById("<?= $id !== $_USER ? "confirm" : "confirm2" ?>")).show()
}
@@ -94,15 +123,28 @@ if (!isset($_PROFILE["requests"][$id])):
<p>
<?= l("lang_edit_confirm_summary") ?><br>
<!--suppress HtmlFormInputWithoutLabel -->
- <textarea class="form-control" name="summary"></textarea>
+ <textarea class="form-control" name="summary"><?= isset($_PROFILE["requests"][$id]) ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $_PROFILE["requests"][$id] . ".json"), true)["summary"] : "" ?></textarea>
</p>
<p><?= l("lang_edit_confirm_followup") ?></p>
- <button class="btn btn-primary"><?= l("lang_edit_confirm_button") ?></button>
+ <button class="btn btn-primary" onclick="stopHook();"><?= l("lang_edit_confirm_button") ?></button>
</div>
</div>
</div>
</div>
+ <div class="modal fade" id="preview">
+ <div class="modal-dialog modal-xl">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title"><?= l("lang_edit_preview") ?></h4>
+ <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+ </div>
+
+ <div class="modal-body" id="page-preview"></div>
+ </div>
+ </div>
+ </div>
+
<div class="modal fade" id="confirm2">
<div class="modal-dialog">
<div class="modal-content">
@@ -119,34 +161,31 @@ if (!isset($_PROFILE["requests"][$id])):
</div>
</div>
</div>
-</form>
-<?php else: ?>
- <div class="container">
- <br><br>
- <h1 id="btn-area-container" style="display: grid; grid-template-columns: 1fr max-content;">
- <?php if ($id !== $_USER): ?>
- <span><?= getNameFromId($id) ?></span>
- <?php else: ?>
- <span><?= $data["nick_name"] ?? $data["first_name"] . " " . $data["last_name"] ?><?php if (isset($data["nick_name"]) && trim($data["nick_name"]) !== ""): ?> <small><small><small>(<?= $data["first_name"] . " " . $data["last_name"] ?>)</small></small></small><?php endif; ?></span>
- <?php endif; ?>
- <span id="btn-area" class="btn-group"><a style="height: 38px;" id="form-btn" title="<?= l("lang_edit_save") ?>" class="btn btn-outline-primary btn-with-img disabled" data-bs-toggle="tooltip"><img src="/icons/save.svg" style="width: 24px;"></a><a style="height: 38px;" href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : "articles" ?>/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_edit_cancel") ?>" data-bs-toggle="tooltip"><img src="/icons/close.svg" style="width: 24px;"></a></span>
- </h1>
- <div class="alert alert-warning">
- <p><b><?= l("lang_edit_alert_title") ?></b></p>
- <?php
+ <script>
+ let hook = false;
- $request = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $_PROFILE["requests"][$id] . ".json")), true);
+ window.onbeforeunload = function() {
+ if (hook) {
+ return "";
+ }
+ }
- ?>
- <p><?= str_replace("%1", timeAgo($request["date"]), l("lang_edit_alert_message")) ?></p>
- <?= l("lang_edit_alert_contents") ?>
- </div>
+ function startHook() {
+ hook = true;
+ }
- <?= doLinking($request["contents"]) ?>
+ function stopHook() {
+ hook = false;
+ }
- <br><br>
- </div>
-<?php endif; ?>
+ let _preview = new bootstrap.Modal(document.getElementById("preview"));
+
+ function preview() {
+ document.getElementById("page-preview").innerHTML = editor.getData();
+ _preview.show();
+ }
+ </script>
+</form>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php"; ?> \ No newline at end of file
diff --git a/_edit/save/index.php b/_edit/save/index.php
index 3e16871..9216535 100644
--- a/_edit/save/index.php
+++ b/_edit/save/index.php
@@ -20,17 +20,16 @@ if (isset($id)) {
die();
}
-if (isset($_PROFILE["requests"][$id])) {
- header("Location: /edit/" . $id);
- die();
-}
-
if (isset($_POST["contents"])) {
$_POST["contents"] = str_replace("https://delta-staging.equestria.dev/", "/", str_replace("https://delta.equestria.dev/", "/", str_replace("https://" . $_SERVER['HTTP_HOST'] . "/", "/", str_replace("http://" . $_SERVER['HTTP_HOST'] . "/", "/", str_replace("<script>", "&lt;script&gt;", $_POST["contents"])))));
}
$rid = uuid();
+if (isset($_PROFILE["requests"][$id])) {
+ $rid = $_PROFILE["requests"][$id];
+}
+
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json")) {
if ($_PROFILE["blocked"] >= $blockLevel) die();
@@ -76,19 +75,35 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".j
$config = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/email.json"), true);
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") || file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gallery/" . $id . ".json") || file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/articles/" . $id . ".json")) {
- file_get_contents('https://notifications.equestria.dev/delta', false, stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: " . formatPonypush("New change request published") . "\r\n" .
- "Priority: default\r\n" .
- "Tags: requests\r\n" .
- "Actions: view, Open change requests, https://delta.equestria.dev/admin/requests/, clear=true\r\n" .
- "Authorization: Basic " . base64_encode($config["ntfyuser"] . ":" . $config["ntfypass"]),
- 'content' => formatPonypush($_PROFILE['first_name'] . " " . $_PROFILE["last_name"] . " published a request to change " . getNameFromId($id) . (isset($_POST["summary"]) && trim($_POST["summary"]) !== "" ? ": " . $_POST["summary"] : ""))
- ]
- ]));
+ if (isset($_PROFILE["requests"][$id])) {
+ file_get_contents('https://notifications.equestria.dev/delta', false, stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: " . formatPonypush("Change request edited") . "\r\n" .
+ "Priority: default\r\n" .
+ "Tags: requests\r\n" .
+ "Actions: view, Open change requests, https://delta.equestria.dev/admin/requests/, clear=true\r\n" .
+ "Authorization: Basic " . base64_encode($config["ntfyuser"] . ":" . $config["ntfypass"]),
+ 'content' => formatPonypush($_PROFILE['first_name'] . " " . $_PROFILE["last_name"] . " edited their request to change " . getNameFromId($id) . (isset($_POST["summary"]) && trim($_POST["summary"]) !== "" ? ": " . $_POST["summary"] : ""))
+ ]
+ ]));
+ } else {
+ file_get_contents('https://notifications.equestria.dev/delta', false, stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: " . formatPonypush("New change request published") . "\r\n" .
+ "Priority: default\r\n" .
+ "Tags: requests\r\n" .
+ "Actions: view, Open change requests, https://delta.equestria.dev/admin/requests/, clear=true\r\n" .
+ "Authorization: Basic " . base64_encode($config["ntfyuser"] . ":" . $config["ntfypass"]),
+ 'content' => formatPonypush($_PROFILE['first_name'] . " " . $_PROFILE["last_name"] . " published a request to change " . getNameFromId($id) . (isset($_POST["summary"]) && trim($_POST["summary"]) !== "" ? ": " . $_POST["summary"] : ""))
+ ]
+ ]));
+ }
}
if ($id === $_USER) {
diff --git a/_icons/_mdi/preview.svg b/_icons/_mdi/preview.svg
new file mode 100644
index 0000000..61ab204
--- /dev/null
+++ b/_icons/_mdi/preview.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><path d="M19,3H5C3.89,3,3,3.9,3,5v14c0,1.1,0.89,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.11,3,19,3z M19,19H5V7h14V19z M13.5,13 c0,0.83-0.67,1.5-1.5,1.5s-1.5-0.67-1.5-1.5c0-0.83,0.67-1.5,1.5-1.5S13.5,12.17,13.5,13z M12,9c-2.73,0-5.06,1.66-6,4 c0.94,2.34,3.27,4,6,4s5.06-1.66,6-4C17.06,10.66,14.73,9,12,9z M12,15.5c-1.38,0-2.5-1.12-2.5-2.5c0-1.38,1.12-2.5,2.5-2.5 c1.38,0,2.5,1.12,2.5,2.5C14.5,14.38,13.38,15.5,12,15.5z"/></g></svg> \ No newline at end of file
diff --git a/_icons/preview.svg b/_icons/preview.svg
new file mode 100644
index 0000000..d8828f8
--- /dev/null
+++ b/_icons/preview.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48"><path d="M223 900q-27.5 0-47.25-19.75T156 833V319q0-27.5 19.75-47.25T223 252h514q27.5 0 47.25 19.75T804 319v514q0 27.5-19.75 47.25T737 900H223Zm0-35h514q14 0 23-9t9-23V372H191v461q0 14 9 23t23 9Zm257.16-137q-60.768 0-110.969-30.82Q318.99 666.359 292 616.004q26.99-50.799 77.03-82.401Q419.071 502 479.84 502q60.768 0 110.969 31.598Q641.01 565.197 669 616.151q-27.99 50.511-78.03 81.18Q540.929 728 480.16 728Zm.273-38q42.216 0 80.171-19.265Q598.559 651.47 628 616q-29.102-35.35-67.54-55.675Q522.021 540 479.686 540t-80.459 20.325Q361.102 580.65 333 616q28.536 35.47 66.877 54.735Q438.217 690 480.433 690ZM480 616Zm.294 42Q497 658 509.5 645.206t12.5-29.5Q522 599 509.206 586.5t-29.5-12.5Q463 574 450.5 586.794t-12.5 29.5Q438 633 450.794 645.5t29.5 12.5Z" fill="#000000"/></svg> \ No newline at end of file
diff --git a/admin/approve/index.php b/admin/approve/index.php
index 010aba4..fdca968 100644
--- a/admin/approve/index.php
+++ b/admin/approve/index.php
@@ -19,6 +19,11 @@ if (isset($id)) {
$request = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $id . ".json")), true);
+if (isset($_GET["md5"]) && $_GET["md5"] !== md5(json_encode($request))) {
+ header("Location: /admin/requests/?modified");
+ die();
+}
+
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")) {
while (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")) === "") {}
diff --git a/admin/reject/index.php b/admin/reject/index.php
index aee5074..ac33eb4 100644
--- a/admin/reject/index.php
+++ b/admin/reject/index.php
@@ -19,6 +19,11 @@ if (isset($id)) {
$request = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $id . ".json")), true);
+if (isset($_GET["md5"]) && $_GET["md5"] !== md5(json_encode($request))) {
+ header("Location: /admin/requests/?modified");
+ die();
+}
+
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")) {
while (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")) === "") {}
diff --git a/admin/requests/index.php b/admin/requests/index.php
index 233d751..fe7491e 100644
--- a/admin/requests/index.php
+++ b/admin/requests/index.php
@@ -13,6 +13,12 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
<a href="/admin">← <?= l("lang_admin_title") ?></a>
<h1><?= l("lang_admin_titles_requests") ?></h1>
+ <?php if (isset($_GET["modified"])): ?>
+ <div class="alert alert-warning">
+ <b><?= l("lang_admin_modified_title") ?> </b><?= l("lang_admin_modified_description") ?>
+ </div>
+ <?php endif; ?>
+
<?php
$requestsNonPlus = array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests"), function ($i) { return !str_starts_with($i, "."); });
@@ -44,12 +50,14 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
$i = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
$i["_id"] = explode(".", $id)[0];
$i["_plus"] = true;
+ $i["_original"] = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$id")), true);
return $i;
}, $requestsPlus), ...array_map(function ($i) {
$id = $i;
$i = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$i")), true);
$i["_id"] = explode(".", $id)[0];
$i["_plus"] = false;
+ $i["_original"] = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/$id")), true);
return $i;
}, $requestsNonPlus)];
@@ -84,7 +92,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
<pre>[<?= l("lang_admin_requests_empty") ?>]</pre>
<?php endif; ?>
- <a class="btn btn-outline-success" href="/admin/approve/?id=<?= $request["_id"] ?>"><?php if ($request["type"] !== "article" && $request["type"] !== "gallerymeta" && $request["type"] !== "galleryupload" && $request["type"] !== "userpage"): ?><?= l("lang_admin_requests_mark") ?><?php else: ?><?= l("lang_admin_requests_merge") ?><?php endif; ?></a><?php if (!($request["type"] !== "article" && $request["type"] !== "gallerymeta" && $request["type"] !== "galleryupload" && $request["type"] !== "userpage")): ?> <a href="/admin/approve/?id=<?= $request["_id"] ?>&mark" class="btn btn-outline-warning"><?= l("lang_admin_requests_mark") ?></a><?php endif; ?> <a href="/admin/reject/?id=<?= $request["_id"] ?>" class="btn btn-outline-danger"><?= l("lang_admin_requests_reject") ?></a><br>
+ <a class="btn btn-outline-success" href="/admin/approve/?id=<?= $request["_id"] ?>&md5=<?= md5(json_encode($request["_original"])) ?>"><?php if ($request["type"] !== "article" && $request["type"] !== "gallerymeta" && $request["type"] !== "galleryupload" && $request["type"] !== "userpage"): ?><?= l("lang_admin_requests_mark") ?><?php else: ?><?= l("lang_admin_requests_merge") ?><?php endif; ?></a><?php if (!($request["type"] !== "article" && $request["type"] !== "gallerymeta" && $request["type"] !== "galleryupload" && $request["type"] !== "userpage")): ?> <a href="/admin/approve/?id=<?= $request["_id"] ?>&mark&md5=<?= md5(json_encode($request["_original"])) ?>" class="btn btn-outline-warning"><?= l("lang_admin_requests_mark") ?></a><?php endif; ?> <a href="/admin/reject/?id=<?= $request["_id"] ?>&md5=<?= md5(json_encode($request["_original"])) ?>" class="btn btn-outline-danger"><?= l("lang_admin_requests_reject") ?></a><br>
<small class="text-muted">*<?= l("lang_admin_requests_notify") ?><?php if ($request["type"] !== "article" && $request["type"] !== "gallerymeta" && $request["type"] !== "galleryupload" && $request["type"] !== "userpage"): ?> <span class="text-warning">*<?= l("lang_admin_requests_manual") ?></span><?php endif; ?></small>
</div>
</details>
diff --git a/includes/editor.php b/includes/editor.php
index c3a4a56..b697254 100644
--- a/includes/editor.php
+++ b/includes/editor.php
@@ -3,6 +3,7 @@
<script>
let editor;
+ let lastData = null;
ClassicEditor
.create(document.querySelector( '#editor-box' ), {
@@ -25,7 +26,18 @@
fullPage: true
})
.then((newEditor) => {
- editor = newEditor;
+ editor = window.error = newEditor;
+
+ setInterval(() => {
+ if (lastData) {
+ if (lastData !== editor.getData()) {
+ if (window.oneditorchange) window.oneditorchange(editor.getData());
+ lastData = editor.getData();
+ }
+ } else {
+ lastData = editor.getData();
+ }
+ });
})
</script>
<style>
diff --git a/includes/email.html b/includes/email.html
index 2980f93..7e3606d 100644
--- a/includes/email.html
+++ b/includes/email.html
@@ -1,5 +1,5 @@
<div style="background-color:#eee;margin:10px;border-radius: 10px;padding:50px 0;">
- <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6dXJsKCNTVkdJRF8xXyk7fQo8L3N0eWxlPgo8bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzFfIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjczLjYxOTUiIHkxPSIxODYuOTE2NyIgeDI9IjQzNy41NzkyIiB5Mj0iNTUwLjg3NjUiPgoJPHN0b3AgIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6I0U0NDg1NyIvPgoJPHN0b3AgIG9mZnNldD0iMC41IiBzdHlsZT0ic3RvcC1jb2xvcjojQzcxMUUxIi8+Cgk8c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojN0Y1MkZGIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMzcuNywyNC4zTDE0LjEsNDcyLjFDNy41LDQ4NS40LDE3LjIsNTAxLDMyLDUwMWg0NDcuMWMxNC45LDAsMjQuNS0xNS42LDE3LjktMjguOUwyNzMuNSwyNC4zCglDMjY2LjEsOS42LDI0NS4xLDkuNiwyMzcuNywyNC4zeiIvPgo8L3N2Zz4K" style="width: 64px; height: 64px; display: block; margin-left: auto; margin-right: auto;">
+ <img src="data:image/png" style="width: 64px; height: 64px; display: block; margin-left: auto; margin-right: auto;">
</div>
<div style="font-family: sans-serif; margin-top: 50px;padding:50px;" class="container">
diff --git a/includes/header.php b/includes/header.php
index 303fa14..811b224 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -659,7 +659,7 @@ if (isset($_GET["__"])) {
background-color: #<?= $palette[6] ?>;
}
- .list-group-item-action.list-group-item-primary:hover {
+ .list-group-item-action.list-group-item-primary:hover, .list-group-item-action.list-group-item-primary:active, .list-group-item-action.list-group-item-primary:focus {
background-color: #<?= $palette[6] ?>dd;
color: var(--bs-body-bg);
}
@@ -867,5 +867,4 @@ if (isset($_GET["__"])) {
</style>
<?php endif; ?>
-<div class="bg-white">
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/oobe.php"; ?> \ No newline at end of file
+<div class="bg-white"> \ No newline at end of file
diff --git a/includes/navigation.php b/includes/navigation.php
index 186f779..34fc557 100644
--- a/includes/navigation.php
+++ b/includes/navigation.php
@@ -346,4 +346,6 @@
}
</script>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/oobe.php"; ?>
+
<div id="page"> \ No newline at end of file
diff --git a/lang/en.json b/lang/en.json
index 8cdf6f9..91235bd 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -201,16 +201,17 @@
"save": "Publish change request",
"confirm": {
"title": "Publish this change request",
- "description": "Do you want to publish your changes to be reviewed by the administrators? After you have published your request, you won't be able to make any more changes to the document.",
+ "description": "Do you want to publish your changes to be reviewed by the administrators? After you have published your request, you will be able to make more changes to the document.",
"summary": "Describe changes you made to this document:",
"followup": "You will receive an alert when your change is approved or rejected.",
"button": "Publish"
},
"alert": {
"title": "You have a pending change request for this content",
- "message": "You have published a change request for this content %1. You need to wait for that change request to be reviewed by the administrators before you can publish another change request.",
- "contents": "Below is the contents of your change request."
- }
+ "message": "You have published a change request for this content %1. You can continue changing it until the administrators have reviewed it.",
+ "message2": "You have published a change request for this content %1. You need to wait for that change request to be reviewed by the administrators before you can publish another change request."
+ },
+ "preview": "Changes preview"
},
"request": {
"title": "Create a change request",
@@ -1065,7 +1066,11 @@
"manual": "Manual changes required",
"notify": "Author will be notified of the decision taken"
},
- "search": "Search objects in the Delta database..."
+ "search": "Search objects in the Delta database...",
+ "modified": {
+ "title": "Unable to change this request:",
+ "description": "You cannot change this request as it was modified while you were reviewing it. Please review the request again."
+ }
},
"oobe": {
"next": "Next",
diff --git a/lang/fr.json b/lang/fr.json
index a2a1376..636b09f 100644
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -201,16 +201,17 @@
"save": "Publier la demande",
"confirm": {
"title": "Publier cette demande de changement",
- "description": "Voulez-vous publier vos changements pour être relus par les administrateur·ice·s ? Après avoir publié votre demande, vous ne pourrez plus apporter d'autres changements à ce document.",
+ "description": "Voulez-vous publier vos changements pour être relus par les administrateur·ice·s ? Après avoir publié votre demande, vous pourrez apporter d'autres changements à ce document.",
"summary": "Décrivez les changements que vous avez apporté :",
"followup": "Vous recevrez une alerte lorsque votre changement est approuvé ou rejeté.",
"button": "Publier"
},
"alert": {
"title": "Vous avez une demande de changement pour ce contenu",
- "message": "Vous avez publié une demande de changement pour ce contenu %1. Vous devez attendre que cette demande soit relue par les administrateur·ice·s avant de pouvoir en publier une nouvelle.",
- "contents": "Ci-dessous est le contenu de votre demande."
- }
+ "message": "Vous avez publié une demande de changement pour ce contenu %1. Vous pouvez continuer de la modifier jusqu'à ce que les administrateur·ice·s l'ait relue.",
+ "message2": "Vous avez publié une demande de changement pour ce contenu %1. Vous devez attendre que cette demande soit relue par les administrateur·ice·s avant de pouvoir en publier une nouvelle."
+ },
+ "preview": "Prévisualisation"
},
"request": {
"title": "Créer une demande de changement",
diff --git a/logo.svg b/logo.svg
index 1019d73..bec5ce9 100644
--- a/logo.svg
+++ b/logo.svg
@@ -1,15 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 26.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<style type="text/css">
.st0{fill:url(#SVGID_1_);}
+ .st1{opacity:0.2;fill:#FFFFFF;}
+ .st2{opacity:0.125;fill:#FFFFFF;}
</style>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="73.6195" y1="186.9167" x2="437.5792" y2="550.8765">
+<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="86.1471" y1="314.0248" x2="425.913" y2="-25.7412" gradientTransform="matrix(1 0 0 -1 0 511.8898)">
<stop offset="0" style="stop-color:#E44857"/>
<stop offset="0.5" style="stop-color:#C711E1"/>
<stop offset="1" style="stop-color:#7F52FF"/>
</linearGradient>
-<path class="st0" d="M237.7,24.3L14.1,472.1C7.5,485.4,17.2,501,32,501h447.1c14.9,0,24.5-15.6,17.9-28.9L273.5,24.3
- C266.1,9.6,245.1,9.6,237.7,24.3z"/>
+<path class="st0" d="M238.1,46.8L14.5,449.1c-6.6,11.9,3.1,26,17.9,26h447.1c14.9,0,24.5-14,17.9-26L273.9,46.8
+ C266.5,33.6,245.5,33.6,238.1,46.8z"/>
+<path class="st1" d="M256,37.4v289.2L15,465.8c-3-4.9-3.6-11-0.4-16.7L238.1,47.3C241.8,40.7,248.9,37.4,256,37.4z"/>
+<path class="st2" d="M497,465.8L256,326.6V37.4c7.1,0,14.2,3.3,17.9,9.9l223.5,401.8C500.6,454.8,500.1,460.9,497,465.8z"/>
</svg>
diff --git a/request/index.php b/request/index.php
index 6d8a3b5..087578e 100644
--- a/request/index.php
+++ b/request/index.php
@@ -58,7 +58,7 @@ if (!isset($_PROFILE["requests"]["r:" . $_GET['id']])):
$request = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $_PROFILE["requests"]["r:" . $_GET['id']] . ".json")), true);
?>
- <p><?= str_replace("%1", timeAgo($request["date"]), l("lang_edit_alert_message")) ?></p>
+ <p><?= str_replace("%1", timeAgo($request["date"]), l("lang_edit_alert_message2")) ?></p>
<?= l("lang_edit_alert_contents") ?>
</div>
diff --git a/version b/version
index 46584a8..83c6fcf 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-5.12.0-rc1 \ No newline at end of file
+5.1.12-rc1 \ No newline at end of file