Wikipedia:WikiProject User scripts/Scripts/New message history: Difference between revisions
Content deleted Content added
adding purpose section |
m Protected Wikipedia:WikiProject User scripts/Scripts/New message history: javascript page outside user space [edit=sysop:move=sysop] |
||
(7 intermediate revisions by 4 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
/**** NO WARRANTY IS PROVIDED OR IMPLIED. ***/
addOnloadHook(function () {
var divs = document.getElementsByTagName('div');
var talkmessagebox;
Line 23 ⟶ 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 32 ⟶ 36:
talkmessagebox.appendChild(historylink);
talkmessagebox.appendChild(document.createTextNode(')'));
});
// </nowiki></pre>
[[Category:Wikipedia scripts]]
|