User:John Vandenberg/tags.js
Jump to navigation
Jump to search
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Clear the cache in Tools → Preferences
For details and instructions about other browsers, see Wikipedia:Bypass your cache.
Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the central discussion page, Scriptorium. The code will be executed when previewing this page under some skins, including Monobook. You can in the interim if you wish to refresh the content sooner under another skin. |
This script seems to have a documentation page at User:John Vandenberg/tags. |
// <pre>
// [[User:JayVDB/tags.js]]
// <nowiki>
//
// Tags for Wikisource
// Copied from tags script by S (formerly known as Seed 2.0) -
// uber-alpha hack
// heavily based on CleanupTab.js
// My thanks and major props go to AzaToth.
//requires:
//importScript('User:JayVDB/Add LI menu');
//importStylesheet('User:JayVDB/Add LI menu/css');
if(typeof(autosubmit) == 'undefined') { var autosubmit = 'false'; }
if(typeof(minoredit) == 'undefined') { var minoredit = 'true'; }
Date.monthNames = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ];
Date.prototype.getMonthName = function() { return Date.monthNames[ this.getMonth() ]; }
Date.prototype.getUTCMonthName = function() { return Date.monthNames[ this.getUTCMonth() ]; }
function doCleanup(n) {
text = document.editform.wpTextbox1.value;
date = new Date();
switch(n) {
case 'commons':
text = '{' + '{' + 'Move to Wikimedia Commons}}\n\n' + text;
summary = 'Marked image to be moved to Wikimedia Commons using [[User:JayVDB/tags|tags]]';
break;
case 'delete':
text = '{' + '{' + 'delete}}\n\n' + text;
summary = 'Marked image as listed on [[Wikisource:Proposed deletions|Proposed deletions]] using [[User:JayVDB/tags|tags]]';
break;
}
document.editform.wpSummary.value = summary;
document.editform.wpTextbox1.value = text;
if (minoredit == true) {
document.editform.wpMinoredit.checked = true;
}
if (autosubmit == true) {
document.editform.submit();
}
}
$(function() {
if ( wgCanonicalNamespace in { "User":'', "User_talk":'' } ) {
return;
}
if ( document.editform ) {
var tabs = document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0];
addlimenu(tabs, "tags", "tags" );
mw.util.addPortletLink("tags", "javascript:doCleanup('commons')", "commons", "commons", "Move to Wikimedia Commons", "");
mw.util.addPortletLink("tags", "javascript:doCleanup('delete')", "delete", "commons", "Mark for deletion", "");
}
});
// </nowiki>
// </pre>