MediaWiki talk:Gadget-CategoryAboveBelowImage.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search


Upload form[edit]

{{Editprotected}}

As discussed, please update to the following:

source
//* by [[User:Ianezz]] ([[Commons:Village_pump/Archive/2009Sep#CSS_placement_of_categories]]), based on [[:wikinews:Help:User_style#Moving_categories_to_top]]
 
function catsattop() {
  if ( wgCanonicalNamespace=="Special") return;
  var cats = document.getElementById('catlinks');
  var bc = document.getElementById('bodyContent');
  var f  = document.getElementById('file');
  if (f != null) { f.appendChild(cats); } else { bc.insertBefore(cats, bc.childNodes[0]); }
}
hookEvent ('load', catsattop);

For MediaWiki:Gadget-CategoryAboveAll.js, please use the following:

source
//* by [[User:Ianezz]] ([[Commons:Village_pump/Archive/2009Sep#CSS_placement_of_categories]]), based on [[:wikinews:Help:User_style#Moving_categories_to_top]]
 
function catsattop() {
  if ( wgCanonicalNamespace=="Special") return;
  var cats = document.getElementById('catlinks');
  var bc = document.getElementById('bodyContent');
  bc.insertBefore(cats, bc.childNodes[0]);
}
 
hookEvent ('load', catsattop);

Thanks. -- User:Docu at 13:02, 27 February 2010 (UTC)[reply]

done. Esby (talk) 20:18, 28 February 2010 (UTC)[reply]

Faster load + clone catsEdit request+[edit]

{{Edit request}}

I've updated the script with keeping the original catlist and clones the other. Because it is sometimes annoying, the catlist is missing and the load time was bad (if you only want check cats, document.ready = jQuery is not anymore needed). User: Perhelion 09:38, 8 September 2016 (UTC)[reply]

✓ Done Awesome! Thank you! Zhuyifei1999 (talk) 16:05, 14 October 2016 (UTC)[reply]