kstych.js
2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
document.addEventListener('deviceready', function() {
$(document).bind('backbutton', onPressBack);
});
function onPressBack()
{
if(lastvarUrl.indexOf("dashboard")==0)
{
if (window.confirm("Do you want to Exit App?"))
{
navigator.app.exitApp();
}
}
else menuAction("dashboard");
}
function mobile_logout()
{
pushNotification.unregister(function(){}, function(){}, {});
}
// // handle GCM notifications for Android
// var queueMsg='';
// function onNotificationAndroid(e) {
// switch( e.event )
// {
// case 'registered':
// if ( e.regid.length > 0 )
// {
// //not needed here
// //navigator.app.loadUrl("http://184.73.157.107/web/android?device=mobile&type=android&gcm="+e.regid+'&queuemsg='+encodeURIComponent(queueMsg), {wait:0, loadingDialog:"Please Wait.,Loading", loadUrlTimeoutValue: 60000});
// //console.log("regID = " + e.regid);
// }
// break;
//
// case 'message':
// // if this flag is set, this notification happened while we were in the foreground.
// // you might want to play a sound to get the user's attention, throw up a dialog, etc.
// if (e.foreground)
// {
// //to be handled in App , this should not happen here //e.payload
// //queueMsg=JSON.stringify(e);
// }
// else
// {
// // otherwise we were launched because the user touched a notification in the notification tray.
// //if (e.coldstart)queueMsg=JSON.stringify(e);//closed app
// //else queueMsg=JSON.stringify(e);//background app
// }
//
// queueMsg=JSON.stringify(e);
// break;
//
// case 'error':
// //'ERROR -> MSG:' + e.msg
// break;
//
// default:
// //EVENT -> Unknown, an event was received and we do not know what it is
// break;
// }
// }
//
// function successHandler (result) {
// //$("#app-status-ul").append('<li>success:'+ result +'</li>');
// }
//
// function errorHandler (error) {
// //$("#app-status-ul").append('<li>error:'+ error +'</li>');
// }