Sha256: 79397d76b9063387e8bfa7e89c99bcf2b21782487da3022769d700ae9d3c926d
Contents?: true
Size: 968 Bytes
Versions: 9
Compression:
Stored size: 968 Bytes
Contents
/** * Register 'notify' update plugin */ JeGol.addUpdatePlugins('notify', { /** * Update plugin - Audio visual inication for new messages. * @param {Object} msgStanza - string topic */ DoUpdate: function(msgStanza) { flashIfOutofScope(); return false; } }); var browserInfocus = 1; var flashSpeed = 1500; var defaultTitle = 'jeGol'; function onBlur() { browserInfocus = 0; } function onFocus(){ browserInfocus = 1; } function flashIfOutofScope(){ if (browserInfocus == 1) { window.document.title = defaultTitle; } else { if(window.document.title == defaultTitle) { window.document.title = '*New Message*'; }else { window.document.title = defaultTitle; } setTimeout("flashIfOutofScope();",flashSpeed); } } if (/*@cc_on!@*/false) { // check for Internet Explorer document.onfocusin = onFocus; document.onfocusout = onBlur; } else { window.onfocus = onFocus; window.onblur = onBlur; }
Version data entries
9 entries across 9 versions & 1 rubygems