diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-12-11 05:37:34 -0600 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-12-11 05:37:34 -0600 |
| commit | aa5a9b7c7cd52a69f8dd1d0cdc15475e113e6da0 (patch) | |
| tree | cecfdb0893eb9e936fe605478b3f8195dc7ef987 | |
| parent | 4178c44c48aa401f7780bec3f89430c83d50fe30 (diff) | |
remembered a couple things, push 0.3.4
59 files changed, 256 insertions, 142 deletions
diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml index d6130be4..6868f69c 100755 --- a/StoneIsland/config.xml +++ b/StoneIsland/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget id="us.okfoc.stoneisland" version="0.3.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget id="us.okfoc.stoneisland" version="0.3.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>Stone Island</name> <description> Stone Island diff --git a/StoneIsland/platforms/android/AndroidManifest.xml b/StoneIsland/platforms/android/AndroidManifest.xml index bcf48a32..e14caf77 100755 --- a/StoneIsland/platforms/android/AndroidManifest.xml +++ b/StoneIsland/platforms/android/AndroidManifest.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<manifest android:hardwareAccelerated="true" android:versionCode="302" android:versionName="0.3.2" package="us.okfoc.stoneisland" xmlns:android="http://schemas.android.com/apk/res/android"> +<manifest android:hardwareAccelerated="true" android:versionCode="304" android:versionName="0.3.4" package="us.okfoc.stoneisland" xmlns:android="http://schemas.android.com/apk/res/android"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> diff --git a/StoneIsland/platforms/android/assets/www/css/nav.css b/StoneIsland/platforms/android/assets/www/css/nav.css index f76fb744..c769dabd 100755 --- a/StoneIsland/platforms/android/assets/www/css/nav.css +++ b/StoneIsland/platforms/android/assets/www/css/nav.css @@ -93,7 +93,7 @@ #nav .social span { display: block; float: left; - width: 82px; + width: 61px; border-left: 1px solid #ddd; color: #bbb; font-size: 18px; @@ -174,6 +174,24 @@ padding-bottom:0px; z-index: 2 } +#intro .alert { + box-sizing: border-box; + width: calc(100vw); + text-align: center; + font-size: 14pt; + font-weight: bold; + line-height: 0; + text-transform: uppercase; + color: #3E6616; + position: absolute; + height: 0; + left: 0; + top: auto; + bottom: calc(25vh - 58px); + margin: auto 0; + padding: 0; +} + /* HEADER AND FOOTER ON MOST PAGES */ diff --git a/StoneIsland/platforms/android/assets/www/icons/android-icon-144x144.png b/StoneIsland/platforms/android/assets/www/icons/android-icon-144x144.png Binary files differdeleted file mode 100755 index 08a2989c..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/android-icon-144x144.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/android-icon-192x192.png b/StoneIsland/platforms/android/assets/www/icons/android-icon-192x192.png Binary files differdeleted file mode 100755 index b36071b6..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/android-icon-192x192.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/android-icon-36x36.png b/StoneIsland/platforms/android/assets/www/icons/android-icon-36x36.png Binary files differdeleted file mode 100755 index f37ec0e2..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/android-icon-36x36.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/android-icon-48x48.png b/StoneIsland/platforms/android/assets/www/icons/android-icon-48x48.png Binary files differdeleted file mode 100755 index 0556cbed..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/android-icon-48x48.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/android-icon-72x72.png b/StoneIsland/platforms/android/assets/www/icons/android-icon-72x72.png Binary files differdeleted file mode 100755 index 07272e93..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/android-icon-72x72.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/android-icon-96x96.png b/StoneIsland/platforms/android/assets/www/icons/android-icon-96x96.png Binary files differdeleted file mode 100755 index efcfbca5..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/android-icon-96x96.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-114x114.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-114x114.png Binary files differdeleted file mode 100755 index 56e9a482..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-114x114.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-120x120.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-120x120.png Binary files differdeleted file mode 100755 index c9b1bb2b..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-120x120.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-144x144.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-144x144.png Binary files differdeleted file mode 100755 index 08a2989c..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-144x144.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-152x152.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-152x152.png Binary files differdeleted file mode 100755 index 9af7c290..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-152x152.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-180x180.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-180x180.png Binary files differdeleted file mode 100755 index 249a5463..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-180x180.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-57x57.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-57x57.png Binary files differdeleted file mode 100755 index f7b5a99d..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-57x57.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-60x60.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-60x60.png Binary files differdeleted file mode 100755 index 9605a263..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-60x60.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-72x72.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-72x72.png Binary files differdeleted file mode 100755 index 07272e93..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-72x72.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-76x76.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-76x76.png Binary files differdeleted file mode 100755 index 5ba075af..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-76x76.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon-precomposed.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon-precomposed.png Binary files differdeleted file mode 100755 index 65303103..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon-precomposed.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/apple-icon.png b/StoneIsland/platforms/android/assets/www/icons/apple-icon.png Binary files differdeleted file mode 100755 index 65303103..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/apple-icon.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/browserconfig.xml b/StoneIsland/platforms/android/assets/www/icons/browserconfig.xml deleted file mode 100755 index c5541482..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/browserconfig.xml +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/icons/favicon-16x16.png b/StoneIsland/platforms/android/assets/www/icons/favicon-16x16.png Binary files differdeleted file mode 100755 index 8787c0e6..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/favicon-16x16.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/favicon-32x32.png b/StoneIsland/platforms/android/assets/www/icons/favicon-32x32.png Binary files differdeleted file mode 100755 index c78d2d28..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/favicon-32x32.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/favicon-96x96.png b/StoneIsland/platforms/android/assets/www/icons/favicon-96x96.png Binary files differdeleted file mode 100755 index efcfbca5..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/favicon-96x96.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/favicon.ico b/StoneIsland/platforms/android/assets/www/icons/favicon.ico Binary files differdeleted file mode 100755 index 521e2cfc..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/favicon.ico +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/manifest.json b/StoneIsland/platforms/android/assets/www/icons/manifest.json deleted file mode 100755 index 013d4a6a..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/manifest.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "App", - "icons": [ - { - "src": "\/android-icon-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" - }, - { - "src": "\/android-icon-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" - }, - { - "src": "\/android-icon-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" - }, - { - "src": "\/android-icon-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "\/android-icon-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "\/android-icon-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" - } - ] -}
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/icons/ms-icon-144x144.png b/StoneIsland/platforms/android/assets/www/icons/ms-icon-144x144.png Binary files differdeleted file mode 100755 index 08a2989c..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/ms-icon-144x144.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/ms-icon-150x150.png b/StoneIsland/platforms/android/assets/www/icons/ms-icon-150x150.png Binary files differdeleted file mode 100755 index 98983d89..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/ms-icon-150x150.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/ms-icon-310x310.png b/StoneIsland/platforms/android/assets/www/icons/ms-icon-310x310.png Binary files differdeleted file mode 100755 index cd0e0a98..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/ms-icon-310x310.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/icons/ms-icon-70x70.png b/StoneIsland/platforms/android/assets/www/icons/ms-icon-70x70.png Binary files differdeleted file mode 100755 index 09adb6db..00000000 --- a/StoneIsland/platforms/android/assets/www/icons/ms-icon-70x70.png +++ /dev/null diff --git a/StoneIsland/platforms/android/assets/www/index.html b/StoneIsland/platforms/android/assets/www/index.html index e0925f65..73eed267 100755 --- a/StoneIsland/platforms/android/assets/www/index.html +++ b/StoneIsland/platforms/android/assets/www/index.html @@ -26,23 +26,6 @@ <link rel="stylesheet" type="text/css" href="css/products.css"> <link rel="stylesheet" type="text/css" href="css/cart.css"> <link rel="stylesheet" type="text/css" href="css/blogs.css"> - <link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png"> - <link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png"> - <link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png"> - <link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png"> - <link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png"> - <link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png"> - <link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png"> - <link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png"> - <link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png"> - <link rel="icon" type="image/png" sizes="192x192" href="icons/android-icon-192x192.png"> - <link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png"> - <link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png"> - <link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png"> - <link rel="manifest" href="icons/manifest.json"> - <meta name="msapplication-TileColor" content="#ffffff"> - <meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png"> - <meta name="theme-color" content="#ffffff"> <title>Stone Island</title> </head> <body class="loading"> @@ -107,6 +90,7 @@ <span class="fb ion-social-facebook"></span> <span class="insta ion-social-instagram-outline"></span> <span class="tw ion-social-twitter"></span> + <span class="yt ion-social-youtube"></span> </span> </div> @@ -118,7 +102,7 @@ <div class="hub">HUB</div> <div class="story">STORY</div> <div class="archive">ARCHIVE</div> - <span + <div class="alert"></div> <span class="latlng">+40° 58' 90" -74° 04' 46"</span> </div> @@ -509,7 +493,7 @@ Receive notifications for Store </div> <div class="toggle"> - <input type="checkbox" id="store-notifications" name="switch" class="switch"> + <input type="checkbox" id="store-notifications" name="store" class="switch"> <label for="store-notifications"></label> </div> </div> @@ -519,7 +503,7 @@ Receive notifications for Hub </div> <div class="toggle"> - <input type="checkbox" id="hub-notifications" name="switch" class="switch"> + <input type="checkbox" id="hub-notifications" name="hub" class="switch"> <label for="hub-notifications"></label> </div> </div> diff --git a/StoneIsland/platforms/android/assets/www/js/index.js b/StoneIsland/platforms/android/assets/www/js/index.js index 468c0d7e..73af443a 100755 --- a/StoneIsland/platforms/android/assets/www/js/index.js +++ b/StoneIsland/platforms/android/assets/www/js/index.js @@ -64,6 +64,8 @@ var app = (function(){ app.ready = function(){ if (window.cordova) { + document.addEventListener('pause', app.paused, false) + document.addEventListener('resume', app.resumed, false) cordova.plugins.Keyboard.disableScroll(true) geo.fetch() } @@ -74,12 +76,24 @@ var app = (function(){ // app.router.launch() // } // else { - app.account.connect( app.router.launch.bind(app.router) ) + push.init() + app.account.connect( app.router.launch.bind(app.router) ) // } $("body").removeClass("loading") } + var refresh_time = +Date.now() + app.paused = function(){} + app.resumed = function(){ + geo.fetch() + var now = +Date.now() + if (now - refresh_time > 60 * 60 * 1000) { + refresh_time = now + app.blog.refresh() + } + } + return app })() diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js index 0de80048..0d6fa807 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/account/SettingsView.js @@ -3,22 +3,38 @@ 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 = new IScroll('#settings', app.iscroll_options) }, show: function(){ if (! auth.logged_in()) { return app.router.go("intro") } - app.footer.show("SAVE") 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") }, - - save: function(){ + + 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/blogs/ArchiveView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js index 254df6d1..a1863b67 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/ArchiveView.js @@ -78,6 +78,7 @@ var ArchiveView = ScrollableView.extend({ count = count || row.images.length row.images.forEach(function(cell, i){ + if (count && i > count) { return } var $t = $("<div>") $t.addClass("row").addClass("loading") var t = this.row_template.replace(/{{image}}/, cell.uri) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js index 9b49abbd..02491b32 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js @@ -17,6 +17,11 @@ var BlogView = View.extend({ }) }, + refresh: function(){ + this.loaded = false + this.fetch() + }, + success: function(data){ if (this.loaded) return @@ -24,20 +29,6 @@ var BlogView = View.extend({ this.loaded = true this.data = data = typeof data == "string" ? JSON.parse(data) : data - app.archive.populate(data.archive) - this.loader.preloadImage(data.hub[0].image[0].uri, function(img){ - app.hub.populate(data.hub) - }) - this.loader.preloadImage(data.story[0].image.uri, function(img){ - app.story.populate(data.story) - }) - data.page.forEach(function(page){ - app[page.tag].populate(page) - - }) - app.collection.setCollectionName( data.store[0].collection ) - - app.closed.populate(data.store[0].ClosedStoreImages) switch (data.store[0].StoreStatus) { case "open": app.closed.storeIsClosed = false @@ -51,6 +42,32 @@ var BlogView = View.extend({ app.closed.storeOpenDate = moment(data.store[0].OpensOn) break } + + if (app.closed.storeIsClosed) { + app.closed.populate(data.store[0].ClosedStoreImages) + } + else { + app.gallery_id = data.store[0].CollectionId + app.collection.setCollectionName( data.store[0].collection ) + app.collection.fetch() + } + + app.archive.populate(data.archive) + this.loader.preloadImage(data.hub[0].image[0].uri, function(img){ + app.hub.populate(data.hub) + }.bind(this)) + this.loader.preloadImage(data.story[0].image.uri, function(img){ + app.story.populate(data.story) + setTimeout(function(){ + this.loader.preloadImage(data.story[1].image.uri) + this.loader.preloadImage(data.story[2].image.uri) + }.bind(this), 2000) + }.bind(this)) + + data.page.forEach(function(page){ + app[page.tag].populate(page) + }) + console.log(data.store[0].StoreStatus) var fits_large = (data.store[0].FitsLarge === "true") @@ -61,10 +78,6 @@ var BlogView = View.extend({ app.collection.$el.addClass("gray") app.product.gallery.$el.addClass("gray") } - - app.gallery_id = data.store[0].CollectionId - - app.collection.fetch() }, })
\ No newline at end of file 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 49c05ff6..a6c4384b 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js @@ -107,7 +107,7 @@ var HubView = ScrollableView.extend({ }, share: function(){ - window.plugins.socialsharing.share( this.item['ModelNames'], null, null, "http://stoneisland.com/") + window.plugins.socialsharing.share( this.item['ModelNames'], null, null, "http://stoneisland.com/" ) }, })
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/StoryView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/StoryView.js index a10c8351..c2a9f4b4 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/StoryView.js @@ -15,6 +15,7 @@ var StoryView = ScrollableView.extend({ this.$content = this.$(".content") this.$links = this.$(".links") this.$loader = this.$(".loader") + this.loader = new Loader () this.scroller = new IScroll('#story', app.iscroll_options) }, @@ -25,7 +26,7 @@ var StoryView = ScrollableView.extend({ }, populate: function(data){ - if (this.loaded) { console.warn("populate called twice"); return } + if (this.loaded) {} this.loaded = true this.data = data this.$loader.hide() @@ -58,10 +59,10 @@ var StoryView = ScrollableView.extend({ this.$content.find("[data-id=" + id + "]").addClass("active") var section = this.sections[id] - var replace = this.$img - // optional image transition.. ? + var $replace = this.$img + this.$img.fadeTo(110,0.65, function() { - replace.attr("src", section.image.uri) + $replace.attr("src", section.image.uri) }).fadeTo(130,1) this.deferScrollToTop() }, 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 ab0c0141..4e771b62 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js @@ -1 +1,76 @@ -//
\ No newline at end of file +var push = (function(){ + var appId = "GS82ZxpN8Mecpc53rsyu6aLLGK0W4CKi42J25DLB" + var clientKey = "hQRtQfsgimYnX5PMivtcdXCG9eZhESeyTr0Rd8Sv" + var push = { settings: {} } + var parsePlugin + push.init = function(){ + parsePlugin = window.parsePlugin || { initialize: function(){} } + parsePlugin.initialize(appId, clientKey, push.did_initialize, push.error) + } + push.did_initialize = function() { + parsePlugin.registerCallback('onNotification', function(){ + window.onNotification = push.got_push_notification + }, push.error) + + push.settings.requested = localStorage.getItem("yoox.push_requested") == "true" + push.settings.hub = localStorage.getItem("yoox.push_hub") == "true" + push.settings.store = localStorage.getItem("yoox.push_store") == "true" + + if ( ! push.settings.requested ) { + localStorage.setItem("yoox.push_" + channel, "true") + push.subscribe("hub", function(){ + push.subscribe("store") + }) + } + } + push.subscribe = function(channel, cb){ + parsePlugin.subscribe(channel, function(){ + push.settings[channel] = true + localStorage.setItem("yoox.push_" + channel, "true") + console.log("subscribed to", channel) + cb && cb() + }, push.error) + } + push.unsubscribe = function(channel, cb){ + parsePlugin.unsubscribe(channel, function(){ + push.settings[channel] = false + localStorage.setItem("yoox.push_" + channel, "false") + console.log("unsubscribed from", channel) + cb && cb() + }, push.error) + } + // parsePlugin.getInstallationId(function(id) { + // var install_data = { + // installation_id: id, + // channels: ['SampleChannel'] + // } + // }, push.error) + push.got_push_notification = function(push_obj) { + // alert('We received this push notification: ' + JSON.stringify(push_obj)); + app.blog.refresh() + + try { + var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) + if (is_hub) { + app.intro.$alert.show().html("[ HUB UPDATED ]") + } + else { + app.intro.$alert.show().html("[ STORE UPDATED ]") + } + } + catch (e) { + app.intro.$alert.show().html("[ HUB UPDATED ]") + } + + if (push_obj.receivedInForeground === false) { + // TODO: route the user to the uri in push_obj + } + else { + app.route("intro") + } + } + push.error = function(e){ + console.log("push error") + } + return push +})()
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/js/lib/nav/IntroView.js b/StoneIsland/platforms/android/assets/www/js/lib/nav/IntroView.js index 2d8dca43..8797241f 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/nav/IntroView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/nav/IntroView.js @@ -10,8 +10,10 @@ var IntroView = View.extend({ }, initialize: function(){ + this.$alert = this.$(".alert") this.compass = this.$("#compass").get(0) this.orient = this.deviceorientation.bind(this) + this.$alert.hide() }, show: function(){ @@ -24,6 +26,7 @@ var IntroView = View.extend({ hide: function(){ window.removeEventListener("deviceorientation", this.orient) + this.$alert.hide() }, deviceorientation: function(e){ 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 704aaa34..71314559 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/nav/NavView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/nav/NavView.js @@ -34,6 +34,7 @@ var NavView = View.extend({ "click .fb": "fb", "click .insta": "insta", "click .tw": "tw", + "click .yt": "yt", }, initialize: function(){ @@ -153,5 +154,8 @@ var NavView = View.extend({ tw: function(){ window.open("https://twitter.com/stoneisland", '_system') }, + yt: function(){ + window.open("https://www.youtube.com/user/StoneIslandOfficial", '_system') + }, }) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/ClosedStoreView.js b/StoneIsland/platforms/android/assets/www/js/lib/products/ClosedStoreView.js index 5f8c1e84..6f7b8486 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/ClosedStoreView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/ClosedStoreView.js @@ -12,6 +12,7 @@ var ClosedStoreView = View.extend({ timeout: -1, images: null, + images_loaded: {}, initialize: function(){ this.loader = new Loader () @@ -21,7 +22,6 @@ 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) @@ -38,15 +38,27 @@ var ClosedStoreView = View.extend({ animate: function(){ this.timeout = setTimeout(this.animate.bind(this), this.delay) + this.next() + }, + + next: function(){ if (! this.images) return var url = choice(this.images) - this.loader.preloadImage(url, function(img){ - this.el.style.backgroundImage = 'url(' + img.src + ')' - }.bind(this)) + + if (this.images_loaded[url]) { + this.el.style.backgroundImage = 'url(' + url + ')' + } + else { + this.loader.preloadImage(url, function(img){ + this.el.style.backgroundImage = 'url(' + url + ')' + this.images_loaded[url] = true + }.bind(this)) + } }, populate: function(data){ this.images = data.map(function(img){ return img.uri }) + this.next() }, website_link: function(){ diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js b/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js index 285e551d..484cd442 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js @@ -56,7 +56,7 @@ var ProductView = ScrollableView.extend({ cache: {}, - gallery_prev: function(){ + gallery_left: function(){ app.product.gallery.gallery.previous() }, gallery_right: function(){ @@ -250,8 +250,8 @@ var ProductView = ScrollableView.extend({ app.selector.select("style", colors, function(color){ this.code = color.code this.$color.html(color.label) - - // UPDATE GALLERY + this.gallery.populate( color.code, this.details['ImageTypes'] ) + this.gallery_right() }.bind(this)) }, diff --git a/StoneIsland/platforms/android/assets/www/js/lib/view/View.js b/StoneIsland/platforms/android/assets/www/js/lib/view/View.js index fe145221..2401df0d 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/view/View.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/view/View.js @@ -59,7 +59,6 @@ var View = (function($, _){ var match = key.match(delegateEventSplitter); var eventName = match[1], selector = match[2]; method = _.bind(method, this); - eventName += '.delegateEvents' + this._id; if (is_mobile) { if (eventName === 'mouseenter' || eventName === 'mouseleave') { continue @@ -68,6 +67,7 @@ var View = (function($, _){ eventName = 'touchstart' } } + eventName += '.delegateEvents' + this._id; if (selector === '') { this.$el.on(eventName, method); } else { diff --git a/StoneIsland/platforms/android/assets/www/js/vendor/util.js b/StoneIsland/platforms/android/assets/www/js/vendor/util.js index 23f55d4c..e09b6ada 100755 --- a/StoneIsland/platforms/android/assets/www/js/vendor/util.js +++ b/StoneIsland/platforms/android/assets/www/js/vendor/util.js @@ -143,7 +143,7 @@ if (!Function.prototype.bind) { }()); // Identify browser based on useragent string -(function( ua ) { +var browser = (function( ua ) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || /(webkit)[ \/]([\w.]+)/.exec( ua ) || diff --git a/StoneIsland/platforms/android/res/xml/config.xml b/StoneIsland/platforms/android/res/xml/config.xml index 177e57d5..1d29a8b0 100755 --- a/StoneIsland/platforms/android/res/xml/config.xml +++ b/StoneIsland/platforms/android/res/xml/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget id="us.okfoc.stoneisland" version="0.3.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget id="us.okfoc.stoneisland" version="0.3.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <preference name="loglevel" value="DEBUG" /> <feature name="Keyboard"> <param name="android-package" value="com.ionic.keyboard.IonicKeyboard" /> diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj index bb05ee63..a9addbce 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj +++ b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj @@ -61,7 +61,7 @@ A51DA261CB3F4B89BC98FFDE /* PushPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = E88AD47F098D47C99EC93E5B /* PushPlugin.m */; }; A7F71F118E604F32AE765DFD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38EE2AA2E4DD46CEA0DA5F7C /* QuartzCore.framework */; }; BC44C1F8D6E54E169B1C3024 /* CDVLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = F0AAFF41056245EFBF8D4D8F /* CDVLocation.m */; }; - C520CB1888FA4F4E963A4605 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34ADAA286CAF455C830BBC5A /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + C520CB1888FA4F4E963A4605 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34ADAA286CAF455C830BBC5A /* Social.framework */; settings = {ATTRIBUTES = (Required, ); }; }; C637100EF6E8411FA1763828 /* IonicKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 62533E046CE7411F9CEA6CD8 /* IonicKeyboard.m */; }; CE2E2F6D58504A0EA2470AEE /* CDVParsePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 3048B836F3BD467E83BFF217 /* CDVParsePlugin.m */; }; D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */; }; diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate Binary files differindex 7524205f..ecd31cc2 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate +++ b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist index 259f7c4d..b337c70c 100755 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist +++ b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist @@ -57,7 +57,7 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.3.3</string> + <string>0.3.4</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleURLTypes</key> @@ -70,7 +70,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>0.3.3</string> + <string>0.3.4</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/Stone Island/config.xml index 3dfdae4b..70a10a75 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/Stone Island/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget id="us.okfoc.stoneisland" version="0.3.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget id="us.okfoc.stoneisland" version="0.3.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <preference name="AllowInlineMediaPlayback" value="false" /> <preference name="BackupWebStorage" value="cloud" /> <preference name="DisallowOverscroll" value="false" /> diff --git a/StoneIsland/platforms/ios/www/js/index.js b/StoneIsland/platforms/ios/www/js/index.js index 77f8a782..050a729c 100755 --- a/StoneIsland/platforms/ios/www/js/index.js +++ b/StoneIsland/platforms/ios/www/js/index.js @@ -83,15 +83,13 @@ var app = (function(){ $("body").removeClass("loading") } - - var pause_time = 0 - app.paused = function(){ - - } - + var refresh_time = +Date.now() + app.paused = function(){} app.resumed = function(){ - if (! pause_time) return - if (Date.now() - pause_time > 60 * 60 * 1000) { + geo.fetch() + var now = +Date.now() + if (now - refresh_time > 60 * 60 * 1000) { + refresh_time = now app.blog.refresh() } } diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js index 5cd09d6c..b1fa1c97 100755 --- a/StoneIsland/platforms/ios/www/js/lib/_router.js +++ b/StoneIsland/platforms/ios/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/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js index 49c05ff6..dae7f98d 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/ios/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/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js index 4e771b62..5585ba71 100755 --- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/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/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js index 798920d1..53e99390 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js +++ b/StoneIsland/platforms/ios/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) { diff --git a/StoneIsland/www/js/index.js b/StoneIsland/www/js/index.js index 77f8a782..050a729c 100755 --- a/StoneIsland/www/js/index.js +++ b/StoneIsland/www/js/index.js @@ -83,15 +83,13 @@ var app = (function(){ $("body").removeClass("loading") } - - var pause_time = 0 - app.paused = function(){ - - } - + var refresh_time = +Date.now() + app.paused = function(){} app.resumed = function(){ - if (! pause_time) return - if (Date.now() - pause_time > 60 * 60 * 1000) { + geo.fetch() + var now = +Date.now() + if (now - refresh_time > 60 * 60 * 1000) { + refresh_time = now app.blog.refresh() } } diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 5cd09d6c..b1fa1c97 100755 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/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/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js index 49c05ff6..dae7f98d 100755 --- a/StoneIsland/www/js/lib/blogs/HubView.js +++ b/StoneIsland/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/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js index 4e771b62..5585ba71 100755 --- a/StoneIsland/www/js/lib/etc/push.js +++ b/StoneIsland/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/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index 798920d1..53e99390 100755 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/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) { |
