Jump to content

User:PerfektesChaos/js/tableXpander/scout/d.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/// tableXpander/scout.js
/// 2020-07-26 PerfektesChaos@de.wikipedia
/// <nowiki>
/* global window:false                                                 */
/* jshint forin:false,
          bitwise:true, curly:true, eqeqeq:true, latedef:true,
          laxbreak:true,
          nocomma:true, strict:true, undef:true, unused:true           */
( function ( mw, $ ) {
   "use strict";
   var Version   = -1.0,
       Signature = "tableXpander",
       GUI       = { show:    Signature + "@PerfektesChaos",
                     sign:    "|}===={|",
                     start:   "https://en.wikipedia.org/"
                              + "w/index.php?title="
                              + "User:PerfektesChaos/js/"
                              + Signature
                              + "/"
                              + ( Version > 0  ?  "r"  :  "d" )
                              + ".js"
                              + "&action=raw&ctype=text/javascript" };



   GUI.fire = function () {
      // Start processing
      // Uses:
      //    (GUI.firing)
      // 2020-07-26 PerfektesChaos@de.wikipedia
      mw.loader.using( [ "mediawiki.util" ],
                       GUI.firing );
   };   // GUI.fire()



   GUI.fired = function () {
      // Tool requested
      // Uses:
      //    >  GUI.$portlet
      //    >  GUI.start
      // 2020-07-26 PerfektesChaos@de.wikipedia
      GUI.$portlet.empty();
      mw.loader.load( GUI.start );
   };   // GUI.fired()



   GUI.firing = function () {
      // Libraries ready
      // Uses:
      //    (GUI.furnish)
      // 2020-07-26 PerfektesChaos@de.wikipedia
      $( GUI.furnish );
   };   // GUI.firing()



   GUI.furnish = function () {
      // Equip page
      // Precondition:
      //    DOM ready, libraries ready
      // Uses:
      //    >  Signature
      //    >  GUI.sign
      //    >  GUI.show
      //     < GUI.$portlet
      //    (GUI.fired)
      // 2020-07-26 PerfektesChaos@de.wikipedia
      var sign = "t-" + Signature;
      if ( ! $( "#" + sign ).length ) {
         GUI.$portlet = $( mw.util.addPortletLink( "p-tb",
                                                   "#",
                                                   GUI.sign,
                                                   sign,
                                                   GUI.show,
                                                   null,
                                                   null ) );
         GUI.$portlet.click( GUI.fired );
      }
   };   // GUI.furnish()



   GUI.fire();
}( window.mediaWiki, window.jQuery ) );



// Emacs
// Local Variables:
// coding: utf-8-unix
// fill-column: 80
// End:

/// EOF </nowiki>   tableXpander/scout.js