@@ -220,7 +220,7 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
window.location.href = `certificate.html?id=${id}`;
|
window.location.href = `certificate.html?id=${id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeSearchTermFromUrl() {
|
function applyQueryParams() {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const presetTerm =
|
const presetTerm =
|
||||||
params.get('searchTerm') ||
|
params.get('searchTerm') ||
|
||||||
@@ -236,13 +236,14 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
params.get('q') ||
|
params.get('q') ||
|
||||||
'';
|
'';
|
||||||
|
|
||||||
if (presetTerm) {
|
if (!presetTerm || !presetTerm.trim()) return;
|
||||||
document.getElementById('searchTerm').value = presetTerm;
|
|
||||||
}
|
document.getElementById('searchTerm').value = presetTerm.trim();
|
||||||
|
handleSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
||||||
document.getElementById('searchTerm').addEventListener('keypress', e => {
|
document.getElementById('searchTerm').addEventListener('keypress', e => {
|
||||||
if (e.key === 'Enter') handleSearch();
|
if (e.key === 'Enter') handleSearch();
|
||||||
});
|
});
|
||||||
initializeSearchTermFromUrl();
|
applyQueryParams();
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
resultsDiv.innerHTML = html;
|
resultsDiv.innerHTML = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeSearchTermFromUrl() {
|
function applyQueryParams() {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const presetTerm =
|
const presetTerm =
|
||||||
params.get('searchTerm') ||
|
params.get('searchTerm') ||
|
||||||
@@ -128,10 +128,11 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
params.get('q') ||
|
params.get('q') ||
|
||||||
'';
|
'';
|
||||||
|
|
||||||
if (presetTerm) {
|
if (!presetTerm || !presetTerm.trim()) return;
|
||||||
document.getElementById('searchTerm').value = presetTerm;
|
|
||||||
}
|
document.getElementById('searchTerm').value = presetTerm.trim();
|
||||||
|
handleSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
||||||
initializeSearchTermFromUrl();
|
applyQueryParams();
|
||||||
|
|||||||
+6
-5
@@ -230,7 +230,7 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
window.location.href = `certificate.html?id=${id}`;
|
window.location.href = `certificate.html?id=${id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeSearchTermFromUrl() {
|
function applyQueryParams() {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const presetTerm =
|
const presetTerm =
|
||||||
params.get('searchTerm') ||
|
params.get('searchTerm') ||
|
||||||
@@ -246,13 +246,14 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
params.get('q') ||
|
params.get('q') ||
|
||||||
'';
|
'';
|
||||||
|
|
||||||
if (presetTerm) {
|
if (!presetTerm || !presetTerm.trim()) return;
|
||||||
document.getElementById('searchTerm').value = presetTerm;
|
|
||||||
}
|
document.getElementById('searchTerm').value = presetTerm.trim();
|
||||||
|
handleSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
||||||
document.getElementById('searchTerm').addEventListener('keypress', e => {
|
document.getElementById('searchTerm').addEventListener('keypress', e => {
|
||||||
if (e.key === 'Enter') handleSearch();
|
if (e.key === 'Enter') handleSearch();
|
||||||
});
|
});
|
||||||
initializeSearchTermFromUrl();
|
applyQueryParams();
|
||||||
|
|||||||
+6
-5
@@ -135,7 +135,7 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
resultsDiv.innerHTML = html;
|
resultsDiv.innerHTML = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeSearchTermFromUrl() {
|
function applyQueryParams() {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const presetTerm =
|
const presetTerm =
|
||||||
params.get('searchTerm') ||
|
params.get('searchTerm') ||
|
||||||
@@ -147,10 +147,11 @@ const SUPABASE_URL = 'https://chixssrphfgxvqqigkzo.supabase.co';
|
|||||||
params.get('q') ||
|
params.get('q') ||
|
||||||
'';
|
'';
|
||||||
|
|
||||||
if (presetTerm) {
|
if (!presetTerm || !presetTerm.trim()) return;
|
||||||
document.getElementById('searchTerm').value = presetTerm;
|
|
||||||
}
|
document.getElementById('searchTerm').value = presetTerm.trim();
|
||||||
|
handleSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
||||||
initializeSearchTermFromUrl();
|
applyQueryParams();
|
||||||
|
|||||||
Reference in New Issue
Block a user