The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Mention sound and webtab

2 posters

Go down

Mention sound and webtab Empty Mention sound and webtab

Post by Yuushishio 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)
avatar
Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Mention sound and webtab Empty Re: Mention sound and webtab

Post by Take Notes March 14th 2016, 12:14 am

Take Notes
Take Notes
Helper
Helper

Male Posts : 2337
Reputation : 324
Language : English
Location : Forumountain

Back to top Go down

Mention sound and webtab Empty Re: Mention sound and webtab

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

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

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Mention sound and webtab Empty Re: Mention sound and webtab

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

bump!
help Sad
avatar
Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Mention sound and webtab Empty Re: Mention sound and webtab

Post by Take Notes 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.
Take Notes
Take Notes
Helper
Helper

Male Posts : 2337
Reputation : 324
Language : English
Location : Forumountain

Back to top Go down

Back to top


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