User:Allstarecho/autoarchive.js

//For useage instructions, see http://en.wikipedia.org/wiki/User:Allstarecho/autoarchive.js

if (archiverAddText == null) var archiverAddText = '{'+'{talkheader}'+'}\n{{User:MiszaBot/config\n|archiveheader = {{Talkarchivenav}}\n|maxarchivesize = 80K\n|counter = 1\n|minthreadsleft = 1\n|minthreadstoarchive = 1\n|algo = old(15d)\n|archive = Talk:PAGE NAME/Archive %(counter)d\n}'+'}\n'; if (archiverSummary == null) var archiverSummary = 'Set up of MiszaBot auto archiving using AutoArchive'; function addArchiverText { var box = document.getElementById('wpTextbox1'); var content = box.value; content = archiverAddText + content; box.value = content; var sumBox = document.getElementById('wpSummary'); sumBox.value = archiverSummary; } function goToArchiver { var url = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + mw.config.get('wgPageName') + '&action=edit&addarchive=true'; window.location = url; } function attachArchiverLink { var archiverLink = new wa_element('li'); archiverLink.ele_obj.id = 't-archiver'; archiverLink.ele_obj.innerHTML = 'Auto-Archive'; archiverLink.addScriptEvent('click', function { goToArchiver; }); archiverLink.attach(document.getElementById('pt-userpage'), 'before'); }

importScript('User:Ale_jrb/Scripts/waLib.js'); //hookEvent('load', attachArchiverLink); //if (window.location.href.indexOf('&addarchive=true') > -1) { hookEvent('load', addArchiverText); }