User:OneTwoThreeFall/global.js

/*jslint indent:2, browser:true, sloppy:true */ /*global $, mw, importArticles */

importArticles({ type: 'script',  articles: [    'u:dev:CacheCheck/code.js',    'u:dev:RevealAnonIP/usercode.js',    'u:dev:NoImageLightbox/code.js',    'u:dev:DisplayTimer/code.js',    'u:123f:MediaWiki:QuickDiff.user.js',    'u:community:User:OneTwoThreeFall/MassNullEdit.modified.js',    'u:community:User:OneTwoThreeFall/LastEdited.modified.js'  ] });

// if 'useskin' parameter exists, set it as a cookie var customSkin = mw.util.getParamValue('useskin'); if (customSkin) { $.cookie('useskin', customSkin, {   domain: mw.config.get('wgCookieDomain'),    path: mw.config.get('wgCookiePath')  }); }

// disable redirect links $('.mw-redirect, .allpagesredirect > a').each(function {  var link = new mw.Uri(this.href);  link.extend({ redirect: 'no' }); $(this).attr('href', link.toString); });

// don't leave redirect when moving files if (mw.config.get('wgCanonicalSpecialPageName') === 'Movepage' &&   mw.config.get('wgRelevantPageName').indexOf(mw.config.get("wgFormattedNamespaces")[6] + ':') === 0) { $('#wpLeaveRedirect').prop('checked', false); }

// quick prefix search if (mw.config.get('wgNamespaceNumber') !== -1) { var prefixlink = 'Prefix search'; if (mw.config.get('skin') === 'oasis') { $('#my-tools-menu').prepend(prefixlink); } else if (mw.config.get('skin') === 'monobook') { $('#p-tb > .pBody > ul').append(prefixlink); } }

// add contribs and watchlist links to user menu $('.user-menu > li:has(a[data-id="preferences"])') .after('My watchlist' +   'My contributions');

// add button to unhide removed messages on thread pages $('.removed-info').append('Show '); $('.showremovedmessage').click(function {  $(this).closest('.message-removed').removeClass('hide'); });

// move edit + talk buttons into header $('#WikiaPageHeader > .header-container > .header-title > h1') .after($('#WikiaPageHeader > .comments').css('margin', '2px 10px 0')) .after($('#WikiaPageHeader > .wikia-menu-button')) .after($('#WikiaPageHeader > .wikia-button'));

// run in Monobook only if (mw.config.get('skin') === 'monobook') {

// Vector style for Monobook importArticle({   type: 'style',    article: 'u:dev:Pseudo-Vector/code.css'  });

// move edit links next to heading $('.editsection').each(function {    $(this).css({ 'float': 'none', 'padding-left': '1em', 'display': 'inline' }).parent.append(this); });

// add contributions link on user pages if ([2, 3, 1200].indexOf(mw.config.get('wgNamespaceNumber')) !== -1) { mw.util.addPortletLink(     'p-cactions',      mw.util.getUrl('Special:Contributions/' + mw.config.get('wgTitle').split('/')[0]),      'Contributions',      'ca-contributions',      null,      null,      '#ca-edit'    ); }

}

// run after page is completely loaded $(window).load(function {

// pre-open grouped items in recent changes and watchlist if (['Recentchanges', 'Watchlist'].indexOf(mw.config.get('wgCanonicalSpecialPageName')) !== -1) { $('.mw-collapsible-toggle-collapsed').click; }

// add 'used templates' button to edit toolbar if (mw.config.get('wgIsEditPage')) { $('#cke_toolbar_source_1 > img:last-of-type').after(     $('#mw-editbutton-bold').clone.removeAttr('id alt').attr({ 'title': $('.tmpl_listused > a').text, 'onclick': $('.tmpl_listused > a').attr('onclick') }).css('background-image', 'url(//vignette3.wikia.nocookie.net/central/images/4/43/Button-template.png)')   ); }

});