User:Cenarium/common.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:Cenarium/common.css. |
// custom links
mw.util.addPortletLink( 'p-personal', '/wiki/User:Cenarium/Bugs', 'Bugs', null, null, null, '#pt-preferences');
mw.util.addPortletLink( 'p-personal', '/wiki/User:Cenarium/Rights', 'Rights', null, null, null, '#pt-preferences');
mw.util.addPortletLink( 'p-personal', '/wiki/User:Cenarium/Sandbox', 'Sandbox', null, null, null, '#pt-preferences');
//rename of tabs (except edit)
$( '#ca-nstab-user a' ).text( 'User' );
$( '#ca-talk a' ).text( 'Talk' );
$( '#ca-history a' ).text( 'History' );
$( '#ca-unprotect a' ).text( 'Protect' );
// rename of edit tabs
$( '#ca-edit a' ).text( 'Edit' );
$( '#ca-ve-edit a' ).text( 'VEdit' );
// rename of edit section links
if (wgAction == 'view') {
jQuery( document ).ready( function( $ ) {
$( '.mw-editsection a' ).text( 'Edit' );
$( '.mw-editsection-visualeditor' ).text( 'VEdit' );
} );
}
// interwikis removed
$("#p-lang").remove();
// move interface cleanup
if (wgCanonicalSpecialPageName === "Movepage") {
jQuery( document ).ready( function( $ ) {
if (document.getElementsByClassName('error mw-moveuserpage-warning').length > 0) {
var t=document.getElementsByClassName('error mw-moveuserpage-warning')[0];
t.parentNode.removeChild(t.nextSibling);
t.parentNode.removeChild(t);
}
var z=document.getElementById("mw-content-text").firstChild;
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z);
g=document.getElementById("movepagetalktext");
g.parentNode.removeChild(g);
} );
}
// delete interface cleanup
if (wgAction == 'delete') {
jQuery( document ).ready( function( $ ) {
var z=document.getElementById("Deletereason").parentNode;
z.parentNode.removeChild(z.previousSibling);
z.parentNode.removeChild(z.previousSibling);
z.parentNode.removeChild(z);
t=document.getElementById("mw-deleteconfirm-table");
t.removeChild(t.childNodes[2]);
t.removeChild(t.childNodes[2]);
t.removeChild(t.childNodes[2]);
g=document.getElementsByClassName("mw-delete-editreasons")[0];
g.parentNode.removeChild(g);
} );
}
// block interface cleanup
if (wgCanonicalSpecialPageName === "Block") {
jQuery( document ).ready( function( $ ) {
var z=document.getElementById("blockiptext");
z.parentNode.removeChild(z);
t=document.getElementById("GovernmentIps");
t.parentNode.removeChild(t);
} );
}
// protect interface cleanup
if (wgAction == 'protect') {
jQuery( document ).ready( function( $ ) {
var z=document.getElementById("protect_text");
z.parentNode.removeChild(z);
t=document.getElementsByClassName("mw-protect-editreasons")[0];
t.parentNode.removeChild(t);
g=document.getElementById("mw-protect-table3").firstChild;
g.removeChild(g.childNodes[5]);
} );
}
if (wgAction == 'edit'||wgAction == 'submit') {
jQuery( document ).ready( function( $ ) {
var z=document.getElementsByClassName("editnotice-link")[0];
z.parentNode.removeChild(z);
var t=document.getElementsByClassName("editnotice_BLP_editintro")[0];
t.parentNode.removeChild(t);
var g=document.getElementsByClassName("disambig-editintro")[0];
g.parentNode.removeChild(g);
if (wgPageName === "Wikipedia:Education_noticeboard") { $("#editnotice-area").remove() }
} );
}
// WhatLinksHere interface cleanup
// wgCanonicalSpecialPageName === "WhatLinksHere" check doesn't work
if (document.getElementById("mw-whatlinkshere-target") !== null ) {
jQuery( document ).ready( function( $ ) {
var z=document.getElementById("mw-whatlinkshere-target").parentNode.parentNode;
z.parentNode.removeChild(z.previousSibling);
z.parentNode.removeChild(z.previousSibling);
} );
}
// Contributions interface cleanup
if (wgCanonicalSpecialPageName === "Contributions") {
jQuery( document ).ready( function( $ ) {
var z=document.getElementById("mw-sp-contributions-explain");
z.parentNode.removeChild(z);
var t=document.getElementsByClassName("metadata topicon")[0];
t.parentNode.removeChild(t);
var g=document.getElementById("newbie");
g.parentNode.removeChild(g.nextSibling);
g.parentNode.removeChild(g.nextSibling);
g.parentNode.removeChild(g.nextSibling);
g.parentNode.removeChild(g);
var k=document.getElementsByClassName("mw-contributions-table")[0];
k.parentNode.removeChild(k.nextSibling);
k.parentNode.removeChild(k.nextSibling);
h=k.firstChild.nextSibling.lastChild.previousSibling;
h.parentNode.removeChild(h.previousSibling);
h.parentNode.removeChild(h.previousSibling);
h.parentNode.removeChild(h.previousSibling);
h.parentNode.removeChild(h.previousSibling);
h.parentNode.removeChild(h.previousSibling);
} );
}
// Log interface cleanup
if (wgCanonicalSpecialPageName === "Log") {
jQuery( document ).ready( function( $ ) {
var z=document.getElementById("tagfilter").parentNode;
z.parentNode.removeChild(z.previousSibling);
z.parentNode.removeChild(z.previousSibling);
z.parentNode.removeChild(z);
var t=document.getElementById("mw-content-text").firstChild;
t.parentNode.removeChild(t.nextSibling);
t.parentNode.removeChild(t.nextSibling);
t.parentNode.removeChild(t.nextSibling);
t.parentNode.removeChild(t);
} );
}
// UserRights interface cleanup
// wgCanonicalSpecialPageName === "UserRights" check doesn't work
if (document.getElementById("mw-userrights-form1") !== null) {
jQuery( document ).ready( function( $ ) {
document.getElementById("mw-userrights-form1").parentNode.removeChild(document.getElementById("mw-userrights-form1"));
var z=document.getElementsByClassName("mw-usertoollinks")[0];
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
} );
}
// Watchlist interface cleanup
if (wgCanonicalSpecialPageName === "Watchlist") {
jQuery( document ).ready( function( $ ) {
var z=document.getElementById("mw-wlheader-showupdated");
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.previousSibling);
z.parentNode.removeChild(z.previousSibling);
z.parentNode.removeChild(z);
var t=document.getElementById("mw-watchlist-form");
t.parentNode.removeChild(t);
} );
}
// AbuseFilter interface cleanup
if (wgCanonicalSpecialPageName === "AbuseFilter") {
jQuery( document ).ready( function( $ ) {
var z=document.getElementsByClassName("mw-abusefilter-status")[0].nextSibling;
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
z.parentNode.removeChild(z.nextSibling);
} );
}
mw.loader.using( 'ext.visualEditor.viewPageTarget.init', function(){
mw.libs.ve.addPlugin( function() {
mw.hook( 've.activationComplete' ).add(function(){
$('.ve-init-mw-viewPageTarget-toolbar-actions div:nth-child(1) a:nth-child(1) span:nth-child(2)').html('Save window');
});
} );
});