User:Gryllida/js/TagAbandoned.js

// // Adds new "tag abandoned" link, // near "What links here" and "Related changes". // In the timeless skin this is conveniently located // in the right sidebar. If you are using another // skin and the location of the buttons is not // convenient to you, please let me know. // // You clicking the link immediately inserts // "" to the top of the current page, // and removes the "tag abandoned" link from the sidebar.

var tagabandoned = { tag: function { var api = new mw.Api; api.postWithToken("edit", {				action: 'edit',				title: mw.config.get ('wgPageName'),				prependtext: '',				summary: 'added status tag: (s)'			}).done(function (data){				$('#tagabandoned').fadeOut;				jsMsg( 'Template added' );			}); },	init: function { var t = document.getElementById('t-whatlinkshere'); if (!t) return; var li = document.createElement('li'); var a = document.createElement('a'); a.setAttribute('href', 'javascript:tagabandoned.tag'); a.id = 'tagabandoned'; a.appendChild(document.createTextNode('tag abandoned')); li.appendChild(a); t.parentNode.appendChild(li); } };

mw.loader.using(['mediawiki.api'], function { tagabandoned.init; });

//