MediaWiki:Gadget-sharing.js

Revision as of 11:45, 16 January 2024 by CryptoUser (talk | contribs) (Created page with "// Sharing buttons: $(function () { // работает в пространстве статей, в режиме просмотра, кроме главной: if (mw.config.get ('wgNamespaceNumber') !== 0 || mw.config.get ('wgAction') !== 'view' || mw.config.get ('wgArticleId') === 13047 ) return; if (window.location.hostname.indexOf ('.onion') !== -1 || window.location.hostname.indexOf ('.i2p') !== -1) return; // -- no counters for Onion or i2p....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.
// Sharing buttons:
$(function () {
   // работает в пространстве статей, в режиме просмотра, кроме главной:
   
   if (mw.config.get ('wgNamespaceNumber') !== 0 || mw.config.get ('wgAction') !== 'view' || mw.config.get ('wgArticleId') === 13047 ) return;
   
   if (window.location.hostname.indexOf ('.onion') !== -1 || window.location.hostname.indexOf ('.i2p') !== -1) return; // -- no counters for Onion or i2p.
 
   // AddThis script:
   $.getScript ('//s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e8745233773c8c2');
   // AddThis configuration:
   var addthis_config = {pubid: '4e8745233773c8c2'}; // -- was xa-4e8736b826f341a7.
   // Sharing buttons:
   var buttons = '<div class="noprint" style="float:right; text-align: right;"><span class="addthis_toolbox addthis_default_style">'
               + '<a class="addthis_button_facebook"></a><a class="addthis_button_livejournal"></a><a class="addthis_button_vk"></a>'
               + '<a class="addthis_button_twitter"></a><a class="addthis_button_odnoklassniki_ru"></a><a class="addthis_button_mymailru"></a>'
               + '<a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a>'
               + '<a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a>'
               + '<a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></span></div>';
   // To the right of the page title:
   $('#firstHeading').prepend(buttons);
   // After page content:
   $('#footer-info-lastmod').prepend(buttons);
});