This commit is contained in:
lalka2016 2023-09-24 10:58:03 +03:00
parent 0bfcadcde7
commit 54a70583ef
10 changed files with 47 additions and 29 deletions

View file

@ -76,7 +76,7 @@
<img src="/assets/packages/static/openvk/img/loading_mini.gif" style="width: 40px;"> <img src="/assets/packages/static/openvk/img/loading_mini.gif" style="width: 40px;">
</div> </div>
<a n:if="!$template->isRollbacked()" id="noSpam-rollback-template-link-{$template->getId()}" onClick="rollbackTemplate({$template->getId()})">{_roll_back}</a> <a n:if="!$template->isRollbacked()" id="noSpam-rollback-template-link-{$template->getId()}" onClick="rollbackTemplate({$template->getId()})">{_roll_back}</a>
<span n:attr="style => $template->isRollbacked() ? '' : 'display: none;'" id="noSpam-rollback-template-rollbacked-{$template->getId()}">{roll_backed}</span> <span n:attr="style => $template->isRollbacked() ? '' : 'display: none;'" id="noSpam-rollback-template-rollbacked-{$template->getId()}">{_roll_backed}</span>
</div> </div>
</td> </td>
</tr> </tr>

View file

@ -41,7 +41,7 @@
</a> </a>
<a href="/photo{$photo->getPrettyId()}?from=album{$album->getId()}"> <a href="/photo{$photo->getPrettyId()}?from=album{$album->getId()}">
<img class="album-photo--image" src="{$photo->getURL()}" alt="{$photo->getDescription()}" /> <img class="album-photo--image" src="{$photo->getURLBySizeId('tinier')}" alt="{$photo->getDescription()}" />
</a> </a>
</div> </div>
{/foreach} {/foreach}

View file

@ -27,10 +27,10 @@
<hr/> <hr/>
<div style="width: 100%; min-height: 100px;" class="ovk-photo-details"> <div style="width: 100%; min-height: 100px;" class="ovk-photo-details">
<div style="float: left; min-height: 100px; width: 70%;"> <div style="float: left; min-height: 100px; width: 68%;margin-left: 3px;">
{include "../components/comments.xml", comments => $comments, count => $cCount, page => $cPage, model => "photos", parent => $photo, custom_id => 999} {include "../components/comments.xml", comments => $comments, count => $cCount, page => $cPage, model => "photos", parent => $photo, custom_id => 999}
</div> </div>
<div style="float: left; min-height: 100px; width: 30%;"> <div style="float:right;min-height: 100px;width: 30%;margin-left: 1px;">
<div> <div>
<h4>{_information}</h4> <h4>{_information}</h4>
<span style="color: grey;">{_info_description}:</span> <span style="color: grey;">{_info_description}:</span>
@ -42,7 +42,7 @@
</div> </div>
<br/> <br/>
<h4>{_actions}</h4> <h4>{_actions}</h4>
{if $thisUser->getId() != $photo->getOwner()->getId()} {if isset($thisUser) && $thisUser->getId() != $photo->getOwner()->getId()}
{var canReport = true} {var canReport = true}
{/if} {/if}
<div n:if="isset($thisUser) && $thisUser->getId() === $photo->getOwner()->getId()"> <div n:if="isset($thisUser) && $thisUser->getId() === $photo->getOwner()->getId()">

View file

@ -35,7 +35,7 @@
<a n:if="$canDelete ?? false" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">{_delete}</a> <a n:if="$canDelete ?? false" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">{_delete}</a>
<a <a
n:if="$thisUser->getChandlerUser()->can('access')->model('admin')->whichBelongsTo(NULL) AND $post->getEditTime()" n:if="isset($thisUser) && $thisUser->getChandlerUser()->can('access')->model('admin')->whichBelongsTo(NULL) AND $post->getEditTime()"
style="display:block;width:96%;" style="display:block;width:96%;"
class="profile_link" class="profile_link"
href="/admin/logs?type=1&obj_type=Post&obj_id={$post->getId()}" href="/admin/logs?type=1&obj_type=Post&obj_id={$post->getId()}"

View file

@ -22,9 +22,16 @@
<div class="text" id="text{$comment->getId()}"> <div class="text" id="text{$comment->getId()}">
<span data-text="{$comment->getText(false)}" class="really_text">{$comment->getText()|noescape}</span> <span data-text="{$comment->getText(false)}" class="really_text">{$comment->getText()|noescape}</span>
<div n:ifcontent class="attachments_b"> {var $attachmentsLayout = $comment->getChildrenWithLayout(288)}
<div class="attachment" n:foreach="$comment->getChildren() as $attachment" data-localized-nsfw-text="{_nsfw_warning}"> <div n:ifcontent class="attachments attachments_b" style="height: {$attachmentsLayout->height|noescape}; width: {$attachmentsLayout->width|noescape};">
{include "attachment.xml", attachment => $attachment, parent => $comment, parentType => "comment"} <div class="attachment" n:foreach="$attachmentsLayout->tiles as $attachment" style="float: {$attachment[3]|noescape}; width: {$attachment[0]|noescape}; height: {$attachment[1]|noescape};" data-localized-nsfw-text="{_nsfw_warning}">
{include "attachment.xml", attachment => $attachment[2], parent => $comment, parentType => "comment"}
</div>
</div>
<div n:ifcontent class="attachments attachments_m">
<div class="attachment" n:foreach="$attachmentsLayout->extras as $attachment">
{include "attachment.xml", attachment => $attachment, post => $comment}
</div> </div>
</div> </div>
</div> </div>

