Advertisement
Maulle

User:Maulle/global.js

Sep 18th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /******************************/
  2. /*    Special:Chat Scripts    */
  3. /******************************/
  4. var ChatHacksLoaded = true;
  5. if (ChatHacksLoaded === true) {
  6.     ChatHacksLoaded = true;
  7.     importScriptPage('ChatOptions/code.js', 'dev');
  8.     importScriptPage('MessageBlocker/code.js', 'dev');
  9.     importScriptPage('User:Monchoman45/ChatHacks.js', 'c');
  10. }
  11. /***************************/
  12. /*    Site-wide Scripts    */
  13. /***************************/
  14. AjaxRCRefreshText = 'Refresh';
  15. AjaxRCRefreshHoverText = 'Automatically refresh the page';
  16. ajaxPages = [
  17.     "Special:RecentChanges",
  18.     "Special:WikiActivity",
  19.     "Special:Contributions",
  20.     "Special:NewFiles",
  21.     "Special:BlockList",
  22.     "Special:Log"
  23. ];
  24.  
  25. /* Creates Back To Top Button In Footer */
  26.     var Speed = 50;
  27.  
  28. /* InactiveUsers */
  29. InactiveUsers = { months: 1 };
  30.  
  31. /* AdvancedOasisUI */
  32. window.AdvancedOasisUI = {
  33.       accountNavFollowedPages: true,
  34.       accountNavWatchlist: true,
  35.       categoryRedlink: true,
  36.       RCHeader: true,
  37.       DefaultSourceMode: true,
  38.       lightbox: false,
  39.       randomPageLimitedTo: '',
  40.       activity2RC: false,
  41.       userLang: false,
  42. };
  43.  
  44. importArticles({
  45.     type: "script",
  46.     articles: [
  47.         'w:c:dev:CacheCheck/code.js',
  48.         'w:c:dev:WHAM/code.js',
  49.         'w:c:dev:AjaxBatchDelete/code.js',
  50.         'w:c:dev:AjaxUndo/code.js',
  51.         'w:c:dev:AjaxRC/code.js',
  52.         'w:c:dev:AdvancedOasisUI/code.js',
  53.     'w:c:dev:RevealAnonIP/code.js',
  54.     'w:c:dev:View_Source/code.js',
  55.         'w:c:dev:CategoryRenameAuto-update/code.js',
  56.     'w:c:dev:PageMakerPro/code.js',
  57.         'w:c:admintools:MediaWiki:Wikia.js',
  58.         'w:c:dev:QuickTools/advanced.js',
  59.     'w:c:dev:InactiveUsers/code.js',
  60.     'w:c:dev:Thread Inspection/code.js',
  61.     'w:c:dev:FastOldImageDelete/code.js',
  62.     'w:c:dev:FixWantedFiles/code.js',
  63.     'w:c:dev:CacheCheck/code.js',
  64.     'w:c:dev:ListFiles/code.js',
  65.     'w:c:dev:PortableCSSPad/code.js',
  66.     ]
  67. });
  68.  
  69. // Skin Switch Button for monobook to oasis and vice versa
  70. // and for monobook and oasis to wikiamobile
  71.  
  72. $( function () {
  73.     if ( !document.getElementById( 'ca-skins' ) ) {
  74.         if ( skin === 'oasis' || skin === 'wikia' ) {
  75.             $( '<li id="ca-skins"><a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=monobook">MB</a></li>' ).appendTo( '#AccountNavigation' ); $( '<li id="ca-skins"><a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikiamobile">WM</a></li>' ).appendTo( '#AccountNavigation' );
  76.         } else {
  77.             $( '<li id="ca-skins"><a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikia">Oasis</a></li>' ).appendTo( '#p-cactions > .pBody > ul' ); $( '<li id="ca-skins"><a href="/index.php?title=' + encodeURIComponent( wgPageName ) + '&useskin=wikiamobile">Mobile</a></li>' ).appendTo( '#p-cactions > .pBody > ul' );
  78.         }
  79.     }
  80. } );
  81.  
  82. /* Function */
  83. function addLinks(id, link, link_title){
  84.     var l = '<li class="overflow custom" id="' + id + '"><a href="' + link + '">' + link_title + '</a></li>';
  85.     $('.WikiaBarWrapper .tools #my-tools-menu').append(l);
  86. }
  87.  
  88. function insertLinks(){
  89.     addLinks('leaderboard', '/wiki/Special:Leaderboard', 'Leaderboard');
  90.     addLinks('monobook', '?useskin=monobook', 'Mono');
  91.     addLinks('wikiamobile', '?useskin=wikiamobile', 'Mobile');
  92.     addLinks('forum', '/wiki/Special:Forum', 'Forum');
  93.     addLinks('chat', '/wiki/Special:Chat', 'Chat');
  94.     addlinks('system messages', '/wiki/Special:allmessages', 'System');
  95.     addlinks('recentchanges', '/wiki/Special:Recentchanges', 'Recent');
  96. }
  97.  
  98. addOnloadHook(insertLinks);
  99.  
  100. function addCSS(style){
  101.     var x = '<style type="text/css">' + style + '</style>';
  102.     $('head').append(x);
  103. }
  104.  
  105. function configureCSS(){
  106.     addCSS($('#css').text());
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement