User:Zhuyifei1999/common.js

From WikiIndex
< User:Zhuyifei1999
Revision as of 06:01, 24 June 2013 by Zhuyifei1999 (talk | contribs) (Undid revision 170872 by Zhuyifei1999 (talk) -- good one)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/**
 * Move the [edit] link from the opposite edge to the side of the heading title itself
 *
 * @source: http://www.mediawiki.org/wiki/Snippets/Editsection_inline
 * @rev: 4
 */
jQuery( document ).ready( function( $ ) {
        if ( $.inArray( mw.config.get('editsection-inline'), [ 'no', false ]) !== -1 ) {
                return;
        }

        mw.util.addCSS( '.editsection{float:none!important;margin-left:1em}' );
        mw.util.$content.find('.editsection').each( function() {
                var $what = $(this).parent().children();
                $what.first().before( $what.last() );
        });
});