summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/account
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/account')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js176
-rw-r--r--StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js90
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/OrdersView.js195
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js128
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js129
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js46
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/ShippingView.js89
7 files changed, 0 insertions, 853 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js
deleted file mode 100755
index af035f6a..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js
+++ /dev/null
@@ -1,176 +0,0 @@
-var AccountView = View.extend({
-
- initialize: function(){
- this.consent = new ConsentModal({ parent: this })
- },
-
- connect: function(initialLoginPath){
- auth.init(this.ready.bind(this, function(){}, initialLoginPath))
- },
-
- ready: function(cb, initialLoginPath){
- if (auth.logged_in()) {
- this.logged_in(cb, initialLoginPath)
- }
- else {
- this.logged_out(cb)
- }
- },
-
- addresses: [],
- addressLookup: {},
- ccs: [],
- ccLookup: {},
-
- listAddresses: function(opt){
- opt = opt || {}
- sdk.address.list({
- success: function(data){
- this.populateAddresses(data, opt.success)
- }.bind(this),
- error: function(data){
- console.log("error listing addresses!")
- console.log(data.responseText)
- opt.error && opt.error()
- }.bind(this),
- })
- },
-
- populateAddresses: function(data, cb){
- console.log("populate addresses:", data.AddressBook.addressBookItem)
-
- if (! data.AddressBook) {
- console.log("no addresses")
- cb && cb()
- return
- }
-
- this.addresses = data.AddressBook.addressBookItem
- this.addressLookup = {}
- data.AddressBook.addressBookItem.forEach(function(item){
- this.addressLookup[ item.Id ] = item
- if (item.IsDefault) {
- console.log("SHIPPING ADDRESS", item)
- app.shipping.populate(item)
- }
- if (item.IsBillingDefault) {
- console.log("BILLING ADDRESS")
- app.payment.populate(item)
- }
- }.bind(this))
-
- app.cart.shipping.populate()
- app.cart.payment.populate()
-
- cb && cb()
- },
-
- listCreditCards: function(cb){
- sdk.payment.list_credit_cards({
- success: function(data){
- this.populateCreditCards(data, cb)
- }.bind(this)
- })
- },
-
- populateCreditCards: function(data, cb){
- // console.log("populate ccs:", data.CreditCards)
- this.ccs = data.CreditCards
- this.ccLookup = {}
- if (! data.CreditCards || ! data.CreditCards.length) {
- }
- else {
- data.CreditCards.forEach(function(cc){
- this.ccLookup[cc.Id] = cc
- }.bind(this))
- app.payment.populate( data.CreditCards[0] )
- app.cart.payment.populate()
- }
- cb && cb()
- },
-
- logged_in: function(cb, initialLoginPath){
- this.listAddresses()
- this.listCreditCards()
- $("#nav .login").hide()
- $("#nav .account, #nav .logout").show()
- if (! auth.deferred_product && app.last_view) {
- if (app.last_view != app.login && app.last_view != app.signin && app.last_view != app.logout) {
- app.view && app.view.hide && app.view.hide()
- app.view = app.last_view
- app.view.show()
- }
- }
- else {
- cb && cb()
- }
- console.log('logged in')
- app.account.consent.check()
- if ( ! auth.has_cart() ) {
- console.log('no cart')
- app.curtain.show("loading")
- auth.create_cart({
- success: function(){
- console.log('got cart')
- if (auth.deferred_product) {
- console.log('adding deferred product')
- auth.add_deferred_product_to_cart({
- success: function(){
- console.log('success!')
- app.router.go("cart")
- setTimeout(function(){
- app.curtain.hide("loading")
- }, 500)
- },
- error: function(){
- // TODO: should not be called because cart was just created
- console.log("ERROR ADDING PRODUCT TO NEW CART")
- },
- })
- }
- else {
- if (initialLoginPath) {
- console.log("navigating to deep link route from logged_in")
- app.router.go(initialLoginPath)
- }
- else if (!app.last_view) {
- app.router.go("account/profile")
- }
- app.account.consent.check()
- app.curtain.hide("loading")
- }
- },
- error: function(){
- // error CREATING cart...
- console.log("ERROR CREATING CART")
- auth.log_out()
- app.account.logged_out()
- },
- })
- }
- else {
- if (auth.deferred_product) {
- auth.add_deferred_product_to_cart({
- success: function(){
- app.router.go("cart")
- },
- error: function(){
- // TODO: cart might be invalid..
- console.log("CALLED LOGGED_IN, HAD DEFERRED PRODUCT")
- },
- })
- }
- else {
- app.cart.load()
- }
- }
- },
-
- logged_out: function(cb){
- $("#nav .login").show()
- $("#nav .account, #nav .logout").hide()
- $("#nav").removeClass("account")
- cb && cb()
- },
-
-})
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js b/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js
deleted file mode 100644
index c9235498..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js
+++ /dev/null
@@ -1,90 +0,0 @@
-var ConsentModal = View.extend({
-
- el: "#consent_modal",
-
- events: {
- "change [name=AccountTermsConsent]": "changeConsent",
- "click #consent_proceed": "proceed",
- "click #consent_logout": "logout",
- "click a": "navigate",
- },
-
- initialize: function(){
- this.$form = this.$(".form")
- this.$msg = this.$(".msg")
- this.$checkbox = this.$("[name=AccountTermsConsent]")
- this.$consentError = this.$("#consent_error")
- },
-
- check: function(){
- var status = localStorage.getItem('account_terms.consent')
- console.log('account_terms.consent', status)
- if (status !== 'true') {
- console.log('we demand consent!')
- app.demand_consent = true
- this.show()
- return true
- } else {
- console.log('already received consent!')
- this.hide()
- app.demand_consent = false
- return false
- }
- },
-
- show: function(){
- app.demand_consent = true
- this.$el.show()
- setTimeout(function(){
- this.$el.addClass('visible')
- }.bind(this), 20)
- app.curtain.show('opaque')
- setTimeout(function(){
- app.curtain.show('opaque')
- }, 300)
- },
-
- hide: function(){
- app.curtain.hide()
- this.$el.removeClass('visible')
- setTimeout(function(){
- this.$el.hide()
- app.curtain.$el.removeClass('opaque')
- }.bind(this), 300)
- },
-
- navigate: function(e){
- var href = $(e.currentTarget).attr('href').replace('#', '')
- console.log(href)
- this.hide()
- app.router.go(href)
- },
-
- changeConsent: function(){
- var state = this.$checkbox.prop("checked")
- if (state) {
- this.$consentError.removeClass('visible')
- } else {
- this.$consentError.addClass('visible')
- }
- },
-
- proceed: function(){
- var state = this.$checkbox.prop("checked")
- if (!state) {
- this.$consentError.addClass('visible')
- return
- }
- app.demand_consent = false
- this.hide()
- localStorage.setItem('account_terms.consent', 'true')
- },
-
- logout: function(){
- app.demand_consent = false
- this.hide()
- localStorage.setItem('account_terms.consent', 'false')
- app.router.go("account/logout")
- },
-
-}) \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/OrdersView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/OrdersView.js
deleted file mode 100755
index 1522a096..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/OrdersView.js
+++ /dev/null
@@ -1,195 +0,0 @@
-var OrdersView = ScrollableView.extend({
-
- el: "#orders",
-
- loaded: false,
-
- list_template: $("#orders .list_template").html(),
- item_template: $("#orders .item_template").html(),
-
- events: {
- "click .back": "back",
- "click .item": "load_single",
- },
-
- initialize: function(){
- this.$list = this.$(".list")
- this.$empty = this.$(".empty")
- this.$single_order = this.$("#single_order")
-
- this.$rows = this.$(".rows")
- this.$subtotal = this.$(".subtotal")
- this.$shipping = this.$(".shipping")
- this.$tax = this.$(".tax")
- this.$total = this.$(".total")
-
- this.$shipping_address = this.$(".shipping_address")
- this.$shipping_method = this.$(".shipping_method")
-
- this.scroller = ScrollFactory('#orders', app.iscroll_options)
- },
-
- show: function(){
- if (! auth.logged_in()) { return app.router.go("intro") }
- if (! navigator.onLine) {
- app.closed.showElement()
- app.closed.setMessage("PLEASE GO ONLINE TO VIEW<br>YOUR ORDERS.", "")
- return
- }
- app.account.consent.check()
- app.header.set_back(false)
- app.footer.hide()
- document.body.className = "orders"
- this.deferScrollToTop()
- this.el.className = ""
-
- if (this.loaded) {
- this.populate()
- }
- else {
- this.fetch()
- }
- },
-
- orders: null,
- orderLookup: {},
-
- fetch: function(){
- this.$list.empty()
- this.$empty.hide()
- this.loader = new Loader(this.ready.bind(this))
- app.curtain.show("loading")
- sdk.account.fetch_orders({
- success: function(data){
- this.loader.register("orders")
- this.orders = data.OrderDetails
- data.OrderDetails.forEach(function(row){
- this.loader.register(row.OrderNumber)
- sdk.account.fetch_single_order({
- id: row.OrderNumber,
- success: function(row_data){
- this.orderLookup[ row.OrderNumber ] = row_data.OrderFullDetails
- this.loader.ready(row.OrderNumber)
- }.bind(this),
- error: function(){
- this.orderLookup[ row.OrderNumber ] = null
- this.loader.ready(row.OrderNumber)
- }.bind(this),
- })
- }.bind(this))
- this.loader.ready("orders")
- }.bind(this),
- error: function(){
- console.log("error fetching orders")
- }.bind(this),
- })
- },
-
- ready: function(){
- this.populate()
- app.curtain.hide("loading")
- },
-
- populate: function(){
- this.$list.empty()
-
- if (! this.orders.length) {
- this.$empty.show()
- return
- }
- else {
- this.$empty.hide()
- }
- this.orders.forEach(function(row){
- var order = this.orderLookup[ row.OrderNumber ]
- if (! order) { return }
- var t = this.list_template.replace(/{{date}}/g, moment(order['Date']).format("ddd MM/DD/YYYY").toUpperCase())
- .replace(/{{id}}/g, row.OrderNumber)
- .replace(/{{total}}/g, as_cash( order.TotalAmount ))
- var $t = $(t), $images = $t.find(".images")
- order.Items.forEach(function(item){
- var img = new Image ()
- img.src = sdk.image(item['Code10'], "11_f")
- $images.append(img)
- }.bind(this))
- this.$list.append($t)
- }.bind(this))
-
- this.refreshScroller()
- },
-
- load_single: function(e){
- var id = $(e.currentTarget).data("id")
- var order = this.orderLookup[ id ]
- if (! order) { return }
-
- console.log(order)
-
- this.$rows.empty()
-
- order.Items.forEach(function(item){
- var $el = $("<div class='item'><img src='img/spinner.gif'></div>")
- this.$rows.append($el)
- var code_ten = item.Code10
-
- var code = code_ten.substr(0, 8)
- app.product.find(code, function(data, details){
- var descriptions = app.product.get_descriptions( details )
-
- var name_partz = descriptions['ModelNames'].split(' ')
- var num = name_partz.shift()
- var title = name_partz.join(' ')
- var type = title_case( descriptions['MicroCategory'] )
-
- var color_name, size_name
-
- details.Item.ModelColors.some(function(color){
- if (color['Code10'] == code_ten) {
- color_name = color['ColorDescription']
- return true
- }
- return false
- })
- size_name = item.DefaultSize + " " + item.DefaultSizeClassFamily
-
- var t = this.item_template
- .replace(/{{image}}/, sdk.image(item['Code10'], '11_f'))
- .replace(/{{sku}}/, num)
- .replace(/{{title}}/, title)
- .replace(/{{type}}/, type)
- .replace(/{{size}}/, size_name || "DEFAULT")
- .replace(/{{color}}/, color_name || "DEFAULT")
- .replace(/{{quantity}}/, 1)
- .replace(/{{price}}/, as_cash(details.Item.Price.DiscountedPrice))
- $el.data("price", details.Item.Price.DiscountedPrice)
- $el.html(t)
- this.refreshScroller()
- }.bind(this))
- }.bind(this))
-
- var subtotal = order.ItemsTotalAmount
- var shipping_cost = order.Delivery.Amount
- var tax = order.SalesTaxAmount
- var total = order.TotalToPay
-
- this.$subtotal.html( as_cash(subtotal) )
- this.$shipping.html( as_cash(shipping_cost) )
- this.$tax.html( as_cash(tax) )
- this.$total.html( as_cash(total) )
-
- var street = order.Delivery.Address.replace(/\n$/,"").replace("\n","<br>")
- var address = order.Delivery.Name + "<br>" + street + "<br>" + order.Delivery.City + " " + order.Delivery.ZipCode
- this.$shipping_address.html(address)
- this.$shipping_method.html(order.Delivery.Type + " - " + order.Delivery.Time)
-
- app.header.set_back(true)
- this.$el.addClass("single")
- },
-
- back: function(){
- app.header.set_back(false)
- this.el.className = ""
- },
-
-})
-
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js
deleted file mode 100755
index 8767b39f..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js
+++ /dev/null
@@ -1,128 +0,0 @@
-var PaymentView = FormView.extend({
-
- el: "#payment",
-
- action: sdk.payment.add_credit_card,
-
- events: {
- },
-
- test_data: {
- "Name":"Name",
- "Surname":"Surname",
- "Address1":"address",
- "Address2":"address2",
- "City":"Ferrara",
- "Province":"NY",
- "HolderIsoCountry":"IT",
- "CreditCardCountry": "US",
- "ZipCode":"40200",
- "Type":"Visa",
- "Number":"4111111111111111",
- "ExpirationMonth":"09",
- "ExpirationYear":"2017",
- "Cvv":"1233",
- },
-
- initialize: function(){
- this.$form = this.$(".form")
- this.$msg = this.$(".msg")
- this.address = new AddressView ({ parent: this, checkPhone: false })
- this.cc = new CreditCardView ({ parent: this })
- this.scroller = ScrollFactory('#payment', app.iscroll_options)
- },
-
- show: function(){
- if (! auth.logged_in()) { return app.router.go("intro") }
- if (! navigator.onLine) {
- app.closed.showElement()
- app.closed.setMessage("PLEASE GO ONLINE TO CHANGE<br>YOUR PAYMENT INFO.", "")
- return
- }
- app.account.consent.check()
- app.footer.show("SAVE")
- document.body.className = "payment"
- this.deferScrollToTop()
- // this.preload()
- },
-
- populate: function(data){
- this.data = data || this.data
- this.address.populate(data)
- this.cc.populate(data)
- },
-
- finalize: function(data){
- if (this.cc.data && this.cc.data.Guid) {
- sdk.payment.delete_credit_card({
- guid: this.cc.data.Guid,
- success: function(){ console.log("deleted credit card") },
- error: function(){ console.log("error deleting credit card") },
- })
- }
-
- data.IsDefault = "true" // this.$isDefault.prop("checked") ? "true" : "false"
- data.UserId = sdk.auth.user_id
- data.HolderIsoCountry = "US"
- data.CreditCardNumber = data.Number
- data.IsPreferred = "true"
-
- console.log(data)
- return data
- },
-
- success: function(data){
- app.curtain.show("loading")
- app.account.listAddresses({
- success: function(){
- this.$msg.html('Your payment information has been saved.')
- app.curtain.hide("loading")
- }.bind(this),
- error: function(){
- app.curtain.hide("loading")
- },
- })
- },
-
- error: function(data){
- console.log("ERROR WITH PAYMENT")
- console.log(data)
- },
-
- cancel: function(){
- app.router.go("intro")
- },
-
-})
-
-/*
- var new_card = {
- "Name":"Name",
- "Surname":"Surname",
- "Address":"address",
- "City":"Ferrara",
- "Province":"FE",
- "HolderIsoCountry":"IT",
- "ZipCode":"40200",
- "Type":"Visa",
- "Number":"0000567890124285",
- "ExpirationMonth":"02",
- "ExpirationYear":"2017",
- }
- promise(sdk.payment.add_credit_card, { data: new_card }).then(function(data){
- last_guid = data['CreditCard']['Guid']
- assert(data.Header.StatusCode == 201)
- assert(!! last_guid)
- done()
- })
-
- promise(sdk.payment.list_credit_cards, { data: {} }).then(function(data){
- assert(data.Header.StatusCode == 201)
- console.log(data)
- done()
- })
-
- promise(sdk.payment.delete_credit_card, { guid: last_guid }).then(function(data){
- assert(data.Header.StatusCode == 200)
- done()
-*/ \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js
deleted file mode 100755
index 1bbfff22..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js
+++ /dev/null
@@ -1,129 +0,0 @@
-var ProfileView = FormView.extend({
-
- el: "#profile",
-
- events: {
- "click .privacy-msg": "privacy_link",
- },
-
- action: sdk.account.update,
-
- initialize: function(){
- this.$form = this.$(".form")
- this.$msg = this.$(".msg")
- this.scroller = ScrollFactory('#profile', app.iscroll_options)
- },
-
- show: function(){
- if (! auth.logged_in()) { return app.router.go("intro") }
- if (! navigator.onLine) {
- app.closed.showElement()
- app.closed.setMessage("PLEASE GO ONLINE TO<br>EDIT YOUR PROFILE.", "")
- return
- }
- if (! auth.user) return
- app.account.consent.check()
- app.footer.show("SAVE")
- document.body.className = "profile"
- if (auth.user.BirthDay.match(/T/)) {
- auth.user.BirthDay = auth.user.BirthDay.split("T")[0]
- }
- if (auth.user.BirthDay === '1900-01-01') {
- auth.user.BirthDay = ''
- }
- if (auth.user.name && ! auth.user.Name) {
- auth.user.Name = auth.user.name
- }
- if (auth.user.surname && ! auth.user.Surname) {
- auth.user.Surname = auth.user.surname
- }
- if (auth.user.email && ! auth.user.Email) {
- auth.user.Email = auth.user.email
- }
- console.log(auth.user)
- this.preload(auth.user)
- this.deferScrollToTop()
- },
-
- validate_presence: {
- "Name": "Please enter your first name.",
- "Surname": "Please enter your last name.",
- "Email": "Please enter a valid email address.",
- // "BirthDay": "Please enter your birthday.",
- },
-
- validate_fields: function(data, errors){
- if (! data.Email.match("@")) { errors.push([ "Email", "Email address is not valid." ]) }
- if (! data.CurrentPassword && (data.NewPassword || data.Email !== auth.user.Email)) { errors.push([ "CurrentPassword", "Please enter your current password." ]) }
- if (data.CurrentPassword && ! data.NewPassword) { errors.push([ "NewPassword", "Please enter your new password." ]) }
- if (data.NewPassword && data.NewPassword.length < 7) { errors.push([ "CurrentPassword", "New password must be 7 characters or more." ]) }
- var now = new Date ()
- var year = now.getFullYear()
- if (! data.BirthDay) data.BirthDay = year + '-01-01'
- if (data.BirthDay.split('-')[0] || '2018')
- var birthday = new Date (data.BirthDay)
- if (isNaN(birthday) || (now - birthday) / (365*24*60*60*1000) < 18) {
- errors.push(['BirthDay', 'You must be 18 or older to use the Stone Island app.'])
- }
- // if (data.Gender === "NONE") { errors.push([ "Gender", "Please supply your gender." ]) }
- },
-
- finalize: function(data){
- if (data.CurrentPassword && (data.NewPassword || data.Email !== auth.user.Email)) {
- data.NewPassword = data.NewPassword || data.CurrentPassword
- data.NewEmail = data.NewEmail || auth.user.Email
-
- sdk.account.update_mail_and_password({
- data: {
- Password: data.CurrentPassword,
- NewPassword: data.NewPassword || data.CurrentPassword,
- Email: auth.user,
- NewEmail: data.NewEmail || auth.user.Email,
- },
- success: function(){ console.log("updated password") },
- error: function(){ console.log("error updating password") },
- })
- }
-
- var submissible_data = _.pick(data, "Name Surname BirthDay YooxLetter".split(" "))
- submissible_data.Gender = "U"
-// submissible_data.idUser = auth.user_id
-// submissible_data.AccessToken = auth.access_token
-// submissible_data.Premium = "false"
-// submissible_data.LanguageId = ""
-// submissible_data.SiteCode = "STONEISLAND_US"
-// submissible_data.FuriganaName = ""
-// submissible_data.FuriganaSurname = ""
-// submissible_data.UserPromocode = ""
- submissible_data.BirthDay += "T00:00:00Z"
- submissible_data.YooxLetter = this.$("[name=YooxLetter]").prop("checked")
- submissible_data.DataProfiling = this.$("[name=DataProfiling]").prop("checked")
-
- console.log(data.DataProfiling, submissible_data.DataProfiling)
- console.log(submissible_data)
-
- return submissible_data
- },
-
- privacy_link: function(){
- // rewrite app.privacy instance temporarily
- app.privacy.back = function(){
- app.router.go("account/profile")
- }
- app.privacy.hide = function(){
- app.privacy.back = app.privacy.hide = null
- }
- app.router.go("page/privacy")
- },
-
- success: function(data){
- },
-
- error: function(data){
- },
-
- cancel: function(){
- app.router.go("intro")
- },
-
-}) \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js
deleted file mode 100755
index 196b7759..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var SettingsView = FormView.extend({
-
- el: "#settings",
-
- events: {
- "change [name=store]": "changeStore",
- "change [name=hub]": "changeHub",
- },
-
- initialize: function(){
- this.$form = this.$(".form")
- this.$msg = this.$(".msg")
- this.$store = this.$("[name=store]")
- this.$hub = this.$("[name=hub]")
- this.scroller = ScrollFactory('#settings', app.iscroll_options)
- },
-
- show: function(){
- if (! auth.logged_in()) { return app.router.go("intro") }
- if (! navigator.onLine) {
- app.closed.showElement()
- app.closed.setMessage("PLEASE GO ONLINE TO CHANGE<br>YOUR NOTIFICATION SETTINGS.", "")
- return
- }
- app.account.consent.check()
- document.body.className = "settings"
- this.deferScrollToTop()
-
- this.$store.prop("checked", !! push.settings.store)
- this.$hub.prop("checked", !! push.settings.hub)
- // push.subscribe("store")
- // push.subscribe("hub")
- },
-
- changeStore: function(){
- var state = app.settings.$store.prop("checked")
- if (state) { push.subscribe("store") }
- else { push.unsubscribe('store') }
- },
- changeHub: function(){
- var state = app.settings.$hub.prop("checked")
- if (state) { push.subscribe("hub") }
- else { push.unsubscribe('hub') }
- },
-
-}) \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/ShippingView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/ShippingView.js
deleted file mode 100755
index 4c45e97f..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/ShippingView.js
+++ /dev/null
@@ -1,89 +0,0 @@
-var ShippingView = FormView.extend({
-
- el: "#shipping",
-
- action: sdk.address.add,
-
- events: {
- },
-
- test_data: {
- "Name":"name",
- "Surname":"surname",
- "Address":"address1\naddress2",
- "IsDefault":false,
- "IsBillingDefault":false,
- "IsOwner":false,
- "ZipCode":"88040",
- "City":"City",
- "Province":"NY",
- "Phone":"1234567890",
- "Mobile":"Mobile",
- "Mail":"Mail",
- "UserId": sdk.auth.user_id,
- },
-
- initialize: function(){
- this.$form = this.$(".form")
- this.$msg = this.$(".msg")
- this.address = new AddressView ({ parent: this })
- this.scroller = ScrollFactory('#shipping', app.iscroll_options)
- },
-
- show: function(){
- if (! auth.logged_in()) { return app.router.go("intro") }
- if (! navigator.onLine) {
- app.closed.showElement()
- app.closed.setMessage("PLEASE GO ONLINE TO<br>EDIT YOUR SHIPPING INFO.", "")
- return
- }
-// this.preload( this.data || this.test_data )
- app.account.consent.check()
- app.footer.show("SAVE")
- document.body.className = "shipping"
- this.deferScrollToTop()
- },
-
- populate: function(data){
- this.data = data || this.data
- this.address.populate(data)
- },
-
- finalize: function(data){
- if (this.address.data && this.address.data.Id) {
- sdk.address.destroy({
- id: this.address.data.Id,
- success: function(){},
- error: function(){},
- })
- }
-
- data.IsDefault = "true" // this.$isDefault.prop("checked") ? "true" : "false"
- data.UserId = sdk.auth.user_id
-
- console.log(data)
- return data
- },
-
- success: function(data){
- app.curtain.show("loading")
- app.account.listAddresses({
- success: function(){
- this.$msg.html('Your address has been saved.')
- app.curtain.hide("loading")
- }.bind(this),
- error: function(){
- app.curtain.hide("loading")
- },
- })
- },
-
- error: function(data){
- console.log(data)
- },
-
- cancel: function(){
- app.router.go("intro")
- },
-
-}) \ No newline at end of file