From 164fc4407621b4bd6448dd7790d684635a023726 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 16 Sep 2015 15:07:05 -0400 Subject: build --- StoneIsland/platforms/ios/www/js/lib/_router.js | 61 ++++++++++++++++++ .../platforms/ios/www/js/lib/blogs/ArchiveView.js | 20 ++++++ .../platforms/ios/www/js/lib/blogs/HubView.js | 20 ++++++ .../platforms/ios/www/js/lib/blogs/StoryView.js | 20 ++++++ .../platforms/ios/www/js/lib/cart/CartBilling.js | 11 ++++ .../platforms/ios/www/js/lib/cart/CartShipping.js | 11 ++++ .../platforms/ios/www/js/lib/cart/CartSummary.js | 11 ++++ .../platforms/ios/www/js/lib/cart/CartView.js | 15 +++++ .../platforms/ios/www/js/lib/nav/CurtainView.js | 21 ++++++ .../platforms/ios/www/js/lib/nav/FooterView.js | 11 ++++ .../platforms/ios/www/js/lib/nav/HeaderView.js | 26 ++++++++ .../platforms/ios/www/js/lib/nav/IntroView.js | 44 +++++++++++++ .../platforms/ios/www/js/lib/nav/LoginView.js | 19 ++++++ .../platforms/ios/www/js/lib/nav/NavView.js | 75 ++++++++++++++++++++++ .../ios/www/js/lib/products/CollectionView.js | 47 ++++++++++++++ .../ios/www/js/lib/products/ProductView.js | 15 +++++ .../platforms/ios/www/js/lib/products/Selector.js | 24 +++++++ 17 files changed, 451 insertions(+) create mode 100644 StoneIsland/platforms/ios/www/js/lib/_router.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/cart/CartBilling.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/cart/CartView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/nav/CurtainView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/nav/NavView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/products/ProductView.js create mode 100644 StoneIsland/platforms/ios/www/js/lib/products/Selector.js (limited to 'StoneIsland/platforms/ios/www/js/lib') diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js new file mode 100644 index 00000000..08b8b819 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/_router.js @@ -0,0 +1,61 @@ +var SiteRouter = Router.extend({ + + el: 'body', + routeByHash: true, + + routes: { + '/': 'intro', + '/intro': 'intro', + '/store': 'store', + '/hub': 'hub', + '/story': 'story', + '/archive': 'archive', + + '/faq': 'faq', + '/search': 'search', + + '/cart': 'cart', + }, + + initialize: function(){ + }, + + go: function(url){ + if (app.view && app.view.hide) { + app.view.hide() + } + window.location.href = "#/" + url + this.parseRoute(url) + }, + + intro: function(){ + app.view = app.intro + app.intro.show() + }, + + store: function(){ + app.view = app.store + app.collection.show() + }, + + hub: function(){ + app.view = app.hub + app.hub.show() + }, + + story: function(){ + app.view = app.story + app.story.show() + }, + + archive: function(){ + app.view = app.archive + app.archive.show() + }, + + cart: function(){ + app.view = app.cart + app.cart.show() + }, + +}) diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js new file mode 100644 index 00000000..742ee0f2 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/ArchiveView.js @@ -0,0 +1,20 @@ +var ArchiveView = View.extend({ + + el: "#archive", + template: $("#archive .template").html(), + + events: { + }, + + initialize: function(){ + this.$content = this.$(".content") + }, + + show: function(){ + document.body.className = "archive" + }, + + populate: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js new file mode 100644 index 00000000..430464b1 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js @@ -0,0 +1,20 @@ +var HubView = View.extend({ + + el: "#hub", + template: $("#hub .template").html(), + + events: { + }, + + initialize: function(){ + this.$content = this.$(".content") + }, + + show: function(){ + document.body.className = "hub" + }, + + populate: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js new file mode 100644 index 00000000..ed46af31 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/StoryView.js @@ -0,0 +1,20 @@ +var StoryView = View.extend({ + + el: "#story", + template: $("#story .template").html(), + + events: { + }, + + initialize: function(){ + this.$content = this.$(".content") + }, + + show: function(){ + document.body.className = "story" + }, + + populate: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartBilling.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartBilling.js new file mode 100644 index 00000000..f3c9cbe2 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartBilling.js @@ -0,0 +1,11 @@ +var CartBilling = View.extend({ + + el: "#billing", + + events: { + }, + + initialize: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js new file mode 100644 index 00000000..beaf6bd2 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartShipping.js @@ -0,0 +1,11 @@ +var CartShipping = View.extend({ + + el: "#shipping", + + events: { + }, + + initialize: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js new file mode 100644 index 00000000..37400dd0 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartSummary.js @@ -0,0 +1,11 @@ +var CartSummary = View.extend({ + + el: "#summary", + + events: { + }, + + initialize: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js new file mode 100644 index 00000000..f958f716 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/cart/CartView.js @@ -0,0 +1,15 @@ +var CartView = View.extend({ + + el: "#cart", + + events: { + }, + + initialize: function(){ + }, + + show: function(){ + document.body.className = "cart" + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/CurtainView.js b/StoneIsland/platforms/ios/www/js/lib/nav/CurtainView.js new file mode 100644 index 00000000..30c3190e --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/CurtainView.js @@ -0,0 +1,21 @@ +var CurtainView = View.extend({ + + el: "#curtain", + + events: { + "click": "click", + }, + + initialize: function(){ + }, + + click: function(){ + if (document.body.classList.contains("nav")) { + app.nav.hide() + } + else if (document.body.classList.contains("login")) { + app.login.hide() + } + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js new file mode 100644 index 00000000..15c6425f --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js @@ -0,0 +1,11 @@ +var FooterView = View.extend({ + + el: "#footer", + + events: { + }, + + initialize: function(){ + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js new file mode 100644 index 00000000..bbf18274 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js @@ -0,0 +1,26 @@ +var HeaderView = View.extend({ + + el: "#header", + + events: { + "click .burger": "nav", + "click .logo": "logo", + "click .cart": "cart", + }, + + initialize: function(){ + }, + + nav: function(){ + app.nav.show() + }, + + logo: function(){ + app.router.go("intro") + }, + + cart: function(){ + app.router.go("cart") + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js b/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js new file mode 100644 index 00000000..93602eb5 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js @@ -0,0 +1,44 @@ +var IntroView = View.extend({ + + el: "#intro", + + events: { + "click .store": "store", + "click .hub": "hub", + "click .story": "story", + "click .archive": "archive", + }, + + initialize: function(){ + this.compass = this.$("#compass").get(0) + this.orient = this.deviceorientation.bind(this) + }, + + show: function(){ + document.body.className = "intro" + window.addEventListener("deviceorientation", this.orient) + this.orient({ alpha: 0 }) + // get location.. + }, + + hide: function(){ + window.removeEventListener("deviceorientation", this.orient) + }, + + deviceorientation: function(e){ + var heading + if ('webkitCompassHeading' in e) { + heading = e.webkitCompassHeading || 0 + } + else { + heading = e.alpha || 0 + } + this.compass.style[transformProp] = "translateZ(0) translateX(-50%) translateY(-50%) rotate(" + heading + "deg)" + }, + + store: function(){ app.router.go("store") }, + hub: function(){ app.router.go("hub") }, + story: function(){ app.router.go("story") }, + archive: function(){ app.router.go("archive") }, + +}) diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js b/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js new file mode 100644 index 00000000..0f30db3d --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js @@ -0,0 +1,19 @@ +var LoginView = View.extend({ + + el: "#login", + + events: { + }, + + initialize: function(){ + }, + + show: function(){ + document.body.classList.add("login") + }, + + hide: function(){ + document.body.classList.remove("login") + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/NavView.js b/StoneIsland/platforms/ios/www/js/lib/nav/NavView.js new file mode 100644 index 00000000..c9eb2d4e --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/NavView.js @@ -0,0 +1,75 @@ +var NavView = View.extend({ + + el: "#nav", + + events: { + "click .store": "store", + "click .hub": "hub", + "click .story": "story", + "click .archive": "archive", + + "click .login": "login", + "click .faq": "faq", + "click .search": "search", + + "click .fb": "fb", + "click .insta": "insta", + "click .tw": "tw", + }, + + initialize: function(){ + }, + + show: function(){ + $("body").addClass("nav") + $("#curtain").show() + }, + + hide: function(){ + $("body").removeClass("nav") + $("#curtain").hide() + }, + + store: function(){ + this.hide() + app.router.go("store") + }, + hub: function(){ + this.hide() + app.router.go("hub") + }, + story: function(){ + this.hide() + app.router.go("story") + }, + archive: function(){ + this.hide() + app.router.go("archive") + }, + + login: function(){ + this.hide() + app.router.go("login") + }, + + search: function(){ + this.hide() + app.router.go("search") + }, + faq: function(){ + this.hide() + app.router.go("faq") + }, + + fb: function(){ + window.open("https://www.facebook.com/StoneIsland", '_system') + }, + insta: function(){ + window.open("https://instagram.com/stoneisland_official", '_system') + }, + tw: function(){ + window.open("https://twitter.com/stoneisland", '_system') + }, + + +}) diff --git a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js new file mode 100644 index 00000000..0ce740a8 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js @@ -0,0 +1,47 @@ +var CollectionView = View.extend({ + + el: "#collection", + template: $("#collection .template").html(), + loaded: false, + data: null, + items: {}, + + events: { + }, + + initialize: function(){ + this.$content = this.$(".content") + this.$loader = this.$(".loader") + }, + + show: function(){ + document.body.className = "collection" + if (this.loaded) { + return this.populate(this.data) + } + this.fetch() + }, + + fetch: function(){ + this.$loader.show() + sdk.fetch_collection({ + gallery_id: 31617, // STONE ISLAND / SUPREME + success: this.populate.bind(this) + }) + }, + + populate: function(data){ + this.$loader.hide() + this.$content.empty() + // DefaultCode10 + console.log(data) + data.SearchResponseFull.Results.Items.forEach(function(item){ + this.items[ item['Code8'] ] = item + var t = this.template.replace(/{{image}}/, sdk.image(item['DefaultCode10'])) + .replace(/{{code8}}/, item['Code8']) + this.$content.append(t) + + }.bind(this)) + }, + +}) diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js new file mode 100644 index 00000000..3c18338e --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js @@ -0,0 +1,15 @@ +var ProductView = View.extend({ + + el: "#product", + + events: { + }, + + initialize: function(){ + }, + + show: function(){ + document.body.className = "product" + }, + +}) \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/products/Selector.js b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js new file mode 100644 index 00000000..c81aa121 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/products/Selector.js @@ -0,0 +1,24 @@ +var Selector = View.extend({ + + el: "#selector", + + events: { + "click .close": "hide", + "click span": "pick", + }, + + initialize: function(){ + }, + + select: function(options, callback){ + }, + + hide: function(){ + }, + + pick: function(e){ + var el = $(e.currentTarget) + + }, + +}) \ No newline at end of file -- cgit v1.2.3-70-g09d2