Compare commits

..

3 commits

Author SHA1 Message Date
lalka2016
77d0603e67 Remove javascript positioning🤮🤮🤮 2023-08-11 17:31:46 +03:00
lalka2016
553731deed Fix scroll 2023-08-11 14:14:36 +03:00
lalka2016
8bccab7bc0 Newlines and fix textareas 2023-08-11 12:37:25 +03:00
9 changed files with 39 additions and 33 deletions

View file

@ -35,7 +35,7 @@ final class SearchPresenter extends OpenVKPresenter
$invert = $this->queryParam("invert") == 1 ? "ASC" : "DESC"; $invert = $this->queryParam("invert") == 1 ? "ASC" : "DESC";
$page = (int) ($this->queryParam("p") ?? 1); $page = (int) ($this->queryParam("p") ?? 1);
$this->willExecuteWriteAction(); # $this->willExecuteWriteAction();
if($query != "") if($query != "")
$this->assertUserLoggedIn(); $this->assertUserLoggedIn();

View file

@ -149,11 +149,10 @@
]} ]}
{/if} {/if}
</div> </div>
<p style="margin-left: 15px; margin-top: 0;"> <p style="margin-left: 15px; {if $thisUser->getPaginatorType() == 1}margin-top: 14px;{/if}">
<b>{tr("results", $count)}</b> <b>{tr("results", $count)}</b>
</p> </p>
<div> <div style="display: flex;flex-direction: row;">
{include searchOptions}
{var $data = is_array($iterator) ? $iterator : iterator_to_array($iterator)} {var $data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
<div class="container_gray borderup infContainer" style="float:left;width:73.3%;"> <div class="container_gray borderup infContainer" style="float:left;width:73.3%;">
@ -231,12 +230,7 @@
]} ]}
{/if} {/if}
</div> </div>
<script> {include searchOptions}
window.addEventListener("load", (event) => {
document.getElementsByClassName("container_gray")[0].style.minHeight = document.getElementsByClassName("searchOptions")[0].clientHeight+"px";
document.getElementsByClassName("searchOptions")[0].style.minHeight = document.getElementsByClassName("container_gray")[0].clientHeight-3+"px";
})
</script>
{/block} {/block}
{block searchOptions} {block searchOptions}

View file

@ -51,7 +51,7 @@
{include "../components/paginator.xml", conf => $paginatorConf} {include "../components/paginator.xml", conf => $paginatorConf}
{/if} {/if}
<script> <script n:if="$thisUser->getPaginatorType() == 0">
u("#pageSelect").nodes[0].value = {$paginatorConf->perPage}; u("#pageSelect").nodes[0].value = {$paginatorConf->perPage};
u("#pageSelect").on("change", function(e) { u("#pageSelect").on("change", function(e) {

View file

@ -2,4 +2,4 @@
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage) && $conf->page < $pageCount" class="showMore" data-pageсount="{$pageCount}" data-page="{$conf->page}"> <div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage) && $conf->page < $pageCount" class="showMore" data-pageсount="{$pageCount}" data-page="{$conf->page}">
{_show_more} {_show_more}
</div> </div>

View file

@ -3,7 +3,7 @@
<div id="write" style="padding: 5px 0;" onfocusin="expand_wall_textarea({$textAreaId});"> <div id="write" style="padding: 5px 0;" onfocusin="expand_wall_textarea({$textAreaId});">
<form action="{$route}" method="post" enctype="multipart/form-data" style="margin:0;"> <form action="{$route}" method="post" enctype="multipart/form-data" style="margin:0;">
<textarea id="wall-post-input{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea> <textarea id="wall-post-input{$textAreaId}" data-id="{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea>
<div> <div>
<!-- padding to fix <br/> bug --> <!-- padding to fix <br/> bug -->
</div> </div>

View file

@ -2319,7 +2319,7 @@ a.poll-retract-vote {
float:right; float:right;
scrollbar-width: none; scrollbar-width: none;
font-size:12px; font-size:12px;
background-color:#f7f7f7; background-color:#F6F6F6;
margin-right: -7px; margin-right: -7px;
} }
@ -2697,22 +2697,9 @@ body.article .floating_sidebar, body.article .page_content {
font-size: 12px; font-size: 12px;
} }
.small_red_button {
float: right;
font-weight: bold;
}
.small_red_button a {
color: #B0B0B0;
}
.small_red_button a:hover {
color: #a7a7a7;
}
.showMore { .showMore {
text-align: center; text-align: center;
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
cursor: pointer; cursor: pointer;
} }

View file

@ -44,4 +44,4 @@ tippy(".mention", {
}); });
} }
initMentions() initMentions()

View file

@ -272,9 +272,11 @@ async function showArticle(note_id) {
$(document).on("click", ".showMore", async (e) => { $(document).on("click", ".showMore", async (e) => {
e.currentTarget.innerHTML = `<img id="loader" src="/assets/packages/static/openvk/img/loading_mini.gif">` e.currentTarget.innerHTML = `<img id="loader" src="/assets/packages/static/openvk/img/loading_mini.gif">`
let url = new URL(location.href) let url = new URL(location.href)
let newPage = Number(e.currentTarget.dataset.page) + 1 let newPage = Number(e.currentTarget.dataset.page) + 1
url.searchParams.set("p", newPage) url.searchParams.set("p", newPage)
url.searchParams.set("posts", 10)
let xhr = new XMLHttpRequest let xhr = new XMLHttpRequest
xhr.open("GET", url) xhr.open("GET", url)
@ -305,6 +307,16 @@ $(document).on("click", ".showMore", async (e) => {
for(const obj of objects) { for(const obj of objects) {
container.insertAdjacentHTML("beforeend", obj.outerHTML) container.insertAdjacentHTML("beforeend", obj.outerHTML)
} }
if(result.querySelectorAll("textarea").length > 0) {
for(const trea of result.querySelectorAll("textarea")) {
setupWallPostInputHandlers(trea.dataset.id)
u("#post-buttons" + trea.dataset.id + " .postFileSel").on("change", function() {
handleUpload.bind(this, trea.dataset.id)();
});
}
}
bsdnHydrate() bsdnHydrate()
@ -318,3 +330,20 @@ $(document).on("click", ".showMore", async (e) => {
xhr.send() xhr.send()
}) })
let showMoreObserver = new IntersectionObserver(entries => {
entries.forEach(x => {
if(x.isIntersecting) {
$(".showMore").click()
}
})
}, {
root: null,
rootMargin: "0px",
threshold: 0
})
let showMore = document.querySelector('.showMore');
if(showMore != null)
showMoreObserver.observe(showMore);

View file

@ -691,8 +691,4 @@ $(document).on("scroll", () => {
$(".floating_sidebar")[0].classList.remove("hide_anim"); $(".floating_sidebar")[0].classList.remove("hide_anim");
}, 250); }, 250);
} }
if($(window).scrollTop() == $(document).height() - $(window).height() && document.querySelector(".showMore") != null) {
$(".showMore").click()
}
}) })