User:Gz33/orphanbuttons.js

/*	ORPHAN BUTTONS Description: Adds buttons to add automatic summaries when successfully de-orphaning articles or adding links to orphaned articles Link: User:Gz33/orphanbuttons.js if ((wgNamespaceNumber == 0) &&  document.URL.match(/&action=(edit|submit)/)) addOnloadHook(function{ var wpSave = document.getElementById('wpSave'); if (!wpSave) return; else    linkText = 'Adding link to orphaned article, Wikiproject Orphanage: You can help!';   deOrphText = 'Successfully de-orphaned! Wikiproject Orphanage: You can help!'; //create button var btn = document.createElement('input'); btn.type='button'; btn.value = 'Orphan linked'; btn.onclick = function{ document.getElementById('wpSummary').value = linkText }; btn.style.marginRight = '4px';  btn.title = 'Added a link to an orphan article';

wpSave.parentNode.insertBefore(btn, wpSave.NextSibling);

//create button var btn2 = document.createElement('input'); btn2.type='button'; btn2.value = 'DeOrphaned'; btn2.onclick = function{ document.getElementById('wpSummary').value = deOrphText }; btn2.style.marginRight = '4px'; btn2.title = 'Article successfully de-orphaned!';

btn.parentNode.insertBefore(btn2, btn);

})