User:.jun/global.js

// Chat hacks importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); importScriptPage('User:Joeytje50/tabinsert.js', 'rs');

// AjaxRC if (mw.config.get('wgCanonicalSpecialPageName') == 'WikiActivity') { // reposition to the right on special:wikiactivity mw.util.addCSS(       '#ajaxRefresh {' +            'position: absolute;' +            'right: 0;' +            'bottom: 10px;' +        '}' +        '#ajaxLoadProgress {' +            'margin-left: 5px;' +        '}'    ); } window.ajaxCallAgain = window.ajaxCallAgain || []; window.ajaxCallAgain.push(function {   $('.rc-conntent, .activityfeed')        .find('a')        .each(function { if ($(this).attr('href') !== '#') { $(this).attr('target', '_blank'); }       }); }); window.ajaxPages = ['Special:RecentChanges', 'Special:WikiActivity'], window.ajaxRefresh = 30000;

// Miscellaneous $(function {   var buttons = {        monobook: {            href: 'useskin=monobook'        },        wikiamobile: {            href: 'useskin=wikiamobile'        },        vector: {            href: 'useskin=monobook&usevector=1&usesitecss=0'        },        qqx: {            href: 'uselang=qqx'        },        debug: {            href: 'debug=true'        },        test: {            id: 'test-mode',            text: (mw.config.get('wgContentReviewTestModeEnabled') ? 'exit' : 'enter') + ' test mode',           handler: function {                if (mw.config.get('wgContentReviewTestModeEnabled')) {                    $.nirvana.sendRequest({ controller: 'ContentReviewApiController', method: 'disableTestMode', callback: function(e) { if (e.status) { window.location.reload; }                       }                    });                } else {                    $.nirvana.sendRequest({ controller: 'ContentReviewApiController', method: 'enableTestMode', data: { pageId: mw.config.get('wgArticleId'), wikiId: mw.config.get('wgCityId'), editToken: mw.user.tokens.get('editToken') },                       callback: function(e) { if (e.status) { window.location.reload; }                       }                    });                }            }        }    };        $('.global-navigation .hubs-links').html('');        for (var i in buttons) {            $('.global-navigation .hubs-links').append( $('') .attr({                       href: (buttons[i].href ? mw.config.get('wgArticlePath').replace(/\$1/g, (mw.config.get('wgPageName') + (!!window.location.search ? window.location.search + '&' : '?') + buttons[i].href + (!!window.location.hash ? window.location.hash : ))) : ),                       class: 'globalnav-button',                        id: (buttons[i].id ? buttons[i].id : '')                   }) .text(buttons[i].text || i)           );            if (buttons[i].id && buttons[i].handler && typeof buttons[i].handler == 'function') {                $('#' + buttons[i].id).bind('click', buttons[i].handler);            }        }    // load pseudo-vector on usevector=1    if (mw.config.get('skin') == 'monobook' && $.getUrlVar('usevector')) {        importStylesheetPage('Pseudo-Vector/code.css', 'dev');    } });

// special:wikiactivity >> special:recentchanges $('[data-canonical="wikiactivity"]') .attr('href', '/wiki/Special:RecentChanges') .html('Recent changes');

// opens links on new pages $('.rc-conntent, .activityfeed') .find('a') .each(function {       if ($(this).attr('href') !== '#') {            $(this).attr('target', '_blank');        }    });

if ($.getUrlVar('action') == 'edit' &&  $('#wpSummary').length &&   !mw.config.get('wgEditPageWideSourceMode')   ) { var val = ''; if ($('#wpSummary').val) { val = $('#wpSummary').val; }   $('#wpSummary').replaceWith($(' ').attr({ id: 'wpSummary', name: 'wpSummary', style: 'resize: none; height: 40px', placeholder: 'Add a summary of your edit' }).val(val)); } // Custom edit buttons if (mw.toolbar) { mw.toolbar.addButton(       'http://static1.wikia.nocookie.net/__cb20070329064845/central/images/2/23/Button_code.png',        'Code',        ' ',        '',        'mw-editbutton-code'    ); }

// PersistentParameters var persistentParameterList = ['useskin', 'uselang', 'usesitecss', 'usesitejs', 'useusercss', 'useuserjs', 'usevector'];

// View Source mw.util.addCSS(   '#source-code, #source-toc {' +        'font-family: monaco, monospace !important;' +    '}' +    '#source-code > a {' +        'color: ' + $('a').css('color') + ' !important;' +        'font-weight: bold;' +    '}' );

// Imports importArticles({   type: 'script',    articles: [        'u:dev:AjaxRC/code.js',        'u:dev:PersistentParameters/code.js',        'u:dev:LastEdited/code.js',        'u:dev:QuickDiff/code.js',        'u:dev:View_Source/code.js'    ] });