User:Twsx/vector.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Twsx/vector.css. |
/* START - Extra Navigation Menu */
/* START - Extra Navigation Menu */
/* START - Extra Navigation Menu */
/*
Links that can be shown the same as their actual link is can be defined simply in quotes, i.e. 'WP:AIV'
For links that are supposed to show a different text than the actual link (i.e. if the actual link is too long) should be defines such as this: 'Special:NewPages===S:NP'
*/
$(document).ready( function() {
// Link array
var mAdm = ['WP:AIV', 'WP:ANI', 'WP:AFD'];
var mPolicy = ['WP:CSD', 'WP:N', 'WP:NOT'];
var mMisc = ['WP:WARN', 'Special:NewPages===S:NP', 'Special:PendingChanges===S:PC'];
var mUser = ['User:Twsx/vector.js===Vector.js'];
// Headers
var mHeaders = ['Admin Stuff', 'Policy', 'Misc', 'User'];
// Put it together
var mItems = [mAdm, mPolicy, mMisc, mUser];
var newHTML = ''+
'<div class="vectorMenu" id="p-twsx">'+
' <h3><span>twsX</span><a href="#"></a></h3>'+
' <div class="menu">'+
' <ul>'+
'';
for (var i = 0; i < mItems.length; i++) {
newHTML = newHTML + '<li style="white-space: nowrap; font-size: 12px; background-color: #787878; color: #FFFFFF; padding: 4px 6px;">'+mHeaders[i]+'</li>';
for (var x = 0; x < mItems[i].length; x++) {
if (mItems[i][x].match(/^(.+)===(.+)$/)) {
var matches = mItems[i][x].match(/^(.+)===(.+)$/);
newHTML = newHTML + '<li style="white-space: nowrap;" onmouseover="this.style.background=\'#454545\'; this.style.color=\'#FFFFFF\';" onmouseout="this.style.background=\'#FFFFFF\'; this.style.color=\'#000000\';"><a href="http://en.wikipedia.org/wiki/'+matches[1]+'" title="'+matches[1]+'" style="color: inherit;">'+matches[2]+'</a></li>';
} else {
newHTML = newHTML + '<li style="white-space: nowrap;" onmouseover="this.style.background=\'#454545\'; this.style.color=\'#FFFFFF\';" onmouseout="this.style.background=\'#FFFFFF\'; this.style.color=\'#000000\';"><a href="http://en.wikipedia.org/wiki/'+mItems[i][x]+'" title="'+mItems[i][x]+'" style="color: inherit;">'+mItems[i][x]+'</a></li>';
}
}
}
newHTML = newHTML+
' </ul>'+
' </div>'+
'</div>'+
'';
$('#p-search').before(newHTML);
});
/* END - Extra Navigation Menu */
/* END - Extra Navigation Menu */
/* END - Extra Navigation Menu */
/* START - Link to Special:ListUsers for users */
/* START - Link to Special:ListUsers for users */
/* START - Link to Special:ListUsers for users */
//$(document).ready( function() {
//var wLoc = window.location + '';
// if (!wLoc.match(/Special:ListUsers/)) {
// jQuery('.mw-usertoollinks').each(function( index ) {
// var userToolLinks = jQuery(this).html();
// var contName = userToolLinks.match(/\/wiki\/Special\:Contributions\/((.+))" title="Special/);
// contName = contName[1];
// console.log(contName);
// userToolLinks = userToolLinks.replace('contribs</a>)', 'contribs</a> | <a href="/wiki/Special:ListUsers/' + contName + '">perm</a>)');
// jQuery(this).html(userToolLinks);
// });
// }
//});
/* END - Link to Special:ListUsers for users */
/* END - Link to Special:ListUsers for users */
/* END - Link to Special:ListUsers for users */
/* START - Custom Watchlist */
/* START - Custom Watchlist */
/* START - Custom Watchlist */
function showAlternateWatchlist() {
$('#bodyContent').html('<iframe src="https://x.xxer.org/wpwl.php" frameborder="0" style="border: 0; height: 600px; width: 100%;"></iframe><br/><a href="https://x.xxer.org/wpwl.php" target="_blank">Open Externally</a>');
$('#firstHeading').html('Extended Watchlist');
document.title = 'WP WL';
}
$(document).ready( function() {
$('li#pt-watchlist a').html('WL');
$('li#pt-watchlist').append(' – (<a href="javascript:showAlternateWatchlist();">Extended</a>)');
});
/* END - Custom Watchlist */
/* END - Custom Watchlist */
/* END - Custom Watchlist */
/*
*
* EVERYTHING STARTING FROM HERE IS UNDOCMENTED, FOR TESTING PURPOSES, DANGEROUS, KILLS MUDKIPZ, ETC.
*
*/
mw.loader.load('https://meta.wikimedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:MoreMenu.import.js');