MediaWiki:Common.js: Unterschied zwischen den Versionen
Tin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Tin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var topBarHtml = '<div class="top-bar">' + | // Create the top bar with a toggle button | ||
var topBarHtml = '<div class="top-bar" id="top-bar" style="background-color: #f8f9fa; padding: 10px; border-bottom: 1px solid #ccc;">' + | |||
'<button id="toggle-top-bar" style="float: right; background: none; border: none; cursor: pointer; font-size: 16px;">[Hide]</button>' + | |||
'<a href="https://know.sevetin.net/s/2fa9e87c-2144-4938-b548-c743b858db9e"><b>Mitmachen</b></a>' + | |||
' | <a href="https://gurkipedia.de/wiki">Wiki</a>' + | |||
' | <a href="https://forum.gurkistan.eu">Forum</a>' + | |||
' | <a href="https://discord.gg/gurkistan-community-1077941897399631932">Community-Discord</a>' + | |||
'</div>'; | |||
// Prepend the top bar to the body | |||
$('body').prepend(topBarHtml); | $('body').prepend(topBarHtml); | ||
// Toggle functionality for hiding/showing the top bar | |||
$('#toggle-top-bar').click(function() { | |||
var topBar = $('#top-bar'); | |||
if (topBar.is(':visible')) { | |||
topBar.hide(); | |||
$(this).text('[Show]'); | |||
} else { | |||
topBar.show(); | |||
$(this).text('[Hide]'); | |||
} | |||
}); | |||
}); | }); |
Version vom 20. Oktober 2024, 12:18 Uhr
$(document).ready(function() {
// Create the top bar with a toggle button
var topBarHtml = '<div class="top-bar" id="top-bar" style="background-color: #f8f9fa; padding: 10px; border-bottom: 1px solid #ccc;">' +
'<button id="toggle-top-bar" style="float: right; background: none; border: none; cursor: pointer; font-size: 16px;">[Hide]</button>' +
'<a href="https://know.sevetin.net/s/2fa9e87c-2144-4938-b548-c743b858db9e"><b>Mitmachen</b></a>' +
' | <a href="https://gurkipedia.de/wiki">Wiki</a>' +
' | <a href="https://forum.gurkistan.eu">Forum</a>' +
' | <a href="https://discord.gg/gurkistan-community-1077941897399631932">Community-Discord</a>' +
'</div>';
// Prepend the top bar to the body
$('body').prepend(topBarHtml);
// Toggle functionality for hiding/showing the top bar
$('#toggle-top-bar').click(function() {
var topBar = $('#top-bar');
if (topBar.is(':visible')) {
topBar.hide();
$(this).text('[Show]');
} else {
topBar.show();
$(this).text('[Hide]');
}
});
});