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

Version Path
jegolize-0.1.12 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.11 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.10 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.9 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.8 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.6 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.3 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.2 public/javascripts/jegol.plugin/update.notify.js
jegolize-0.1.1 public/javascripts/jegol.plugin/update.notify.js