„MediaWiki:Common.js” változatai közötti eltérés
Innen: Sanctum2 Wikipédia
Ugrás a navigációhozUgrás a kereséshez
Nincs szerkesztési összefoglaló |
Nincs szerkesztési összefoglaló |
||
14. sor: | 14. sor: | ||
var value = $(this).val().toLowerCase(); | var value = $(this).val().toLowerCase(); | ||
$('.mw-parser-output table.wikitable:first tr').filter(function() { | $('.mw-parser-output table.wikitable:first tr').filter(function() { | ||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); | |||
}); | |||
}); | |||
}); | |||
// MediaWiki:Common.js | |||
$(document).ready(function() { | |||
// Add fixed header with logo and search box | |||
var headerHtml = '<div id="customHeader" style="position: fixed; top: 0; left: 0; right: 0; background-color: #333; color: #fff; padding: 10px; z-index: 1000;">' + | |||
'<div style="float: left;"><img src="/path/to/logo.png" style="height: 50px;"></div>' + | |||
'<div style="float: right;"><input type="text" id="searchInput" placeholder="Search..." style="padding: 5px; border-radius: 5px; border: 1px solid #72716F; color: #333; width: 200px;"></div>' + | |||
'<div style="clear: both;"></div>' + | |||
'</div>'; | |||
// Insert the custom header at the top of the page | |||
$('#mw-page-base').before(headerHtml); | |||
// Adjust content margin to prevent overlapping with fixed header | |||
$('#content').css('margin-top', '80px'); // Adjust this value as needed | |||
// Search functionality | |||
$('#searchInput').on('keyup', function() { | |||
var value = $(this).val().toLowerCase(); | |||
$('.mw-parser-output').find('h2, h3, h4, p').filter(function() { | |||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); | $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); | ||
}); | }); | ||
}); | }); | ||
}); | }); |
A lap 2024. június 24., 09:40-kori változata
// MediaWiki:Common.js $(document).ready(function() { // Add search box with styled input var searchBoxHtml = '<div id="searchBox" style="position: sticky; top: 0; background-color: #333; padding: 10px; border-radius: 5px; width: 90%; margin-left: auto; margin-right: auto;">' + '<label for="tableSearch" style="color: #fff; font-size: 1.2em; margin-right: 10px;">Keresés név alapján:</label>' + '<input type="text" id="tableSearch" placeholder="Írd be a tárgy nevét..." style="padding: 5px; border-radius: 5px; border: 1px solid #72716F; color: #333; width: 70%; max-width: 500px;">' + '</div>'; // Insert search box above the "Kép Név Beszerezhetőség" table $('.mw-parser-output table.wikitable:first').before(searchBoxHtml); // Search functionality $('#tableSearch').on('keyup', function() { var value = $(this).val().toLowerCase(); $('.mw-parser-output table.wikitable:first tr').filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); }); }); }); // MediaWiki:Common.js $(document).ready(function() { // Add fixed header with logo and search box var headerHtml = '<div id="customHeader" style="position: fixed; top: 0; left: 0; right: 0; background-color: #333; color: #fff; padding: 10px; z-index: 1000;">' + '<div style="float: left;"><img src="/path/to/logo.png" style="height: 50px;"></div>' + '<div style="float: right;"><input type="text" id="searchInput" placeholder="Search..." style="padding: 5px; border-radius: 5px; border: 1px solid #72716F; color: #333; width: 200px;"></div>' + '<div style="clear: both;"></div>' + '</div>'; // Insert the custom header at the top of the page $('#mw-page-base').before(headerHtml); // Adjust content margin to prevent overlapping with fixed header $('#content').css('margin-top', '80px'); // Adjust this value as needed // Search functionality $('#searchInput').on('keyup', function() { var value = $(this).val().toLowerCase(); $('.mw-parser-output').find('h2, h3, h4, p').filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); }); }); });