MediaWiki:Common.js: Różnice pomiędzy wersjami
Strona MediaWiki
Inne akcje
Nie podano opisu zmian |
Nie podano opisu zmian |
||
| Linia 25: | Linia 25: | ||
}; | }; | ||
document.querySelector('#searchform').addEventListener('submit', e => { | |||
e.preventDefault(); | e.preventDefault(); | ||
const q = encodeURIComponent(input.value); | const q = encodeURIComponent( | ||
document.querySelector('input[name="search"]').value | |||
); | |||
window.location.href = | window.location.href = | ||
'https://cse.google.com/cse?cx=c5dc7c21d2dab4a11&q=' + q; | 'https://cse.google.com/cse?cx=c5dc7c21d2dab4a11&q=' + q; | ||
}); | }); | ||
Aktualna wersja na dzień 07:05, 29 maj 2026
/* Umieszczony tutaj kod JavaScript zostanie załadowany przez każdego użytkownika, podczas każdego ładowania strony. */
document.addEventListener("click", function (e) {
const body = document.querySelector(".mw-body");
if (!body) return;
const rect = body.getBoundingClientRect();
const x = e.clientX;
const y = e.clientY;
const centerX = window.innerWidth / 2;
if (
y >= rect.top + 20 &&
y <= rect.top + 20 + 128 &&
x >= centerX - 203 &&
x <= centerX + 203
) {
window.location.href = "/";
}
});
window.__gcse = {
parsetags: 'explicit'
};
document.querySelector('#searchform').addEventListener('submit', e => {
e.preventDefault();
const q = encodeURIComponent(
document.querySelector('input[name="search"]').value
);
window.location.href =
'https://cse.google.com/cse?cx=c5dc7c21d2dab4a11&q=' + q;
});