Below problems are in JavaScript/HTML only. In Flex both
works well.
In JavaScript/HTML on Mac, dock icon bounces only once in CRITICAL.
Below 3 cases(type, CRITICAL, "aaa"), same results.
How do I use JavaScript code to react doc icon repeatedly?
function notify() {
if (air.NativeApplication.supportsDockIcon) {
var critical = document.getElementById("critical");
var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
//air.NativeApplication.nativeApplication.icon.bounce(type);
//air.DockIcon(air.NativeApplication.nativeApplication.icon).bounce(air.NotificationType. CRITICAL);
air.NativeApplication.nativeApplication.icon.bounce("aaa");
}
}
function setListener()
{
nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
}
</script>
</head>
<body onload="setListener()">
And I have another problem on Windows just as Mac.
Below cases(type, CRITICAL, ,no argumens) are same results.
Application windows and taskbar flash only once.
How do I use JavaScript code to flash window and taskbar??
function notify(){
if(air.NativeApplication.supportsSystemTrayIcon && air.NativeWindow.supportsNotification) {
var critical = document.getElementById('critical');
var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
window.nativeWindow.notifyUser(type);
//window.nativeWindow.notifyUser(air.NotificationType.CRITICAL);
//window.nativeWindow.notifyUser();
}
}
function setListener(){
window.nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
}
</script>
</head>
<body onLoad="setListener()">
In JavaScript/HTML on Mac, dock icon bounces only once in CRITICAL.
Below 3 cases(type, CRITICAL, "aaa"), same results.
How do I use JavaScript code to react doc icon repeatedly?
function notify() {
if (air.NativeApplication.supportsDockIcon) {
var critical = document.getElementById("critical");
var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
//air.NativeApplication.nativeApplication.icon.bounce(type);
//air.DockIcon(air.NativeApplication.nativeApplication.icon).bounce(air.NotificationType. CRITICAL);
air.NativeApplication.nativeApplication.icon.bounce("aaa");
}
}
function setListener()
{
nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
}
</script>
</head>
<body onload="setListener()">
And I have another problem on Windows just as Mac.
Below cases(type, CRITICAL, ,no argumens) are same results.
Application windows and taskbar flash only once.
How do I use JavaScript code to flash window and taskbar??
function notify(){
if(air.NativeApplication.supportsSystemTrayIcon && air.NativeWindow.supportsNotification) {
var critical = document.getElementById('critical');
var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
window.nativeWindow.notifyUser(type);
//window.nativeWindow.notifyUser(air.NotificationType.CRITICAL);
//window.nativeWindow.notifyUser();
}
}
function setListener(){
window.nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
}
</script>
</head>
<body onLoad="setListener()">