helialprofile.png
Welcome to IOPWiki, Commander.
We are lacking editors focused on Girls' Frontline and Girls' Frontline 2. You can contribute without an account. Learn how to contribute and join our Discord server.

Difference between revisions of "Widget:StatTable"

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)
 
(37 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
 
<script>
 
<script>
RLQ.push(function () {
+
function swap_costume() {
$(document).ready(function() {
+
        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() {
 
if (document.getElementById("stat_table")) {
 
if (document.getElementById("stat_table")) {
 
         st_element = document.getElementById("stat_table");
 
         st_element = document.getElementById("stat_table");
         st_element.outerHTML =
+
         st_element.outerHTML = '<div id="stat_table" style="color:blue"><!--{$dmg_max|escape:'html'}--></div>';
            '<div id="stat_table" style="color:blue"><!--{$dmg_max|escape:'html'}--></div>'
 
 
}
 
}
 
swap_costume();
 
swap_costume();
});
+
  });
});
+
}]);
 
 
function swap_costume() {
 
        costumeSelection = document.getElementById("costumeSelection").value;
 
        // document.getElementById("fullart").innerHTML = "<a href=\"/wiki/File:Springfield.png\" class=\"image\"><img src=\"/wiki/Special:Filepath/Springfield" + costumeSelection + ".png?width=420\" srcset=\"/wiki/Special:Filepath/Springfield" + costumeSelection + ".png?width=630 1.5x, /wiki/Special:Filepath/Springfield" + costumeSelection + ".png?width=840 2x\" data-file-width=\"1024\" data-file-height=\"1024\" height=\"420\" width=\"420\"></img></a>";
 
        $("#fullart a").attr("href", "/wiki/File:Springfield" + costumeSelection + ".png");
 
        $("#fullart a img").attr("src", "/wiki/Special:Filepath/Springfield" + costumeSelection + ".png?width=420");
 
}
 
 
 
 
 
  
 
</script>
 
</script>
 
<select id="costumeSelection" onchange="swap_costume()">
 
<select id="costumeSelection" onchange="swap_costume()">
<option value="" selected="selected">Default</option>
+
<option value="<!--{$defaultpath|escape:'html'}-->" selected="selected">Default</option>
 
<option value="_Mod">Mod</option>
 
<option value="_Mod">Mod</option>
<option value="_costume1"><!--{$costume1|escape:'html'}--></option>
+
<option value="<!--{$costume1path|escape:'html'}-->"><!--{$costume1|escape:'html'}--></option>
<option value="_costume2"><!--{$costume2|escape:'html'}--></option>
+
<option value="<!--{$costume2path|escape:'html'}-->"><!--{$costume2|escape:'html'}--></option>
<option value="_costume3"><!--{$costume3|escape:'html'}--></option>
+
<option value="<!--{$costume3path|escape:'html'}-->"><!--{$costume3|escape:'html'}--></option>
 
</select>
 
</select>
  
Line 34: Line 44:
  
 
<noinclude>
 
<noinclude>
{{#widget:StatTable|dmg_max=999|costume1=test1|costume2=test2|costume3=test3}}
+
{{#widget:StatTable
<div id="fullart">[[file:Springfield.png|420]]</div>
+
|dmg_max=999
 +
|defaultpath={{filepath:Springfield.png|420}}
 +
|costume1=test1
 +
|costume1path={{filepath:Springfield_costume1.png|420}}
 +
|costume2=test2
 +
|costume2path={{filepath:Springfield_costume2.png|420}}
 +
|costume3=test3
 +
|costume3path={{filepath:Springfield_costume3.png|420}}
 +
}}
 +
 
 +
<div id="fullart" style="float:left; padding: 10px;">[[file:Springfield.png|420px]]</div>
 +
<div id="dummydiv" style="float:left; padding: 10px; border: thin solid white;" onclick="alert('hi');">[[File:Springfield_chibi.png|link=|center|class=tdoll_chibi]]</div>
 +
 
 
</noinclude>
 
</noinclude>

Latest revision as of 15:10, 14 October 2019


test

Springfield.png
Springfield chibi.png