Compare commits

..

No commits in common. "a3843e8417359d086986f46245276ea23971506c" and "77c3c86031206dac3832e74a9242a1cd5198693b" have entirely different histories.

5 changed files with 22 additions and 45 deletions

View file

@ -28,7 +28,7 @@
<div style="width: 100%; min-height: 100px;" class="ovk-photo-details">
<div style="float: left; min-height: 100px; width: 70%;">
{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}
</div>
<div style="float: left; min-height: 100px; width: 30%;">
<div>

View file

@ -4,7 +4,7 @@
{var $commentsURL = "/al_comments/create/$model/" . $parent->getId()}
{var $club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club}
{if !$readOnly}
{include "textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), club => $club, custom_id => $custom_id}
{include "textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), club => $club}
{/if}
</div>

View file

@ -1,6 +1,5 @@
{php if(!isset($GLOBALS["textAreaCtr"])) $GLOBALS["textAreaCtr"] = 10;}
{var $textAreaId = ($post ?? NULL) === NULL ? (++$GLOBALS["textAreaCtr"]) : $post->getId()}
{var $textAreaId = ($custom_id ?? NULL) === NULL ? $textAreaId : $custom_id}
<div id="write" style="padding: 5px 0;" onfocusin="expand_wall_textarea({$textAreaId});">
<form action="{$route}" method="post" enctype="multipart/form-data" style="margin:0;">

View file

@ -2323,10 +2323,6 @@ a.poll-retract-vote {
margin: 15px auto 0 auto;
}
.ovk-photo-details {
overflow: auto;
}
.photo_com_title {
font-weight: bold;
padding-bottom: 20px;
@ -2341,7 +2337,6 @@ a.poll-retract-vote {
left: 0;
width: 35%;
height: 100%;
max-height: 60vh;
position: absolute;
cursor: pointer;
}
@ -2350,7 +2345,6 @@ a.poll-retract-vote {
right: 0;
width: 35%;
height: 100%;
max-height: 60vh;
position: absolute;
cursor: pointer;
}

View file

@ -174,8 +174,6 @@ function OpenMiniature(e, photo, post, photo_id) {
let imagesCount = 0;
let imagesIndex = 0;
let tempDetailsSection = [];
let dialog = u(
`<div class="ovk-photo-view-dimmer">
<div class="ovk-photo-view">
@ -210,36 +208,6 @@ function OpenMiniature(e, photo, post, photo_id) {
__closeDialog();
});
function __reloadTitleBar() {
u("#photo_com_title_photos").last().innerHTML = "Фотография " + imagesIndex + " из " + imagesCount;
}
function __loadDetails(photo_id, index) {
if(tempDetailsSection[index] == null) {
u(".ovk-photo-details").last().innerHTML = '<img src="/assets/packages/static/openvk/img/loading_mini.gif">';
ky("/photo" + photo_id, {
hooks: {
afterResponse: [
async (_request, _options, response) => {
let parser = new DOMParser();
let body = parser.parseFromString(await response.text(), "text/html");
let element = u(body.getElementsByClassName("ovk-photo-details")).last();
tempDetailsSection[index] = element.innerHTML;
if(index == imagesIndex) {
u(".ovk-photo-details").last().innerHTML = element.innerHTML;
}
}
]
}
});
} else {
u(".ovk-photo-details").last().innerHTML = tempDetailsSection[index];
}
}
function __slidePhoto(direction) {
/* direction = 1 - right
direction = 0 - left */
@ -259,8 +227,7 @@ function OpenMiniature(e, photo, post, photo_id) {
let photoURL = json.body[imagesIndex - 1].url;
u("#ovk-photo-img").last().src = photoURL;
__reloadTitleBar();
__loadDetails(json.body[imagesIndex - 1].id, imagesIndex);
u("#photo_com_title_photos").last().innerHTML = "Фотография " + imagesIndex + " из " + imagesCount;
}
}
@ -295,8 +262,25 @@ function OpenMiniature(e, photo, post, photo_id) {
}
});
__reloadTitleBar();
__loadDetails(json.body[imagesIndex - 1].id, imagesIndex); }
u("#photo_com_title_photos").last().innerHTML = "Фотография " + imagesIndex + " из " + imagesCount;
}
]
}
});
ky("/photo" + photo_id, {
hooks: {
afterResponse: [
async (_request, _options, response) => {
let parser = new DOMParser();
let body = parser.parseFromString(await response.text(), "text/html");
let element = u(body.getElementsByClassName("ovk-photo-details")).last();
u(".ovk-photo-details").last().innerHTML = element.innerHTML;
u("#photo_com_title_photos").last().innerHTML = "Фотография " + imagesIndex + " из " + imagesCount;
}
]
}
});