Check out Sunborn's two newly announced games (official English titles pending): Girls' Frontline: Blue Butterfly Contract and Reverse Collapse: F !
You don't need an account to join in. Learn how to contribute, browse Bounties and join our Discord server.

Widget:StatTable: Difference between revisions

Welcome to IOP Wiki. This website is maintained by the Girls' Frontline community and is free to edit by anyone.
Jump to navigation Jump to search
Added document-ready wait functionality as the MediaWiki does not wait for DOM
Moved JavaScript to Gadget
 
Line 1: Line 1:
<includeonly>
<includeonly>
<script>
<script>RLQ.push(['md5hasher', function () {
function swap_costume() {
        costumeSelection = document.getElementById("costumeSelection").value;
 
        $("#fullart a").attr("href", costumeSelection);
        $("#fullart a img").attr("src", costumeSelection);
        $("#fullart a img").attr("alt", costumeSelection);
        //$("#fullart a img").attr("srcset", "/wiki/Special:Redirect/file/Springfield" + costumeSelection + ".png 1.5x, /wiki/Special:Redirect/file/Springfield" + costumeSelection + ".png 2x");
        $(".tdoll_chibi").attr("src", "/wiki/Special:Redirect/file/Springfield" + costumeSelection + "_S.png");
       
        // As we change the link, we have to update the Thumb-Cache of the Media Viewer
        // Clear up the thumbs cache
        if (mv && mv.mmv && mv.mmv.bootstrap && mv.mmv.bootstrap.viewer) {
          mw.mmv.bootstrap.thumbs = [];
          // Search for all thumbs
          mw.mmv.bootstrap.processThumbs($("#content"));
          // Re-Init the viewer with the new thumbs
          mw.mmv.bootstrap.viewer.initWithThumbs(mw.mmv.bootstrap.thumbs);
        }
}
 
RLQ.push(['jquery', function () {
   $(document).ready(function() {
   $(document).ready(function() {
if (document.getElementById("stat_table")) {
if (document.getElementById("stat_table")) {
Line 27: Line 6:
         st_element.outerHTML = '<div id="stat_table" style="color:blue"><!--{$dmg_max|escape:'html'}--></div>';
         st_element.outerHTML = '<div id="stat_table" style="color:blue"><!--{$dmg_max|escape:'html'}--></div>';
}
}
swap_costume();
    window.iopwidgets.StatTable.swap_costume();
   });
   });
}]);
}]);

Latest revision as of 19:03, 19 July 2025


test