The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Mention sound and webtab

View previous topic View next topic Go down

Mention sound and webtab

Post by Yuushishio on March 13th 2016, 11:28 pm

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)

Yuushishio
Forumember

Posts : 117
Reputation : 3
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Re: Mention sound and webtab

Post by Genesis on March 14th 2016, 12:14 am


Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

Re: Mention sound and webtab

Post by Yuushishio on March 14th 2016, 5:10 am

@forumedic thank you, I got the sound now.
How about the effect in website tab?

Yuushishio
Forumember

Posts : 117
Reputation : 3
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Re: Mention sound and webtab

Post by Yuushishio on March 16th 2016, 3:20 am

bump!
help Sad

Yuushishio
Forumember

Posts : 117
Reputation : 3
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Re: Mention sound and webtab

Post by Genesis on March 16th 2016, 3:59 am

Sorry I have no idea.

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){}})
});
Maybe someone can modify it for your purposes.

Genesis
Forum Reviewer
Forum Reviewer

Male Posts : 2331
Reputation : 322
Language : English
Location : Forumountain

http://forumpromocean.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum