Mention sound and webtab Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
2 posters

    Mention sound and webtab

    avatar
    Yuushishio
    Forumember


    Posts : 117
    Reputation : 4
    Language : English

    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)
    Take Notes
    Take Notes
    Helper
    Helper


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

    Mention sound and webtab Empty Re: Mention sound and webtab

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

    avatar
    Yuushishio
    Forumember


    Posts : 117
    Reputation : 4
    Language : English

    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

    Mention sound and webtab Empty Re: Mention sound and webtab

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

    bump!
    help Sad
    Take Notes
    Take Notes
    Helper
    Helper


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

    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.