View file

@ -22,20 +22,6 @@ function trim(string) {
return newStr; 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) { function initGraffiti(id) {
let canvas = null; let canvas = null;
let msgbox = MessageBox(tr("draw_graffiti"), "<div id='ovkDraw'></div>", [tr("save"), tr("cancel")], [function() { let msgbox = MessageBox(tr("draw_graffiti"), "<div id='ovkDraw'></div>", [tr("save"), tr("cancel")], [function() {
@ -202,7 +188,7 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") {
*/ */
e.preventDefault(); 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") {
<img src="/assets/packages/static/openvk/img/loading_mini.gif"> <img src="/assets/packages/static/openvk/img/loading_mini.gif">
</text> </text>
<div> <div>
<a id="ovk-photo-close">Закрыть</a> <a id="ovk-photo-close">${tr("close")}</a>
</div> </div>
</div> </div>
<center style="margin-bottom: 8pt;"> <center style="margin-bottom: 8pt;">
@ -235,6 +221,7 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") {
</div> </div>
</div>`); </div>`);
u("body").addClass("dimmed").append(dialog); u("body").addClass("dimmed").append(dialog);
document.querySelector("html").style.overflowY = "hidden"
let button = u("#ovk-photo-close"); let button = u("#ovk-photo-close");
@ -242,13 +229,14 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") {
let __closeDialog = () => { let __closeDialog = () => {
u("body").removeClass("dimmed"); u("body").removeClass("dimmed");
u(".ovk-photo-view-dimmer").remove(); u(".ovk-photo-view-dimmer").remove();
document.querySelector("html").style.overflowY = "scroll"
}; };
__closeDialog(); __closeDialog();
}); });
function __reloadTitleBar() { 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) { function __loadDetails(photo_id, index) {
@ -268,6 +256,20 @@ function OpenMiniature(e, photo, post, photo_id, type = "post") {
if(index == imagesIndex) { if(index == imagesIndex) {
u(".ovk-photo-details").last().innerHTML = element.innerHTML; 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);
})
} }
] ]
} }

View file

@ -20,9 +20,12 @@ function MessageBox(title, body, buttons, callbacks) {
button.on("click", function(e) { button.on("click", function(e) {
let __closeDialog = () => { let __closeDialog = () => {
if(document.querySelector(".ovk-photo-view-dimmer") == null) {
u("body").removeClass("dimmed"); u("body").removeClass("dimmed");
u(".ovk-diag-cont").remove();
document.querySelector("html").style.overflowY = "scroll" document.querySelector("html").style.overflowY = "scroll"
}
u(".ovk-diag-cont").remove();
}; };
Reflect.apply(callbacks[callback], { Reflect.apply(callbacks[callback], {

View file

@ -68,7 +68,7 @@ function toggleMenu(id) {
} }
document.addEventListener("DOMContentLoaded", function() { //BEGIN document.addEventListener("DOMContentLoaded", function() { //BEGIN
u("#_photoDelete").on("click", function(e) { $(document).on("click", "#_photoDelete", function(e) {
var formHtml = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >"; var formHtml = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >";
formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />"; formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />";
formHtml += "</form>"; formHtml += "</form>";

View file

@ -347,6 +347,7 @@
"albums" = "Albums"; "albums" = "Albums";
"album" = "Album"; "album" = "Album";
"photos" = "photos"; "photos" = "photos";
"photo" = "Photo";
"create_album" = "Create album"; "create_album" = "Create album";
"edit_album" = "Edit album"; "edit_album" = "Edit album";
"edit_photo" = "Edit photo"; "edit_photo" = "Edit photo";
@ -425,6 +426,8 @@
"error_uploading_photo" = "Error when uploading photo. Error text: "; "error_uploading_photo" = "Error when uploading photo. Error text: ";
"too_many_photos" = "Too many photos."; "too_many_photos" = "Too many photos.";
"photo_x_from_y" = "Photo $1 from $2";
/* Notes */ /* Notes */
"notes" = "Notes"; "notes" = "Notes";

View file

@ -329,6 +329,7 @@
"album" = "Альбом"; "album" = "Альбом";
"albums" = "Альбомы"; "albums" = "Альбомы";
"photos" = "фотографий"; "photos" = "фотографий";
"photo" = "Фотография";
"create_album" = "Создать альбом"; "create_album" = "Создать альбом";
"edit_album" = "Редактировать альбом"; "edit_album" = "Редактировать альбом";
"edit_photo" = "Изменить фотографию"; "edit_photo" = "Изменить фотографию";
@ -407,6 +408,8 @@
"error_uploading_photo" = "Не удалось загрузить фотографию. Текст ошибки: "; "error_uploading_photo" = "Не удалось загрузить фотографию. Текст ошибки: ";
"too_many_photos" = "Слишком много фотографий."; "too_many_photos" = "Слишком много фотографий.";
"photo_x_from_y" = "Фотография $1 из $2";
/* Notes */ /* Notes */
"notes" = "Заметки"; "notes" = "Заметки";