User:Techman224/common.js

From Wikidata
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/*
//Shows snippet of English Wikipedia article to the right of the interwiki link list. Copied from [[User:Sven Manguard/common.js]]
var title = $('.wb-sitelinks-link-en a').text();
if (title !== '') {
  $.getJSON('//en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&exchars=2000&titles='+title+'&format=json&callback=?', function(data) {
    $('#x-articlepreview').append('<h4>English</h4>' + data.query.pages[Object.keys(data.query.pages)[0]].extract);
  });
}
$('.wb-widget-container').html('<div id="x-articlepreview" style="max-width:35em;margin-left:30px;"><h3>Article preview</h3></div>');

// Some administrator scripts
importScript('User:Legoktm/easyblock.js');
importScript('User:Legoktm/quickwarn.js');
importScript( 'User:Bene* /userwarn.js' );
*/