Widget:costumeSwitcher: Difference between revisions
Jump to navigation
Jump to search
m Single instead of Double quotes |
First try for swap_mod |
||
Line 1: | Line 1: | ||
<includeonly><script> | <includeonly><script> | ||
funciton swap_mod(element) { | |||
var selectBox = $(element); | |||
var selectedValue = selectBox.find(':selected').val(); | |||
var tmp = new DOMParser().parseFromString(selectedValue, "text/html"); | |||
var tdollData = jQuery.parseJSON(tmp.documentElement.textContent); | |||
var statContainer = selectBox.closest('.stattable'); | |||
for (var key in tdollData) { | |||
if (!tdollData.hasOwnProperty(key)) { | |||
continue; | |||
} | |||
statContainer.find('*[data-tdoll-stat-id="' + key + '"]').text(tdollData[key]); | |||
} | |||
} | |||
function swap_costume(element) { | function swap_costume(element) { | ||
var neededGadgets = [ 'ext.gadget.md5hasher' ]; | var neededGadgets = [ 'ext.gadget.md5hasher' ]; |