add querystring to searchbox

This commit is contained in:
lamacchinadesiderante 2023-01-29 20:20:24 +01:00
parent fd7a902f6b
commit 9553dd65bd
5 changed files with 36 additions and 4 deletions

View File

@ -323,8 +323,9 @@
</section>
</main>
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<script src="https://link.storjshare.io/jvrcr2yqjhlpnr7blizxg4tzpqra/proxyraye%2Fjs%2Fresults.js?download=1" ></script>
<script src="https://link.storjshare.io/jup5z3xb733xwvm27bz5qecrfjeq/proxyraye%2Fjs%2Fdisclaimer.js?download=1" ></script>
<script src="https://link.storjshare.io/jvrcr2yqjhlpnr7blizxg4tzpqra/proxyraye%2Fjs%2Fresults.js?download=1"></script>
<script src="https://link.storjshare.io/jup5z3xb733xwvm27bz5qecrfjeq/proxyraye%2Fjs%2Fdisclaimer.js?download=1"></script>
<script src="https://link.storjshare.io/jub7h7k4omb3ykjytgtoetfjqxbq/proxyraye%2Fjs%2FqueryString.js?download=1"></script>
</body>
</html>

View File

@ -80,7 +80,7 @@ h1 {
#disclaimer {
border: 1px solid var(--primary);
padding: 8px;
border-radius: 32px;
border-radius: 4px;
text-align: center;
margin-bottom: 32px;
font-size: 14px;
@ -122,6 +122,10 @@ section {
gap: 10px;
}
section.results img {
opacity: 1;
}
a:hover {
text-decoration: none;
}
@ -132,7 +136,6 @@ img, .thumbnailText {
}
img {
border-radius: 4px;
}

View File

@ -1,4 +1,5 @@
</main>
<script src="https://code.jquery.com/jquery-3.6.3.min.js"
integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<script
@ -7,5 +8,9 @@
src="https://link.storjshare.io/jup5z3xb733xwvm27bz5qecrfjeq/proxyraye%2Fjs%2Fdisclaimer.js?download=1"></script>
<script
src="https://link.storjshare.io/jxrt2nrnjfmfgtdal2x3he7mat7q/proxyraye%2Fjs%2FcopyToClipboard.js?download=1"></script>
<script
src="https://link.storjshare.io/jub7h7k4omb3ykjytgtoetfjqxbq/proxyraye%2Fjs%2FqueryString.js?download=1"></script>
</body>
</html>

22
res/js/queryString.js Normal file
View File

@ -0,0 +1,22 @@
$( document ).ready(function() {
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
// get query string
let k = params.k;
if (k) {
// set k inside searchbox
$('#searchText').val(k);
// enable results
$('section').removeClass('.transparentResults');
// click on toggler
$('#resToggler').click()
}
});

View File

@ -1,3 +1,4 @@
$('#resToggler').click(() => {
$('section').toggleClass('transparentResults');
$('section').toggleClass('results');
})