diff --git a/Web/Presenters/templates/NoSpam/Templates.xml b/Web/Presenters/templates/NoSpam/Templates.xml index a86df534..e2936b15 100644 --- a/Web/Presenters/templates/NoSpam/Templates.xml +++ b/Web/Presenters/templates/NoSpam/Templates.xml @@ -76,7 +76,7 @@ {_roll_back} - {roll_backed} + {_roll_backed} diff --git a/Web/Presenters/templates/Photos/Album.xml b/Web/Presenters/templates/Photos/Album.xml index 1bd49a6f..0c919e90 100644 --- a/Web/Presenters/templates/Photos/Album.xml +++ b/Web/Presenters/templates/Photos/Album.xml @@ -41,7 +41,7 @@ - {$photo->getDescription()} + {$photo->getDescription()} {/foreach} diff --git a/Web/Presenters/templates/Photos/Photo.xml b/Web/Presenters/templates/Photos/Photo.xml index 47384415..e3ecaf9c 100644 --- a/Web/Presenters/templates/Photos/Photo.xml +++ b/Web/Presenters/templates/Photos/Photo.xml @@ -27,10 +27,10 @@
-
+
{include "../components/comments.xml", comments => $comments, count => $cCount, page => $cPage, model => "photos", parent => $photo, custom_id => 999}
-
+

{_information}

{_info_description}: @@ -42,7 +42,7 @@

{_actions}

- {if $thisUser->getId() != $photo->getOwner()->getId()} + {if isset($thisUser) && $thisUser->getId() != $photo->getOwner()->getId()} {var canReport = true} {/if}
diff --git a/Web/Presenters/templates/Wall/Post.xml b/Web/Presenters/templates/Wall/Post.xml index bd40b6c5..6ce9edd9 100644 --- a/Web/Presenters/templates/Wall/Post.xml +++ b/Web/Presenters/templates/Wall/Post.xml @@ -35,7 +35,7 @@ {_delete} {$comment->getText()|noescape} -
-
- {include "attachment.xml", attachment => $attachment, parent => $comment, parentType => "comment"} + {var $attachmentsLayout = $comment->getChildrenWithLayout(288)} +
+
+ {include "attachment.xml", attachment => $attachment[2], parent => $comment, parentType => "comment"} +
+
+ +
+
+ {include "attachment.xml", attachment => $attachment, post => $comment}
diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index da4b6b33..39ee2199 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -22,20 +22,6 @@ function trim(string) { return newStr; } -/*function handleVideoTAreaUpdate(event, id) { - console.log(event, id); - let indicator = u("#post-buttons" + id + " .post-upload"); - let file = event.target.files[0]; - if(typeof file === "undefined") { - indicator.attr("style", "display: none;"); - } else { - u("span", indicator.nodes[0]).text("Видеолента: " + trim(file.name) + " (" + humanFileSize(file.size, false) + ")"); - indicator.attr("style", "display: block;"); - } - - document.querySelector("#post-buttons" + id + " #wallAttachmentMenu").classList.add("hidden"); -}*/ - function initGraffiti(id) { let canvas = null; let msgbox = MessageBox(tr("draw_graffiti"), "
", [tr("save"), tr("cancel")], [function() { @@ -202,7 +188,7 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") { */ e.preventDefault(); - if(u(".ovk-photo-view").length > 0) return false; + if(u(".ovk-photo-view").length > 0) u(".ovk-photo-view-dimmer").remove(); // Значения для переключения фоток @@ -221,7 +207,7 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") {
@@ -235,6 +221,7 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") {
`); u("body").addClass("dimmed").append(dialog); + document.querySelector("html").style.overflowY = "hidden" let button = u("#ovk-photo-close"); @@ -242,13 +229,14 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") { let __closeDialog = () => { u("body").removeClass("dimmed"); u(".ovk-photo-view-dimmer").remove(); + document.querySelector("html").style.overflowY = "scroll" }; __closeDialog(); }); function __reloadTitleBar() { - u("#photo_com_title_photos").last().innerHTML = "Фотография " + imagesIndex + " из " + imagesCount; + u("#photo_com_title_photos").last().innerHTML = imagesCount > 1 ? tr("photo_x_from_y", imagesIndex, imagesCount) : tr("photo"); } function __loadDetails(photo_id, index) { @@ -268,6 +256,20 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") { if(index == imagesIndex) { u(".ovk-photo-details").last().innerHTML = element.innerHTML; } + + document.querySelectorAll(".ovk-photo-details .bsdn").forEach(bsdnInitElement) + document.querySelectorAll(".ovk-photo-details script").forEach(scr => { + // stolen from #953 + let newScr = document.createElement('script') + + if(scr.src) { + newScr.src = scr.src + } else { + newScr.textContent = scr.textContent + } + + document.querySelector(".ovk-photo-details").appendChild(newScr); + }) } ] } diff --git a/Web/static/js/messagebox.js b/Web/static/js/messagebox.js index 368311dd..e56c720f 100644 --- a/Web/static/js/messagebox.js +++ b/Web/static/js/messagebox.js @@ -20,9 +20,12 @@ function MessageBox(title, body, buttons, callbacks) { button.on("click", function(e) { let __closeDialog = () => { - u("body").removeClass("dimmed"); + if(document.querySelector(".ovk-photo-view-dimmer") == null) { + u("body").removeClass("dimmed"); + document.querySelector("html").style.overflowY = "scroll" + } + u(".ovk-diag-cont").remove(); - document.querySelector("html").style.overflowY = "scroll" }; Reflect.apply(callbacks[callback], { diff --git a/Web/static/js/openvk.cls.js b/Web/static/js/openvk.cls.js index 22144cfc..b131bfa0 100644 --- a/Web/static/js/openvk.cls.js +++ b/Web/static/js/openvk.cls.js @@ -68,7 +68,7 @@ function toggleMenu(id) { } document.addEventListener("DOMContentLoaded", function() { //BEGIN - u("#_photoDelete").on("click", function(e) { + $(document).on("click", "#_photoDelete", function(e) { var formHtml = "
"; formHtml += ""; formHtml += "
"; diff --git a/locales/en.strings b/locales/en.strings index 89de34c8..b1d211d1 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -347,6 +347,7 @@ "albums" = "Albums"; "album" = "Album"; "photos" = "photos"; +"photo" = "Photo"; "create_album" = "Create album"; "edit_album" = "Edit album"; "edit_photo" = "Edit photo"; @@ -425,6 +426,8 @@ "error_uploading_photo" = "Error when uploading photo. Error text: "; "too_many_photos" = "Too many photos."; +"photo_x_from_y" = "Photo $1 from $2"; + /* Notes */ "notes" = "Notes"; diff --git a/locales/ru.strings b/locales/ru.strings index 9a69c804..49871399 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -329,6 +329,7 @@ "album" = "Альбом"; "albums" = "Альбомы"; "photos" = "фотографий"; +"photo" = "Фотография"; "create_album" = "Создать альбом"; "edit_album" = "Редактировать альбом"; "edit_photo" = "Изменить фотографию"; @@ -407,6 +408,8 @@ "error_uploading_photo" = "Не удалось загрузить фотографию. Текст ошибки: "; "too_many_photos" = "Слишком много фотографий."; +"photo_x_from_y" = "Фотография $1 из $2"; + /* Notes */ "notes" = "Заметки";