MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus Shoplytics Wiki
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| (11 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 3: | Zeile 3: | ||
if (mw.config.get('wgPageName') === 'Hauptseite') { | if (mw.config.get('wgPageName') === 'Hauptseite') { | ||
const searchForm = ` | const searchForm = ` | ||
<h1 style="color:#220e60; font-weight:700; text-align:center; border:0;">Wie können wir dir helfen?</h1> | <h1 style="color:#220e60; font-weight:700; text-align:center; border:0;">Wie können wir dir helfen?</h1><br> | ||
<style>.firstHeading {display:none;}</style> | <style>.firstHeading, #searchInput {display:none;}</style> | ||
<form style="text-align: center;" action="/index.php" method="get" class="custom-search-form" style="margin-top: 1em;"> | <form style="text-align: center;" action="/index.php" method="get" class="custom-search-form" style="margin-top: 1em;"> | ||
<input type="hidden" name="title" value="Spezial:Suche"> | <input type="hidden" name="title" value="Spezial:Suche"> | ||
<input | <input style="width:90%;max-width:600px;box-sizing: border-box; border: solid 3px #220e60; border-radius: 3em; padding:15px;" type="search" name="search" placeholder="Shoplytics Wiki durchsuchen..."> | ||
</form> | </form> | ||
`; | `; | ||
$('#bodyContent').prepend(searchForm); | $('#bodyContent').prepend(searchForm); | ||
} | |||
}); | |||
$(document).ready(function () { | |||
if (mw.config.get('wgUserName') === null) { | |||
$('.dropdown-toggle').each(function () { | |||
const label = $(this).text().trim(); | |||
if (label === 'Werkzeuge' || label === 'Aktionen') { | |||
$(this).closest('.dropdown').hide(); | |||
} | |||
}); | |||
} | } | ||
}); | }); | ||
Aktuelle Version vom 21. April 2025, 10:55 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */
$(document).ready(function() {
if (mw.config.get('wgPageName') === 'Hauptseite') {
const searchForm = `
<h1 style="color:#220e60; font-weight:700; text-align:center; border:0;">Wie können wir dir helfen?</h1><br>
<style>.firstHeading, #searchInput {display:none;}</style>
<form style="text-align: center;" action="/index.php" method="get" class="custom-search-form" style="margin-top: 1em;">
<input type="hidden" name="title" value="Spezial:Suche">
<input style="width:90%;max-width:600px;box-sizing: border-box; border: solid 3px #220e60; border-radius: 3em; padding:15px;" type="search" name="search" placeholder="Shoplytics Wiki durchsuchen...">
</form>
`;
$('#bodyContent').prepend(searchForm);
}
});
$(document).ready(function () {
if (mw.config.get('wgUserName') === null) {
$('.dropdown-toggle').each(function () {
const label = $(this).text().trim();
if (label === 'Werkzeuge' || label === 'Aktionen') {
$(this).closest('.dropdown').hide();
}
});
}
});