Convert CofeeScript to JavaScript

Compiled using `coffee -c` with CoffeeScript 1.12.6.
This commit is contained in:
Javi Martín
2019-07-03 00:11:16 +02:00
parent 2ff2100ebb
commit d93a029ce5
121 changed files with 2428 additions and 1924 deletions

View File

@@ -0,0 +1,34 @@
// Generated by CoffeeScript 1.12.6
(function() {
"use strict";
App.WatchFormChanges = {
forms: function() {
return $("form[data-watch-changes]");
},
msg: function() {
return $("[data-watch-form-message]").data("watch-form-message");
},
hasChanged: function() {
return App.WatchFormChanges.forms().is(function() {
return $(this).serialize() !== $(this).data("watchChanges");
});
},
checkChanges: function() {
if (App.WatchFormChanges.hasChanged()) {
return confirm(App.WatchFormChanges.msg());
} else {
return true;
}
},
initialize: function() {
if (App.WatchFormChanges.forms().length === 0 || App.WatchFormChanges.msg() === void 0) {
return;
}
$(document).off("page:before-change").on("page:before-change", App.WatchFormChanges.checkChanges);
return App.WatchFormChanges.forms().each(function() {
return $(this).data("watchChanges", $(this).serialize());
});
}
};
}).call(this);