I've made a few changes that seem to get some simple notifications going...
Add the following line:
var lastMessanges = 0;
After:
var pane = null;
Then add:
if (lastMessanges < numMessanges) { lastMessanges = numMessanges if (lastMessanges == 1) { Unity.Notification.showNotification("Gmail", "You have " + lastMessanges + " unread message.", null); } if (lastMessanges > 1) { Unity.Notification.showNotification("Gmail", "You have " + lastMessanges + " unread messages.", null); } } lastMessanges = numMessanges
Unity.Launcher.setCount(Number(numMessanges));
The attached file contains the above changes as well as Fernando and Andrew's changes.
This my first attempt at Java Script so feedback would be most welcome!
I've made a few changes that seem to get some simple notifications going...
Add the following line:
var lastMessanges = 0;
After:
var pane = null;
Then add:
if (lastMessanges < numMessanges) { Notification. showNotificatio n("Gmail" , "You have " + lastMessanges + " unread message.", null); Notification. showNotificatio n("Gmail" , "You have " + lastMessanges + " unread messages.", null);
lastMessanges = numMessanges
if (lastMessanges == 1) {
Unity.
}
if (lastMessanges > 1) {
Unity.
}
}
lastMessanges = numMessanges
After:
Unity. Launcher. setCount( Number( numMessanges) );
The attached file contains the above changes as well as Fernando and Andrew's changes.
This my first attempt at Java Script so feedback would be most welcome!