Difference between revisions of "MediaWiki:Common.js"

From M59Wiki
Jump to navigation Jump to search
Line 5: Line 5:
 
jQuery( document ).ready( function ( $ ) {
 
jQuery( document ).ready( function ( $ ) {
 
   'use strict';
 
   'use strict';
   var placeholder;
+
   var edittools;
  if ( $( '#editpage-specialchars' ).length ) {
+
  if ( $( '.mw-editTools' ).length ) {
   placeholder = $( '#editpage-specialchars' )[0];
+
   edittools = $( '.mw-editTools' )[0];
 
   } else {
 
   } else {
  placeholder = $( '<div id="editpage-specialchars"> </div>' ).prependTo( '.mw-editTools' )[0];
 
console.log(placeholder);
 
  }
 
  if ( !placeholder ) {
 
 
     return;
 
     return;
 
   }
 
   }
   $( '.editOptions' ).before( placeholder );
+
   $( '.editOptions' ).before( edittools );
 
});
 
});

Revision as of 12:20, 6 July 2022

/* Any JavaScript here will be loaded for all users on every page load. */

// Extension:Edittools
// We put the edit tools section above the summary box.
jQuery( document ).ready( function ( $ ) {
  'use strict';
  var edittools;
 if ( $( '.mw-editTools' ).length ) {
   edittools = $( '.mw-editTools' )[0];
  } else {
    return;
  }
  $( '.editOptions' ).before( edittools );
});