Removing calls to deprecated functionality in favor of the new versions. Old version...
authorKrinkle <krinkle@users.mediawiki.org>
Thu, 7 Jul 2011 17:52:55 +0000 (17:52 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Thu, 7 Jul 2011 17:52:55 +0000 (17:52 +0000)
Follows-up:
* r75275: Introduced the updateTooltipAccessKeys function in the new library but didn't call it on document ready and left the deprecated one in the onloadhook-run in wikibits.js untouched
* r75287: Introduced jquery.checkboxShiftClick and called on-load but left the load call for the legacy version untouched. Depending on the load order at any given time it may not have been used.

Also reordering the if-else case in mw.util.updateTooltipAccessKeys to allow a call without arguments ("undefined instanceof Foo" throws exception)

resources/mediawiki.page/mediawiki.page.ready.js
resources/mediawiki/mediawiki.util.js
skins/common/wikibits.js

index c9f4ad4..eba5db1 100644 (file)
@@ -18,4 +18,7 @@ jQuery( document ).ready( function( $ ) {
        /* Enable CheckboxShiftClick */
        $( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick();
 
+       /* Add accesskey hints to the tooltips */
+       mw.util.updateTooltipAccessKeys();
+
 } );
index 435a105..ebd63ef 100644 (file)
                 * otherwise, all the nodes that will probably have accesskeys by
                 * default are updated.
                 *
-                * @param nodeList mixed A jQuery object, or array of elements to update.
+                * @param nodeList {Array|jQuery} (optional) A jQuery object, or array of elements to update.
                 */
                'updateTooltipAccessKeys' : function( nodeList ) {
                        var $nodes;
-                       if ( nodeList instanceof jQuery ) {
-                               $nodes = nodeList;
-                       } else if ( nodeList ) {
-                               $nodes = $( nodeList );
-                       } else {
+                       if ( !nodeList ) {
+                       
                                // Rather than scanning all links, just the elements that
                                // contain the relevant links
                                this.updateTooltipAccessKeys(
                                // these are rare enough that no such optimization is needed
                                this.updateTooltipAccessKeys( $( 'input' ) );
                                this.updateTooltipAccessKeys( $( 'label' ) );
+
                                return;
+
+                       } else if ( nodeList instanceof jQuery ) {
+                               $nodes = nodeList;
+                       } else {
+                               $nodes = $( nodeList );
                        }
 
                        $nodes.each( function ( i ) {
index 81cad57..5cb037b 100644 (file)
@@ -612,9 +612,6 @@ window.runOnloadHook = function() {
        // might cause the function to terminate prematurely
        doneOnloadHook = true;
 
-       updateTooltipAccessKeys( null );
-       setupCheckboxShiftClick();
-
        // Run any added-on functions
        for ( var i = 0; i < onloadFuncts.length; i++ ) {
                onloadFuncts[i]();