Compare commits

...

25 commits

Author SHA1 Message Date
mrilyew
bf30cfaeeb showArticle() stranniy chel 2025-05-25 11:32:35 +03:00
mrilyew
9d7971ad77 add delete warning on post page delet btuton 2025-05-25 11:26:22 +03:00
mrilyew
b9f3a67433 tickets cut text change from 50 to 200 2025-05-25 11:21:08 +03:00
mrilyew
718d4ffd86 fix yerror that u cant bplay audio on repor tpage 2025-05-25 11:06:50 +03:00
mrilyew
fcc4a99799 add warning before delete on comment 2025-05-25 10:56:39 +03:00
mrilyew
40b6b2715a make video not unlisted after editing 2025-05-24 23:51:28 +03:00
mrilyew
3faab6f9e9 feature autostart gif (hidden) 2025-05-24 23:13:13 +03:00
mrilyew
89cccd5878 fix random topic deletion 2025-05-24 22:23:49 +03:00
mrilyew
ca07849bb9 fix wrong comments when editing 2025-05-24 22:20:23 +03:00
mrilyew
c5d4e8d1a0 make doc image 60% 2025-05-24 22:05:57 +03:00
mrilyew
800ad5d7b8 fix router recursion error 2025-05-24 22:03:06 +03:00
mrilyew
074bdec314 add comments sort 2025-05-24 21:47:11 +03:00
mrilyew
dd3e355504 fix infinty scroll for high screens 2025-05-24 19:02:15 +03:00
mrilyew
cdf2eb685e fix followers scroll 2025-05-24 17:53:44 +03:00
mrilyew
78dd0bf0d6 nospam: add warning before apply 2025-05-24 17:27:02 +03:00
mrilyew
a88e17a6e5 show count of comments on microblog comments link 2025-05-24 17:11:26 +03:00
mrilyew
acd00c5f86 add margin to post page 2025-05-24 16:47:44 +03:00
mrilyew
9e7956ec03 enlarge graffiti window 2025-05-24 16:44:51 +03:00
mrilyew
911247b396 source window change padding 2025-05-24 16:34:13 +03:00
mrilyew
f05ea1973e texatreao fi x c ccss padings 2025-05-24 16:31:15 +03:00
mrilyew
cca6f55bc8 fix notes picker 2025-05-24 16:10:25 +03:00
mrilyew
bb2f1b55f7 fix 500 on followers page 2025-05-24 16:08:00 +03:00
mrilyew
1ce92f7c58 back ajax transition on support tickets 2025-05-24 16:05:45 +03:00
mrilyew
f276522fc5 fix blacklist paddings 2025-05-24 16:04:08 +03:00
mrilyew
5755d13425 remove hash setting on scroll 2025-05-24 15:58:44 +03:00
25 changed files with 181 additions and 60 deletions

View file

@ -56,7 +56,7 @@ final class Board extends VKAPIRequestHandler
$comment->save();
}
} catch(\Throwable $e) {
} catch (\Throwable $e) {
return $topic->getId();
}
@ -183,7 +183,7 @@ final class Board extends VKAPIRequestHandler
}
$obj = (object) [
"items" => []
"items" => [],
];
if ($extended) {
@ -222,7 +222,7 @@ final class Board extends VKAPIRequestHandler
$this->fail(4, "Invalid count");
}
$obj = (object)[];
$obj = (object) [];
$club = (new ClubsRepo())->get($group_id);

View file

@ -411,7 +411,7 @@ final class Groups extends VKAPIRequestHandler
$obj = (object) [
"count" => sizeof($members),
"items" => []
"items" => [],
];
foreach ($members as $member) {

View file

@ -75,9 +75,9 @@ abstract class Postable extends Attachable
return new DateTime($edited);
}
public function getComments(int $page, ?int $perPage = null): \Traversable
public function getComments(int $page, ?int $perPage = null, string $sort = "ASC"): \Traversable
{
return (new Comments())->getCommentsByTarget($this, $page, $perPage);
return (new Comments())->getCommentsByTarget($this, $page, $perPage, $sort);
}
public function getCommentsCount(): int

