◆少前百科是非盈利性、非官方的少女前线维基百科。 ◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科。 ◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科 ◆To foreigners,You can use twitter to contact us. |
“Widget:ChibiCostumeSwitcher”的版本间的差异
Mikumikuer(讨论 | 贡献) |
小 |
||
(未显示3个用户的25个中间版本) | |||
第1行: | 第1行: | ||
− | <includeonly><script> | + | <includeonly><style> |
+ | div#content { | ||
+ | overflow: clip; | ||
+ | }</style><script> | ||
+ | /* Original widget created by en.gfwiki.com/wiki/User:Messing_with_data, Copied under Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License */ | ||
RLQ.push(function () { | RLQ.push(function () { | ||
$(document).ready(function() { | $(document).ready(function() { | ||
第16行: | 第20行: | ||
mw.loader.using(neededGadgets).then(function () { | mw.loader.using(neededGadgets).then(function () { | ||
swap_costume_intern(element, targetId); | swap_costume_intern(element, targetId); | ||
+ | },function () {var mobile=$("#section_0"); | ||
+ | if (mobile.length == 0){console.error("Loading needed libraries failed");} | ||
+ | else {swap_costume_intern(element, targetId);} | ||
}); | }); | ||
} | } | ||
第22行: | 第29行: | ||
var selectBox = $(element); | var selectBox = $(element); | ||
− | costumeSelectionIndex = selectBox.prop('selectedIndex'); | + | const costumeSelectionIndex = selectBox.prop('selectedIndex'); |
− | + | console.log('costumeSelectionIndex', costumeSelectionIndex, costumeSelectionIndex != 0); | |
var chibiCostumeName = ""; | var chibiCostumeName = ""; | ||
if (costumeSelectionIndex != 0) { | if (costumeSelectionIndex != 0) { | ||
− | chibiCostumeName = " | + | chibiCostumeName = "_"+selectBox.val() |
} | } | ||
− | |||
var targetSelector = targetId == "" ? ".chibiAnimationContainer" : ("#" + targetId); | var targetSelector = targetId == "" ? ".chibiAnimationContainer" : ("#" + targetId); | ||
$(targetSelector).attr('data-tdoll-costume', chibiCostumeName); | $(targetSelector).attr('data-tdoll-costume', chibiCostumeName); | ||
− | $(targetSelector).find('.chibiAnimation').trigger("costume_changed", chibiCostumeName); | + | $(targetSelector).find('.chibiAnimation').trigger("costume_changed", [chibiCostumeName]); |
+ | if($(targetSelector).children('.chibiDormButton').hasClass('stateon')) { | ||
+ | var currentDormButton = $(targetSelector).children('.chibiDormButton'); | ||
+ | var futureEnabledState = currentDormButton.hasClass('stateoff'); | ||
+ | if(futureEnabledState) { | ||
+ | currentDormButton.addClass('stateon'); | ||
+ | currentDormButton.removeClass('stateoff'); | ||
+ | } else { | ||
+ | currentDormButton.removeClass('stateon'); | ||
+ | currentDormButton.addClass('stateoff'); | ||
+ | } | ||
+ | } | ||
var tdollId = selectBox.closest('.costumeContainer').find('.tdoll_chibi').data('tdollId'); | var tdollId = selectBox.closest('.costumeContainer').find('.tdoll_chibi').data('tdollId'); | ||
第46行: | 第63行: | ||
</script> | </script> | ||
<select class="gf-droplist chibi-costume-switcher" autocomplete="off" onchange="swap_costume(this, '<!--{$target|escape:'html'}-->')" > | <select class="gf-droplist chibi-costume-switcher" autocomplete="off" onchange="swap_costume(this, '<!--{$target|escape:'html'}-->')" > | ||
− | <option value="{{BASEPAGENAME}}" selected="selected"> | + | <option value="{{BASEPAGENAME}}" selected="selected">默认Q版</option> |
<!--{foreach from=$costumes key=key item=item}--> | <!--{foreach from=$costumes key=key item=item}--> | ||
− | <!--{if $ | + | <!--{if $key neq '' && $item neq ""}--><option value="<!--{$key|escape:'html'}-->"><!--{$item|escape:'html'}--></option><!--{/if}--> |
<!--{/foreach}--> | <!--{/foreach}--> | ||
</select></includeonly> | </select></includeonly> | ||
第55行: | 第72行: | ||
{{#widget:ChibiCostumeSwitcher | {{#widget:ChibiCostumeSwitcher | ||
|target=enemyChibiAnimation | |target=enemyChibiAnimation | ||
− | |costumes. | + | |costumes.mod=mod |
− | |costumes. | + | |costumes.301=301 |
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
− | <div id="enemyChibiAnimation" class="chibiAnimationContainer" data-tdoll-id=" | + | <div id="enemyChibiAnimation" class="chibiAnimationContainer" data-tdoll-id="柯尔特左轮" data-tdoll-hidedormbutton="false" style="border: thin dashed gray;"> </div><p style="font-style: italic;">Original widget created by https://en.gfwiki.com/wiki/User:Messing_with_data, <b>Copied under Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License</b></p></noinclude> |
− | </noinclude> |
2023年8月26日 (六) 00:04的最新版本
Original widget created by https://en.gfwiki.com/wiki/User:Messing_with_data, Copied under Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License