MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
/* Das folgende JavaScript wird für alle Benutzer geladen. */ | /* Das folgende JavaScript wird für alle Benutzer geladen. */ | ||
$('.tbbox-logo').wrap('<a href="/"></a>'); | $('.tbbox-logo').wrap('<a href="/"></a>'); | ||
//Popup item | //Popup item | ||
if ($('.item_container').length+$('.set_icon').length>0) { | if ($('.item_container').length+$('.set_icon').length>0) { | ||
Zeile 12: | Zeile 13: | ||
mw.config.set('tableSorterCollation',{'ä':'ae','ö':'oe','ß':'ss','ü':'ue'}); | mw.config.set('tableSorterCollation',{'ä':'ae','ö':'oe','ß':'ss','ü':'ue'}); | ||
//craft products count | |||
if ($('.target_input').length) { | |||
$('.target_input p').each(function () { | |||
var id = $(this).attr('id'); | |||
var phrase = $(this).text(); | |||
var newInput = "<input type='number' name='input_new' value='" + phrase + "' class='target' max='9000' min='' />"; | |||
$(this).replaceWith(newInput); | |||
}); | |||
var multiplierValue = 1; | |||
var currentAmountsArray = []; | |||
$('.number').each(function (index) { | |||
currentAmountsArray[index] = parseInt($(this).text()); | |||
}); | |||
$("input[name='input_new']").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'); | |||
}); | |||
}); | |||
} |
Version vom 8. April 2022, 13:52 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.the-west.de/wiki/Evsets.json?action=raw",function(e){evsets=e}); $.getScript("//wiki.the-west.de/wiki/Popup.js?action=raw"); } mw.config.set('tableSorterCollation',{'ä':'ae','ö':'oe','ß':'ss','ü':'ue'}); //craft products count if ($('.target_input').length) { $('.target_input p').each(function () { var id = $(this).attr('id'); var phrase = $(this).text(); var newInput = "<input type='number' name='input_new' value='" + phrase + "' class='target' max='9000' min='' />"; $(this).replaceWith(newInput); }); var multiplierValue = 1; var currentAmountsArray = []; $('.number').each(function (index) { currentAmountsArray[index] = parseInt($(this).text()); }); $("input[name='input_new']").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'); }); }); }