-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
377 lines (278 loc) · 12.7 KB
/
index.html
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AfriTaxi</title>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, user-scalable=no">
<link href="css/animate.min.css" rel="stylesheet" type="text/css">
<link href="css/toast.css" rel="stylesheet" type="text/css">
<link href="css/materialize.css" rel="stylesheet" type="text/css">
<link href="reg/reg.css" rel="stylesheet" type="text/css">
<link href="css/sweetalert.css" rel="stylesheet" type="text/css">
<link href="css/at_ol.css" rel="stylesheet" type="text/css">
<script src="cordova.js"></script>
<script src="js/myalert.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/materialize.min.js"></script>
<script src="js/sweetalert.min.js"></script>
<script src="js/responsivevoice.js"></script>
<script src="reg/logic.js"></script>
<script src="reg/oauth/oauth_google.js"></script>
<script src="reg/oauth/oauth_facebook.js"></script>
<script src="reg/oauth/account.js"></script>
<script src="js/preventreload.js"></script>
<script src="js/logupdate.js"></script>
<script src="js/audio_definitions.js"></script>
<script src="js/toast.js"></script>
<script src="js/hash_start.js"></script>
<script type="text/javascript">
function app_restart() {
setTimeout(function() {
location.reload();
}, 3000);
}
$(document).ready(function() {
window.location.href = "index.html#start";
if (window.cordova) {
loading_error_check = setTimeout(function() {
localStorage.setItem('toast', 'Loading...');
toast();
app_restart();
}, 6000);
}
var rememberuser = localStorage.getItem("rememberuser");
if (rememberuser == "Yes") {
console.log("Remember user, go to start.");
document.location.href = "gotostart.html";
} else {
console.log("User not logged in, show splash screen.");
// bring back start page elements that where hidden.
document.getElementById("start_hide").style.display = "block";
}
var quick_tour_viewed = localStorage.getItem('quick_tour_viewed');
if (quick_tour_viewed == 'Yes') {
} else {
document.location.href = 'tour/swipe.html';
}
$.get("https://250taxi.com/db/partner/check_app_update.php?check=client", function(data) {
var currentversion = "44";
var serverversion = data;
if (currentversion < serverversion) {
alert("Your app is outdated. Please install the update to ensure smooth operation.");
window.open('https://250taxi.com/mobile_select.html', '_blank', 'location=no');
}
});
var currentTime = new Date().getHours();
if (0 <= currentTime && currentTime < 5) {
setnight();
}
if (5 <= currentTime && currentTime < 11) {}
if (11 <= currentTime && currentTime < 16) {}
if (16 <= currentTime && currentTime < 22) {}
if (22 <= currentTime && currentTime <= 24) {
setnight();
}
});
function showindicator() {
document.getElementById("loadingindicator").className = "animated fadeIn";
document.getElementById("loadingindicator").style.display = "block";
}
function hideindicator() {
document.getElementById("loadingindicator").className = "animated fadeOut";
setTimeout(function() {
document.getElementById("loadingindicator").style.display = "none";
}, 1000);
}
function letsgo() {
showindicator();
setTimeout(function() {
document.location.href = 'locate.html';
}, 3000);
}
function setnight() {
// document.getElementById('splashimg').src = 'splash_night.jpg';
// document.getElementById('splashpage').style.backgroundColor = '#130F20';
// document.getElementById('claim').style.color = '#73CEE9';
}
function dogpscheck() {
}
function opensettings() {
window.plugins.OneSignal.promptLocation();
swal("", "Your GPS is not enabled. Please turn it on in your settings. AfriTaxi needs GPS to find your pickup location.", "error")
}
function dodevicenamecheck() {
var device_model = device.model;
var device_platform = device.platform;
var device_version = device.version;
var device_uuid = device.uuid;
// alert(device_model + device_platform + device_version + device_uuid);
localStorage.setItem("device_model", device_model);
localStorage.setItem("device_platform", device_platform);
localStorage.setItem("device_version", device_version);
localStorage.setItem("device_uuid", device_uuid);
}
function social_login_btn() {
$('#google_sign_in').on('click', function() {
localStorage.setItem("google_login_button_clicked", "Yes");
app.onLoginButtonClick();
});
$('#facebook_sign_in').on('click', function() {
localStorage.setItem("facebook_login_button_clicked", "Yes");
facebook_login_start();
});
}
function start_reg() {
$("#reg_start").load("reg/mainmenu.html", function() {
$.get('reg/social_login.html', function(data) {
$('#reg_form').prepend(data);
social_login_btn();
var country = localStorage.getItem("country");
$("#phone_country_select").val(country);
$('select').material_select();
});
document.getElementById("reg_start").style.height = "100%";
if (document.getElementById("close_reg_start_arrow"))
document.getElementById("close_reg_start_arrow").style.marginLeft = "10px";
});
location.href = "#registration";
localStorage.setItem("reg_start_open", "Yes");
}
function start_login() {
$("#reg_start").load("reg/login.html", function() {
$.get('reg/social_login.html', function(data) {
$('#reg_form').prepend(data);
social_login_btn();
});
document.getElementById("reg_start").style.height = "100%";
if (document.getElementById("close_reg_start_arrow"))
document.getElementById("close_reg_start_arrow").style.marginLeft = "10px";
});
location.href = "#login";
localStorage.setItem("reg_start_open", "Yes");
}
function close_reg_start() {
localStorage.setItem("reg_start_open", "No");
location.href = "#start";
document.getElementById("reg_start").style.height = "0%";
if (document.getElementById("close_reg_start_arrow"))
document.getElementById("close_reg_start_arrow").style.marginLeft = "-50px";
if (document.getElementById("reg_form"))
document.getElementById("reg_form").style.display = "none";
}
function terms() {
window.open('https://250taxi.com/termsandconditions.php', '_blank', 'location=no');
}
function cordova_start() {
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
clearTimeout(loading_error_check);
var deviceOS = device.platform; //fetch the device operating system
var deviceOSVersion = device.version; //fetch the device OS version
// alert(deviceOSVersion);
console.log("Device OS: " + deviceOS);
console.log("Device OS Version: " + deviceOSVersion);
if (deviceOSVersion == "4.1.3") {
alert("Your Android Version is very old. If you experience problems with the app, please call our customer care number.");
}
if (deviceOSVersion == "4.1.2") {
alert("Your Android Version is very old. If you experience problems with the app, please call our customer care number.");
}
if (deviceOSVersion == "4.1.1") {
alert("Your Android Version is very old. If you experience problems with the app, please call our customer care number.");
}
// set to either landscape
screen.lockOrientation('portrait');
dogpscheck();
dodevicenamecheck();
// window.plugins.OneSignal.setLogLevel({logLevel: 4, visualLevel: 4});
var notificationOpenedCallback = function(jsonData) {
console.log('didReceiveRemoteNotificationCallBack: ' + JSON.stringify(jsonData));
};
window.plugins.OneSignal.init("03b0ecf1-200e-470c-8c27-9010306734a3", {
googleProjectNumber: "1006498509511"
}, notificationOpenedCallback);
// Show an alert box if a notification comes in when the user is in your app.
window.plugins.OneSignal.enableInAppAlertNotification(true);
window.plugins.OneSignal.getIds(function(ids) {
console.log('getIds: ' + JSON.stringify(ids));
// alert("userId = " + ids.userId + ", pushToken = " + ids.pushToken);
localStorage.setItem("os_id", "" + ids.userId + "");
});
}
</script>
</head>
<body onload="cordova_start();">
<div id="loadingindicator">
<div class="preloader-wrapper medium active">
<div class="spinner-layer spinner-blue">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-red">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-yellow">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-green">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</div>
<div id="reg_start"></div>
<div id="start_hide">
<div id="logo_white"></div>
<div id="claim" class="" style="-webkit-animation-delay: 2s;">
<br>
<div id="welcome_notice">
<img src="css/we_take_you_there.gif">
</div>
<div id="loginregister" class="animated slideInUp" style="-webkit-animation-delay:3s;">
<div onclick="start_login();" class="left notextselect" style="-webkit-animation-delay: 2s;">Login</div>
<div onclick="start_reg();" class="right notextselect" style="-webkit-animation-delay: 3s;">Register</div>
</div>
</div>
<script>
$(document).ready(function() {
var year = new Date().getFullYear();
document.getElementById("copyright_current_year").innerHTML = year;
});
</script>
<div id="copyright" class="animated fadeIn" style="-webkit-animation-delay: 5s;">
© 2015 - <span id="copyright_current_year"></span> afrionline.net
</div>
</div>
</body>
</html>