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} {/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="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)} {var $subStatus = $user->getSubscriptionStatus($thisUser)}
{if $subStatus === 0} {if $subStatus === 0}

View file

@ -24,7 +24,7 @@
</div> </div>
<div class='scroll_container'> <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> <a name="postGarter={$post->getId()}"></a>
{include "../components/post.xml", post => $post, onWallOf => true, commentSection => true} {include "../components/post.xml", post => $post, onWallOf => true, commentSection => true}
</div> </div>

View file

@ -15,7 +15,7 @@
<div class="content scroll_container"> <div class="content scroll_container">
{if sizeof($posts) > 0} {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> <a name="postGarter={$post->getId()}"></a>
{include "../components/post.xml", post => $post, commentSection => true} {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) const nodes = parsed_content.querySelectorAll(container_node)
nodes.forEach(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) container.append(node)
}) })
@ -2395,7 +2404,13 @@ const showMoreObserver = new IntersectionObserver(entries => {
} }
const page_number = Number(next_page.html()) const page_number = Number(next_page.html())
await __processPaginatorNextPage(page_number)
try {
await __processPaginatorNextPage(page_number)
} catch(e) {
console.error(e)
}
bsdnHydrate() bsdnHydrate()
u('.paginator:not(.paginator-at-top)').removeClass('lagged') u('.paginator:not(.paginator-at-top)').removeClass('lagged')
} }

View file

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

View file

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