mic_none

User:Polygnotus/Scripts/Todoes.js Source: en.wikipedia.org/wiki/User:Polygnotus/Scripts/Todoes.js

mw.hook('wikipage.content').add(function() {
	
	if (document.getElementById('pt-todoes')) {
		//workaround so that even if you enable live updates in RecentChanges the script does not repeat
        return;
    }
	
    var personalTools = document.getElementById('p-personal');
    if (personalTools) {
        var ul = personalTools.querySelector('ul');
        var sandboxLi = ul.querySelector('li#pt-sandbox');
        
        if (sandboxLi) {
            var todoesLink = document.createElement('li');
            todoesLink.id = 'pt-todoes';
            todoesLink.innerHTML = '<a href="https://demo.azizisearch.com/lite/wikipedia/page/Special:MyPage/Todoes">Todoes</a>';
            
            sandboxLi.insertAdjacentElement('afterend', todoesLink);
        }
    }
});