Widget:Live2DSwitcher: Difference between revisions
Jump to navigation
Jump to search
loaded missing resources |
No edit summary |
||
Line 6: | Line 6: | ||
containers.each(function() { | containers.each(function() { | ||
var container = $(this); | |||
var doll = container.data('t-doll'); | |||
mw.loader.using('ext.gadget.live2d').then(function() { | mw.loader.using('ext.gadget.live2d').then(function() { | ||
var ul = $(this).find('ul'); | var ul = $(this).find('ul'); | ||
var settings = gfUtils.live2dUtils.convertSettingsFromUl(ul); | var settings = gfUtils.live2dUtils.convertSettingsFromUl(ul); | ||
for (costume in settings) { | |||
for (variant in costume) { | |||
var id = doll + "|" + costume.costumeId + "|" + variant.variantId; | |||
var name = variant.name; | |||
if (!name) { | |||
name = costume.costumeId + " - " + variant.variantId; | |||
} | |||
$('#mySelect').append($('<option>', { | |||
value: id, | |||
text: name | |||
})); | |||
} | |||
} | |||
console.log(settings); | console.log(settings); | ||
}); | }); | ||
Line 36: | Line 51: | ||
<!--<option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected"></option>--> | <!--<option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected"></option>--> | ||
</select></includeonly><noinclude> | </select></includeonly><noinclude> | ||
<div class="dollLive2d" style="height: 800px; width: 700px;"> | <div class="dollLive2d" data-t-doll="Thompson" style="height: 800px; width: 700px;"> | ||
{{#widget:Live2DSwitcher}} | {{#widget:Live2DSwitcher}} | ||
<div class="live2dsettings" style="display:none">{{:Thompson/Live2DSettings}}</div> | <div class="live2dsettings" style="display:none">{{:Thompson/Live2DSettings}}</div> | ||
</div> | </div> | ||
</noinclude> | </noinclude> |