Jump to content

User:Ch1902/vector.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ch1902 (talk | contribs) at 19:18, 19 February 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$.extend({
   /**
    * Add a new link to the page action dropdown menu
    */
   addActionMenuItem: function (text, href, id, how) {
      return $('<li/>').attr({id: id || ''}).append(
         $('<a/>').attr('href', href).text(text)
      )[(how || 'append') + 'To']('div#p-cactions ul');
   },
   /**
    * Add a new link to the page view menu
    */
   addViewMenuItem: function (text, href, id, how) {
      return $('<li/>').attr({id: id || ''}).append(
         $('<span/>').append(
            $('<a/>').attr('href', href).text(text)
         )
      )[(how || 'prepend') + 'To']('div#p-views ul');
   }
});

/* disable */
ls_enable = false;

popupStructure = 'lite';
popupMaxWidth = 500;


addOnloadHook(function () {
   $.addActionMenuItem('COM:Ch1902', 'http://commons.wikimedia.org/wiki/User:Ch1902');
   $.addActionMenuItem('COM:Watch', 'http://commons.wikimedia.org/wiki/Special:Watchlist');
   $.addActionMenuItem('COM:Upload', 'http://commons.wikimedia.org/w/index.php?title=Special:Upload&uploadformstyle=basic');
   $.addViewMenuItem('WD:Page', 'http://www.wikidata.org/wiki/Special:ItemByTitle/enwiki/' + mw.config.get('wgPageName'));
});