MediaWiki: Common.js

From Infinity
Revision as of 11:48, 11 March 2020 by Ian (talk | contribs) (Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: $(document).ready(function(){ $(".n4").hide(); $("#dropdown").change(function...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Any JavaScript here will be loaded for all users on every page load. */

$(document).ready(function(){
          $(".n4").hide();
            $("#dropdown").change(function(){
                if ($("#dropdown").val() == "n4") {
                    $(".n4").show(300);
                } else {
                    $(".n4").hide(300);
                }
            });
        });

$(document).ready(function(){
          $(".n5toggle").hide();
            $("#gametoggle").click(function(){
                if ($("#gametoggle").is(":checked")) {
                    $(".n4").show(300);
                } else {
                    $(".n4").hide(300);
                }
            });
        });


$(function () {
	$('#mw-mywiki-gameswap').html("<div class='form-row'><label><span>Game Version: </span><select name='register_as' id='dropdown'><option value='none'>Select One</option><option value='n4'>Show full N4 Rules</option><option value='c1'>Show CodeOne Rules</option></select></label> </div>");
}());


$(function () {
	$('#n5gametoggle').html("<span class='gamesliderlabel'>Show full N4 rules: </span><label class='switch' > <input type='checkbox' id='gametoggle' ><span class='slider round' ></span></label>");
}());