- methods: {
- toggleStage: function(stage) {
- let $form = $("#form");
- $form.fadeOut(animationDuration);
- setTimeout( () => {
- this.stage = stage;
- $form.show(0);
- }, animationDuration);
- },
- submit: function() {
- if (this.stage=="register")
+ submit: function() {
+ if (this.stage=="register")
+ {
+ if (Date.now() - enterTime < 5000)
+ return;
+ }
+ let error = Validator.checkObject({email: this.user.email}, "User");
+ if (!error && this.stage == "register")
+ error = Validator.checkObject({name: this.user.name}, "User");
+ let $dialog = $("#dialog");
+ show($dialog);
+ setTimeout(() => {hide($dialog);}, 3000);
+ if (error.length > 0)
+ return showMsg($dialog, "error", error);
+ showMsg($dialog, "process", "Processing... Please wait");
+ $.ajax(ajaxUrl[this.stage],