From 6a9186aea6b85beef28e3eb765fbf2322a1c7890 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Sep 2017 00:47:11 +0200 Subject: wtf broken --- StoneIsland/config.xml | 24 +++++++- StoneIsland/package-lock.json | 24 ++++++++ StoneIsland/package.json | 6 +- StoneIsland/platforms/android/android.json | 17 +++++- .../android/assets/www/cordova_plugins.js | 3 +- .../android/platform_www/cordova_plugins.js | 3 +- StoneIsland/platforms/android/res/xml/config.xml | 1 + .../UserInterfaceState.xcuserstate | Bin 59744 -> 111565 bytes .../Resources/GoogleService-Info.plist | 34 +++++++++++ .../Resources/Resources/GoogleService-Info.plist | 40 +++++++++++++ .../ios/Stone Island/Stone Island-Info.plist | 4 +- StoneIsland/platforms/ios/Stone Island/config.xml | 10 ++-- StoneIsland/platforms/ios/ios.json | 19 +++++- .../platforms/ios/platform_www/cordova_plugins.js | 3 +- StoneIsland/platforms/ios/www/cordova_plugins.js | 3 +- StoneIsland/platforms/ios/www/js/lib/_router.js | 3 + StoneIsland/platforms/ios/www/js/lib/etc/push.js | 8 +-- .../ios/www/js/lib/products/ProductView.js | 2 + StoneIsland/platforms/ios/www/js/sdk/auth.js | 4 ++ StoneIsland/plugins/android.json | 4 ++ .../plugins/cordova-plugin-app-name/LICENSE | 21 +++++++ .../plugins/cordova-plugin-app-name/README.md | 26 ++++++++ .../plugins/cordova-plugin-app-name/package.json | 66 +++++++++++++++++++++ .../plugins/cordova-plugin-app-name/plugin.xml | 31 ++++++++++ .../cordova-plugin-app-name/scripts/npm-install.js | 8 +++ .../scripts/sync-plugin-version.js | 12 ++++ .../cordova-plugin-app-name/src/rename-app.js | 63 ++++++++++++++++++++ StoneIsland/plugins/fetch.json | 10 ++++ StoneIsland/plugins/ios.json | 4 ++ StoneIsland/www/js/lib/_router.js | 3 + StoneIsland/www/js/lib/products/ProductView.js | 2 + StoneIsland/www/js/sdk/auth.js | 4 ++ 32 files changed, 441 insertions(+), 21 deletions(-) create mode 100644 StoneIsland/platforms/ios/Stone Island/Resources/Resources/GoogleService-Info.plist create mode 100644 StoneIsland/plugins/cordova-plugin-app-name/LICENSE create mode 100644 StoneIsland/plugins/cordova-plugin-app-name/README.md create mode 100644 StoneIsland/plugins/cordova-plugin-app-name/package.json create mode 100644 StoneIsland/plugins/cordova-plugin-app-name/plugin.xml create mode 100644 StoneIsland/plugins/cordova-plugin-app-name/scripts/npm-install.js create mode 100644 StoneIsland/plugins/cordova-plugin-app-name/scripts/sync-plugin-version.js create mode 100755 StoneIsland/plugins/cordova-plugin-app-name/src/rename-app.js diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml index da6b1387..5126ce0e 100755 --- a/StoneIsland/config.xml +++ b/StoneIsland/config.xml @@ -1,6 +1,6 @@ - Stone Island + StoneIsland Stone Island @@ -41,7 +41,25 @@ - + + + + + - + + + + + + + + + + + + + + + diff --git a/StoneIsland/package-lock.json b/StoneIsland/package-lock.json index bd618007..7de9b28c 100644 --- a/StoneIsland/package-lock.json +++ b/StoneIsland/package-lock.json @@ -1040,6 +1040,14 @@ } } }, + "cordova-plugin-app-name": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cordova-plugin-app-name/-/cordova-plugin-app-name-1.0.4.tgz", + "integrity": "sha1-FruwzRrwdAumNH66QPIgM0HU+z0=", + "requires": { + "xml2js": "0.4.19" + } + }, "cordova-plugin-firebase": { "version": "0.1.24", "resolved": "https://registry.npmjs.org/cordova-plugin-firebase/-/cordova-plugin-firebase-0.1.24.tgz", @@ -4674,6 +4682,22 @@ "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" } }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": "https://registry.npmjs.org/sax/-/sax-1.1.4.tgz", + "xmlbuilder": "9.0.4" + }, + "dependencies": { + "xmlbuilder": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz", + "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=" + } + } + }, "xmlbuilder": { "version": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.0.0.tgz", "integrity": "sha1-mLj2UcowqmJANvEn0RzGbce5B6M=", diff --git a/StoneIsland/package.json b/StoneIsland/package.json index 455528cc..5228669d 100644 --- a/StoneIsland/package.json +++ b/StoneIsland/package.json @@ -6,6 +6,7 @@ "dependencies": { "cordova": "^6.4.0", "cordova-ios": "^4.3.1", + "cordova-plugin-app-name": "^1.0.4", "cordova-plugin-firebase": "^0.1.24", "cordova-plugin-statusbar": "^2.2.3", "cordova-plugin-whitelist": "1", @@ -22,7 +23,10 @@ "plugins": { "cordova-plugin-whitelist": {}, "cordova-plugin-statusbar": {}, - "cordova-plugin-firebase": {} + "cordova-plugin-firebase": {}, + "cordova-plugin-app-name": { + "APP_NAME": "Stone Island" + } } } } \ No newline at end of file diff --git a/StoneIsland/platforms/android/android.json b/StoneIsland/platforms/android/android.json index c87b55d4..11c3ca04 100755 --- a/StoneIsland/platforms/android/android.json +++ b/StoneIsland/platforms/android/android.json @@ -210,6 +210,16 @@ } ] } + }, + "config.xml": { + "parents": { + "/*": [ + { + "xml": "", + "count": 1 + } + ] + } } } }, @@ -263,6 +273,10 @@ }, "cordova-plugin-firebase": { "PACKAGE_NAME": "us.okfoc.stoneisland" + }, + "cordova-plugin-app-name": { + "APP_NAME": "Stone Island", + "PACKAGE_NAME": "us.okfoc.stoneisland" } }, "dependent_plugins": {}, @@ -404,6 +418,7 @@ "ionic-plugin-keyboard": "2.2.1", "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24" + "cordova-plugin-firebase": "0.1.24", + "cordova-plugin-app-name": "1.0.4" } } \ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/cordova_plugins.js b/StoneIsland/platforms/android/assets/www/cordova_plugins.js index f462f716..ea5e1643 100755 --- a/StoneIsland/platforms/android/assets/www/cordova_plugins.js +++ b/StoneIsland/platforms/android/assets/www/cordova_plugins.js @@ -139,7 +139,8 @@ module.exports.metadata = "ionic-plugin-keyboard": "2.2.1", "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24" + "cordova-plugin-firebase": "0.1.24", + "cordova-plugin-app-name": "1.0.4" }; // BOTTOM OF METADATA }); \ No newline at end of file diff --git a/StoneIsland/platforms/android/platform_www/cordova_plugins.js b/StoneIsland/platforms/android/platform_www/cordova_plugins.js index f462f716..ea5e1643 100755 --- a/StoneIsland/platforms/android/platform_www/cordova_plugins.js +++ b/StoneIsland/platforms/android/platform_www/cordova_plugins.js @@ -139,7 +139,8 @@ module.exports.metadata = "ionic-plugin-keyboard": "2.2.1", "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24" + "cordova-plugin-firebase": "0.1.24", + "cordova-plugin-app-name": "1.0.4" }; // BOTTOM OF METADATA }); \ No newline at end of file diff --git a/StoneIsland/platforms/android/res/xml/config.xml b/StoneIsland/platforms/android/res/xml/config.xml index 57fa94d1..3125e402 100644 --- a/StoneIsland/platforms/android/res/xml/config.xml +++ b/StoneIsland/platforms/android/res/xml/config.xml @@ -77,4 +77,5 @@ + diff --git a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate index 06f45880..7d29ed0f 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate and b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/StoneIsland/platforms/ios/Stone Island/Resources/GoogleService-Info.plist b/StoneIsland/platforms/ios/Stone Island/Resources/GoogleService-Info.plist index 5516ebf3..0d23216d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Resources/GoogleService-Info.plist +++ b/StoneIsland/platforms/ios/Stone Island/Resources/GoogleService-Info.plist @@ -2,5 +2,39 @@ + AD_UNIT_ID_FOR_BANNER_TEST + ca-app-pub-3940256099942544/2934735716 + AD_UNIT_ID_FOR_INTERSTITIAL_TEST + ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + 426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt + API_KEY + AIzaSyAp9tJ_gK45ZhRDiaKOCgvsztQMbhsD_Ms + GCM_SENDER_ID + 426306878988 + PLIST_VERSION + 1 + BUNDLE_ID + us.okfoc.stoneisland + PROJECT_ID + stone-island + STORAGE_BUCKET + stone-island.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:426306878988:ios:0efb92963073829a + DATABASE_URL + https://stone-island.firebaseio.com \ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Resources/Resources/GoogleService-Info.plist b/StoneIsland/platforms/ios/Stone Island/Resources/Resources/GoogleService-Info.plist new file mode 100644 index 00000000..0d23216d --- /dev/null +++ b/StoneIsland/platforms/ios/Stone Island/Resources/Resources/GoogleService-Info.plist @@ -0,0 +1,40 @@ + + + + + AD_UNIT_ID_FOR_BANNER_TEST + ca-app-pub-3940256099942544/2934735716 + AD_UNIT_ID_FOR_INTERSTITIAL_TEST + ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + 426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt + API_KEY + AIzaSyAp9tJ_gK45ZhRDiaKOCgvsztQMbhsD_Ms + GCM_SENDER_ID + 426306878988 + PLIST_VERSION + 1 + BUNDLE_ID + us.okfoc.stoneisland + PROJECT_ID + stone-island + STORAGE_BUCKET + stone-island.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:426306878988:ios:0efb92963073829a + DATABASE_URL + https://stone-island.firebaseio.com + + \ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist index 22781695..016faa32 100644 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist +++ b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleDisplayName - ${PRODUCT_NAME} + Stone Island CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIcons @@ -17,7 +17,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - ${PRODUCT_NAME} + Stone Island CFBundlePackageType APPL CFBundleShortVersionString diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/Stone Island/config.xml index d955ecf8..46a44916 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/Stone Island/config.xml @@ -51,7 +51,11 @@ - Stone Island + + + + + StoneIsland Stone Island @@ -90,8 +94,4 @@ - - - - diff --git a/StoneIsland/platforms/ios/ios.json b/StoneIsland/platforms/ios/ios.json index 9596fcd6..2db25e88 100644 --- a/StoneIsland/platforms/ios/ios.json +++ b/StoneIsland/platforms/ios/ios.json @@ -98,6 +98,18 @@ "xml": "", "count": 1 } + ], + "CFBundleName": [ + { + "xml": "Stone Island", + "count": 1 + } + ], + "CFBundleDisplayName": [ + { + "xml": "Stone Island", + "count": 1 + } ] } }, @@ -190,6 +202,10 @@ }, "cordova-plugin-firebase": { "PACKAGE_NAME": "us.okfoc.stoneisland" + }, + "cordova-plugin-app-name": { + "APP_NAME": "Stone Island", + "PACKAGE_NAME": "us.okfoc.stoneisland" } }, "dependent_plugins": {}, @@ -357,6 +373,7 @@ "ionic-plugin-keyboard": "2.2.1", "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24" + "cordova-plugin-firebase": "0.1.24", + "cordova-plugin-app-name": "1.0.4" } } \ No newline at end of file diff --git a/StoneIsland/platforms/ios/platform_www/cordova_plugins.js b/StoneIsland/platforms/ios/platform_www/cordova_plugins.js index e39888f0..9005406d 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova_plugins.js +++ b/StoneIsland/platforms/ios/platform_www/cordova_plugins.js @@ -165,7 +165,8 @@ module.exports.metadata = "ionic-plugin-keyboard": "2.2.1", "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24" + "cordova-plugin-firebase": "0.1.24", + "cordova-plugin-app-name": "1.0.4" }; // BOTTOM OF METADATA }); \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/cordova_plugins.js b/StoneIsland/platforms/ios/www/cordova_plugins.js index e39888f0..9005406d 100644 --- a/StoneIsland/platforms/ios/www/cordova_plugins.js +++ b/StoneIsland/platforms/ios/www/cordova_plugins.js @@ -165,7 +165,8 @@ module.exports.metadata = "ionic-plugin-keyboard": "2.2.1", "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24" + "cordova-plugin-firebase": "0.1.24", + "cordova-plugin-app-name": "1.0.4" }; // BOTTOM OF METADATA }); \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js index 9927712a..43438854 100755 --- a/StoneIsland/platforms/ios/www/js/lib/_router.js +++ b/StoneIsland/platforms/ios/www/js/lib/_router.js @@ -87,6 +87,9 @@ var SiteRouter = Router.extend({ else { app.view = app[name] } + + window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) + app.header.set_back( !! app.view.back ) app.view.show() }.bind(this) diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js index 14236728..00a2e839 100755 --- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/www/js/lib/etc/push.js @@ -105,8 +105,8 @@ var push = (function(){ return sdk.cms() + '/_services/push/' + key } push.got_push_notification = function(push_obj) { - console.log('We received this push notification: ' + JSON.stringify(push_obj)); - window.zsazsa = push_obj + // console.log('We received this push notification: ' + JSON.stringify(push_obj)); + app.blog.refresh() push_obj.additionalData = push_obj.additionalData || {} @@ -119,10 +119,10 @@ var push = (function(){ catch (e) { } - if (is_hub || push_obj.additionalData.url)) { + if (is_hub) { app.intro.$alert.show().html("[ HUB UPDATED ]") } - else { + else if (! push_obj.additionalData.url) { auth.clear_cart() app.intro.$alert.show().html("[ STORE UPDATED ]") } diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js index 6a61be1b..2743946a 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js @@ -167,6 +167,8 @@ var ProductView = ScrollableView.extend({ this.$price.html(price) this.$body.html(body) + window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) + this.$productHeader.toggleClass("wide", title.length > 48) var fits_large = !! this.fitLargeCodes[this.code] diff --git a/StoneIsland/platforms/ios/www/js/sdk/auth.js b/StoneIsland/platforms/ios/www/js/sdk/auth.js index fa8dd71c..bcfb2d3a 100755 --- a/StoneIsland/platforms/ios/www/js/sdk/auth.js +++ b/StoneIsland/platforms/ios/www/js/sdk/auth.js @@ -51,6 +51,9 @@ var auth = sdk.auth = (function(){ localStorage.setItem("yoox.access_token", access_token) localStorage.setItem("yoox.user_id", user_id) + + window.FirebasePlugin && window.FirebasePlugin.setUserId(user_id) + cb && cb() } auth.get_user = function(cb){ @@ -63,6 +66,7 @@ var auth = sdk.auth = (function(){ auth.user_id = -1 localStorage.removeItem("yoox.access_token") localStorage.removeItem("yoox.user_id") + cb && cb() } diff --git a/StoneIsland/plugins/android.json b/StoneIsland/plugins/android.json index 67cc3c41..6ad5cf91 100755 --- a/StoneIsland/plugins/android.json +++ b/StoneIsland/plugins/android.json @@ -53,6 +53,10 @@ }, "cordova-plugin-firebase": { "PACKAGE_NAME": "us.okfoc.stoneisland" + }, + "cordova-plugin-app-name": { + "APP_NAME": "Stone Island", + "PACKAGE_NAME": "us.okfoc.stoneisland" } }, "dependent_plugins": { diff --git a/StoneIsland/plugins/cordova-plugin-app-name/LICENSE b/StoneIsland/plugins/cordova-plugin-app-name/LICENSE new file mode 100644 index 00000000..3b7b70c7 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-app-name/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 blakgeek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/StoneIsland/plugins/cordova-plugin-app-name/README.md b/StoneIsland/plugins/cordova-plugin-app-name/README.md new file mode 100644 index 00000000..a8680f30 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-app-name/README.md @@ -0,0 +1,26 @@ +# cordova-plugin-app-name +I created this plugin to address the issue of spaces in the names of my Cordova apps. + +## How does it work? +It adds an after_prepare hook that changes the value of app_name in strings.xml for Android and updates the "Project Name" and +"Project Display Name" in the plist for iOS. + +## How do I install it? + +If you're like me and using [Cordova CLI](http://cordova.apache.org/): +``` +cordova plugin add cordova-plugin-app-name --variable APP_NAME="Look I Got Spaces and Stuff!" +``` + +or + +``` +phonegap local plugin add cordova-plugin-app-name --variable APP_NAME="Look I Got Spaces and Stuff!" +``` + +## How do I use it? +Um ... See above :) + + + + diff --git a/StoneIsland/plugins/cordova-plugin-app-name/package.json b/StoneIsland/plugins/cordova-plugin-app-name/package.json new file mode 100644 index 00000000..5db6bb73 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-app-name/package.json @@ -0,0 +1,66 @@ +{ + "_from": "cordova-plugin-app-name", + "_id": "cordova-plugin-app-name@1.0.4", + "_inBundle": false, + "_integrity": "sha1-FruwzRrwdAumNH66QPIgM0HU+z0=", + "_location": "/cordova-plugin-app-name", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "cordova-plugin-app-name", + "name": "cordova-plugin-app-name", + "escapedName": "cordova-plugin-app-name", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/cordova-plugin-app-name/-/cordova-plugin-app-name-1.0.4.tgz", + "_shasum": "16bbb0cd1af0740ba6347eba40f2203341d4fb3d", + "_spec": "cordova-plugin-app-name", + "_where": "/Users/user/Sites/stone-island/StoneIsland/node_modules", + "bugs": { + "url": "https://github.com/blakgeek/cordova-plugin-app-name/issues" + }, + "bundleDependencies": false, + "cordova": { + "id": "cordova-plugin-app-name", + "platforms": [ + "ios", + "android" + ] + }, + "dependencies": { + "xml2js": "^0.4.16" + }, + "deprecated": false, + "description": "A Cordova/PhoneGap plugin that allows you to give you app a name with spaces and special characters and stuff.", + "devDependencies": { + "libxmljs": "^0.18.4" + }, + "homepage": "https://github.com/blakgeek/cordova-plugin-app-name", + "keywords": [ + "ecosystem:cordova", + "cordova-android", + "cordova-ios", + "cordova:plugin", + "spaces", + "app", + "name", + "rename" + ], + "license": "MIT", + "name": "cordova-plugin-app-name", + "repository": { + "type": "git", + "url": "git+https://github.com/blakgeek/cordova-plugin-app-name.git" + }, + "scripts": { + "postversion": "node scripts/sync-plugin-version.js; git add plugin.xml; git commit plugin.xml -m \"v${npm_package_version}\"" + }, + "version": "1.0.4" +} diff --git a/StoneIsland/plugins/cordova-plugin-app-name/plugin.xml b/StoneIsland/plugins/cordova-plugin-app-name/plugin.xml new file mode 100644 index 00000000..6e7c5480 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-app-name/plugin.xml @@ -0,0 +1,31 @@ + + + App Namer + Carlos "blakgeek" Lawton + + Cordova/Phonegap plugin that allows you to put spaces in the display name of your app. + + cordova, ios, app, name, spaces + MIT + + + + + + + + + + + + + + + + $APP_NAME + + + $APP_NAME + + + diff --git a/StoneIsland/plugins/cordova-plugin-app-name/scripts/npm-install.js b/StoneIsland/plugins/cordova-plugin-app-name/scripts/npm-install.js new file mode 100644 index 00000000..710905cf --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-app-name/scripts/npm-install.js @@ -0,0 +1,8 @@ +var exec = require('child_process').execSync; + +module.exports = function(context) { + + exec('npm install', { + cwd: context.opts.plugin.pluginInfo.dir + }); +}; \ No newline at end of file diff --git a/StoneIsland/plugins/cordova-plugin-app-name/scripts/sync-plugin-version.js b/StoneIsland/plugins/cordova-plugin-app-name/scripts/sync-plugin-version.js new file mode 100644 index 00000000..e3295cc9 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-app-name/scripts/sync-plugin-version.js @@ -0,0 +1,12 @@ +var fs = require('fs'); +var libxml = require('libxmljs'); +var version = process.env.npm_package_version; +var content = fs.readFileSync('plugin.xml'); +var xml = libxml.parseXmlString(content); +xml.get('/p:plugin', { + 'p': 'http://apache.org/cordova/ns/plugins/1.0' +}).attr({ + 'version': version +}); + +fs.writeFileSync('plugin.xml', xml.toString()); diff --git a/StoneIsland/plugins/cordova-plugin-app-name/src/rename-app.js b/StoneIsland/plugins/cordova-plugin-app-name/src/rename-app.js new file mode 100755 index 00000000..3eb4d211 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-app-name/src/rename-app.js @@ -0,0 +1,63 @@ +#!/usr/bin/env node + +var fs = require('fs'); +var path = require("path"); +var xml2js = require('xml2js'); +var parser = new xml2js.Parser(); +var builder = new xml2js.Builder({ + xmldec: { + version: '1.0', + encoding: 'UTF-8' + } +}); + +module.exports = function (context) { + + if(context.opts.platforms.indexOf('android') === -1) return; + + console.log('Attempting to set app name'); + + var projectRoot = context.opts.projectRoot; + var configPath = path.join(projectRoot, 'platforms', 'android', 'res', 'xml', 'config.xml'); + var stringsPath = path.join(projectRoot, 'platforms', 'android', 'res', 'values', 'strings.xml'); + var stringsXml, name; + + // make sure the android config file exists + try { + fs.accessSync(configPath, fs.F_OK); + } catch(e) { + return; + } + + name = getConfigParser(context, configPath).getPreference('AppName'); + + if (name) { + stringsXml = fs.readFileSync(stringsPath, 'UTF-8'); + parser.parseString(stringsXml, function (err, data) { + + data.resources.string.forEach(function (string) { + + if (string.$.name === 'app_name') { + + console.log('Setting App Name: ', name); + string._ = name; + } + }); + + fs.writeFileSync(stringsPath, builder.buildObject(data)); + + }); + } +}; + +function getConfigParser(context, config) { + var semver = context.requireCordovaModule('semver'); + + if (semver.lt(context.opts.cordova.version, '5.4.0')) { + ConfigParser = context.requireCordovaModule('cordova-lib/src/ConfigParser/ConfigParser'); + } else { + ConfigParser = context.requireCordovaModule('cordova-common/src/ConfigParser/ConfigParser'); + } + + return new ConfigParser(config); +} diff --git a/StoneIsland/plugins/fetch.json b/StoneIsland/plugins/fetch.json index e1f47bbb..4d0eafbb 100755 --- a/StoneIsland/plugins/fetch.json +++ b/StoneIsland/plugins/fetch.json @@ -122,5 +122,15 @@ }, "is_top_level": true, "variables": {} + }, + "cordova-plugin-app-name": { + "source": { + "type": "registry", + "id": "cordova-plugin-app-name" + }, + "is_top_level": true, + "variables": { + "APP_NAME": "Stone Island" + } } } \ No newline at end of file diff --git a/StoneIsland/plugins/ios.json b/StoneIsland/plugins/ios.json index ad839f95..7ac7caec 100644 --- a/StoneIsland/plugins/ios.json +++ b/StoneIsland/plugins/ios.json @@ -50,6 +50,10 @@ }, "cordova-plugin-firebase": { "PACKAGE_NAME": "us.okfoc.stoneisland" + }, + "cordova-plugin-app-name": { + "APP_NAME": "Stone Island", + "PACKAGE_NAME": "us.okfoc.stoneisland" } }, "dependent_plugins": { diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 9927712a..43438854 100755 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/www/js/lib/_router.js @@ -87,6 +87,9 @@ var SiteRouter = Router.extend({ else { app.view = app[name] } + + window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) + app.header.set_back( !! app.view.back ) app.view.show() }.bind(this) diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index 6a61be1b..2743946a 100755 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -167,6 +167,8 @@ var ProductView = ScrollableView.extend({ this.$price.html(price) this.$body.html(body) + window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) + this.$productHeader.toggleClass("wide", title.length > 48) var fits_large = !! this.fitLargeCodes[this.code] diff --git a/StoneIsland/www/js/sdk/auth.js b/StoneIsland/www/js/sdk/auth.js index fa8dd71c..bcfb2d3a 100755 --- a/StoneIsland/www/js/sdk/auth.js +++ b/StoneIsland/www/js/sdk/auth.js @@ -51,6 +51,9 @@ var auth = sdk.auth = (function(){ localStorage.setItem("yoox.access_token", access_token) localStorage.setItem("yoox.user_id", user_id) + + window.FirebasePlugin && window.FirebasePlugin.setUserId(user_id) + cb && cb() } auth.get_user = function(cb){ @@ -63,6 +66,7 @@ var auth = sdk.auth = (function(){ auth.user_id = -1 localStorage.removeItem("yoox.access_token") localStorage.removeItem("yoox.user_id") + cb && cb() } -- cgit v1.2.3-70-g09d2