- {$author->getCanonicalName()}
+ {$author->getCanonicalName()}
{if $post->isDeactivationMessage()}
{$author->isFemale() ? tr($deac . "_f") : tr($deac . "_m")}
@@ -92,7 +92,10 @@
{/if}
{if !($forceNoEditLink ?? false) && $post->canBeEditedBy($thisUser)}
- {_edit} |
+ getTargetWall() < 0}data-fromgroup="{(int)$post->isPostedOnBehalfOfGroup()}"{/if}>{_edit} |
{/if}
{if !($forceNoDeleteLink ?? false) && $post->canBeDeletedBy($thisUser)}
diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js
index a84a0ad2..93e209b0 100644
--- a/Web/static/js/al_wall.js
+++ b/Web/static/js/al_wall.js
@@ -271,10 +271,22 @@ $(document).on("click", "#editPost", (e) => {
if(content.querySelector("textarea") == null) {
content.insertAdjacentHTML("afterbegin", `
-

-
-
-
+
+
`)
@@ -295,7 +307,11 @@ $(document).on("click", "#editPost", (e) => {
}
xhr.onerror = () => {
- MessageBox(tr("error"), "unknown error occured", tr("ok"), (() => {Function.noop}))
+ MessageBox(tr("error"), "unknown error occured", [tr("ok")], [() => {Function.noop}])
+ }
+
+ xhr.ontimeout = () => {
+ MessageBox(tr("error"), "Try to refresh page", [tr("ok")], [() => {Function.noop}])
}
xhr.onload = () => {
@@ -310,6 +326,23 @@ $(document).on("click", "#editPost", (e) => {
(${tr("edited_short")})
`)
}
+
+ if(e.currentTarget.dataset.nsfw != null) {
+ e.currentTarget.setAttribute("data-nsfw", result.nsfw)
+
+ if(result.nsfw == 0) {
+ post.classList.remove("post-nsfw")
+ } else {
+ post.classList.add("post-nsfw")
+ }
+ }
+
+ if(e.currentTarget.dataset.fromgroup != null) {
+ e.currentTarget.setAttribute("data-fromgroup", result.from_group)
+ }
+
+ post.querySelector(".post-avatar").setAttribute("src", result.author.avatar)
+ post.querySelector(".post-author-name").innerHTML = result.author.name
} else {
MessageBox(tr("error"), result.error, [tr("ok")], [Function.noop])
post.querySelector("#editPost").click()
@@ -317,7 +350,12 @@ $(document).on("click", "#editPost", (e) => {
}
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
- xhr.send("postid="+e.currentTarget.dataset.id+"&newContent="+nwcntnt+"&hash="+encodeURIComponent(u("meta[name=csrf]").attr("value"))+"&type="+type)
+ xhr.send("postid="+e.currentTarget.dataset.id+
+ "&newContent="+nwcntnt+
+ "&hash="+encodeURIComponent(u("meta[name=csrf]").attr("value"))+
+ "&type="+type+
+ "&nsfw="+(content.querySelector("#nswfw") != null ? content.querySelector("#nswfw").checked : 0)+
+ "&fromgroup="+(content.querySelector("#fromgroup") != null ? content.querySelector("#fromgroup").checked : 0))
})
text.style.display = "none"
+
+
+
+
+ ${e.currentTarget.dataset.nsfw != null ? `
+
+
+
+ ` : ``}
+ ${e.currentTarget.dataset.fromgroup != null ? `
+
+
+
+ ` : ``}