Jump to content

User:Tom29739/archiver.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Tom29739 (talk | contribs) at 21:24, 25 April 2016 (Added test functionality). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
userIsInGroup = function ( group ) {
	return $.inArray(group, mw.config.get( 'wgUserGroups' )) !== -1;
};
if (userIsInGroup( "autoconfirmed" ) || stuff.userIsInGroup( "confirmed" )) {
var pagename = mw.config.get("wgPageName");
var url = "//tools.wmflabs.org/hall-of-fame/api.php?pageURL=" + pagename;
// Create portlet link
var archive = mw.util.addPortletLink( 'p-cactions', url,
	'Archive', 'ca-archive-stuff',	'Click here to archive this page'
);
var testurl = "//tools.wmflabs.org/hall-of-fame/apitest.php?pageURL=" + pagename;
// Create portlet link
var archive = mw.util.addPortletLink( 'p-cactions', testurl,
	'Test archive', 'ca-archive-stuff',	'Click here to test archive this page'
);
}