Compare commits

...

2 commits

Author SHA1 Message Date
mrilyew
9d75f0b249 fix(feed): fix dementia 2024-12-08 12:03:32 +03:00
mrilyew
35bfe97360 fix(ajax): fix #1169, fix #1172 2024-12-08 11:45:19 +03:00
6 changed files with 30 additions and 5 deletions

View file

@ -132,7 +132,7 @@
{/if}
<a style="width: 194px;" n:if="OPENVK_ROOT_CONF['openvk']['preferences']['commerce'] && $user->getGiftCount() == 0" href="/gifts?act=pick&user={$user->getId()}" class="profile_link">{_send_gift}</a>
<a style="width: 194px;" n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link">{_send_message}</a>
<a style="width: 194px;" n:if="$user->getPrivacyPermission('messages.write', $thisUser)" href="/im?sel={$user->getId()}" class="profile_link" rel="nofollow">{_send_message}</a>
{var $subStatus = $user->getSubscriptionStatus($thisUser)}
{if $subStatus === 0}

View file

@ -24,7 +24,7 @@
</div>
<div class='scroll_container'>
<div class='scroll_node' n:foreach='$posts as $post'>
<div class='scroll_node' n:foreach='$posts as $post' data-uniqueid="{$post->getPrettyId()}">
<a name="postGarter={$post->getId()}"></a>
{include "../components/post.xml", post => $post, onWallOf => true, commentSection => true}
</div>

View file

@ -15,7 +15,7 @@
<div class="content scroll_container">
{if sizeof($posts) > 0}
<div class='scroll_node' n:foreach='$posts as $post'>
<div class='scroll_node' n:foreach='$posts as $post' data-uniqueid="{$post->getPrettyId()}">
<a name="postGarter={$post->getId()}"></a>
{include "../components/post.xml", post => $post, commentSection => true}

View file

@ -2335,6 +2335,15 @@ async function __processPaginatorNextPage(page)
const nodes = parsed_content.querySelectorAll(container_node)
nodes.forEach(node => {
const unique_id = node.dataset.uniqueid
if(unique_id) {
const elements_unique = u(`.scroll_node[data-uniqueid='${unique_id}']`).length
if(elements_unique > 0) {
console.info('AJAX | Found duplicates')
return
}
}
container.append(node)
})
@ -2395,7 +2404,13 @@ const showMoreObserver = new IntersectionObserver(entries => {
}
const page_number = Number(next_page.html())
try {
await __processPaginatorNextPage(page_number)
} catch(e) {
console.error(e)
}
bsdnHydrate()
u('.paginator:not(.paginator-at-top)').removeClass('lagged')
}

View file

@ -152,7 +152,7 @@ window.router = new class {
return false
}
if(!url || url == '' || url == '/') {
if(!url || url == '') {
return false
}
@ -275,6 +275,11 @@ u(document).on('click', 'a', async (e) => {
return
}
// temporary fix
if(dom_url == '/') {
url = url + 'id0'
}
e.preventDefault()
console.log(`AJAX | Going to URL ${url}`)

View file

@ -229,6 +229,11 @@ function serializeForm(form, submitter = null)
}
}
break
case 'radio':
if(inp.checked) {
fd.append(inp.name, inp.value)
}
break
}
})