Merge "Remove double escaping of group member name on Special:ListUsers"
[lhc/web/wiklou.git] / resources / src / mediawiki.page / mediawiki.page.ready.js
index a05a054..36eb9d4 100644 (file)
@@ -7,7 +7,7 @@
                // it works only comparing to window.self or window.window (http://stackoverflow.com/q/4850978/319266)
                if ( window.top !== window.self ) {
                        // Un-trap us from framesets
-                       window.top.location = window.location;
+                       window.top.location.href = location.href;
                }
        }
 
@@ -36,6 +36,7 @@
 
        // Things outside the wikipage content
        $( function () {
+               var $nodes;
 
                if ( !supportsPlaceholder ) {
                        // Exclude content to avoid hitting it twice for the (first) wikipage content
                }
 
                // Add accesskey hints to the tooltips
-               mw.util.updateTooltipAccessKeys();
+               if ( document.querySelectorAll ) {
+                       // If we're running on a browser where we can do this efficiently,
+                       // just find all elements that have accesskeys. We can't use jQuery's
+                       // polyfill for the selector since looping over all elements on page
+                       // load might be too slow.
+                       $nodes = $( document.querySelectorAll( '[accesskey]' ) );
+               } else {
+                       // Otherwise go through some elements likely to have accesskeys rather
+                       // than looping over all of them. Unfortunately this will not fully
+                       // work for custom skins with different HTML structures. Input, label
+                       // and button should be rare enough that no optimizations are needed.
+                       $nodes = $( '#column-one a, #mw-head a, #mw-panel a, #p-logo a, input, label, button' );
+               }
+               $nodes.updateTooltipAccessKeys();
 
        } );