User:Matt B./monobook.js: Difference between revisions
Appearance
Content deleted Content added
Finally got control-z removed. Still missing control-f |
m Maintenance: Replacing document.write with mw.loader.load (mw:ResourceLoader/Migration_guide_(users)#Avoid_document.write() - phab:T130879) |
||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
if (document.URL.match("http://en.wikipedia.org/wiki/Special:Recentchanges") || document.URL.match("autosummary=Revert") || document.URL.match("Special:Contributions") || document.URL.match("action=history") || document.URL.match("Special:Watchlist") ) |
if (document.URL.match("http://en.wikipedia.org/wiki/Special:Recentchanges") || document.URL.match("autosummary=Revert") || document.URL.match("Special:Contributions") || document.URL.match("action=history") || document.URL.match("Special:Watchlist") ) |
||
{ |
{ |
||
mw.loader.load( |
|||
document.write('<script type="text/javascript" src="' |
|||
'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' |
|||
+ '&action=raw&ctype=text/javascript&dontcountme=s |
+ '&action=raw&ctype=text/javascript&dontcountme=s'); |
||
} |
} |
||
// disable Wikipedia access keys/keyboard shortcuts |
// disable Wikipedia access keys/keyboard shortcuts |
||
⚫ | |||
addOnloadHook(function(){ |
|||
ta['pt-anonuserpage'] = new Array('+','The user page for the ip you\'re editing as'); |
|||
var columnOne = document.getElementById('column-one'); |
|||
⚫ | |||
if (!columnOne) return; |
|||
⚫ | |||
removeKeys(columnOne.getElementsByTagName('a')) |
|||
⚫ | |||
removeKeys(document.getElementsByTagName('input')) |
|||
ta['pt-watchlist'] = new Array('+','The list of pages you\'re monitoring for changes.'); |
|||
removeKeys(document.getElementsByTagName('label')) |
|||
⚫ | |||
}) |
|||
ta['pt-login'] = new Array('+','You are encouraged to log in; however, it is not mandatory.'); |
|||
ta['pt-anonlogin'] = new Array('+','You are encouraged to log in; however, it is not mandatory.'); |
|||
function removeKeys(nodeList){ |
|||
⚫ | |||
var el; |
|||
⚫ | |||
for (var i = 0; i < nodeList.length; i++) { |
|||
ta['ca-edit'] = new Array('+','You can edit this page. Please use the preview button before saving.'); |
|||
el = nodeList[i]; |
|||
⚫ | |||
if (!el.accessKey) continue; |
|||
⚫ | |||
if (!window.removeAccessKeys || removeAccessKeys.indexOf(el.accessKey) >= 0) { |
|||
⚫ | |||
el.accessKey = ''; //el.setAttribute('accessKey', ''); |
|||
⚫ | |||
if (el.title) el.title = el.title.replace(tooltipAccessKeyRegexp, ''); |
|||
⚫ | |||
} |
|||
ta['ca-undelete'] = new Array('+','Restore the edits done to this page before it was deleted'); |
|||
} |
|||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
ta[' |
// ta['pt-userpage'] = new Array('+','My user page'); |
||
ta[' |
// ta['pt-anonuserpage'] = new Array('+','The user page for the ip you\'re editing as'); |
||
ta[ |
// ta['pt-mytalk'] = new Array('+','My talk page'); |
||
ta[' |
// ta['pt-anontalk'] = new Array('+','Discussion about edits from this ip address'); |
||
ta[' |
// ta['pt-preferences'] = new Array('+','My preferences'); |
||
ta[' |
// ta['pt-watchlist'] = new Array('+','The list of pages you\'re monitoring for changes.'); |
||
ta[' |
// ta['pt-mycontris'] = new Array('+','List of my contributions'); |
||
ta[' |
// ta['pt-login'] = new Array('+','You are encouraged to log in; however, it is not mandatory.'); |
||
ta[' |
// ta['pt-anonlogin'] = new Array('+','You are encouraged to log in; however, it is not mandatory.'); |
||
ta[' |
// ta['pt-logout'] = new Array('+','Log out'); |
||
ta[' |
// ta['ca-talk'] = new Array('+','Discussion about the content page'); |
||
ta[' |
// ta['ca-edit'] = new Array('+','You can edit this page. Please use the preview button before saving.'); |
||
ta[' |
// ta['ca-addsection'] = new Array('+','Add a comment to this discussion.'); |
||
ta[' |
// ta['ca-viewsource'] = new Array('+','This page is protected. You can view its source.'); |
||
ta[' |
// ta['ca-history'] = new Array('+','Past versions of this page.'); |
||
ta[' |
// ta['ca-protect'] = new Array('+','Protect this page'); |
||
ta[' |
// ta['ca-delete'] = new Array('+','Delete this page'); |
||
ta[' |
// ta['ca-undelete'] = new Array('+','Restore the edits done to this page before it was deleted'); |
||
ta['ca- |
// ta['ca-move'] = new Array('+','Move this page'); |
||
ta['ca- |
// ta['ca-watch'] = new Array('+','Add this page to your watchlist'); |
||
ta['ca- |
// ta['ca-unwatch'] = new Array('+','Remove this page from your watchlist'); |
||
ta[' |
// ta['search'] = new Array('+','Search this wiki'); |
||
ta[' |
// ta['p-logo'] = new Array('+','Main Page'); |
||
ta[' |
// ta['n-mainpage'] = new Array('+','Visit the Main Page'); |
||
ta[ |
// ta["n-Main-page"] = new Array('+','Visit the Main Page'); |
||
ta[' |
// ta['n-portal'] = new Array('+','About the project, what you can do, where to find things'); |
||
ta[' |
// ta['n-currentevents'] = new Array('+','Find background information on current events'); |
||
ta[' |
// ta['n-recentchanges'] = new Array('+','The list of recent changes in the wiki.'); |
||
⚫ | |||
⚫ | |||
⚫ | |||
// ta['n-planet'] = new Array('+','Weblog aggregator of Wikimedia-related posts') |
|||
// ta['t-whatlinkshere'] = new Array('+','List of all wiki pages that link here'); |
|||
// ta['t-recentchangeslinked'] = new Array('+','Recent changes in pages linked from this page'); |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
// ta['t-specialpages'] = new Array('+','List of all special pages'); |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
// ta['ca-nstab-mediawiki'] = new Array('+','View the system message'); |
|||
⚫ | |||
⚫ | |||
// ta['ca-nstab-category'] = new Array('+','View the category page'); |
|||
// </nowiki></pre> |
// </nowiki></pre> |
Latest revision as of 20:09, 6 February 2021
// <pre><nowiki>
// Use Lupin's popups: [[User:Lupin/popups.js]]
if (document.URL.match("http://en.wikipedia.org/wiki/Special:Recentchanges") || document.URL.match("autosummary=Revert") || document.URL.match("Special:Contributions") || document.URL.match("action=history") || document.URL.match("Special:Watchlist") )
{
mw.loader.load(
'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
}
// disable Wikipedia access keys/keyboard shortcuts
addOnloadHook(function(){
var columnOne = document.getElementById('column-one');
if (!columnOne) return;
removeKeys(columnOne.getElementsByTagName('a'))
removeKeys(document.getElementsByTagName('input'))
removeKeys(document.getElementsByTagName('label'))
})
function removeKeys(nodeList){
var el;
for (var i = 0; i < nodeList.length; i++) {
el = nodeList[i];
if (!el.accessKey) continue;
if (!window.removeAccessKeys || removeAccessKeys.indexOf(el.accessKey) >= 0) {
el.accessKey = ''; //el.setAttribute('accessKey', '');
if (el.title) el.title = el.title.replace(tooltipAccessKeyRegexp, '');
}
}
}
// ta['pt-userpage'] = new Array('+','My user page');
// ta['pt-anonuserpage'] = new Array('+','The user page for the ip you\'re editing as');
// ta['pt-mytalk'] = new Array('+','My talk page');
// ta['pt-anontalk'] = new Array('+','Discussion about edits from this ip address');
// ta['pt-preferences'] = new Array('+','My preferences');
// ta['pt-watchlist'] = new Array('+','The list of pages you\'re monitoring for changes.');
// ta['pt-mycontris'] = new Array('+','List of my contributions');
// ta['pt-login'] = new Array('+','You are encouraged to log in; however, it is not mandatory.');
// ta['pt-anonlogin'] = new Array('+','You are encouraged to log in; however, it is not mandatory.');
// ta['pt-logout'] = new Array('+','Log out');
// ta['ca-talk'] = new Array('+','Discussion about the content page');
// ta['ca-edit'] = new Array('+','You can edit this page. Please use the preview button before saving.');
// ta['ca-addsection'] = new Array('+','Add a comment to this discussion.');
// ta['ca-viewsource'] = new Array('+','This page is protected. You can view its source.');
// ta['ca-history'] = new Array('+','Past versions of this page.');
// ta['ca-protect'] = new Array('+','Protect this page');
// ta['ca-delete'] = new Array('+','Delete this page');
// ta['ca-undelete'] = new Array('+','Restore the edits done to this page before it was deleted');
// ta['ca-move'] = new Array('+','Move this page');
// ta['ca-watch'] = new Array('+','Add this page to your watchlist');
// ta['ca-unwatch'] = new Array('+','Remove this page from your watchlist');
// ta['search'] = new Array('+','Search this wiki');
// ta['p-logo'] = new Array('+','Main Page');
// ta['n-mainpage'] = new Array('+','Visit the Main Page');
// ta["n-Main-page"] = new Array('+','Visit the Main Page');
// ta['n-portal'] = new Array('+','About the project, what you can do, where to find things');
// ta['n-currentevents'] = new Array('+','Find background information on current events');
// ta['n-recentchanges'] = new Array('+','The list of recent changes in the wiki.');
// ta['n-randompage'] = new Array('+','Load a random page');
// ta['n-help'] = new Array('+','The place to find out.');
// ta['n-sitesupport'] = new Array('+','Support us');
// ta['n-planet'] = new Array('+','Weblog aggregator of Wikimedia-related posts')
// ta['t-whatlinkshere'] = new Array('+','List of all wiki pages that link here');
// ta['t-recentchangeslinked'] = new Array('+','Recent changes in pages linked from this page');
// ta['feed-rss'] = new Array('+','RSS feed for this page');
// ta['feed-atom'] = new Array('+','Atom feed for this page');
// ta['t-contributions'] = new Array('+','View the list of contributions of this user');
// ta['t-emailuser'] = new Array('+','Send a mail to this user');
// ta['t-upload'] = new Array('+','Upload images or media files');
// ta['t-specialpages'] = new Array('+','List of all special pages');
// ta['ca-nstab-main'] = new Array('+','View the content page');
// ta['ca-nstab-user'] = new Array('+','View the user page');
// ta['ca-nstab-media'] = new Array('+','View the media page');
// ta['ca-nstab-special'] = new Array('+','This is a special page, you can\'t edit the page itself.');
// ta['ca-nstab-wp'] = new Array('+','View the project page');
// ta['ca-nstab-image'] = new Array('+','View the image page');
// ta['ca-nstab-mediawiki'] = new Array('+','View the system message');
// ta['ca-nstab-template'] = new Array('+','View the template');
// ta['ca-nstab-help'] = new Array('+','View the help page');
// ta['ca-nstab-category'] = new Array('+','View the category page');
// </nowiki></pre>