diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-10-26 04:11:12 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-10-26 04:11:12 +0200 |
| commit | 2dc213bc3e581fe324d2a2ede320f9a5d5db68c0 (patch) | |
| tree | 388afa203b7c310330d3749a6ae93acf9f23dab0 /StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js | |
| parent | 70f3af46c5071866eac85b39c59cda6ebdd09ef7 (diff) | |
deploy 0.9.2
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js')
| -rwxr-xr-x | StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js deleted file mode 100755 index 220026c0..00000000 --- a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js +++ /dev/null @@ -1,121 +0,0 @@ -var SignupView = FormView.extend({ - - el: "#signup", - - action: sdk.account.signup, - last_data: null, - -/* - test_data: { - "Email": "testit.account" + Math.floor(Math.random() * 10000000) + "@yoox.com", - "Password": "TestPassword", - "Password2": "TestPassword", - "Gender": "U", - "Name": "TestName", - "Surname": "TestSurname", - "BirthDay": "1978-11-12", - "DataProfiling": true, - }, -*/ - - events: { - "click .privacy-msg": "privacy_link", - "submit form": "save", - }, - - initialize: function(){ - this.$form = this.$(".form") - this.$msg = this.$(".msg") - this.scroller = new IScroll('#signup', app.iscroll_options) - }, - - show: function(){ - if (auth.logged_in()) { - app.router.go("intro") - return - } - var msg = "* Your personal and payment<br>information will always remain private" - app.footer.show("SUBMIT") - this.$("input").val("") - this.$msg.html(msg) - document.body.className = "signup" - - this.preload() - this.deferScrollToTop() - }, - - validate_presence: { - "Name": "Please enter your first name.", - "Surname": "Please enter your last name.", - "Email": "Please enter a valid email address.", - "ConfirmEmail": "Please enter a valid email address.", - // "BirthDay": "Please enter your birthday.", - "Password": "Please enter your password.", - "Password2": "Please enter your password again.", - "DataProfiling": "You must agree to data profiling.", - }, - - validate_fields: function(data, errors){ - if (data.Password.length < 7) { errors.push([ "Password", "Password must be 7 characters or more." ]) } - if (data.Password !== data.Password2) { errors.push([ "Password2", "Passwords don't match." ]) } - if (! data.Email.match("@")) { errors.push([ "Email", "Email address is not valid." ]) } - if (data.Email.toLowerCase() !== data.ConfirmEmail.toLowerCase()) { errors.push([ "ConfirmEmail", "Email addresses don't match." ]) } - // if (data.Gender === "NONE") { errors.push([ "Gender", "Please supply your gender." ]) } - if (data.DataProfiling !== "true") { errors.push([ "DataProfiling", "You must consent to use this service." ]) } - data.YooxLetter = this.$("[name=YooxLetter]").prop("checked") - }, - - finalize: function(data){ - delete data.ConfirmEmail - - data.Gender = "U" - data.BirthDay += "T00:00:00Z" - - this.last_data = data - console.log(data) - return data - }, - - privacy_link: function(){ - // rewrite app.privacy instance temporarily - app.privacy.back = function(){ - app.router.go("account/signup") - } - app.privacy.hide = function(){ - app.privacy.back = app.privacy.hide = null - } - app.router.go("page/privacy") - }, - - success: function(data){ - console.log('success', data) - auth.user = auth.user || {} - auth.user.Name = this.last_data.Name - auth.user.Surname = this.last_data.Surname - auth.user.Email = this.last_data.Email - auth.user.BirthDay = this.last_data.BirthDay - app.account.logged_in(function(){ app.router.go("store") }) - }, - - error: function(data){ - try { - data = JSON.parse(data.responseText) - app.signup.show_errors([[ 'Name', data['Error']['Description'] ]]) - } - catch (e) { - switch (data.status) { - case 409: - app.signup.show_errors([[ 'Email', "Email is already in use." ]]) - break - default: - app.signup.show_errors([[ 'Name', "There was an unknown error." ]]) - break - } - } - }, - - cancel: function(){ - auth.deferred_product = null - }, - -})
\ No newline at end of file |
