Minify JS
This commit is contained in:
parent
f791a1ee6c
commit
95cbc500ae
4 changed files with 7 additions and 5 deletions
1
public/static/js/geolocation.min.js
vendored
Normal file
1
public/static/js/geolocation.min.js
vendored
Normal file
|
@ -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()});
|
|
@ -1,4 +1,4 @@
|
|||
function travelynx_run_action(link, req, redir, err_callback) {
|
||||
function tvly_run(link, req, redir, err_callback) {
|
||||
var error_icon = '<i class="material-icons">error</i>';
|
||||
var progressbar = $('<div class="progress"><div class="indeterminate"></div></div>');
|
||||
link.hide();
|
||||
|
@ -25,7 +25,7 @@ $(document).ready(function() {
|
|||
station: link.data('station'),
|
||||
train: link.data('train'),
|
||||
};
|
||||
travelynx_run_action(link, req, '/');
|
||||
tvly_run(link, req, '/');
|
||||
});
|
||||
$('.action-checkout').click(function() {
|
||||
var link = $(this);
|
||||
|
@ -34,7 +34,7 @@ $(document).ready(function() {
|
|||
station: link.data('station'),
|
||||
force: link.data('force'),
|
||||
};
|
||||
travelynx_run_action(link, req, '/' + req.station, function() {
|
||||
tvly_run(link, req, '/' + req.station, function() {
|
||||
link.append(' – Keine Echtzeitdaten vorhanden')
|
||||
link.data('force', true);
|
||||
});
|
||||
|
|
1
public/static/js/travelynx-actions.min.js
vendored
Normal file
1
public/static/js/travelynx-actions.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
function tvly_run(t,a,n,i){var c='<i class="material-icons">error</i>',o=$('<div class="progress"><div class="indeterminate"></div></div>');t.hide(),t.after(o),$.post("/action",a,function(a){a.success?$(location).attr("href",n):(M.toast({html:c+" "+a.error}),o.remove(),i&&i(),t.append(" "+c),t.show())})}$(document).ready(function(){$(".action-checkin").click(function(){var t=$(this);tvly_run(t,{action:"checkin",station:t.data("station"),train:t.data("train")},"/")}),$(".action-checkout").click(function(){var t=$(this),a={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,a,"/"+a.station,function(){t.append(" – Keine Echtzeitdaten vorhanden"),t.data("force",!0)})})});
|
|
@ -10,9 +10,9 @@
|
|||
%= stylesheet '/static/css/local.css'
|
||||
%= javascript '/static/js/jquery-2.2.4.min.js'
|
||||
%= javascript '/static/js/materialize.min.js'
|
||||
%= javascript '/static/js/travelynx-actions.js'
|
||||
%= javascript '/static/js/travelynx-actions.min.js'
|
||||
% if (stash('with_geolocation')) {
|
||||
%= javascript '/static/js/geolocation.js'
|
||||
%= javascript '/static/js/geolocation.min.js'
|
||||
% }
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in a new issue