Jump to content

User:Gorobay/vector.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.
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Topbanana/RLRL_SR_Utility.js&action=raw&ctype=text/javascript');

jQuery(function($) {
  window.VisualEditorSupportCheck = function() { return false; };
  Object.defineProperty(window, 'VisualEditorSupportCheck', {writable: false});
  $('#wpTextbox1').on('input', function() { $('a[accesskey="v"]').detach(); });
  $('.mw-redirectedfrom a').attr('accesskey', 's').updateTooltipAccessKeys();
  $('#ca-watch, #ca-unwatch').find('a').attr('accesskey', 'w').updateTooltipAccessKeys();
  $('#wpWatchthis').removeAttr('accesskey').updateTooltipAccessKeys();
  $('.ns-2, .ns-3').find('#pt-mycontris a').removeAttr('accesskey').updateTooltipAccessKeys();
  $('.ns-2, .ns-3').find('#t-contributions a').attr('accesskey', 'y').updateTooltipAccessKeys();
  $('.page-Wikipedia_Sandbox.action-edit #wpSave').removeAttr('accesskey').updateTooltipAccessKeys();
  $('.page-Special_MovePage small:first-of-type a[href$="action=edit"]').attr('accesskey', 'e').updateTooltipAccessKeys();
  $('.mw-special-Whatlinkshere #mw-content-text > fieldset a:nth-of-type(2)').attr('accesskey', 'j').updateTooltipAccessKeys();
  if ($.client.profile().name === 'firefox' && $.client.profile().platform === 'mac') {
    $('a[rel=discussion]').attr('accesskey', '5').updateTooltipAccessKeys();
  }
  try {
    if (mw.config.get('wgRedirectedFrom')) {
      window.history.replaceState({} , document.title, mw.config.get('wgArticlePath').replace('$1', encodeURIComponent(mw.config.get('wgRedirectedFrom')) + window.location.hash));
    }
  } catch(e) { }
  $('td[title] :only-child').removeAttr('title');
  $('#bodyContent:has(#redirectsub) #collapseButton0').click();
  if (mw.config.get('wgNamespaceNumber') !== mw.config.get('wgNamespaceIds').file) {
    function bypassMediaViewer(prefix) {
      if (window.location.hash.startsWith(prefix)) {
        return window.location.href = mw.config.get('wgArticlePath').replace('$1', window.location.hash.substring(prefix.length));
      }
    }
    bypassMediaViewer('#/media/') || bypassMediaViewer('#mediaviewer/');
  }
});