-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp-geotagger-js.php
78 lines (69 loc) · 2.66 KB
/
wp-geotagger-js.php
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
<?php
function shortcode_geotagger_js($params = array())
{
// PARAMS to the shortcode: field
extract(shortcode_atts(array(
'master_class' => 'geotagger-js'
), $params));
$val = '';
$val .= '<script type="text/javascript" src="' . get_stylesheet_directory_uri() . '/assets/exif.js"></script>';
$val .= '<script type="text/javascript" src="' . get_stylesheet_directory_uri() . '/assets/geotagger.js"></script>';
$val .= '<style type="text/css"> @import url("' . get_stylesheet_directory_uri() . '/assets/geotagger-js.css"); </style>';
$val .= '<div class="' . $master_class . '">';
ob_start();
?>
<div id="geotagger-js-waypoints">
<div class="geotagger-js-dragdrop" id="geotagger-js-dragdrop-waypoints">
<span class="desc">
<span class="step" data-number="1"></span>
Visit <a href="https://takeout.google.com/settings/takeout/custom/location_history" target="_blank">Google Takeout</a> to download your location-history at Google. Afterwards you may drag&drop the .json-files you received here, or ...
</span>
<label class="file">
<input type="file" multiple="multiple" onchange="handleJSON(this.files)" />
select your files here
</label>
</div>
<script type="text/javascript"> addDropArea('geotagger-js-dragdrop-waypoints', handleJSON); </script>
<div id="geotagger-js-statistics">
<canvas id="geotagger-js-statistics-canvas" width="1232" height="200"></canvas>
<div>
<span>
<span class="title">from:</span>
<span class="value" id="geotagger-js-statistics-from"></span>
</span>
<span>
<span class="title">to:</span>
<span class="value" id="geotagger-js-statistics-to"></span>
</span>
<span>
<span class="title">days with data:</span>
<span class="value" id="geotagger-js-statistics-days"></span>
</span>
<span>
<span class="title">waypoints:</span>
<span class="value" id="geotagger-js-statistics-waypoints"></span>
</span>
</div>
</div>
</div>
<div id="geotagger-js-images" class="disabled">
<div class="geotagger-js-dragdrop" id="geotagger-js-dragdrop-images">
<span class="desc">
<span class="step" data-number="2"></span>
Drag&drop the images you want to geotag here, or ...
</span>
<label class="file">
<input type="file" multiple="multiple" onchange="handleImages(this.files)" />
select your images here
</label>
</div>
<script type="text/javascript"> addDropArea('geotagger-js-dragdrop-images', handleImages); </script>
</div>
<div id="geotagger-js-imagelist">
</div>
</div>
<?php
$val .= ob_get_clean();
return $val;
}
add_shortcode('geotagger_js', 'shortcode_geotagger_js');