From a8a3aa17cec8fbbfe3e4d4cf4df0331e0b5b80d8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 31 Mar 2019 08:45:51 +0200 Subject: Perform undo by deleting the erroneous database entry --- public/static/js/travelynx-actions.js | 1 + public/static/js/travelynx-actions.min.js | 2 +- public/static/v3 | 1 - public/static/v5 | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) delete mode 120000 public/static/v3 create mode 120000 public/static/v5 (limited to 'public/static') diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js index d47df77..8235889 100644 --- a/public/static/js/travelynx-actions.js +++ b/public/static/js/travelynx-actions.js @@ -43,6 +43,7 @@ $(document).ready(function() { var link = $(this); var req = { action: 'undo', + undo_id: link.data('id'), }; tvly_run(link, req, '/'); }); diff --git a/public/static/js/travelynx-actions.min.js b/public/static/js/travelynx-actions.min.js index 4fe0e76..2999816 100644 --- a/public/static/js/travelynx-actions.min.js +++ b/public/static/js/travelynx-actions.min.js @@ -1 +1 @@ -function tvly_run(n,t,a,c){var i='error',o=$('
');n.hide(),n.after(o),$.post("/action",t,function(t){t.success?$(location).attr("href",a):(M.toast({html:i+" "+t.error}),o.remove(),c&&c(),n.append(" "+i),n.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),n={action:"checkout",station:t.data("station"),force:t.data("force")};tvly_run(t,n,"/s/"+n.station,function(){t.append(" – Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){tvly_run($(this),{action:"undo"},"/")}),$(".action-cancelled-from").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_from",station:t.data("station"),train:t.data("train")},"/")}),$(".action-cancelled-to").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_to",station:t.data("station"),force:!0},"/")})}); +function tvly_run(t,a,n,c){var i='error',o=$('
');t.hide(),t.after(o),$.post("/action",a,function(a){a.success?$(location).attr("href",n):(M.toast({html:i+" "+a.error}),o.remove(),c&&c(),t.append(" "+i),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,"/s/"+a.station,function(){t.append(" – Ohne Echtzeitdaten auschecken?"),t.data("force",!0)})}),$(".action-undo").click(function(){var t=$(this);tvly_run(t,{action:"undo",undo_id:t.data("id")},"/")}),$(".action-cancelled-from").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_from",station:t.data("station"),train:t.data("train")},"/")}),$(".action-cancelled-to").click(function(){var t=$(this);tvly_run(t,{action:"cancelled_to",station:t.data("station"),force:!0},"/")})}); diff --git a/public/static/v3 b/public/static/v3 deleted file mode 120000 index 945c9b4..0000000 --- a/public/static/v3 +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/public/static/v5 b/public/static/v5 new file mode 120000 index 0000000..945c9b4 --- /dev/null +++ b/public/static/v5 @@ -0,0 +1 @@ +. \ No newline at end of file -- cgit v1.2.3