Hello everyone,
This code will change the "in a watched topic" with the actual name of the topic. It should work on any forum version, as long as you have the toolbar activated. This code should be added with placement on all pages.
This code will change the "in a watched topic" with the actual name of the topic. It should work on any forum version, as long as you have the toolbar activated. This code should be added with placement on all pages.
- Code:
$(function(){
//by Wolfuryo
var i=0; // initialization for the for loop
if(!_userdata.activate_toolbar || !_userdata.session_logged_in) return; //no toolbar, no fun
/*Adding the name and some classes*/
_lang["Notif_topic_watch"] = "<a href=\"/u%(id)d\">%(name)s</a> wrote a message in <a href=\"/t%(topic_id)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>";
_lang["Notif_topic_watch_p"] = "<a href=\"/u%(id)d\">%(name)s</a> wrote a message in <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>";
_lang["Notif_topic_watch_guest"] = "A guest wrote a message in <a href=\"/t%(topic_id)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>";
_lang["Notif_topic_watch_p_guest"] = "A guest wrote a message in <a href=\"/t%(topic_id)dp%(start)d-%(topic_name)s?nid=%(nid)s#%(post_id)d\" class='cl'>%(topic_name)s</a>";
$("body").on("DOMNodeInserted", ".cl", function(){ //The notification is created
$(this).text($(this).text().replace(/-/g, " ")).removeClass("cl").addClass("cd"); //remove some stuff
})
})