User:OneTwoThreeFall/global.js

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

// imports: settings window.lastEdited = {size: false, time: true};

// imports importArticles({ type: 'script',  articles: [    'u:dev:CacheCheck/code.js',    'u:dev:NullEditButton/code.js',    'u:dev:RevealAnonIP/usercode.js',    'u:dev:NoImageLightbox/code.js',    'u:dev:MassNullEdit/code.js',    'u:dev:DisplayTimer/code.js',    'u:dev:LastEdited/code.js'  ] });

// use uncyclopedia's vector style for monobook w/ fixes if (mw.config.get('skin') === 'monobook') { importArticles({   type: 'style',    articles: [      'u:uncyclopedia:MediaWiki:Uncyclopedia.css',      'u:community:User:OneTwoThreeFall/monobook-vector-fixes.css'    ]  }); // move edit links to after header $('.editsection').each(function {    $(this).css({ 'float': 'none', 'padding-left': '1em', 'display': 'inline' }).parent.append(this); }); }

// if 'useskin' parameter exists, set it as a cookie var customSkin = mw.util.getParamValue('useskin'); if (customSkin !== null) { $.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 create redirect when moving files if (mw.config.get('wgPageName').indexOf('Special:MovePage/File:') !== -1) { $('#wpLeaveRedirect').prop('checked', false); }

// add 'used templates' link in wide-mode edit panel $(window).load(function {  $('.text-links').clone(true).css('display', 'none').appendTo('.checkboxes').find('a').html('Used templates'); });

// link to S:RC in 'Recent Wiki Activity' rail module if (mw.config.get('skin') === 'oasis') { $('.WikiaRail').on('afterLoad.rail', function {    $('#WikiaRecentActivity > a[title="Special:WikiActivity"]')      .html('Wiki Activity &gt;')      .after(' Recent Changes &gt;');  }); } else if (mw.config.get('skin') === 'venus') { $('#recentWikiActivity > a[title="Special:WikiActivity"]') .html('Wiki Activity') .after(' Recent Changes'); }

// quick prefix search function getPrefixLI(ns, nsname) { return 'Prefix search (' + (nsname || ns) + ')'; } if (mw.config.get('wgNamespaceNumber') !== -1) { var toolstoadd = getPrefixLI('0', 'Main'); if (mw.config.get('skin') === 'oasis') { $('#my-tools-menu').append(toolstoadd); } else if (mw.config.get('skin') === 'monobook') { $('#p-tb > ul').append(toolstoadd); } }

// 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('<button class="secondary showremovedmessage" style="margin-left: 10px;">Show '); $('.showremovedmessage').click(function {  $(this).parent.parent.removeClass('hide').addClass('show'); });