「MediaWiki:Common.js」の版間の差分

編集の要約なし
編集の要約なし
編集の要約なし
 
(同じ利用者による、間の7版が非表示)
89行目: 89行目:
}
}
   
   
addOnloadHook( createCollapseButtons );
$( createCollapseButtons );
   
   
/** Test if an element has a certain class **************************************
/** [[Test]] if an element has a certain class **************************************
  *
  *
  * Description: Uses regular expressions and caching for better performance.
  * Description: Uses regular expressions and caching for better performance.
103行目: 103行目:
         };
         };
})();
})();


/**
/**
  * NIJC:
  * Keep code in MediaWiki:Common.js to a minimum as it is unconditionally
* loaded for all users on every wiki page. If possible create a gadget that is
* enabled by default instead of adding it here (since gadgets are fully
* optimized ResourceLoader modules with possibility to add dependencies etc.)
*
* Since Common.js isn't a gadget, there is no place to declare its
* dependencies, so we have to lazy load them with mw.loader.using on demand and
* then execute the rest in the callback. In most cases these dependencies will
* be loaded (or loading) already and the callback will not be delayed. In case a
* dependency hasn't arrived yet it'll make sure those are loaded before this.
  */
  */
importScriptURI('http://bsd.neuroinf.jp/w/skins/common/jquery.min.js');
/*global mw, $, importStylesheet, importScript */
var NIJC_WindowOnLoad = window.onload;
/*jshint curly:false eqnull:true, strict:false, browser:true, */
window.onload = function(){
mw.loader.using( ['mediawiki.util', 'mediawiki.notify', 'jquery.client'], function () {
  if ( typeof(NIJC_WindowOnLoad) == "function" )
/* Begin of mw.loader.using callback */
    NIJC_WindowOnLoad();
 
  if (typeof(jQuery.proxy) == 'undefined') {
    jQuery.extend({
      proxy: function(fn, thisObject) {
        return function() {
          return fn.apply(thisObject, arguments);
        }
      },
      on: function( types, selector, data, fn, one ) {
        var type, origFn;
        if ( typeof types === "object" ) {
          if ( typeof selector !== "string" ) {
            data = data || selector;
            selector = undefined;
          }
          for ( type in types ) {
            this.on( type, selector, data, types[ type ], one );
          }
          return this;
      }
      if ( data == null && fn == null ) {
        fn = selector;
        data = selector = undefined;
      } else if ( fn == null ) {
        if ( typeof selector === "string" ) {
          fn = data;
          data = undefined;
        } else {
          fn = data;
          data = selector;
          selector = undefined;
        }
      }
      if ( fn === false ) {
        fn = returnFalse;
      } else if ( !fn ) {
        return this;
      }
      if ( one === 1 ) {
        origFn = fn;
        fn = function( event ) {
          jQuery().off( event );
          return origFn.apply( this, arguments );
        };
      }
      return this.each( function() {
        jQuery.event.add( this, types, fn, data, selector );
      });
    });
  }
  jQuery(function($){
 


/**
/**
270行目: 225行目:
$( createNavigationBarToggleButton );
$( createNavigationBarToggleButton );


});
 
}
/* End of mw.loader.using callback */
} );
/* DO NOT ADD CODE BELOW THIS LINE */