Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Wikipedia:WikiProject User scripts/Scripts/New message history

From Wikipedia, the free encyclopedia
<Wikipedia:WikiProject User scripts |Scripts
Purpose
Add a link to your talk page history to the "You have new messages" warning.

;Usage : Include a call tonewmessagehistory() in your load page function.

Bugs
Will probably break any function called after it, so it should be called last.

//

/**** WARNING: THIS SCRIPT IS CURRENTLY UNSTABLE AND WILL KILL OTHER FUNCTIONS. ****//**** NO WARRANTY IS PROVIDED OR IMPLIED. ***/// newmessagehistoryaddOnloadHook(function () {    var divs = document.getElementsByTagName('div');    var talkmessagebox;        for(var x = 0; x < divs.length; ++x)    {        if(divs[x].className.indexOf('usermessage') != -1)        {            talkmessagebox = divs[x];            x = divs.length; // force break        }    }        var newmessagelink = talkmessagebox.getElementsByTagName('a')[0];        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'));        var talkmessagetext = 'You have ';    talkmessagebox.innerHTML = talkmessagetext;        talkmessagebox.appendChild(newmessagelink);    talkmessagebox.appendChild(document.createTextNode(' ('));    talkmessagebox.appendChild(historylink);    talkmessagebox.appendChild(document.createTextNode(')'));});//
Retrieved from "https://en.wikipedia.org/w/index.php?title=Wikipedia:WikiProject_User_scripts/Scripts/New_message_history&oldid=167032692"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp