Es gibt z.Z. Probleme mit einem Update, es ist nur Lesen möglich.
Currently there are issues with the installation, readonly possible for now.

Difference between revisions of "MediaWiki:Gadget-Vorlagenmeister.js"

From Jigsaw-Wiki
Jump to: navigation, search
(Die Seite wurde neu angelegt: „* * Project: Vorlagen-Meister SCOUT * Version: 0.5, Date: 2014-07-13 or later (see VERSION): /*jshint curly:true, eqeqeq:true, latedef:true, laxbreak:tr…“)
 
m (Karbon moved page MediaWiki:Gadget-Vorlagenmeister-org.js to MediaWiki:Gadget-Vorlagenmeister.js without leaving a redirect)
 
(One intermediate revision by the same user not shown)
(No difference)

Latest revision as of 14:36, 21 March 2017

/**
* Project:  Vorlagen-Meister SCOUT
* Version:  0.5, Date: 2014-07-13 or later (see VERSION)
*/

/*jshint curly:true, eqeqeq:true, latedef:true, laxbreak:true,
         strict:true, trailing:true, undef:true                        */
/*global window:false                                                  */



( function ( mw, $ ) {
   "use strict";
   var VERSION     = "(Scout) 0.5 2014-07-13",
       MW_LIB      = "vorlagenmeister",
       OPTIONS;


   if ( typeof( mw.libs[ MW_LIB ] ) !== "object"   ||
        ! mw.libs[ MW_LIB ] ) {
      mw.libs[ MW_LIB ] = { };
   }
   OPTIONS = mw.libs[ MW_LIB ];



   function fire() {
      // Start possible actions on current page
      // Precondition:
      //    mediawiki.util and configs have been loaded
      // Postcondition:
      //    /core.js will be loaded, if appropriate
      // 2014-07-13 PerfektesChaos@de.wikipedia
      var scan   = "|edit|submit|",
          seek   = mw.util.getParamValue( "action" ),
          server = "//de.wikipedia.beta.wmflabs.org",
          env;
      if ( scan.indexOf( seek ) > 0 ) {
         env = mw.config.get( [ "wgIsProbablyEditable",
                                "wgNamespaceNumber",
                                "wgPageContentModel",
                                "wgServer",
                                "wgTitle" ] );
         if ( env.wgIsProbablyEditable                &&
              env.wgPageContentModel === "wikitext"   &&
              ! ( env.wgNamespaceNumber === 10  &&
                  /\/XML$/.test( env.wgTitle ) ) ) {
            if ( typeof( OPTIONS.vsn ) === "undefined" ) {
               OPTIONS.vsn  =  VERSION;
            }
            if ( env.wgServer !== server ) {
               server = "//de.wikipedia.org";
            }
            mw.loader.load( server
                            + "/w/index.php?title="
                            + "MediaWiki:Gadget-Vorlagenmeister/core.js"
                            + "&maxage=259200"   // 3 d
                            + "&action=raw&ctype=text/javascript" );
         }
      }
   }   // fire()



   if ( typeof( OPTIONS.loader ) !== "boolean" ) {
      OPTIONS.loader = true;
      mw.loader.using( [ "mediawiki.util",
                         "jquery.client",
                         "site",
                         "user",
                         "user.options" ],
                       fire );
   }
}( window.mediaWiki, window.jQuery ) );