Widget:Live2DSwitcher: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
var doll = container.data('t-doll'); | var doll = container.data('t-doll'); | ||
mw.loader.using('ext.gadget.live2d').then(function() { | mw.loader.using('ext.gadget.live2d').then(function() { | ||
var ul = | var ul = container.find('ul'); | ||
var settings = gfUtils.live2dUtils.convertSettingsFromUl(ul); | var settings = gfUtils.live2dUtils.convertSettingsFromUl(ul); | ||
for (costume in settings) { | for (costume in settings) { | ||
Line 18: | Line 18: | ||
name = costume.costumeId + " - " + variant.variantId; | name = costume.costumeId + " - " + variant.variantId; | ||
} | } | ||
container.find('.live2dswitcher').append($('<option>', { | |||
value: id, | value: id, | ||
text: name | text: name | ||
Line 48: | Line 48: | ||
</script> | </script> | ||
<select class="gf-droplist" style="flex-grow: 1;" autocomplete="off" onchange="swap_model(this)" > | <select class="gf-droplist live2dswitcher" style="flex-grow: 1;" autocomplete="off" onchange="swap_model(this)" > | ||
<!--<option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected"></option>--> | <!--<option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected"></option>--> | ||
</select></includeonly><noinclude> | </select></includeonly><noinclude> |