View file

@ -135,7 +135,7 @@ final class GroupPresenter extends OpenVKPresenter
$this->template->paginatorConf = (object) [
"count" => $this->template->count,
"page" => $this->queryParam("p") ?? 1,
"page" => (int)($this->queryParam("p") ?? 1),
"amount" => 10,
"perPage" => OPENVK_DEFAULT_PER_PAGE,
];

View file

@ -146,7 +146,7 @@ final class InternalAPIPresenter extends OpenVKPresenter
{
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
header("HTTP/1.1 405 Method Not Allowed");
exit("ты‍ не по адресу");
$this->redirect("/");
}
$type = $this->queryParam("type", false);
@ -165,7 +165,7 @@ final class InternalAPIPresenter extends OpenVKPresenter
if ($type == 'post') {
$this->template->_template = 'components/post.xml';
$this->template->post = $post;
$this->template->commentSection = true;
$this->template->commentSection = $this->queryParam("from_page") == "another";
} elseif ($type == 'comment') {
$this->template->_template = 'components/comment.xml';
$this->template->comment = $post;

View file

@ -102,7 +102,7 @@ final class NoSpamPresenter extends OpenVKPresenter
$item = new $model($item);
if (key_exists("deleted", $item->unwrap()) && $item->isDeleted()) {
if (property_exists($item->unwrap(), "deleted") && $item->isDeleted()) {
$item->setDeleted(0);
$item->save();
}

View file

@ -133,6 +133,7 @@ final class VideosPresenter extends OpenVKPresenter
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$video->setName(empty($this->postParam("name")) ? null : $this->postParam("name"));
$video->setDescription(empty($this->postParam("desc")) ? null : $this->postParam("desc"));
$video->setUnlisted(false);
$video->save();
$this->flash("succ", tr("changes_saved"), tr("changes_saved_video_comment"));

View file

@ -469,7 +469,11 @@ final class WallPresenter extends OpenVKPresenter
}
$this->template->cCount = $post->getCommentsCount();
$this->template->cPage = (int) ($_GET["p"] ?? 1);
$this->template->comments = iterator_to_array($post->getComments($this->template->cPage));
$this->template->sort = $this->queryParam("sort") ?? "asc";
$input_sort = $this->template->sort == "asc" ? "ASC" : "DESC";
$this->template->comments = iterator_to_array($post->getComments($this->template->cPage, null, $input_sort));
}
public function renderLike(int $wall, int $post_id): void

View file

@ -210,7 +210,7 @@
{var $menuLinksAvaiable = sizeof(OPENVK_ROOT_CONF['openvk']['preferences']['menu']['links']) > 0 && $thisUser->getLeftMenuItemStatus('links')}
<div n:if="$canAccessAdminPanel || $canAccessHelpdesk || $menuLinksAvaiable" class="menu_divider"></div>
<a href="/admin" class="link" n:if="$canAccessAdminPanel" title="{_admin} [Alt+Shift+A]" accesskey="a" rel="nofollow">{_admin}</a>
<a href="/support/tickets" class="link" n:if="$canAccessHelpdesk" rel="nofollow">{_helpdesk}
<a href="/support/tickets" class="link" n:if="$canAccessHelpdesk">{_helpdesk}
{if $helpdeskTicketNotAnsweredCount > 0}
(<b>{$helpdeskTicketNotAnsweredCount}</b>)
{/if}

View file

@ -55,7 +55,7 @@
<tbody>
<tr>
<td width="120" valign="top"><span class="nobold">{_pronouns}: </span></td>
<td>{$x->isFemale() ? tr("female") : ($x->isNeutral() ? tr("neutral") : tr("male"))}</td>
<td>{$user->isFemale() ? tr("female") : ($user->isNeutral() ? tr("neutral") : tr("male"))}</td>
</tr>
<tr>
<td width="120" valign="top"><span class="nobold">{_registration_date}: </span></td>

