diff options
Diffstat (limited to 'StoneIsland/platforms/android/assets')
19 files changed, 708 insertions, 52 deletions
diff --git a/StoneIsland/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js b/StoneIsland/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js index 2e9aa67b..2e9aa67b 100755..100644 --- a/StoneIsland/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js +++ b/StoneIsland/platforms/android/assets/www/cordova-js-src/android/nativeapiprovider.js diff --git a/StoneIsland/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js b/StoneIsland/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js index f7fb6bc7..f7fb6bc7 100755..100644 --- a/StoneIsland/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js +++ b/StoneIsland/platforms/android/assets/www/cordova-js-src/android/promptbasednativeapi.js diff --git a/StoneIsland/platforms/android/assets/www/cordova-js-src/exec.js b/StoneIsland/platforms/android/assets/www/cordova-js-src/exec.js index fa8b41be..f73d87a1 100755..100644 --- a/StoneIsland/platforms/android/assets/www/cordova-js-src/exec.js +++ b/StoneIsland/platforms/android/assets/www/cordova-js-src/exec.js @@ -51,10 +51,11 @@ var cordova = require('cordova'), // For the ONLINE_EVENT to be viable, it would need to intercept all event // listeners (both through addEventListener and window.ononline) as well // as set the navigator property itself. - ONLINE_EVENT: 2 + ONLINE_EVENT: 2, + EVAL_BRIDGE: 3 }, jsToNativeBridgeMode, // Set lazily. - nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT, + nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE, pollEnabled = false, bridgeSecret = -1; @@ -77,6 +78,9 @@ function androidExec(success, fail, service, action, args) { androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); } + // If args is not provided, default to an empty array + args = args || []; + // Process any ArrayBuffers in the args into a string. for (var i = 0; i < args.length; i++) { if (utils.typeName(args[i]) == 'ArrayBuffer') { @@ -86,7 +90,6 @@ function androidExec(success, fail, service, action, args) { var callbackId = service + cordova.callbackId++, argsJson = JSON.stringify(args); - if (success || fail) { cordova.callbacks[callbackId] = {success:success, fail:fail}; } @@ -106,6 +109,17 @@ function androidExec(success, fail, service, action, args) { } androidExec.init = function() { + //CB-11828 + //This failsafe checks the version of Android and if it's Jellybean, it switches it to + //using the Online Event bridge for communicating from Native to JS + // + //It's ugly, but it's necessary. + var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/); + var version_code = check && check[0].match(/4.[0-3].*/); + if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) { + nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT; + } + bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); channel.onNativeReady.fire(); }; diff --git a/StoneIsland/platforms/android/assets/www/cordova-js-src/platform.js b/StoneIsland/platforms/android/assets/www/cordova-js-src/platform.js index bffc6751..2bfd0247 100755..100644 --- a/StoneIsland/platforms/android/assets/www/cordova-js-src/platform.js +++ b/StoneIsland/platforms/android/assets/www/cordova-js-src/platform.js @@ -19,6 +19,9 @@ * */ +// The last resume event that was received that had the result of a plugin call. +var lastResumeEvent = null; + module.exports = { id: 'android', bootstrap: function() { @@ -58,6 +61,19 @@ module.exports = { bindButtonChannel('volumeup'); bindButtonChannel('volumedown'); + // The resume event is not "sticky", but it is possible that the event + // will contain the result of a plugin call. We need to ensure that the + // plugin result is delivered even after the event is fired (CB-10498) + var cordovaAddEventListener = document.addEventListener; + + document.addEventListener = function(evt, handler, capture) { + cordovaAddEventListener(evt, handler, capture); + + if (evt === 'resume' && lastResumeEvent) { + handler(lastResumeEvent); + } + }; + // Let native code know we are all done on the JS side. // Native code will then un-hide the WebView. channel.onCordovaReady.subscribe(function() { @@ -79,12 +95,30 @@ function onMessageFromNative(msg) { case 'searchbutton': // App life cycle events case 'pause': - case 'resume': // Volume events case 'volumedownbutton': case 'volumeupbutton': cordova.fireDocumentEvent(action); break; + case 'resume': + if(arguments.length > 1 && msg.pendingResult) { + if(arguments.length === 2) { + msg.pendingResult.result = arguments[1]; + } else { + // The plugin returned a multipart message + var res = []; + for(var i = 1; i < arguments.length; i++) { + res.push(arguments[i]); + } + msg.pendingResult.result = res; + } + + // Save the plugin result so that it can be delivered to the js + // even if they miss the initial firing of the event + lastResumeEvent = msg; + } + cordova.fireDocumentEvent(action, msg); + break; default: throw new Error('Unknown event action ' + action); } diff --git a/StoneIsland/platforms/android/assets/www/cordova-js-src/plugin/android/app.js b/StoneIsland/platforms/android/assets/www/cordova-js-src/plugin/android/app.js index 22cf96e8..22cf96e8 100755..100644 --- a/StoneIsland/platforms/android/assets/www/cordova-js-src/plugin/android/app.js +++ b/StoneIsland/platforms/android/assets/www/cordova-js-src/plugin/android/app.js diff --git a/StoneIsland/platforms/android/assets/www/cordova.js b/StoneIsland/platforms/android/assets/www/cordova.js index 23f6e475..18c020e7 100755..100644 --- a/StoneIsland/platforms/android/assets/www/cordova.js +++ b/StoneIsland/platforms/android/assets/www/cordova.js @@ -1,5 +1,5 @@ // Platform: android -// 2c29e187e4206a6a77fba940ef6f77aef5c7eb8c +// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '4.1.1'; +var PLATFORM_VERSION_BUILD_LABEL = '6.1.2'; // file: src/scripts/require.js /*jshint -W079 */ @@ -101,7 +101,9 @@ if (typeof module === "object" && typeof require === "function") { // file: src/cordova.js define("cordova", function(require, exports, module) { -if(window.cordova){ +// Workaround for Windows 10 in hosted environment case +// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object +if (window.cordova && !(window.cordova instanceof HTMLElement)) { throw new Error("cordova already defined"); } @@ -740,8 +742,13 @@ var Channel = function(type, sticky) { } }; -function forceFunction(f) { - if (typeof f != 'function') throw "Function required as first argument!"; +function checkSubscriptionArgument(argument) { + if (typeof argument !== "function" && typeof argument.handleEvent !== "function") { + throw new Error( + "Must provide a function or an EventListener object " + + "implementing the handleEvent interface." + ); + } } /** @@ -751,28 +758,39 @@ function forceFunction(f) { * and a guid that can be used to stop subscribing to the channel. * Returns the guid. */ -Channel.prototype.subscribe = function(f, c) { - // need a function to call - forceFunction(f); +Channel.prototype.subscribe = function(eventListenerOrFunction, eventListener) { + checkSubscriptionArgument(eventListenerOrFunction); + var handleEvent, guid; + + if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") { + // Received an EventListener object implementing the handleEvent interface + handleEvent = eventListenerOrFunction.handleEvent; + eventListener = eventListenerOrFunction; + } else { + // Received a function to handle event + handleEvent = eventListenerOrFunction; + } + if (this.state == 2) { - f.apply(c || this, this.fireArgs); + handleEvent.apply(eventListener || this, this.fireArgs); return; } - var func = f, - guid = f.observer_guid; - if (typeof c == "object") { func = utils.close(c, f); } + guid = eventListenerOrFunction.observer_guid; + if (typeof eventListener === "object") { + handleEvent = utils.close(eventListener, handleEvent); + } if (!guid) { - // first time any channel has seen this subscriber + // First time any channel has seen this subscriber guid = '' + nextGuid++; } - func.observer_guid = guid; - f.observer_guid = guid; + handleEvent.observer_guid = guid; + eventListenerOrFunction.observer_guid = guid; // Don't add the same handler more than once. if (!this.handlers[guid]) { - this.handlers[guid] = func; + this.handlers[guid] = handleEvent; this.numHandlers++; if (this.numHandlers == 1) { this.onHasSubscribersChange && this.onHasSubscribersChange(); @@ -783,12 +801,20 @@ Channel.prototype.subscribe = function(f, c) { /** * Unsubscribes the function with the given guid from the channel. */ -Channel.prototype.unsubscribe = function(f) { - // need a function to unsubscribe - forceFunction(f); +Channel.prototype.unsubscribe = function(eventListenerOrFunction) { + checkSubscriptionArgument(eventListenerOrFunction); + var handleEvent, guid, handler; - var guid = f.observer_guid, - handler = this.handlers[guid]; + if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") { + // Received an EventListener object implementing the handleEvent interface + handleEvent = eventListenerOrFunction.handleEvent; + } else { + // Received a function to handle event + handleEvent = eventListenerOrFunction; + } + + guid = handleEvent.observer_guid; + handler = this.handlers[guid]; if (handler) { delete this.handlers[guid]; this.numHandlers--; @@ -895,10 +921,11 @@ var cordova = require('cordova'), // For the ONLINE_EVENT to be viable, it would need to intercept all event // listeners (both through addEventListener and window.ononline) as well // as set the navigator property itself. - ONLINE_EVENT: 2 + ONLINE_EVENT: 2, + EVAL_BRIDGE: 3 }, jsToNativeBridgeMode, // Set lazily. - nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT, + nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE, pollEnabled = false, bridgeSecret = -1; @@ -921,6 +948,9 @@ function androidExec(success, fail, service, action, args) { androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); } + // If args is not provided, default to an empty array + args = args || []; + // Process any ArrayBuffers in the args into a string. for (var i = 0; i < args.length; i++) { if (utils.typeName(args[i]) == 'ArrayBuffer') { @@ -930,7 +960,6 @@ function androidExec(success, fail, service, action, args) { var callbackId = service + cordova.callbackId++, argsJson = JSON.stringify(args); - if (success || fail) { cordova.callbacks[callbackId] = {success:success, fail:fail}; } @@ -950,6 +979,17 @@ function androidExec(success, fail, service, action, args) { } androidExec.init = function() { + //CB-11828 + //This failsafe checks the version of Android and if it's Jellybean, it switches it to + //using the Online Event bridge for communicating from Native to JS + // + //It's ugly, but it's necessary. + var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/); + var version_code = check && check[0].match(/4.[0-3].*/); + if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) { + nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT; + } + bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); channel.onNativeReady.fire(); }; @@ -1291,10 +1331,12 @@ define("cordova/init_b", function(require, exports, module) { var channel = require('cordova/channel'); var cordova = require('cordova'); +var modulemapper = require('cordova/modulemapper'); var platform = require('cordova/platform'); +var pluginloader = require('cordova/pluginloader'); var utils = require('cordova/utils'); -var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady]; +var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady, channel.onPluginsReady]; // setting exec cordova.exec = require('cordova/exec'); @@ -1379,10 +1421,19 @@ if (window._nativeReady) { // Call the platform-specific initialization. platform.bootstrap && platform.bootstrap(); +// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. +// The delay allows the attached modules to be defined before the plugin loader looks for them. +setTimeout(function() { + pluginloader.load(function() { + channel.onPluginsReady.fire(); + }); +}, 0); + /** * Create all cordova objects once native side is ready. */ channel.join(function() { + modulemapper.mapModules(window); platform.initialize && platform.initialize(); @@ -1501,9 +1552,109 @@ exports.reset(); }); +// file: src/common/modulemapper_b.js +define("cordova/modulemapper_b", function(require, exports, module) { + +var builder = require('cordova/builder'), + symbolList = [], + deprecationMap; + +exports.reset = function() { + symbolList = []; + deprecationMap = {}; +}; + +function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { + symbolList.push(strategy, moduleName, symbolPath); + if (opt_deprecationMessage) { + deprecationMap[symbolPath] = opt_deprecationMessage; + } +} + +// Note: Android 2.3 does have Function.bind(). +exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) { + addEntry('c', moduleName, symbolPath, opt_deprecationMessage); +}; + +exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) { + addEntry('m', moduleName, symbolPath, opt_deprecationMessage); +}; + +exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) { + addEntry('d', moduleName, symbolPath, opt_deprecationMessage); +}; + +exports.runs = function(moduleName) { + addEntry('r', moduleName, null); +}; + +function prepareNamespace(symbolPath, context) { + if (!symbolPath) { + return context; + } + var parts = symbolPath.split('.'); + var cur = context; + for (var i = 0, part; part = parts[i]; ++i) { + cur = cur[part] = cur[part] || {}; + } + return cur; +} + +exports.mapModules = function(context) { + var origSymbols = {}; + context.CDV_origSymbols = origSymbols; + for (var i = 0, len = symbolList.length; i < len; i += 3) { + var strategy = symbolList[i]; + var moduleName = symbolList[i + 1]; + var module = require(moduleName); + // <runs/> + if (strategy == 'r') { + continue; + } + var symbolPath = symbolList[i + 2]; + var lastDot = symbolPath.lastIndexOf('.'); + var namespace = symbolPath.substr(0, lastDot); + var lastName = symbolPath.substr(lastDot + 1); + + var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; + var parentObj = prepareNamespace(namespace, context); + var target = parentObj[lastName]; + + if (strategy == 'm' && target) { + builder.recursiveMerge(target, module); + } else if ((strategy == 'd' && !target) || (strategy != 'd')) { + if (!(symbolPath in origSymbols)) { + origSymbols[symbolPath] = target; + } + builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); + } + } +}; + +exports.getOriginalSymbol = function(context, symbolPath) { + var origSymbols = context.CDV_origSymbols; + if (origSymbols && (symbolPath in origSymbols)) { + return origSymbols[symbolPath]; + } + var parts = symbolPath.split('.'); + var obj = context; + for (var i = 0; i < parts.length; ++i) { + obj = obj && obj[parts[i]]; + } + return obj; +}; + +exports.reset(); + + +}); + // file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js define("cordova/platform", function(require, exports, module) { +// The last resume event that was received that had the result of a plugin call. +var lastResumeEvent = null; + module.exports = { id: 'android', bootstrap: function() { @@ -1543,6 +1694,19 @@ module.exports = { bindButtonChannel('volumeup'); bindButtonChannel('volumedown'); + // The resume event is not "sticky", but it is possible that the event + // will contain the result of a plugin call. We need to ensure that the + // plugin result is delivered even after the event is fired (CB-10498) + var cordovaAddEventListener = document.addEventListener; + + document.addEventListener = function(evt, handler, capture) { + cordovaAddEventListener(evt, handler, capture); + + if (evt === 'resume' && lastResumeEvent) { + handler(lastResumeEvent); + } + }; + // Let native code know we are all done on the JS side. // Native code will then un-hide the WebView. channel.onCordovaReady.subscribe(function() { @@ -1564,12 +1728,30 @@ function onMessageFromNative(msg) { case 'searchbutton': // App life cycle events case 'pause': - case 'resume': // Volume events case 'volumedownbutton': case 'volumeupbutton': cordova.fireDocumentEvent(action); break; + case 'resume': + if(arguments.length > 1 && msg.pendingResult) { + if(arguments.length === 2) { + msg.pendingResult.result = arguments[1]; + } else { + // The plugin returned a multipart message + var res = []; + for(var i = 1; i < arguments.length; i++) { + res.push(arguments[i]); + } + msg.pendingResult.result = res; + } + + // Save the plugin result so that it can be delivered to the js + // even if they miss the initial firing of the event + lastResumeEvent = msg; + } + cordova.fireDocumentEvent(action, msg); + break; default: throw new Error('Unknown event action ' + action); } @@ -1673,10 +1855,6 @@ module.exports = { // file: src/common/pluginloader.js define("cordova/pluginloader", function(require, exports, module) { -/* - NOTE: this file is NOT used when we use the browserify workflow -*/ - var modulemapper = require('cordova/modulemapper'); var urlutil = require('cordova/urlutil'); @@ -1786,6 +1964,54 @@ exports.load = function(callback) { }); +// file: src/common/pluginloader_b.js +define("cordova/pluginloader_b", function(require, exports, module) { + +var modulemapper = require('cordova/modulemapper'); + +// Handler for the cordova_plugins.js content. +// See plugman's plugin_loader.js for the details of this object. +function handlePluginsObject(moduleList) { + // if moduleList is not defined or empty, we've nothing to do + if (!moduleList || !moduleList.length) { + return; + } + + // Loop through all the modules and then through their clobbers and merges. + for (var i = 0, module; module = moduleList[i]; i++) { + if (module.clobbers && module.clobbers.length) { + for (var j = 0; j < module.clobbers.length; j++) { + modulemapper.clobbers(module.id, module.clobbers[j]); + } + } + + if (module.merges && module.merges.length) { + for (var k = 0; k < module.merges.length; k++) { + modulemapper.merges(module.id, module.merges[k]); + } + } + + // Finally, if runs is truthy we want to simply require() the module. + if (module.runs) { + modulemapper.runs(module.id); + } + } +} + +// Loads all plugins' js-modules. Plugin loading is syncronous in browserified bundle +// but the method accepts callback to be compatible with non-browserify flow. +// onDeviceReady is blocked on onPluginsReady. onPluginsReady is fired when there are +// no plugins to load, or they are all done. +exports.load = function(callback) { + var moduleList = require("cordova/plugin_list"); + handlePluginsObject(moduleList); + + callback(); +}; + + +}); + // file: src/common/urlutil.js define("cordova/urlutil", function(require, exports, module) { @@ -1895,7 +2121,10 @@ utils.clone = function(obj) { retVal = {}; for(i in obj){ - if(!(i in retVal) || retVal[i] != obj[i]) { + // https://issues.apache.org/jira/browse/CB-11522 'unknown' type may be returned in + // custom protocol activation case on Windows Phone 8.1 causing "No such interface supported" exception + // on cloning. + if((!(i in retVal) || retVal[i] != obj[i]) && typeof obj[i] != 'undefined' && typeof obj[i] != 'unknown') { retVal[i] = utils.clone(obj[i]); } } diff --git a/StoneIsland/platforms/android/assets/www/cordova_plugins.js b/StoneIsland/platforms/android/assets/www/cordova_plugins.js index a2734881..722b1683 100755 --- a/StoneIsland/platforms/android/assets/www/cordova_plugins.js +++ b/StoneIsland/platforms/android/assets/www/cordova_plugins.js @@ -104,6 +104,14 @@ module.exports = [ "cordova.plugins.Keyboard" ], "runs": true + }, + { + "id": "phonegap-plugin-push.PushNotification", + "file": "plugins/phonegap-plugin-push/www/push.js", + "pluginId": "phonegap-plugin-push", + "clobbers": [ + "PushNotification" + ] } ]; module.exports.metadata = @@ -121,7 +129,8 @@ module.exports.metadata = "cordova-plugin-splashscreen": "4.0.0", "cordova-plugin-compat": "1.1.0", "cordova-plugin-geolocation": "2.4.0", - "ionic-plugin-keyboard": "2.2.1" -} + "ionic-plugin-keyboard": "2.2.1", + "phonegap-plugin-push": "1.9.2" +}; // BOTTOM OF METADATA });
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/css/products.css b/StoneIsland/platforms/android/assets/www/css/products.css index e067e05a..bdfed42a 100755 --- a/StoneIsland/platforms/android/assets/www/css/products.css +++ b/StoneIsland/platforms/android/assets/www/css/products.css @@ -24,7 +24,6 @@ height: 126vw; } - .product #product { display: block } #product { display: none; @@ -224,7 +223,11 @@ padding-bottom:45px; } #collection h1 { -background:white + background-color: white; + background-image: url(../img/angle-down.png); + background-size: contain; + background-position: top right; + background-repeat: no-repeat; } #selector { diff --git a/StoneIsland/platforms/android/assets/www/img/angle-down.png b/StoneIsland/platforms/android/assets/www/img/angle-down.png Binary files differnew file mode 100644 index 00000000..e0b3b00f --- /dev/null +++ b/StoneIsland/platforms/android/assets/www/img/angle-down.png diff --git a/StoneIsland/platforms/android/assets/www/index.html b/StoneIsland/platforms/android/assets/www/index.html index 768e3140..9c86e559 100755 --- a/StoneIsland/platforms/android/assets/www/index.html +++ b/StoneIsland/platforms/android/assets/www/index.html @@ -355,7 +355,7 @@ <input type="email" name="Email" placeholder="EMAIL ADDRESS" required> <input type="email" name="ConfirmEmail" placeholder="CONFIRM EMAIL ADDRESS" required> <div class="select-wrapper date-wrapper"> - <span>BIRTHDAY (MM/DD/YYYY)</span> + <span>BIRTHDAY (OPTIONAL)</span> <input type="date" name="BirthDay" min="1900-01-01" placeholder="BIRTHDAY (MM/DD/YYYY)" required> </div> @@ -1136,6 +1136,7 @@ <script src="js/lib/products/CollectionView.js"></script> <script src="js/lib/products/filters/CategoryFilter.js"></script> +<script src="js/lib/products/filters/DepartmentFilter.js"></script> <script src="js/lib/products/ClosedStoreView.js"></script> <script src="js/lib/products/ProductView.js"></script> <script src="js/lib/products/GalleryView.js"></script> diff --git a/StoneIsland/platforms/android/assets/www/js/index.js b/StoneIsland/platforms/android/assets/www/js/index.js index 6bea75d0..76a8af05 100755 --- a/StoneIsland/platforms/android/assets/www/js/index.js +++ b/StoneIsland/platforms/android/assets/www/js/index.js @@ -8,7 +8,7 @@ var app = (function(){ app.bind() app.build() - + app.iscroll_options = { mouseWheel: true, scrollbars: true, 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 8d9cf52d..fd0c1887 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js @@ -49,7 +49,7 @@ var SignupView = FormView.extend({ "Surname": "Please enter your last name.", "Email": "Please enter a valid email address.", "ConfirmEmail": "Please enter a valid email address.", - "BirthDay": "Please enter your birthday.", + // "BirthDay": "Please enter your birthday.", "Password": "Please enter your password.", "Password2": "Please enter your password again.", "DataProfiling": "You must agree to data profiling.", 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 b7c80520..5ee7f641 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js @@ -31,7 +31,7 @@ var BlogView = View.extend({ this.loaded = true this.data = data = typeof data == "string" ? JSON.parse(data) : data - switch (data.store[0].StoreStatus) { + switch (data.store[0].DepartmentStoreStatus) { case "open": app.closed.storeIsClosed = false break @@ -46,9 +46,9 @@ var BlogView = View.extend({ app.closed.populate(data.store[0].ClosedStoreImages) } else { - app.gallery_id = data.store[0].CollectionId - app.department_id = data.store[0].DepartmentId - app.collection.setCollectionName( data.store[0].collection ) + app.departments = data.store[0].Departments + app.department_id = data.store[0].Departments[0].uri + app.collection.setCollectionName( data.store[0].Departments[0].text ) app.collection.loaded = false app.collection.fetch() } 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 1657d295..013c2b45 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js @@ -167,6 +167,7 @@ var HubLoader = (function(){ } HubLoader.build = function(){ view.append(item) + view.scroller.refresh() setTimeout(HubLoader.load, 20) } return HubLoader 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 b9a7755f..671d36b3 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js @@ -14,6 +14,7 @@ var CollectionView = ScrollableView.extend({ "mousedown .item": "touchstart", "mousemove .item": "touchmove", "mouseup .item": "touchend", + "touchstart h1": "showDepartmentSelector", }, initialize: function(){ @@ -21,7 +22,7 @@ var CollectionView = ScrollableView.extend({ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#collection', app.iscroll_options) - this.filterView = new CategoryFilter ({ parent: this }) + this.filterView = new DepartmentFilter ({ parent: this }) }, show: function(){ @@ -85,7 +86,7 @@ var CollectionView = ScrollableView.extend({ } console.log(">>>>>>>> YES ") if (! this.loaded) { - console.log("populate 3") + console.log("populate 3", data.SearchResponseFull.Results.Items.length) this.loaded = true this.$loader.hide() this.$content.empty() @@ -140,6 +141,10 @@ var CollectionView = ScrollableView.extend({ this.$title.html(this.collectionName) }, + showDepartmentSelector: function(){ + this.filterView.filter() + }, + firstTouch: { x: 0, y: 0, id: "" }, lastTouch: { x: 0, y: 0, id: "" }, touchstart: function(e){ 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 cfb39f20..81ad536d 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js @@ -118,8 +118,8 @@ var ProductView = ScrollableView.extend({ var title = name_partz.join(' ') var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" - var body = descriptions['Details'] + "<br>" + descriptions['EditorialDescription'] - body = body.replace(/<br>/g, "<br><br>").replace(/(<br>)+$/, "") + var body = descriptions['Details'] + " " + descriptions['EditorialDescription'] + // body = body.replace(/<br>/g, "<br><br>").replace(/(<br>)+$/, "") var default_color_id = this.populate_selectors(data, details) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/Selector.js b/StoneIsland/platforms/android/assets/www/js/lib/products/Selector.js index 6db33b68..9c1109f6 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/Selector.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/Selector.js @@ -5,7 +5,7 @@ var Selector = View.extend({ events: { "click .close": "hide", - "click .options div": "pick", + "touchstart .options div": "pick", }, initialize: function(){ @@ -67,4 +67,4 @@ var Selector = View.extend({ this.hide() }, -})
\ No newline at end of file +}) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/filters/DepartmentFilter.js b/StoneIsland/platforms/android/assets/www/js/lib/products/filters/DepartmentFilter.js new file mode 100644 index 00000000..cc0d925e --- /dev/null +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/filters/DepartmentFilter.js @@ -0,0 +1,31 @@ +var DepartmentFilter = View.extend({ + + initialize: function(opt){ + this.parent = opt.parent + }, + + filter: function(){ + var deps = app.departments.map(function(dep){ + console.log(dep) + return { + id: dep.uri, + label: dep.text, + } + }) + app.selector.select("wide", deps, this.pick.bind(this)) + }, + + last_choice: null, + + pick: function(choice){ + this.parent.$content.empty() + this.last_choice = choice + app.department_id = choice.id + app.collection.loaded = false + app.collection.fetch() + app.footer.hide() + app.collection.setCollectionName(choice.label) + this.parent.deferScrollToTop() + }, + +}) diff --git a/StoneIsland/platforms/android/assets/www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/android/assets/www/plugins/phonegap-plugin-push/www/push.js new file mode 100644 index 00000000..a5315486 --- /dev/null +++ b/StoneIsland/platforms/android/assets/www/plugins/phonegap-plugin-push/www/push.js @@ -0,0 +1,329 @@ +cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { +/* global cordova:false */ +/* globals window */ + +/*! + * Module dependencies. + */ + +var exec = cordova.require('cordova/exec'); + +/** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + +var PushNotification = function(options) { + this._handlers = { + 'registration': [], + 'notification': [], + 'error': [] + }; + + // require options parameter + if (typeof options === 'undefined') { + throw new Error('The options argument is required.'); + } + + // store the options to this object instance + this.options = options; + + // triggered on registration and notification + var that = this; + var success = function(result) { + if (result && typeof result.registrationId !== 'undefined') { + that.emit('registration', result); + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { + var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { + var namespaces = callbackName.split('.'); + var func = namespaces.pop(); + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } + + if (typeof context[func] === 'function') { + context[func].call(context, arg); + } else { + that.emit(callbackName, arg); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + that.emit('notification', result); + } + }; + + // triggered on error + var fail = function(msg) { + var e = (typeof msg === 'string') ? new Error(msg) : msg; + that.emit('error', e); + }; + + // wait at least one process tick to allow event subscriptions + setTimeout(function() { + exec(success, fail, 'PushNotification', 'init', [options]); + }, 10); +}; + +/** + * Unregister from push notifications + */ + +PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { + if (!errorCallback) { errorCallback = function() {}; } + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.unregister failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter must be a function'); + return; + } + + var that = this; + var cleanHandlersAndPassThrough = function() { + if (!options) { + that._handlers = { + 'registration': [], + 'notification': [], + 'error': [] + }; + } + successCallback(); + }; + + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); +}; + +/** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ +PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { + if (!errorCallback) { errorCallback = function() {}; } + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); +}; + +/** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ +PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { + if (!errorCallback) { errorCallback = function() {}; } + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); +}; + +/** + * Call this to set the application icon badge + */ + +PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { + if (!errorCallback) { errorCallback = function() {}; } + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); +}; + +/** + * Get the application icon badge + */ + +PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { + if (!errorCallback) { errorCallback = function() {}; } + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); +}; + +/** + * Get the application icon badge + */ + +PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { + if (!successCallback) { successCallback = function() {}; } + if (!errorCallback) { errorCallback = function() {}; } + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); +}; + +/** + * Listen for an event. + * + * Any event is supported, but the following are built-in: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ + +PushNotification.prototype.on = function(eventName, callback) { + if (!this._handlers.hasOwnProperty(eventName)) { + this._handlers[eventName] = []; + } + this._handlers[eventName].push(callback); +}; + +/** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ + +PushNotification.prototype.off = function (eventName, handle) { + if (this._handlers.hasOwnProperty(eventName)) { + var handleIndex = this._handlers[eventName].indexOf(handle); + if (handleIndex >= 0) { + this._handlers[eventName].splice(handleIndex, 1); + } + } +}; + +/** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ + +PushNotification.prototype.emit = function() { + var args = Array.prototype.slice.call(arguments); + var eventName = args.shift(); + + if (!this._handlers.hasOwnProperty(eventName)) { + return false; + } + + for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { + var callback = this._handlers[eventName][i]; + if (typeof callback === 'function') { + callback.apply(undefined,args); + } else { + console.log('event handler: ' + eventName + ' must be a function'); + } + } + + return true; +}; + +PushNotification.prototype.finish = function(successCallback, errorCallback, id) { + if (!successCallback) { successCallback = function() {}; } + if (!errorCallback) { errorCallback = function() {}; } + if (!id) { id = 'handler'; } + + if (typeof successCallback !== 'function') { + console.log('finish failure: success callback parameter must be a function'); + return; + } + + if (typeof errorCallback !== 'function') { + console.log('finish failure: failure parameter not a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); +}; + +/*! + * Push Notification Plugin. + */ + +module.exports = { + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ + + init: function(options) { + return new PushNotification(options); + }, + + hasPermission: function(successCallback, errorCallback) { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, + + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + + PushNotification: PushNotification +}; + +}); |
