MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Keine Bearbeitungszusammenfassung |
KKeine Bearbeitungszusammenfassung |
||
Zeile 8: | Zeile 8: | ||
$(this).append('<img src="//westde.innogamescdn.com/images/items/'+url+(url.indexOf('.png')<0?'.png':'')+'">'); | $(this).append('<img src="//westde.innogamescdn.com/images/items/'+url+(url.indexOf('.png')<0?'.png':'')+'">'); | ||
}); | }); | ||
$.getJSON(" | $.getJSON("/wiki/Evsets.json?action=raw",function(e){evsets=e}); | ||
$.getScript(" | $.getScript("/wiki/Popup.js?action=raw"); | ||
} | } | ||
Zeile 15: | Zeile 15: | ||
//craft products count | //craft products count | ||
if ($('. | if ($('.input_calc.craft_nb').length) { | ||
$(' | $('<input type="number" class="west" style="width:80px;" id="craft_nb" value="1" max="9000">').appendTo($('.craft_nb')); | ||
var multiplierValue = 1; | var multiplierValue = 1; | ||
var currentAmountsArray = []; | var currentAmountsArray = []; | ||
Zeile 28: | Zeile 22: | ||
currentAmountsArray[index] = parseInt($(this).text()); | currentAmountsArray[index] = parseInt($(this).text()); | ||
}); | }); | ||
$(" | $("#craft_nb").on('input paste keyup', function () { | ||
this.value > 9000 | this.value > 9000 | ||
? (this.value = 9000) | ? (this.value = 9000) | ||
Zeile 43: | Zeile 37: | ||
} | } | ||
//crafting life search - thanks to Criminus from RO | //crafting life search - thanks to Criminus from RO | ||
$('. | if ($('.input_calc.craft_search').length) { | ||
$('<input type="text" class="west" style="width:180px;" id="craft_search" placeholder="Suche">').appendTo($('.craft_search')); | |||
} | |||
$("#craft_search").on("keyup", function() { | |||
} | |||
$("# | |||
var value = $(this).val(); | var value = $(this).val(); | ||
$("table tr").each(function(index) { | $("table tr").each(function(index) { | ||
Zeile 65: | Zeile 56: | ||
}); | }); | ||
}); | }); | ||
//Calculate box | //Calculate box |
Version vom 14. August 2023, 19:30 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */ $('.tbbox-logo').wrap('<a href="/"></a>'); //Popup item if ($('.item_container').length+$('.set_icon').length>0) { $('.item_container').each(function() { var url=$(this).attr('data-url'); $(this).append('<img src="//westde.innogamescdn.com/images/items/'+url+(url.indexOf('.png')<0?'.png':'')+'">'); }); $.getJSON("/wiki/Evsets.json?action=raw",function(e){evsets=e}); $.getScript("/wiki/Popup.js?action=raw"); } mw.config.set('tableSorterCollation',{'ä':'ae','ö':'oe','ß':'ss','ü':'ue'}); //craft products count if ($('.input_calc.craft_nb').length) { $('<input type="number" class="west" style="width:80px;" id="craft_nb" value="1" max="9000">').appendTo($('.craft_nb')); var multiplierValue = 1; var currentAmountsArray = []; $('.number').each(function (index) { currentAmountsArray[index] = parseInt($(this).text()); }); $("#craft_nb").on('input paste keyup', function () { this.value > 9000 ? (this.value = 9000) : this.value < 0 && (this.value = 0); multiplierValue = this.value; $('.number').each(function (index) { $(this).text(currentAmountsArray[index] * multiplierValue); }); $('.craft_extra').show(); $('.craft_extra .item_container').each(function () { $(this).children().addClass('OverlayItem'); }); }); } //crafting life search - thanks to Criminus from RO if ($('.input_calc.craft_search').length) { $('<input type="text" class="west" style="width:180px;" id="craft_search" placeholder="Suche">').appendTo($('.craft_search')); } $("#craft_search").on("keyup", function() { var value = $(this).val(); $("table tr").each(function(index) { if (index !== 0) { $row = $(this); var id = $.map($row.find('td .item_container'), function(element) { return $(element).attr("data-popup") }).join(' '); if (id.toLowerCase().indexOf(value.toLowerCase()) < 0) { $row.hide(); } else { $row.show(); } } }); }); //Calculate box if ($('.calculate_box').length) { $.getScript('/wiki/Calculate.js?action=raw'); }; //File overview if (location.pathname.startsWith("/wiki/Datei:") && !$("#pt-logout").length) $("#page").addClass("file_page");