View file

@ -269,7 +269,13 @@
search();
}
});
$("#apply").on("click", () => { search(Number($("#noSpam-ban-type").val())); })
$("#apply").on("click", (e) => {
e.preventDefault()
MessageBox(tr("warning"), tr("nospam_prevention"), [tr("no"), tr("yes")], [Function.noop, () => {
search(Number($("#noSpam-ban-type").val()));
}]);
})
async function selectChange(value) {
console.log(value);

View file

@ -42,6 +42,6 @@
{block description}
{var $author = $x->getUser()}
{ovk_proc_strtr($x->getContext(), 50)}<br/>
{ovk_proc_strtr($x->getContext(), 200)}<br/>
<span class="nobold">{_author}: </span> <a href="{$author->getURL()}">{$author->getCanonicalName()}</a>
{/block}

View file

@ -40,7 +40,7 @@
</tr>
<tr>
<td>
<a class="button" href="/topic{$topic->getPrettyId()}/delete?hash={urlencode($csrfToken)}">{_delete_topic}</a>
<a id="_anotherDelete" class="button" href="/topic{$topic->getPrettyId()}/delete?hash={urlencode($csrfToken)}">{_delete_topic}</a>
</td>
<td>
<input type="hidden" name="hash" value="{$csrfToken}" />

View file

@ -36,9 +36,10 @@
count => $cCount,
page => $cPage,
model => "posts",
parent => $post }
parent => $post,
sort => $sort}
</div>
<div style="float: left; min-height: 100px; width: 32%;">
<div style="float: left; min-height: 100px; width: 32%;padding-left: 10px;width: 30%;">
<h4>{_actions}</h4>
{if isset($thisUser)}
{var $canDelete = $post->canBeDeletedBy($thisUser)}
@ -47,7 +48,7 @@
{/if}
{/if}
<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" id="_ajaxDelete" class="profile_link" style="display:block;width:96%;" href="/wall{$post->getPrettyId()}/delete">{_delete}</a>
<a
n:if="isset($thisUser) && $thisUser->getChandlerUser()->can('access')->model('admin')->whichBelongsTo(NULL) AND $post->getEditTime()"
style="display:block;width:96%;"

View file

@ -44,7 +44,7 @@
{if !$timeOnly}
{if $comment->canBeDeletedBy($thisUser)}
|
<a href="/comment{$comment->getId()}/delete">{_delete}</a>
<a href="/comment{$comment->getId()}/delete" id="_ajaxDelete">{_delete}</a>
{/if}
{if $comment->canBeEditedBy($thisUser)}
|

View file

@ -1,5 +1,18 @@
<h4 n:if="$showTitle ?? true">{_comments} ({$count})</h4>
<div>
<h4 n:if="$showTitle ?? true">{_comments} ({$count})</h4>
{if !is_null($sort) && $count > 5}
<a class="sort_link" n:attr="href => $sort == 'desc' ? '?sort=asc' : '?sort=desc'">
{if $sort == 'desc'}
{_new_first}
{else}
{_old_first}
{/if}
<div n:class="sort_link_icon, $sort == 'desc' ? sort_link_icon_desc : sort_link_icon_asc"></div>
</a>
{/if}
</div>
<div n:ifset="$thisUser" id="standaloneCommentBox">
{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}

View file

@ -148,7 +148,7 @@
{/if}
</div>
<div n:if="!($forceNoCommentsLink ?? false) && $commentSection == true && $compact == false" class="post-menu-s">
<a n:if="$commentsCount > 3" href="/wall{$post->getPrettyId()}" class="expand_button">{_view_other_comments}</a>
<a n:if="$commentsCount > 3" href="/wall{$post->getPrettyId()}" class="expand_button">{_view_other_comments} ({$commentsCount - 3})</a>
{foreach $comments as $comment}
{include "../comment.xml", comment => $comment, $compact => true}
{/foreach}

