summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/index.js2
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/_router.js1
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js18
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js21
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/auth/LoginView.js6
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js2
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js7
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js8
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js14
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js3
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/etc/push.js2
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/nav/NavView.js1
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js17
13 files changed, 76 insertions, 26 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/index.js b/StoneIsland/platforms/android/assets/www/js/index.js
index 73af443a..050a729c 100755
--- a/StoneIsland/platforms/android/assets/www/js/index.js
+++ b/StoneIsland/platforms/android/assets/www/js/index.js
@@ -3,7 +3,7 @@ var app = (function(){
app.init = function(){
- sdk.init({ env: "test" })
+ sdk.init({ env: "production" })
app.bind()
app.build()
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/_router.js b/StoneIsland/platforms/android/assets/www/js/lib/_router.js
index 5cd09d6c..b1fa1c97 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/_router.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/_router.js
@@ -86,7 +86,6 @@ var SiteRouter = Router.extend({
app.view = app[name]
}
app.header.set_back( !! app.view.back )
- console.log("showing now")
app.view.show()
}.bind(this)
return fn
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js
index 1c5c9f16..7d3b719a 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js
@@ -99,12 +99,18 @@ var AccountView = View.extend({
if ( ! auth.has_cart() ) {
app.curtain.show("loading")
auth.create_cart(function(){
- auth.add_deferred_product_to_cart(function(){
- app.router.go("cart")
- setTimeout(function(){
- app.curtain.hide("loading")
- }, 500)
- })
+ if (auth.deferred_product) {
+ auth.add_deferred_product_to_cart(function(){
+ app.router.go("cart")
+ setTimeout(function(){
+ app.curtain.hide("loading")
+ }, 500)
+ })
+ }
+ else {
+ app.router.go("account/profile")
+ app.curtain.hide("loading")
+ }
})
}
else {
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js
index f370c055..2b608cb4 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/account/ProfileView.js
@@ -17,6 +17,20 @@ var ProfileView = FormView.extend({
if (! auth.logged_in()) { return app.router.go("intro") }
app.footer.show("SAVE")
document.body.className = "profile"
+ auth.user.DataProfiling2 = auth.user.DataProfiling
+ if (auth.user.BirthDay.match(/T/)) {
+ auth.user.BirthDay = auth.user.BirthDay.split("T")[0]
+ }
+ 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()
},
@@ -63,8 +77,11 @@ var ProfileView = FormView.extend({
// submissible_data.FuriganaSurname = ""
// submissible_data.UserPromocode = ""
submissible_data.BirthDay += "T00:00:00Z"
- submissible_data.YooxLetter = data.YooxLetter || "false"
- submissible_data.DataProfiling = "true"
+ 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
},
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/auth/LoginView.js b/StoneIsland/platforms/android/assets/www/js/lib/auth/LoginView.js
index 8a002632..4ef2823f 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/auth/LoginView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/auth/LoginView.js
@@ -37,8 +37,10 @@ var LoginView = FormView.extend({
},
success: function(data){
- // console.log(data)
- app.account.logged_in(function(){ app.router.go("store") })
+ console.log(data)
+ app.account.logged_in(function(){
+ app.router.go("store")
+ })
},
error: function(data){
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
index ff5fa6bb..599f57c7 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
@@ -64,7 +64,7 @@ var SignupView = FormView.extend({
// 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." ]) }
if (data.DataProfiling2 !== "true") { errors.push([ "DataProfiling2", "You must consent to use this service." ]) }
- if (! data.YooxLetter) { data.YooxLetter = false }
+ data.YooxLetter = this.$("[name=YooxLetter]").prop("checked")
},
finalize: function(data){
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js
index a1863b67..5a036930 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js
@@ -63,9 +63,8 @@ var ArchiveView = ScrollableView.extend({
}.bind(this))
this.back()
- this.deferScrollToTop()
-
this.populateDecade(0, 3)
+ this.deferScrollToTop()
},
populateDecade: function(index, count){
@@ -107,6 +106,8 @@ var ArchiveView = ScrollableView.extend({
$t.removeClass('loading')
}.bind(this))
}.bind(this))
+
+ this.deferRefresh()
},
// ['transformProp'] = "translateZ(0) translateX(-50%) translateY(-50%) ";
@@ -175,13 +176,11 @@ var ArchiveView = ScrollableView.extend({
gray = Math.round( (1-q) * 100 )
opacity = lerp(q, 0.2, 1)
text_opacity = lerp(q, 1, 0.3)
-// console.log("<", gray, opacity)
}
else {
gray = Math.round( q * 100 )
opacity = lerp(q, 1, 0.2)
text_opacity = lerp(q, 0.3, 1)
-// console.log(">", gray, opacity)
}
aa.image.style.WebkitFilter = "grayscale(" + gray + "%)"
aa.image.style.opacity = opacity
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js
index a6c4384b..dae7f98d 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js
@@ -4,7 +4,7 @@ var HubView = ScrollableView.extend({
template: $("#hub .template").html(),
events: {
- "click .share": "content-share",
+ "click .content-share": "share",
"click .store": "store_link",
"click .gallery-left": "gallery_left",
"click .gallery-right": "gallery_right",
@@ -106,8 +106,10 @@ var HubView = ScrollableView.extend({
this.galleries[id].next()
},
- share: function(){
- window.plugins.socialsharing.share( this.item['ModelNames'], null, null, "http://stoneisland.com/" )
+ share: function(e){
+ var title = $(e.currentTarget).parent().find(".title").text()
+ console.log("share", title)
+ window.plugins.socialsharing.share(title, null, null, "http://stoneisland.com/" )
},
}) \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
index 4bf05430..c399a2a9 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
@@ -1,6 +1,7 @@
var PageView = ScrollableView.extend({
events: {
+ "touchstart a": "follow_link"
},
initialize: function(opt){
@@ -19,6 +20,19 @@ var PageView = ScrollableView.extend({
populate: function(data){
this.$content.html(data.body.replace(/\n/g, "<br>"))
+ this.$content.find("a").each(function(){
+ var href = $(this).attr("href") // .substr(1, "fuck".length-2)
+ if (href.indexOf("“")) {
+ href = href.substr(1, href.length-2)
+ $(this).attr("href", href)
+ }
+ $(this).attr("target", "_system")
+ })
+ },
+
+ follow_link: function(e){
+ var href = $(e.currentTarget).attr("href")
+ window.open(row.link, '_system')
},
}) \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js
index 648dd167..0522fbc5 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/deeplink.js
@@ -1,3 +1,4 @@
function handleOpenURL (url) {
- app.router.initial_route = url
+ console.log("DEEP LINKING DETECTED", url)
+ this.parseRoute( url )
} \ No newline at end of file
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js
index 4e771b62..5585ba71 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js
@@ -17,7 +17,7 @@ var push = (function(){
push.settings.store = localStorage.getItem("yoox.push_store") == "true"
if ( ! push.settings.requested ) {
- localStorage.setItem("yoox.push_" + channel, "true")
+ localStorage.setItem("yoox.push_requested", "true")
push.subscribe("hub", function(){
push.subscribe("store")
})
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/nav/NavView.js b/StoneIsland/platforms/android/assets/www/js/lib/nav/NavView.js
index 71314559..1c12e7a1 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/nav/NavView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/nav/NavView.js
@@ -155,6 +155,7 @@ var NavView = View.extend({
window.open("https://twitter.com/stoneisland", '_system')
},
yt: function(){
+ console.log("youtube")
window.open("https://www.youtube.com/user/StoneIslandOfficial", '_system')
},
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js
index 798920d1..53e99390 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js
@@ -26,8 +26,9 @@ var CollectionView = ScrollableView.extend({
show: function(){
if (app.closed.storeIsClosed) {
- // (! this.storeOpenDate || moment().diff(this.storeOpenDate) > 0 ) ) {
- return app.closed.show()
+ if (! app.closed.storeOpenDate || app.closed.storeOpenDate.diff() > 0) {
+ return app.closed.show()
+ }
}
app.footer.show("FILTER")
document.body.className = "collection"
@@ -35,7 +36,9 @@ var CollectionView = ScrollableView.extend({
console.log("collection this loaded")
return this.populate(this.data)
}
- // this.fetch()
+ else {
+ this.fetch()
+ }
},
save: function(){
@@ -49,11 +52,17 @@ var CollectionView = ScrollableView.extend({
return
}
this.$loader.show()
- sdk.product.all({
+ console.log("fetching", app.gallery_id)
+ sdk.product.collection({
gallery_id: app.gallery_id,
success: this.populate.bind(this)
})
},
+
+ refresh: function(){
+ this.loaded = false
+ this.fetch()
+ },
populate: function(data){
if (this.loaded && ! data) {