User:Thgoiter/common.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// blendet Links zu OSM und Google Maps in Kategorien ein
if (mw.config.get('wgNamespaceNumber') === 14) { 
  jQuery(document).ready(function(){
    mw.util.addPortletLink('p-cactions', '//tools.wmflabs.org/osm4wiki/cgi-bin/wiki/wiki-osm.pl?project=Commons&l=2&usecache=0&article=Category:' + mw.config.get('wgTitle').split(" ").join("_"), 'OSM (l=2, nocache)', 'OSM');
  });
  jQuery(document).ready(function(){
    mw.util.addPortletLink('p-cactions', '//tools.wmflabs.org/osm4wiki/cgi-bin/wiki/wiki-osm.pl?project=Commons&l=2&usecache=1&article=Category:' + mw.config.get('wgTitle').split(" ").join("_"), 'OSM (l=2, cache)', 'OSM');
  });
  jQuery(document).ready(function(){
    mw.util.addPortletLink('p-cactions', '//tools.wmflabs.org/wp-world/googlmaps-proxy.php?page='+encodeURIComponent('http://tools.wmflabs.org/kmlexport/?project=Commons&l=2&usecache=0&article=Category:' + mw.config.get('wgTitle').split(" ").join("_"))+'&output=classic', 'gMaps (l=2, nocache)', 'gMaps');
  });
  jQuery(document).ready(function(){
    mw.util.addPortletLink('p-cactions', '//tools.wmflabs.org/wp-world/googlmaps-proxy.php?page='+encodeURIComponent('http://tools.wmflabs.org/kmlexport/?project=Commons&l=2&usecache=1&article=Category:' + mw.config.get('wgTitle').split(" ").join("_"))+'&output=classic', 'gMaps (l=2, cache)', 'gMaps');
  });
}