View file

@ -49,7 +49,7 @@ body.dimmed > .dimmer #absolute_territory {
.ovk-diag-body {
padding: 20px;
overflow-y: auto;
max-height: 80vh
max-height: 83vh
}
.ovk-diag-action {

View file

@ -880,7 +880,7 @@ h4 {
}
.post-geo {
margin: 1px 0px;
margin: 8px 0px 2px -3px;
padding: 0 4px;
}
@ -1570,6 +1570,10 @@ body.scrolled .toTop:hover, .toTop.has_down:hover {
color: #3c3c3c;
}
.post-has-geo.appended-geo {
padding: 6px 0px;
}
.post-source #remove_source_button, #small_remove_button {
display: inline-block;
background-repeat: no-repeat;
@ -1884,6 +1888,7 @@ body.scrolled .toTop:hover, .toTop.has_down:hover {
#ovkDraw {
border: 1px solid #757575;
min-height: 510px;
}
#ovkDraw .lc-drawing.with-gui {
@ -1892,6 +1897,7 @@ body.scrolled .toTop:hover, .toTop.has_down:hover {
#ovkDraw .literally {
border-radius: 0;
height: 510px;
}
#ovkDraw .literally .lc-picker,
@ -2670,7 +2676,8 @@ a.poll-retract-vote {
}
.post-buttons .vertical-attachment .vertical-attachment-content {
max-height: 27px;
/*max-height: 27px;*/
padding: 3px 2px;
}
.vertical-attachment .vertical-attachment-content .overflowedName {
@ -3201,6 +3208,11 @@ a.poll-retract-vote {
display: flex;
align-items: center;
gap: 1px;
padding: 5px 9px;
}
.post-buttons .attachment_note {
padding: 3px 0px;
}
.attachment_note svg {
@ -3216,6 +3228,10 @@ a.poll-retract-vote {
height: 12px;
}
.attachments .attachment_note {
padding: 5px 5px;
}
#notesList
{
overflow-y: scroll;
@ -3252,7 +3268,7 @@ body.article .floating_sidebar, body.article .page_content {
display: none;
position: absolute;
z-index: 128;
width: 100%;
width: 98%;
min-height: 100vh;
padding: 20px;
box-sizing: border-box;
@ -3286,6 +3302,7 @@ body.article .floating_sidebar, body.article .page_content {
.articleView_author > div {
display: flex;
flex-direction: column;
margin-top: 3px;
}
.articleView_author > div > span {
@ -3383,6 +3400,7 @@ body.article .floating_sidebar, body.article .page_content {
display: flex;
flex-direction: column;
gap: 22px;
padding: 5px 10px;
}
.sugglist {
@ -3656,7 +3674,7 @@ hr {
.entity_vertical_list {
display: flex;
flex-direction: column;
gap: 3px;
gap: 10px;
height: 197px;
overflow-y: auto;
}
@ -3664,6 +3682,7 @@ hr {
.entity_vertical_list.scroll_container {
height: unset;
overflow-y: unset;
padding: 5px;
}
.entity_vertical_list .entity_vertical_list_item {
@ -3681,12 +3700,16 @@ hr {
}
.entity_vertical_list.m_mini .entity_vertical_list_item .first_column {
gap: 10px;
gap: 13px;
}
.entity_vertical_list.m_mini .entity_vertical_list_item:hover .first_column a {
text-decoration: underline;
}
.entity_vertical_list.m_mini .entity_vertical_list_item .first_column .avatar img {
width: 30px;
height: 30px;
width: 40px;
height: 40px;
}
.entity_vertical_list .entity_vertical_list_item .avatar {
@ -4269,8 +4292,8 @@ hr {
.attachments .docGalleryItem {
display: block;
min-width: 170px;
height: 170px;
width: 50%;
min-height: 170px;
width: 60%;
margin-bottom: 4px;
}
@ -4296,3 +4319,23 @@ hr {
.deleted_mark_average {
padding: 5px 61px;
}
.sort_link {
padding: 5px 2px;
display: inline-block;
}
.sort_link_icon {
background: url(/assets/packages/static/openvk/img/wall.png?v=3) no-repeat;
display: inline-block;
height: 11px;
width: 9px;
}
.sort_link_icon_desc {
background-position: 0px -15px;
}
.sort_link_icon_asc {
background-position: -11px -15px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -845,22 +845,14 @@ u(document).on('click', '.audioEntry .playerButton > .playIcon', async (e) => {
if(!window.player.hasTrackWithId(id) && !window.player.isAtAudiosPage()) {
let _nodes = null
if(u(e.target).closest('.attachments').length > 0) {
window.player.connectionType = '.attachments'
_nodes = u(e.target).closest('.attachments').find('.audioEmbed').nodes
} else if(u(e.target).closest('.content_list').length > 0) {
window.player.connectionType = '.content_list'
_nodes = u(e.target).closest('.content_list').find('.audioEmbed').nodes
} else if(u(e.target).closest('.generic_audio_list').length > 0) {
window.player.connectionType = '.generic_audio_list'
_nodes = u(e.target).closest('.generic_audio_list').find('.audioEmbed').nodes
} else if(u(e.target).closest('.audiosInsert').length > 0) {
window.player.connectionType = '.audiosInsert'
_nodes = u(e.target).closest('.audiosInsert').find('.audioEmbed').nodes
} else if(u(e.target).closest('.scroll_container').length > 0) {
window.player.connectionType = '.scroll_container'
_nodes = u(e.target).closest('.scroll_container').find('.audioEmbed').nodes
}
try_these_containers = [".attachments", ".content_list", ".generic_audio_list", ".audiosInsert", ".scroll_container", ".container_gray"]
try_these_containers.forEach(__container => {
if(u(e.target).closest(__container).length > 0) {
window.player.connectionType = __container
_nodes = u(e.target).closest(__container).find('.audioEmbed').nodes
}
})
window.player.tracks = []
_nodes.forEach(el => {
@ -1859,7 +1851,7 @@ function showAudioAttachment(type = 'form', form = null)
}
let is_attached = false
if(type == 'form') {
is_attached = (u(form).find(`.post-vertical .vertical-attachment[data-id='${id}']`)).length > 0
is_attached = (u(form).find(`.post-vertical .vertical-attachment[data-type='audio'][data-id='${id}']`)).length > 0
} else {
is_attached = (u(form).find(`.PE_audios .vertical-attachment[data-id='${id}']`)).length > 0
}

View file

@ -606,7 +606,22 @@ function reportClub(club_id) {
]);
}
$(document).on("click", "#_photoDelete, #_videoDelete", function(e) {
$(document).on("click", "#_ajaxDelete", function(e) {
MessageBox(tr('warning'), tr('question_confirm'), [
tr('yes'),
tr('no')
], [
() => {
window.router.route(e.target.href)
},
Function.noop
]);
e.stopPropagation()
return e.preventDefault();
});
$(document).on("click", "#_photoDelete, #_videoDelete, #_anotherDelete", function(e) {
var formHtml = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >";
formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />";
formHtml += "</form>";
@ -1125,7 +1140,14 @@ u(document).on("click", "#editPost", async (e) => {
return
}
const new_post_html = await (await fetch(`/iapi/getPostTemplate/${id[0]}_${id[1]}?type=${type}`, {
let is_at_post_page = false
try {
if(location.pathname.indexOf("wall") != -1 && location.pathname.split("_").length == 2) {
is_at_post_page = true
}
} catch(e) {}
const new_post_html = await (await fetch(`/iapi/getPostTemplate/${id[0]}_${id[1]}?type=${type}&from_page=${is_at_post_page ? "post" : "another"}`, {
'method': 'POST'
})).text()
u(ev.target).removeClass('lagged')
@ -1647,7 +1669,7 @@ u(document).on('click', '#__notesAttachment', async (e) => {
insert_place.append(tr('no_notes'))
}
notes.notes.forEach(note => {
notes.items.forEach(note => {
is_attached = (form.find(`.upload-item[data-type='note'][data-id='${note.owner_id}_${note.id}']`)).length > 0
insert_place.append(`
<div class='display_flex_row _content' data-attachmentdata="${note.owner_id}_${note.id}" data-name='${escapeHtml(note.title)}'>
@ -2373,7 +2395,10 @@ async function __processPaginatorNextPage(page)
const new_url = new URL(location.href)
new_url.hash = page
history.replaceState(null, null, new_url)
//history.replaceState(null, null, new_url)
showMoreObserver.disconnect()
showMoreObserver.observe(u('.paginator:not(.paginator-at-top)').nodes[0])
if(typeof __scrollHook != 'undefined') {
__scrollHook(page)
@ -2439,8 +2464,7 @@ u(document).on('click', '#__sourceAttacher', (e) => {
MessageBox(tr('add_source'), `
<div id='source_flex_kunteynir'>
<span>${tr('set_source_tip')}</span>
<!-- давай, копируй ссылку и переходи по ней -->
<input type='text' maxlength='400' placeholder='https://www.youtube.com/watch?v=lkWuk_nzzVA'>
<input type='text' maxlength='400' placeholder='...'>
</div>
`, [tr('cancel')], [
() => {Function.noop}
@ -2650,7 +2674,7 @@ u(document).on('click', "#__geoAttacher", async (e) => {
${tplMapIcon}
<span>${escapeHtml(geo_name)}</span>
<div id="small_remove_button"></div>
`)
`).addClass("appended-geo")
}, () => {}]
})
@ -2953,3 +2977,28 @@ u(document).on("submit", "#additional_fields_form", (e) => {
}
})
})
if(Number(localStorage.getItem('ux.gif_autoplay') ?? 0) == 1) {
const showMoreObserver = new IntersectionObserver(entries => {
entries.forEach(async x => {
doc_item = x.target.closest(".docGalleryItem")
if(doc_item.querySelector(".play-button") != null) {
if(x.isIntersecting) {
doc_item.classList.add("playing")
} else {
doc_item.classList.remove("playing")
}
}
})
}, {
root: null,
rootMargin: '0px',
threshold: 0,
})
if(u('.docGalleryItem').length > 0) {
u('.docGalleryItem').nodes.forEach(item => {
showMoreObserver.observe(item)
})
}
}

View file

@ -401,8 +401,10 @@ window.addEventListener('popstate', (e) => {
return
}*/
window.router.route({
url: location.href,
push_state: false,
})
if(e.state != null) {
window.router.route({
url: location.href,
push_state: false,
})
}
})

View file

@ -868,6 +868,9 @@
"sort_up" = "Sort by ID up";
"sort_down" = "Sort by ID down";
"new_first" = "New frist";
"old_first" = "Old first";
/* Videos */
"videos" = "Videos";
@ -2322,6 +2325,8 @@
"roll_back" = "rollback";
"roll_backed" = "rollbacked";
"nospam_prevention" = "This action will affect a lot of data. Are you sure you want to apply?";
/* RSS */
"post_deact_in_general" = "Page deletion";

View file

@ -826,6 +826,9 @@
"sort_up" = "Сортировать по дате создания вверх";
"sort_down" = "Сортировать по дате создания вниз";
"new_first" = "Сначала новые";
"old_first" = "Сначала старые";
/* Videos */
"videos" = "Видеозаписи";
@ -2217,6 +2220,8 @@
"roll_back" = "откатить";
"roll_backed" = "откачено";
"nospam_prevention" = "Данное действие затронет множество данных. Вы действительно хотите применить?";
/* RSS */
"post_deact_in_general" = "Удаление страницы";