summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-12-03 15:19:43 -0500
committerJules Laplace <jules@okfoc.us>2015-12-03 15:19:43 -0500
commit9b656e51232f1b1f2cf210908b569b1a224e7a90 (patch)
treeb73727987c57b201c5ed6d7d4311195a20a18b73 /StoneIsland/platforms/ios/www/js
parent0e783ecb14849eb8ab36f3c4d591ffdbb2e8e942 (diff)
date css
Diffstat (limited to 'StoneIsland/platforms/ios/www/js')
-rw-r--r--StoneIsland/platforms/ios/www/js/index.js10
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js22
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js9
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js1
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/view/Serializable.js17
5 files changed, 49 insertions, 10 deletions
diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js
index 16989eb0..0b3531dd 100644
--- a/StoneIsland/platforms/ios/www/js/index.js
+++ b/StoneIsland/platforms/ios/www/js/index.js
@@ -70,12 +70,12 @@ var app = (function(){
app.view = null
app.router = new SiteRouter ()
- if (sdk.env == "test") {
- app.router.launch()
- }
- else {
+// if (sdk.env == "test") {
+// app.router.launch()
+// }
+// else {
app.account.connect( app.router.launch.bind(app.router) )
- }
+// }
$("body").removeClass("loading")
}
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
index 327b5328..9b49abbd 100644
--- a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
@@ -10,7 +10,8 @@ var BlogView = View.extend({
fetch: function(){
$.ajax({
method: "GET",
- url: sdk.env == 'test' ? '/db.json' : "http://stone.sup.land/db.json",
+// url: sdk.env == 'test' ? '/db.json' : "http://stone.sup.land/db.json",
+ url: "http://stone.sup.land/db.json",
success: this.success.bind(this),
cache: true,
})
@@ -37,11 +38,22 @@ var BlogView = View.extend({
app.collection.setCollectionName( data.store[0].collection )
app.closed.populate(data.store[0].ClosedStoreImages)
- if (data.store[0].StoreIsOpen !== "true") {
- app.closed.storeIsClosed = true
+ switch (data.store[0].StoreStatus) {
+ case "open":
+ app.closed.storeIsClosed = false
+ break
+ case "closed":
+ app.closed.storeIsClosed = true
+ app.closed.storeOpenDate = null
+ break
+ case "openson":
+ app.closed.storeIsClosed = true
+ app.closed.storeOpenDate = moment(data.store[0].OpensOn)
+ break
}
+ console.log(data.store[0].StoreStatus)
+
var fits_large = (data.store[0].FitsLarge === "true")
-
app.product.$fit.toggle( fits_large )
app.product.$sizing.toggle( fits_large )
@@ -52,7 +64,7 @@ var BlogView = View.extend({
app.gallery_id = data.store[0].CollectionId
- // app.collection.fetch()
+ app.collection.fetch()
},
}) \ No newline at end of file
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js b/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js
index 77dc15b1..5f8c1e84 100644
--- a/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/ClosedStoreView.js
@@ -21,6 +21,15 @@ var ClosedStoreView = View.extend({
document.body.className = "closed"
this.animate()
app.footer.hide()
+ console.log(this)
+ if (this.storeOpenDate) {
+ var date = moment(this.storeOpenDate).format("MM/DD")
+ console.log(date)
+ $(".closed_store_msg h3").html("THIS STORE WILL OPEN ON " + date)
+ }
+ else {
+ $(".closed_store_msg h3").html("THIS STORE IS CURRENTLY CLOSED")
+ }
},
hide: function(){
diff --git a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
index 056f2a52..d4315514 100644
--- a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js
@@ -26,6 +26,7 @@ var CollectionView = ScrollableView.extend({
show: function(){
if (app.closed.storeIsClosed) {
+ // (! this.storeOpenDate || moment().diff(this.storeOpenDate) > 0 ) ) {
return app.closed.show()
}
app.footer.show("FILTER")
diff --git a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
index f9abd011..98aa8ce3 100644
--- a/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
+++ b/StoneIsland/platforms/ios/www/js/lib/view/Serializable.js
@@ -2,7 +2,9 @@ var SerializableView = View.extend({
events: {
"change select": "update_select",
+ "change [type=date]": "update_date",
"focus input": "focus_input",
+ "click .date-wrapper": "focus_date",
"submit form": "save",
},
@@ -21,6 +23,10 @@ var SerializableView = View.extend({
if ($el.attr("type") == "checkbox") {
$el.prop("checked", value)
}
+ if ($el.attr("type") == "date") {
+ $el.val( value )
+ this.update_date({ currentTarget: $el })
+ }
else if ($el.prop("tagName") == "SELECT") {
$el.val( value )
this.update_select({ currentTarget: $el })
@@ -57,12 +63,23 @@ var SerializableView = View.extend({
$(e.currentTarget).removeClass("error_hilite")
},
+ focus_date: function(e){
+ $(e.currentTarget).find("input").focus()
+ },
+
update_select: function(e){
var $target = $(e.currentTarget), value = $target.val()
var label = $target.find("option").filter(function(){ return this.value === value }).html()
$target.parent().addClass("picked")
$target.parent().find("span").html(label)
},
+
+ update_date: function(e){
+ var $target = $(e.currentTarget), value = $target.val()
+ var label = moment(value).format("MM/DD/YYYY")
+ $target.parent().addClass("picked")
+ $target.parent().find("span").html(label)
+ },
validate: function(data, errors){
var data = data || this.serialize()