Difference between revisions of "MediaWiki:Common.js"

From Direct-Mind.Org

(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: /* ref: http://en.wikipedia.org/wiki/Help:User_style#Moving_categories_to_top Moving categories to...")
 
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:




 
/* doesn't work in Firefox
function catsattop() {
function catsattop() {
var cats = document.getElementById('catlinks');
var cats = document.getElementById('catlinks');
Line 13: Line 13:
bc.insertBefore(cats, bc.childNodes[0]);
bc.insertBefore(cats, bc.childNodes[0]);
}
}
*/
/* ditto here
function categoryToTop() {
  var thebody = document.getElementById('contentTop');
  var categories = document.getElementById('catlinks');
  if (categories != null) {
    categories.parentNode.removeChild (categories);
    thebody.parentNode.insertBefore(categories, thebody);
  }
}
*/

Latest revision as of 15:30, 9 January 2015

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

/* ref: http://en.wikipedia.org/wiki/Help:User_style#Moving_categories_to_top
Moving categories to top[edit]
The following code moves the category box to the top of the article. Of course, you might want to apply some CSS to make it look prettier:
*/


/* doesn't work in Firefox
function catsattop() {
var cats = document.getElementById('catlinks');
var bc = document.getElementById('bodyContent');
bc.insertBefore(cats, bc.childNodes[0]);
}
*/


/* ditto here
function categoryToTop() {
  var thebody = document.getElementById('contentTop');
  var categories = document.getElementById('catlinks');

  if (categories != null) {
    categories.parentNode.removeChild (categories);
    thebody.parentNode.insertBefore(categories, thebody);
  }
}
*/