gaz_lloyd

Untitled

Sep 15th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Any JavaScript here will be loaded for all users on every page load. */
  2. //<nowiki>
  3.  
  4. //Ajax refresh
  5. var ajaxPages = ["Special:RecentChanges", "Special:Watchlist", "Special:Log", "Special:Contributions", "Forum:Yew_Grove", "RuneScape:Active_discussions", "Special:AbuseLog", "Special:NewFiles", "Category:Speedy_deletion_candidates", "Category:Speedy_move_candidates", "Special:Statistics", "Special:NewPages", "Special:ListFiles", "Special:Log/move"];
  6. var AjaxRCRefreshText = 'Auto-refresh';
  7.  
  8. importScriptPage('MediaWiki:Common.js/ajaxrefresh.js','rs');
  9.  
  10. var _Hasync= _Hasync|| [];
  11.  _Hasync.push(['Histats.start', '1,2235373,4,603,110,40,"00000010"']);
  12.  _Hasync.push(['Histats.fasi', '1']);
  13.  _Hasync.push(['Histats.track_hits', '']);
  14.  (function() {
  15. var hs = document.createElement('script');
  16. hs.type = 'text/javascript';
  17.  hs.async = true;
  18.  hs.src = ('http://s10.histats.com/js15_as.js');
  19.  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs); })();
  20.  
  21. //Switch Infobox
  22. if ($('.switch-infobox').length) {
  23.    importScriptPage('User:-Matt/SwitchInfobox.js', 'runescape');
  24.    importStylesheetPage('User:-Matt/SwitchInfobox.css', 'runescape');
  25. }
  26.  
  27. // AWB (In browser)
  28. importScriptURI('//en.wikipedia.org/w/index.php?title=User:Joeytje50/AWB.js/load.js&action=raw&ctype=text/javascript');
  29.  
  30. //Highlight tables
  31. if ($( '.lighttable' ).length) {
  32.    importScriptPage('MediaWiki:Common.js/highlightTable.js', 'runescape');
  33. }
  34.  
  35.  
  36. // Automatic file fixing
  37. if (wgPageName.indexOf("Special:MovePage/File:") != -1 || (wgCanonicalNamespace == "File" && Storage)){
  38.    LIRoptions = {
  39.     bottomMessage: 'This appears below the buttons on Special:MovePage',
  40.     editSummary: 'Updating file link (automatic)',
  41.     singleButtonText: 'Rename and replace',
  42.         queueButtonText: 'Rename and add to queue'
  43.    }
  44.  
  45.    importScriptPage("FileUsageAuto-update/code.js", "dev");
  46. }
  47.  
  48. // Unchecks redirects when moving files
  49. if (wgPageName.indexOf("Special:MovePage/File:") != -1) {
  50.     $('input#wpLeaveRedirect').removeAttr('checked');
  51. }
  52.  
  53. if ((wgUserGroups||[]).indexOf('sysop')!=-1) {
  54.     var autoWelcomeText = '{{subst:Welcome|~~~~}}', autoWelcomeSummary = '';
  55.     importScriptPage('User:Quarenon/autowelcome.js','rs');
  56. }
  57.  
  58. importArticles( {
  59.     type: 'script',
  60.     articles: [
  61.         // ...
  62.         'u:dev:MiniComplete/code.js',
  63.     'MediaWiki:Common.js/compare.js',
  64.         'u:dev:DISPLAYTITLE/code.js',
  65.         'MediaWiki:Common.js/youtube.js',
  66.         'MediaWiki:Wikia.js/sidebar.js'
  67.         // ...
  68.     ]
  69. } );
  70. //calc.js import from main RSWiki
  71. if ($('.jcConfig').length) {
  72.     importScriptPage('MediaWiki:Common.js/calc.js', 'rs');
  73.     importStylesheetPage('MediaWiki:Common.css/calc.css', 'rs');
  74. }
  75. /**
  76. * Moves topright icons to be inserted into Wikia pageheader
  77. * Requires additional CSS in [[MediaWiki:Wikia.css]]
  78. *
  79. * @author The 888th Avatar (Avatar Wiki)
  80. * @author Cqm
  81. * @author Joeytje50
  82. */
  83. if ($('.topright-icon').length) {
  84.     (function () {
  85.         // insert container next to tally in pageheader
  86.         $('<div>').attr('id', 'rs-header-icons').insertBefore($('.tally'));
  87.  
  88.         var $icons = $('#rs-header-icons');
  89.  
  90.         $('.topright-icon').each(function () {
  91.             $icons.append($(this).html());
  92.         });
  93.     })();
  94. }
  95.  
  96. window._gaq = window._gaq || [];
  97. _gaq.push(['local._setAccount', 'UA-60460114-1']);
  98. _gaq.push(['local._trackPageview']);
  99. (function() {
  100. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  101.  
  102. ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
  103.  
  104. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  105. })();
  106.  
  107. var util = {
  108.         /**
  109.          * Adds commas to a number string
  110.          *
  111.          * @example 123456.78 -> 123,456.78
  112.          *
  113.          * @param num {number|string} A number to add commas to
  114.          *
  115.          * @returns {string} The number with commas
  116.          */
  117.         addCommas: function (num) {
  118.             num += '';
  119.  
  120.             var x = num.split('.'),
  121.                 x1 = x[0],
  122.                 x2 = x.length > 1
  123.                     ? '.' + x[1]
  124.                     : '',
  125.                 rgx = /(\d+)(\d{3})/;
  126.  
  127.             while (rgx.test(x1)) {
  128.                 x1 = x1.replace(rgx, '$1,$2');
  129.             }
  130.  
  131.             return x1 + x2;
  132.         }
  133. }
  134.  
  135. if($('#XPEach, #GEPrice, #killXP').length) {
  136.     importScript("MediaWiki:Common.js/monstercalc.js");
  137. }
  138.  
  139. // GE Price charts
  140. if($('.GEdatachart').length) {
  141.     importScript("MediaWiki:Common.js/GECharts.js");
  142. }
Advertisement
Add Comment
Please, Sign In to add comment