Mention sound and webtab
2 posters
Page 1 of 1
Mention sound and webtab
My forum: http://www.1000sunny.net/
ver: phpbb3
position: founder.
------
I'm looking for a feature and wondering that if forumotion has it?
It's the mention sound and web tab signal.
I found that we have them for chatbox feature. But... is it only chatbox? can I have it for the whole mention system of notification.
I mean when people got something in their [notifications] (message in topic they're following/they're being mentioned/having vm,pm... etc) then there'll be sound effect and the website tab change, example it will glove/change the favicon/appear noti numer (1)
ver: phpbb3
position: founder.
------
I'm looking for a feature and wondering that if forumotion has it?
It's the mention sound and web tab signal.
I found that we have them for chatbox feature. But... is it only chatbox? can I have it for the whole mention system of notification.
I mean when people got something in their [notifications] (message in topic they're following/they're being mentioned/having vm,pm... etc) then there'll be sound effect and the website tab change, example it will glove/change the favicon/appear noti numer (1)
Take Notes- Helper
- Posts : 2337
Reputation : 324
Language : English
Location : Forumountain
Re: Mention sound and webtab
@forumedic thank you, I got the sound now.
How about the effect in website tab?
How about the effect in website tab?
Re: Mention sound and webtab
Sorry I have no idea.
This code gives notification for Chatbox on tab:
This code gives notification for Chatbox on tab:
- Code:
window.localStorage && $(window).load(function() {
var chatbox_script = function() {
var t_icon = window.top.$.find('link[rel="shortcut icon"]')[0];
var t_doc = window.top.document;
var title = t_doc.title;
var icon = t_icon.getAttribute('href');
var rep_title = '!! New message !! '+title;
var rep_icon = 'http://s301826463.onlinehome.fr/f/al.ico';
$(window).on("focus", function(){ localStorage.cb_blurred='' }).on("blur", function(){ localStorage.cb_blurred=1; });
var overrided = Chatbox.prototype.refresh;
Chatbox.prototype.refresh = function(data) {
if (data.messages && data.messages.length) {
var lm = data.messages.slice(-1)[0];
var last_message = lm.time+','+lm.action+','+lm.msg;
if(this.last_message != last_message) {
var user = $.grep(data.users, function(v){return v.id==chatbox.userId});
user = user.length ? user[0] : [{}];
if(this.last_message!==undefined) {
if(lm.userId!=chatbox.userId && user.username!=lm.username) {
if(localStorage.cb_blurred) (function(){
var blink = function(){
if(title == t_doc.title) {
if(!localStorage.cb_blurred) return;
var new_title = rep_title;
var new_icon = rep_icon;
} else {
var new_title = title;
var new_icon = icon;
}
t_doc.title = new_title;
var new_t_icon = t_icon.cloneNode(true);
new_t_icon.setAttribute('href', new_icon);
var t_icon_parent = t_icon.parentNode;
t_icon_parent.removeChild(t_icon);
t_icon_parent.appendChild(new_t_icon);
t_icon = new_t_icon;
setTimeout(blink, 500);
};
blink();
})();
} else {
localStorage.cb_blurred='';
}
}
this.last_message = lm;
}
}
overrided.call(this, data);
};
};
var
s=document.createElement('script');s.text="("+chatbox_script.toString()+")();";$('object[data^="/chatbox/index.forum"],iframe[src^="/chatbox/index.forum"]').each(function(){try{$(this.contentDocument||this.contentWindow.document).find("#chatbox").closest("html").find("head").first().each(function(){this.appendChild(s.cloneNode(true))})}catch(a){}})
});
Take Notes- Helper
- Posts : 2337
Reputation : 324
Language : English
Location : Forumountain
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum