Wikipedia:WikiProject User scripts/Scripts/New message history: Difference between revisions

Content deleted Content added
Alphax (talk | contribs)
m inserting breakage warning
m Protected Wikipedia:WikiProject User scripts/Scripts/New message history: javascript page outside user space [edit=sysop:move=sysop]
 
(8 intermediate revisions by 5 users not shown)
Line 1:
;Purpose : Add a link to your talk page history to the "You have new messages" warning.
<s>;Usage : Include a call to <code>newmessagehistory()</code> in your load page function.</s>
;Bugs : Will probably break any function called after it, so it should be called last.
 
// <pre><nowiki>
 
/**** WARNING: THIS SCRIPT IS CURRENTLY UNSTABLE AND COULDWILL KILL OTHER FUNCTIONS. ****/
/**** NO WARRANTY IS PROVIDED OR IMPLIED. ***/
 
function// newmessagehistory()
addOnloadHook(function () {
{
var divs = document.getElementsByTagName('div');
var talkmessagebox;
Line 22 ⟶ 26:
var historylink = document.createElement('a');
historylink.href = newmessagelink.href.replace(/\/wiki\//, '/w/index.php?title=') + '&action=history';
historylink.className = 'external text';
historylink.appendChild(document.createTextNode('changes'));
Line 31 ⟶ 36:
talkmessagebox.appendChild(historylink);
talkmessagebox.appendChild(document.createTextNode(')'));
});
 
// </nowiki></pre>
 
[[Category:Wikipedia scripts]]