-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
3692 lines (3273 loc) · 118 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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='en' itemscope='' itemtype='http://schema.org/WebApplication'>
<head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' >
<meta http-equiv='Content-Type' content="text/html; charset=UTF-8" >
<meta name='title' content="Wolo Code" >
<meta itemprop='name' content="Wolo Code" >
<meta name='author' content="Ujjwal Singh" >
<meta name='viewport' content="initial-scale=1.0, viewport-fit=cover" >
<meta name='theme-color' content='#ffffff' >
<meta property="og:url" content="https://wolo.codes" />
<meta property="og:title" content="" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://wolo.codes/social.png" />
<meta property="og:description" content="Words based Lacation codes" />
<meta property="og:site_name" content="wolo.codes" />
<meta property="fb:app_id" content="1860152747451314" />
<meta property="fb:admins" content="100000014591845" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@wolocode">
<meta name="twitter:title" content="">
<meta name="twitter:description" content="Words based Lacation codes">
<meta name="twitter:image" content="https://wolo.codes/social.png">
<meta name="twitter:creator" content="wolocode">
<link rel='icon' type='image/svg+xml' href='/favicon.svg' >
<link rel="alternate icon" type='image/x-icon' href='/favicon.ico' >
<link rel='apple-touch-icon' type='image/png' href='/apple-touch-icon.png' >
<link href='https://wolo.codes' rel='canonical' >
<title>Wolo Code</title>
<link rel='manifest' href='/manifest.json' >
<script>// Firebase
var FIREBASE_CONFIG = {
apiKey: "AIzaSyC-ZxXuNOEEs5mNQD3Z8u4CSJtldtLztDE",
authDomain: "wolo.codes",
databaseURL: "https://wolo-codes.firebaseio.com",
projectId: "wolo-codes",
storageBucket: "wolo-codes.appspot.com",
messagingSenderId: "1073432021665",
appId: "1:1073432021665:web:29ab7635459c72c19bbee0",
measurementId: "G-882VJ942XZ"
};
// Code\Code
var FUNCTIONS_BASE_URL = "https://wolo.codes/api";
//'http://localhost:5000/waddress-5f30b/us-central1';
</script>
<script src='https://browser.sentry-cdn.com/6.4.1/bundle.min.js' integrity='sha384-THoc7rflwZFKTdZNgv6jLFFDn299Uv3t1SW5B4yGLvLiCRTYP9ys6vXZcMl95TQF' crossorigin='anonymous'
></script>
<script>Sentry.init({ dsn: 'https://[email protected]/2045587' });
</script>
<script>
function trackOutboundLink(title, url) {
analytics.logEvent('outbound_link', {title: title, url: url});
}
function getAddressCity(address_components) {
var found_city_i;
var found_group_i;
var found_country_i;
for(var i = address_components.length-1; i >= 0; i--) {
if(address_components[i].types.includes('locality')) {
found_city_i = i;
break;
} else if (address_components[i].types.includes('administrative_area_level_1')) {
found_group_i = i;
found_city_i = i;
} else if (address_components[i].types.includes('administrative_area_level_2')) {
found_city_i = i;
} else if ( found_city_i == null && (address_components[i].types.includes('sublocality') || address_components[i].types.includes('sublocality_level_1')) ) {
found_city_i = i;
} else if (address_components[i].types.includes('country')) {
found_country_i = i;
}
}
var gp_id;
var city_lat;
var city_lng;
var city_name;
var city_accent;
if(found_city_i != null) {
gp_id = address_components[found_city_i].place_id;
city_lat = address_components[found_city_i].geometry['location']['lat']();
city_lng = address_components[found_city_i].geometry['location']['lng']();
city_name = address_components[found_city_i].address_components[0].short_name;
city_accent = address_components[found_city_i].address_components[0].long_name;
}
var group = found_group_i != null? address_components[found_group_i].address_components[0].long_name : null;
var country = found_country_i != null? address_components[found_country_i].address_components[0].long_name : null;
return {
gp_id: gp_id,
city_lat: city_lat,
city_lng: city_lng,
city_name: city_name,
city_accent: city_accent,
group: group,
country: country
};
}
// const CURRENT_VERSION;
// var initWCode;
// var initWCode_jumpToMap;
// var initWCode_jump_ask;
function setLocationAccess(status) {
if (typeof(Storage) !== 'undefined') {
localStorage.location_access = (status == true);
}
}
function locationAccessInitCheck() {
if(typeof(Storage) !== 'undefined' && typeof(localStorage.location_access) !== 'undefined')
return true;
else
return false;
}
function locationAccessCheck() {
if (locationAccessInitCheck() === true && localStorage.location_access != '' && JSON.parse(localStorage.location_access) === true)
return true;
else
return false;
}
function setLocationAccessDND(status) {
if (typeof(Storage) !== 'undefined') {
localStorage.location_access_dnd = (status == true);
}
}
function locationAccessDNDcheck() {
if(locationAccessDNDstatus() && JSON.parse(localStorage.location_access_dnd) === true)
return true;
else
return false;
}
function locationAccessDNDstatus() {
if (typeof(Storage) !== 'undefined' && typeof(localStorage.location_access_dnd) !== 'undefined' && localStorage.location_access_dnd != '')
return true;
else {
setLocationAccessDND(false);
return false;
}
}
function versionCheck() {
var set = false;
if (typeof(Storage) !== 'undefined') {
if(typeof(localStorage.note_version) === 'undefined')
set = true;
else if(localStorage.note_version != '' && localStorage.note_version != 'undefined' && JSON.parse(localStorage.note_version) < CURRENT_VERSION)
set = true;
}
if(set) {
localStorage.note_version = CURRENT_VERSION;
showInfo();
return false;
}
else {
activateOverlayInfo_full();
return true;
}
}
function activateOverlayInfo_full() {
info_intro.classList.add('hide');
info_links.classList.add('hide');
info_message_close.classList.remove('hide');
info_full.classList.remove('hide');
info_agency.classList.add('hide');
}
function activateOverlayInfo_links() {
info_full.classList.add('hide');
info_links.classList.remove('hide');
info_agency.classList.remove('hide');
}
function urlDecode() {
if(window.location.pathname.substr(1) != '') {
var code_string;
var end_flag_char = window.location.pathname.substr(-1);
if(end_flag_char == '/') {
redirect_showLoader();
code_string = window.location.pathname.substr(1, window.location.pathname.length-2);
initWCode_jumpToMap = true;
}
else if (end_flag_char == '_') {
init_map_mode = 'satellite';
code_string = window.location.pathname.substr(1, window.location.pathname.length-2);
initWCode_jumpToMap = false;
}
else {
code_string = window.location.pathname.substr(1);
initWCode_jumpToMap = false;
}
if(!code_string.match(/^[A-Za-z0-9._]+$/)) {
window.location.replace('/404'+'?url='+window.location.host+window.location.pathname+window.location.search);
return false;
}
else {
pushLoader();
var code = code_string.toLowerCase().replace('_', ' ');
pendingWords = code.split('.');
initWCode = true;
return true;
}
}
else {
var urlParams = new URLSearchParams(window.location.search);
var qParam = urlParams.get('q');
if(qParam != null && qParam != '') {
toggleMapType();
var lat_lng = qParam.split(',');
pendingPosition = {lat: parseFloat(lat_lng[0]), lng: parseFloat(lat_lng[1])};
}
return false;
}
}
// .\Script
var DEFAULT_LATLNG = {lat: -34.397, lng: 150.644};
var DEFAULT_INIT_ZOOM = 2;
var DEFAULT_LOCATE_ZOOM = 24;
var pendingInitMap = true;
var syncLocate_engage;
// Firebase
var analytics;
var perf;
var database;
var refCityCenter;
var geoFire;
// Script
var initLoadDone = false;
// UpdateMyBrowser
var _umb = {
require: {
chrome: 60,
firefox: 37,
ie: 10,
opera: 7,
safari: 29
}
};
// Loader
var loaderCount = 0;
//var loaderCount;
function pushLoader() {
document.getElementById('wait_loader').classList.remove('hide');
loaderCount++;
}
function popLoader() {
if(loaderCount)
loaderCount--;
if(!loaderCount)
document.getElementById('wait_loader').classList.add('hide');
}
function clearLoader() {
loaderCount = 0;
document.getElementById('wait_loader').classList.add('hide');
}
// var location_button_begin_time;
// var location_button_PRESS_THRESHOLD = 500;
// var locating = false;
// var locate_button_pressed = false;
// var watch_location_timer;
// var watch_location_id;
// var watch_location_notice_timer;
// var pendingFocusPos;
// var locateRight_callback;
function initLocate(override_dnd, callback) {
if(!locationAccessInitCheck()) {
locateRight_callback = callback;
showLocateRightMessage(true);
}
else
callback(function() {
if(!locationAccessCheck()) {
var hide_dnd = typeof override_dnd == 'undefined' || override_dnd || !locationAccessDNDstatus();
if(override_dnd || !locationAccessDNDcheck()) {
showLocateRightMessage(hide_dnd);
}
else
popLoader();
}
});
}
function locateExec(failure) {
if(!locating) {
var WATCH_LOCATION_MAX_TIMEOUT = 60000;
var WATCH_LOCATION_TIMEOUT = 45000;
var WATCH_LOCATION_NOTICE_TIMEOUT = 5000;
pushLoader();
if (navigator.geolocation) {
locating = true;
if(myLocDot)
myLocDot.setMap(null);
if(accuCircle)
accuCircle.setMap(null);
var watch_location_time_begin = new Date().getTime();
watch_location_timer = setTimeout(endWatchLocation, WATCH_LOCATION_MAX_TIMEOUT);
document.getElementById('proceed_container').classList.remove('hide');
document.getElementById('accuracy_container').classList.remove('hide');
document.getElementById('proceed_progress').style.transition = 'none';
document.getElementById('proceed_progress').style.width = "0%";
document.getElementById('proceed_progress').offsetWidth;
document.getElementById('proceed_progress').style.transition = 'width' + ' ' + WATCH_LOCATION_MAX_TIMEOUT/1000 + 's' + ' ' + 'linear';
document.getElementById('proceed_progress').style.width = "100%";
accuracy_indicator.classList.add('blinking');
location_button.removeEventListener('mouseup', processPositionButtonUp);
location_button.removeEventListener('touchend', processPositionButtonTouchEnd);
location_button.addEventListener('mouseup', processPositionButtonUp);
location_button.addEventListener('touchend', processPositionButtonTouchEnd);
watch_location_notice_timer = setTimeout(watch_location_notice, WATCH_LOCATION_NOTICE_TIMEOUT);
watch_location_id = navigator.geolocation.watchPosition(
function(position) {
var WATCH_LOCATION_MIN_ACCURACY = 10;
setLocationAccess(true);
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
if(typeof accuCircle === 'undefined' || !accuCircle.getMap()) {
accuCircle = new google.maps.Circle({
strokeColor: '#69B7CF',
strokeOpacity: 0,
strokeWeight: 0,
fillColor: '#69B7CF',
fillOpacity: 0.35,
map: map,
center: pos,
radius: position.coords.accuracy,
clickable: false
});
}
else {
accuCircle.setMap(map);
accuCircle.setOptions({'fillOpacity': 0.35});
accuCircle.setCenter(pos);
accuCircle.setRadius(position.coords.accuracy);
}
if(position.coords.accuracy >= 99.5) {
document.getElementById('accuracy_meter').innerText = "99+";
document.getElementById('accuracy_indicator').setAttribute('style', 'background-color: #FF0000');
}
else {
document.getElementById('accuracy_meter').innerText = Math.round(position.coords.accuracy);
document.getElementById('accuracy_indicator').setAttribute('style', 'background-color: '+percantageToColor(100-position.coords.accuracy));
}
document.getElementById('proceed_container').classList.remove('hide');
document.getElementById('accuracy_container').classList.remove('highlight');
document.getElementById('accuracy_container').classList.remove('hide');
if(!firstFocus || !myLocDot || !myLocDot.getMap())
focus_(pos, accuCircle.getBounds());
else
pendingFocusPos = pos;
if(!myLocDot) {
myLocDot = new google.maps.Marker({
clickable: false,
icon: new google.maps.MarkerImage('https://maps.gstatic.com/mapfiles/mobile/mobileimgs2.png',
new google.maps.Size(22,22),
new google.maps.Point(0,18),
new google.maps.Point(11,11)),
shadow: null,
zIndex: 999,
map: map,
position: pos
});
}
else {
if(!myLocDot.getMap())
myLocDot.setMap(map);
myLocDot.setPosition(pos);
}
if(position.coords.accuracy <= WATCH_LOCATION_MIN_ACCURACY && !locate_button_pressed)
processPosition(pos);
},
function(error) {
if(error.code = error.PERMISSION_DENIED) {
clearLocating(true);
showNotification(LOCATION_PERMISSION_DENIED);
setLocationAccess(false);
popLoader();
failure();
}
else
handleLocationError(true);
},
{ maximumAge:100, timeout:WATCH_LOCATION_TIMEOUT, enableHighAccuracy:true }
);
} else {
// Browser does not support Geolocation
handleLocationError(false);
}
}
}
function endWatchLocation() {
if(!locate_button_pressed) {
var pos;
if(myLocDot)
pos = resolveLatLng(myLocDot.getPosition());
if(pos != null)
processPosition(pos);
else
showNotification("Could not get your location.<br> Please move to a more open area and try again by pressing the location icon", NOTIFICATION_DURATION_LONG);
}
}
function proceedPosition() {
var pos;
if(myLocDot)
pos = resolveLatLng(myLocDot.getPosition());
if(pos != null) {
if(!selfBoundsChangedCount) {
map.panTo(pos);
var idleListenerPanBy = map.addListener('idle', function() {
idleListenerPanBy.remove();
map.panBy(0, getPanByOffset());
});
}
processPosition(pos);
}
else
handleLocationError(true);
}
function processPosition(pos) {
clearLocating(false);
if(typeof navigator.geolocation !== 'undefined')
navigator.geolocation.clearWatch(watch_location_id);
clearTimeout(watch_location_timer);
document.getElementById('proceed_container').classList.add('hide');
document.getElementById('accuracy_container').classList.add('highlight');
infoWindow_setContent(MESSAGE_LOADING);
showMarker(pos);
infoWindow.open(map, marker);
if(initWCode == false) {
encode(pos, true);
clearAddress();
getAddress(pos);
}
else {
initWCode = false;
}
}
function processPositionButtonDown() {
firstFocus = true;
clearMap();
if(document.body.classList.contains('decode'))
toggleMapType();
selfBoundsChangedCount = 1;
locate_button_pressed = true;
location_button_begin_time = (new Date).getTime();
syncLocate(true);
}
function processPositionButtonUp() {
var press_duration = locating && (new Date).getTime() - location_button_begin_time;
if(press_duration > location_button_PRESS_THRESHOLD) {
location_icon_dot.classList.add('blinking');
}
else
locate_button_pressed = false;
}
function processPositionButtonTouchStart(e) {
processPositionButtonDown();
e.stopPropagation();
e.preventDefault();
}
function processPositionButtonTouchEnd(e) {
processPositionButtonUp();
e.stopPropagation();
e.preventDefault();
}
function handleLocationError(browserHasGeolocation) {
cleanUp();
showNotification(browserHasGeolocation ?
'Error: The Geolocation service failed' :
'Error: Your browser doesn\'t support geolocation');
notification_top.classList.remove('hide');
syncCheckIncompatibleBrowserMessage();
}
function clearLocating(hideAccuracyContainer) {
if(hideAccuracyContainer)
document.getElementById('accuracy_container').classList.add('hide');
locating = false;
popLoader();
location_icon_dot.classList.remove('blinking');
accuracy_indicator.classList.remove('blinking');
hideNotication();
clearTimeout(watch_location_notice_timer);
}
function watch_location_notice() {
var wait_duration;
if(firstFocus == true) {
notification_duration = NOTIFICATION_DURATION_LONG;
firstFocus = false;
}
else
notification_duration = NOTIFICATION_DURATION_DEFAULT;
showNotification('Getting more accurate location <br> wait for a minute or choose "Proceed"', notification_duration);
}
function getCityFromPositionViaGMap(position, callback_success, callback_failure) {
encode_session_id = Date.now;
var session_id = encode_session_id;
getAddress( {'lat':position.coords.latitude, 'lng':position.coords.longitude}, session_id, function(address_components) {
var city_gp_id = getCityGpId(address_components);
if(city_gp_id != null) {
getCityFromCityGp_id( city_gp_id, session_id, function(city) {
current_city_gp_id = city_gp_id;
setCurrentCity_status(true);
callback_success(city);
}, callback_failure );
}
} );
}
function getCoarseLocation(callback_success, callback_failure) {
if(typeof navigator.geolocation !== 'undefined') {
var options = { timeout: 60000 };
navigator.geolocation.getCurrentPosition (callback_success, callback_failure, options);
} else {
alert("Sorry, browser does not support geolocation!");
}
}
// var locateRight_callback;
function showLocateRightMessage(hide_dnd) {
if(hide_dnd == true)
locate_right_message_dnd.classList.add('hide');
else
locate_right_message_dnd.classList.remove('hide');
showOverlay(document.getElementById('locate_right_message'));
}
function hideLocateRightMessage() {
hideOverlay(document.getElementById('locate_right_message'));
}
function locateRight_grant() {
setLocationAccess(true);
initLocate(false, locateRight_callback);
hideLocateRightMessage();
locateRight_DND_check();
}
function locateRight_deny() {
popLoader();
hideLocateRightMessage();
locateRight_DND_check();
if(!geoIp_city_name && geoIp_city_name != '')
getCityByIp();
else
showNotification("Choose a place on the map");
}
function locateRight_DND_check() {
if(locate_right_message_dnd_input.checked) {
setLocationAccessDND(true);
}
else {
setLocationAccessDND(false);
}
}
var listPressTimer = [];
var cancel = function(e) {
if (this.presstimer !== null) {
clearTimeout(this.presstimer);
listPressTimer[this.pressTimerIndex] = this.presstimer = null;
}
this.classList.remove('longpress');
};
var click = function(e) {
if (this.presstimer !== null) {
clearTimeout(this.presstimer);
listPressTimer[this.pressTimerIndex] = this.presstimer = null;
}
this.classList.remove('longpress');
if (this.longpress) {
return false;
}
this.fnShort(e);
};
var start = function(e) {
if (e.type === 'click' && e.button !== 0) {
return;
}
this.longpress = false;
this.classList.add('longpress');
var parent = this;
if (this.presstimer === null) {
listPressTimer[this.pressTimerIndex] = this.presstimer = setTimeout(function() {
parent.fnLong(e);
parent.longpress = true;
}, 500);
}
return false;
};
function addLongpressListener(node, fnShort, fnLong) {
node.addEventListener('mousedown', start);
node.addEventListener('touchstart', start);
node.addEventListener('click', click);
node.addEventListener('mouseout', cancel);
node.addEventListener('touchend', cancel);
node.addEventListener('touchleave', cancel);
node.addEventListener('touchcancel', cancel);
node.longpress = false;
node.presstimer = null;
node.longtarget = null;
node.fnShort = fnShort;
node.fnLong = fnLong;
node.pressTimerIndex = listPressTimer.length;
}
var pendingInitMap;
var clickHandler;
var map;
function syncInitMap() {
if (document.readyState === 'interactive' && typeof google === 'object' && typeof google.maps === 'object' && typeof initMap == 'function' && pendingInitMap) {
map = new google.maps.Map(document.getElementById('map'), {
center: DEFAULT_LATLNG,
zoom: DEFAULT_INIT_ZOOM,
mapTypeControl: false,
fullscreenControl: false,
streetViewControl: false,
zoomControl: false,
backgroundColor: 'none'
});
initMap();
if(!locationAccessCheck()) {
getCityByIp();
}
else {
var position;
initLocate(false, function() {
getCoarseLocation(function(position) {
getCityFromPositionViaGMap(position, function(city) {
document.getElementById('decode_input_city').innerText = city.name;
getCityCenterFromId(city, function() {
geoIP_city = city;
} );
}, handleLocationError) }, handleLocationError);
return;
});
}
pendingInitMap = false;
}
}
document.addEventListener('DOMContentLoaded', function() {
if(typeof initLoad != 'undefined')
initLoad();
if( typeof CSS == 'undefined' || !CSS.supports("backdrop-filter: blur()") ) {
document.getElementById('logo').classList.add('plain_background');
document.getElementById('footer-content').classList.add('plain_background');
}
});
window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
alert("Oops! Something went wrong. Make sure you are connected to the Internet and are using latest Google Chrome Browser - if this issue persists");
return false;
}
</script>
<script>
function trackOutboundLink(title, url) {
analytics.logEvent('outbound_link', {title: title, url: url});
}
// .\Script
var pendingLocate = false;
// Code\Code
var curEncRequestId = 0;
var curDecRequestId = 0;
var curAddCityRequestId = 0;
var curGeoIpRequestId = 0;
// Code\Copy_wcode
var city_styled_wordlist = [];
var cityNameList;
var WCODE_CODE_COPIED_MESSAGE = "Wolo Code copied to clipboard";
var WCODE_LINK_COPIED_MESSAGE = "Wolo Code link copied to clipboard";
// Code\Core
var PURE_WCODE_CITY_PICKED = "Since your city is not set - city was chosen from the last location";
var PURE_WCODE_CITY_FAILED = "Since your city is not set - you must first choose the city or preceed the Wolo Code with city name";
var IP_CITY_DECODE = "Current city determined using your connection - verify";
var pendingPosition;
var pendingWords;
var wordList;
var current_city_gp_id;
var is_current_city;
var encode_session_id;
var dencode_session_id;
// Code\Model
var code_city;
var code_wcode;
var code_postition;
// Address
var latLng_p = '';
var address = '';
var gpId = '';
// Base
var CURRENT_VERSION = 1;
var initWCode = false;
var initWCode_jumpToMap = false;
var initWCode_jump_ask = false;
// City
var DEFAULT_WCODE = ['bengaluru', 'diesel', 'hall', 'planet'];
var pendingCity = false;
var pendingCitySubmit = false;
var INCORRECT_WCODE = 'INCORRECT INPUT! Should be at least 3 Wolo Code words, optionally preceded by a city. E.g: "Bengaluru cat apple tomato"';
var INCORRECT_CITY = "City not found - check the Wolo Code";
var MESSAGE_LOADING = 'Loading ..';
var LOCATION_PERMISSION_DENIED = "Location permission was denied. Click to point or retry with the locate button";
var CITY_RANGE_RADIUS = 32.767;
var init_map_mode = false;
//Location
var location_button_begin_time;
var location_button_PRESS_THRESHOLD = 500;
var locating = false;
var locate_button_pressed = false;
var watch_location_timer;
var watch_location_id;
var watch_location_notice_timer;
var pendingFocusPos;
var locateRight_callback;
// Focus
var selfBoundsChangedCount = 1;
// External
var external_latLng;
var external_wolo_code_string;
// QR
var mode_preview = false;
var qr_address_active_first = true;
var mode_preview_activated = false;
// Notification
var NOTIFICATION_DURATION_DEFAULT = 2500;
var NOTIFICATION_DURATION_LONG = 10000;
// Account Dialog
var saveList;
var lastActiveSaveEntry;
var account_dialog_address_active_first;
// Title
var current_title;
var current_segment;
var current_address;
// GeoIp
var geoIp_country_code;
var geoIp_city_name;
var pendingWords_geo;
var geoIP_city;
// var pendingLocate;
function syncLocate(override_dnd) {
if (typeof google === 'object' && typeof google.maps === 'object' && typeof map == 'object') {
initLocate(override_dnd, locateExec);
pendingLocate = false;
}
else
pendingLocate = true;
}
function syncCheckIncompatibleBrowserMessage() {
if(typeof UMB === 'object' && UMB.getStatus() == 'unsupported')
showIncompatibleBrowserMessage();
}
</script>
<script src="/root.js" async></script>
<style>
#address_text {
position: absolute;
text-align: center;
bottom: 80px;
background-color: #FFFFFF;
padding: 4px 8px;
border: 1px solid #ddd;
border-radius: 18px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
max-width: 350px;
}
#address_text_main {
display: inline-block;
float: left;
min-width: 89%;
}
#address_text_label {
font-family: 'Abel';
font-size: large;
padding-top: 4px;
color: #69B7CF;
}
#address_text_header {
text-align: left;
font-family: 'Roboto';
padding-left: 5px;
}
#address_text_content {
display: block;
font-family: 'Roboto';
min-height: 48px;
max-width: 306px;
text-align: left;
padding: 6px 0 6px 6px;
color: #888888;
}
#address_text_close {
position: absolute;
top: 2px;
right: 6px;
}
#address_text_close svg {
width: 30px;
}
#address_text_buttons {
display: inline-block;
width: 30px;
}
.address_text_button_spacer {
display: inline-block;
width: 18px;
}
#address_text_copy {
padding-top: 2px;
padding-left: 10px;
margin-left: auto;
margin-right: auto;
}
html {
background: rgb(170, 218, 255);
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Roboto Condensed', Abel, sans-serif;
}
input {
border-radius:0;
-webkit-appearance: none;
}
button {
-webkit-appearance: none;
background: white;
border-radius: 5px
}
button.border {
border: 1px solid;
border-color: #dcdcdc
}
*:focus {
outline: none;
}
#map {
height: 100%;
}
#description {
font-family: Roboto;
font-size: 0.9375em;
font-weight: 300;
}
.pac-card {
margin: 10px 10px 0 0;
border-radius: 2px 0 0 2px;
box-sizing: border-box;
-moz-box-sizing: border-box;
outline: none;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
background-color: #fff;
font-family: Roboto;
}
#pac-container {
padding-bottom: 12px;
margin-right: 12px;
}
.pac-controls {
display: inline-block;
padding: 5px 11px;
}
.pac-controls label {
font-family: Roboto;
font-size: 0.8125em;
font-weight: 300;
}
#logo {
position: absolute;
right: 10px;
top: 10px;
width: 160px;
}
#logo a {
display: inline-block;
border-radius: 6px;
border-width: thin;
border-color: #e5e5e5;
border-style: solid;
padding: 2px;
}
#logo_wolo > .image > svg {
height: 50px;
}
#logo_codes {
text-decoration: none;
}
#logo_codes > .image > svg {
padding-top: 4px;
height: 14px;