index.html
4.87 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title></title>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" charset="utf-8" src="PushNotification.js"></script>
<script type="text/javascript" charset="utf-8" src="CallNumber.js"></script>
<script type="text/javascript" charset="utf-8" src="sharedpreferences.js"></script>
</head>
<body style='background:#000'>
<table class=mtable cellspacing=0 cellpadding=0 border=0 style='height:100%;width:100%;'>
<tr style='height:100%;width:100%' valign=center><td style='height:100%;width:100%' align=center valign=center>
<div>
<ul class="spinner">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
<div><img src="img/logo.png" style='max-width:300px;width:30%'></div>
<!-- <div class="splash-intro" id=splashspan>Trippers Academy</div> -->
<!-- <div class="copy-right"><img src="img/kstych.png" height=18px></div> -->
</td></tr>
</table>
<script type="text/javascript">
var pushNotification;
document.addEventListener('deviceready', function() {
try
{
pushNotification = window.plugins.pushNotification;
pushNotification.register(successHandler, errorHandler, {"senderID":"370075919571","ecb":"onNotificationAndroid"});
}
catch(err)
{
txt="There was an error on this page.\n\n";
txt+="Error description: " + err.message + "\n\n";
alert(txt);
}
});
// handle GCM notifications for Android
var queueMsg='';
function onNotificationAndroid(e) {
switch( e.event )
{
case 'registered':
if ( e.regid.length > 0 )
{
//navigator.app.loadUrl("http://54.83.35.35/web/android?device=mobile&type=android&gcm="+e.regid+'&queuemsg='+encodeURIComponent(queueMsg), {wait:0, loadingDialog:"Please Wait.,Loading", loadUrlTimeoutValue: 60000});
navigator.app.loadUrl("http://54.83.35.35/web/mdialer?device=mobile&type=android&gcm="+e.regid+'&queuemsg='+encodeURIComponent(queueMsg), {wait:0, loadingDialog:"Please Wait.,Loading", loadUrlTimeoutValue: 60000});
//console.log("regID = " + e.regid);
//window.plugins.CallNumber.callNumber(onSuccess, onError, number);
//window.plugins.CallNumber.callNumber(function(){}, function(){}, "+919987221492");
}
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>');
}
</script>
</body>
</html>