summaryrefslogtreecommitdiff
path: root/public/static/js/geolocation.min.js
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-21 16:27:32 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-21 16:27:32 +0200
commit95cbc500ae6841ff552a7b299c127c0754fb3a23 (patch)
tree33079214873c668bff2633f05cc969f7e8107bb0 /public/static/js/geolocation.min.js
parentf791a1ee6c52b94f6a8894362c683a33c9437bb9 (diff)
Minify JS
Diffstat (limited to 'public/static/js/geolocation.min.js')
-rw-r--r--public/static/js/geolocation.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/public/static/js/geolocation.min.js b/public/static/js/geolocation.min.js
new file mode 100644
index 0000000..50cd010
--- /dev/null
+++ b/public/static/js/geolocation.min.js
@@ -0,0 +1 @@
+$(document).ready(function(){var e=$("p.geolocationhint"),t=$("div.geolocation div.progress"),o=function(o,a,n){e.remove(),t.remove()},a=function(e){e.error?o(0,e.error):0==e.candidates.length?o():(resultTable=$("<table><tbody></tbody></table>"),resultBody=resultTable.children(),$.each(e.candidates,function(e,t){var o=t.ds100,a=t.name,n=t.distance;n=n.toFixed(1);var r=$(document.createElement("a"));r.attr("href",o),r.text(a),resultBody.append('<tr><td><a href="/'+o+'">'+a+"</a></td></tr>")}),t.replaceWith(resultTable))},n=function(e){$.post("/x/geolocation",{lon:e.coords.longitude,lat:e.coords.latitude},a)},r=function(e){e.code==e.PERMISSION_DENIED?o():e.code==e.POSITION_UNAVAILABLE?o():(e.code,e.TIMEOUT,o())};navigator.geolocation?navigator.geolocation.getCurrentPosition(n,r):o()});