summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/index.js
blob: e6bdf49f5533572341a832abf324efbe912fc4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
var app = (function(){
  var app = {}
  
  app.init = function(){  
    app.bind()
    app.build()
    
    sdk.init({ env: "test" })
    
    app.iscroll_options = {
      mouseWheel: true,
      scrollbars: true,
    }

    if (window.cordova) {
      document.addEventListener('deviceready', app.ready, false)
    }
    else {
      app.ready()
    }
  }
  
  app.bind = function(){
    document.addEventListener('touchmove', function(e){ e.preventDefault() })
    FastClick.attach(document.body)
  }
  
  app.build = function(){
	  app.blog = new BlogView ()
	  app.archive = new ArchiveView ()
	  app.hub = new HubView ()
	  app.story = new StoryView ()
	  app.cart = new CartView ()

	  app.intro = new IntroView ()
	  app.header = new HeaderView ()
	  app.footer = new FooterView ()
	  app.curtain = new CurtainView ()
	  app.nav = new NavView ()

    app.account = new AccountView ()
	  app.login = new LoginView ()
    app.logout = new LogoutView ()
    app.signup = new SignupView ()
    app.profile = new ProfileView ()
    app.payment = new PaymentView ()
    app.shipping = new ShippingView ()
    app.settings = new SettingsView ()
    app.orders = new OrdersView ()

	  app.terms = new PageView ({ page: "terms" })
	  app.privacy = new PageView ({ page: "privacy" })
	  app.returns = new PageView ({ page: "returns" })
	  app.care = new PageView ({ page: "care" })

	  app.collection = new CollectionView ()
	  app.product = new ProductView ()
	  app.closed = new ClosedStoreView ()
	  app.search = new SearchView ()
	  
	  app.selector = new Selector ()
  }
  
  app.ready = function(){
    if (window.cordova) {
      cordova.plugins.Keyboard.disableScroll(true)
      geo.fetch()
    }

    app.view = null
    app.router = new SiteRouter ()
    app.account.connect( app.router.launch.bind(app.router) )
    
    $("body").removeClass("loading")
  }
  
  return app
})()

app.init()