@nuskin/ns-util
Advanced tools
Comparing version 0.0.4 to 0.0.5-SNAPSHOT.10
{ | ||
"name": "@nuskin/ns-util", | ||
"version": "0.0.4", | ||
"version": "0.0.5-SNAPSHOT.10", | ||
"baseURL": "/", | ||
@@ -9,5 +9,9 @@ "main": "src/util.js", | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"firebase": "^3.8.0", | ||
"moment": "^2.18.1", | ||
"moment-timezone": "^0.5.17", | ||
"string.prototype.startswith": "^0.2.0" | ||
@@ -31,3 +35,3 @@ }, | ||
"moment": "^2.18.1", | ||
"ns-jsanalyzer": "^1.0.0", | ||
"@nuskin/ns-jsanalyzer": "^1.0.0", | ||
"polyserve": "^0.15.0", | ||
@@ -34,0 +38,0 @@ "watch": "0.17.1", |
import ConfigService from './configurationService.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace AgelocService | ||
*/ | ||
var AgelocService = function() { | ||
@@ -621,2 +628,2 @@ var dayMoisturizer = ["T1", "S1", "T2", "S2", "T3", "S3", "T5", "S5", "T6", "S6", "T7", "S7", "T9", "S9"]; | ||
export default AgelocService; | ||
export default AgelocService; |
@@ -1,3 +0,10 @@ | ||
import jQuery from 'nuskinjquery'; | ||
import jQuery from '@nuskin/nuskinjquery'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace AjaxObject | ||
*/ | ||
jQuery.AjaxObject = function AjaxObj (minAjaxCallWaitTimeInit){ | ||
@@ -466,2 +473,2 @@ var minAjaxCallWaitTime = minAjaxCallWaitTimeInit === undefined ? 20000 : minAjaxCallWaitTimeInit; // In milliseconds | ||
} | ||
}; | ||
}; |
import ConfigService from './configurationService.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace Application | ||
*/ | ||
export class Application { | ||
@@ -50,2 +57,2 @@ init(language, country, baseUrl, isAssessmentApp=false) { | ||
} | ||
} | ||
} |
@@ -0,1 +1,9 @@ | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace Base64 | ||
*/ | ||
var Base64 = function(){ | ||
@@ -146,2 +154,2 @@ var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | ||
export default Base64; | ||
export default Base64; |
import BrowserDetection from './browserDetection.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace BrowserDetection | ||
*/ | ||
window.BrowserCompatibility = function (supportedBrowsers) { | ||
@@ -4,0 +11,0 @@ |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
window.BrowserDetection = function () { | ||
let BrowserDetection = function () { | ||
@@ -255,2 +255,2 @@ //TODO: update isWebkit because 'webkitURL' is deprecated. | ||
export default window.BrowserDetection; | ||
export default BrowserDetection; |
@@ -6,3 +6,10 @@ import nuskin from './namespace.js'; | ||
var ConfigService = function() { | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace ConfigService | ||
*/ | ||
var ConfigService = function () { | ||
var DEFAULT_CONFIG_URI = '/content/configuration/global/markets'; | ||
@@ -14,3 +21,3 @@ | ||
var clearConfig = function() { | ||
var clearConfig = function () { | ||
config = {}; | ||
@@ -20,3 +27,3 @@ lastUrl = ''; | ||
var getConfiguration = function(url) { | ||
var getConfiguration = (url) => { | ||
/** | ||
@@ -27,2 +34,19 @@ * If this function is called again with the same url, it will just return the same configuration it loaded | ||
if (url !== lastUrl) { | ||
// TODO: the synchronous approach below works for now but we really ought to return a promise and resolve upstream. | ||
// return await fetch(url, { | ||
// method: 'GET' | ||
// }) | ||
// .then(res => res.json()) | ||
// .then((res) => { | ||
// config = res; | ||
// nuskin.configuration = config; | ||
// lastUrl = url; | ||
// $.setValue(nuskin.events.global.CONFIGURATION_SET); | ||
// }) | ||
// .catch(xhr => { | ||
// nuskin.configuration = null; | ||
// config = {error: 'Ajax error in getting configuration: ' + url + ' with xhr: ' + JSON.stringify(xhr)}; | ||
// console.log("could not load market configuration! error:" + xhr); | ||
// console.log("Configuration URL: " + url); | ||
// }); | ||
$.ajax({ | ||
@@ -32,15 +56,13 @@ type: "GET", | ||
dataType: "json", | ||
async: false, | ||
success: function(data) { | ||
config = data; | ||
nuskin.configuration = config; | ||
lastUrl = url; | ||
$.setValue(nuskin.events.global.CONFIGURATION_SET); | ||
}, | ||
error: function(xhr) { | ||
nuskin.configuration = null; | ||
config = {error: 'Ajax error in getting configuration: ' + url}; | ||
console.log("could not load market configuration! error:" + xhr); | ||
console.log("Configuration URL: " + url); | ||
} | ||
async: false | ||
}).done((data) => { | ||
config = data; | ||
nuskin.configuration = config; | ||
lastUrl = url; | ||
$.setValue(nuskin.events.global.CONFIGURATION_SET); | ||
}).fail((xhr) => { | ||
nuskin.configuration = null; | ||
config = {error: 'Ajax error in getting configuration: ' + url + ' with xhr: ' + JSON.stringify(xhr)}; | ||
console.log("could not load market configuration! error:" + xhr); | ||
console.log("Configuration URL: " + url); | ||
}); | ||
@@ -52,4 +74,4 @@ } | ||
var getMarketUrl = function(baseUrl, country) { | ||
if (typeof(country) === "undefined"){ | ||
var getMarketUrl = function (baseUrl, country) { | ||
if (typeof(country) === "undefined") { | ||
country = "US"; | ||
@@ -66,3 +88,3 @@ } | ||
let getMeCommerceConfig = function(country) { | ||
let getMeCommerceConfig = function (country) { | ||
let runConfig = RunConfigService.getRunConfig(); | ||
@@ -73,3 +95,3 @@ getConfiguration(runConfig.baseUrl + '/content/configuration/global/mecommerce/' + mktRegionMapping[country] + '.service.' + country + '.json'); | ||
let getMarketConfig = function(agelocMe, _country) { | ||
let getMarketConfig = function (agelocMe, _country) { | ||
let country = _country, | ||
@@ -91,5 +113,6 @@ runConfig = RunConfigService.getRunConfig(); | ||
let configUri; | ||
if (typeof(runConfig) !== undefined && runConfig.siteConfigurationPath !== undefined){ | ||
if (typeof(runConfig) !== undefined && runConfig.siteConfigurationPath !== undefined && runConfig.country === country) { | ||
configUri = runConfig.siteConfigurationPath; | ||
} else { | ||
runConfig.country = country; | ||
if (runConfig.assessmentApp) { | ||
@@ -101,2 +124,3 @@ // beggining slash gets stripped off during the agelocme build process. | ||
} | ||
runConfig.siteConfigurationPath = configUri; | ||
} | ||
@@ -145,3 +169,3 @@ | ||
// Check to see if we need to do any overrides for pitch. | ||
if (nuskin.util.isPersonalOffer()){ | ||
if (nuskin.util.isPersonalOffer()) { | ||
overwriteConfigForPitchApp(); | ||
@@ -153,7 +177,7 @@ } | ||
var getAgelocConfig = function(_market) { | ||
var getAgelocConfig = function (_market) { | ||
return getMarketConfig(true, _market); | ||
}; | ||
var getUrlConfig = function(url, clearIt) { | ||
var getUrlConfig = function (url, clearIt) { | ||
if (clearIt) { | ||
@@ -166,3 +190,3 @@ clearConfig(); | ||
var setConfig = function(configObj) { | ||
var setConfig = function (configObj) { | ||
config = configObj; | ||
@@ -199,3 +223,3 @@ | ||
function overwriteConfigForPitchApp(){ | ||
function overwriteConfigForPitchApp() { | ||
// Set overrides given it is a pictch checkout. | ||
@@ -202,0 +226,0 @@ |
@@ -0,1 +1,8 @@ | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace CookieUtil | ||
*/ | ||
class CookieUtil { | ||
@@ -26,2 +33,2 @@ constructor() {} | ||
export default new CookieUtil(); | ||
export default new CookieUtil(); |
@@ -0,1 +1,3 @@ | ||
import moment from 'moment-timezone'; | ||
var nuskinHQ = { | ||
@@ -77,2 +79,8 @@ timezone: "US/Mountain", | ||
return moment( datetime ).format( this.formats.militaryDate ); | ||
}, | ||
toHQTimeEndOfDay: function (datetime) { | ||
return this.toHQTime( datetime ).endOf('day'); | ||
}, | ||
toHQTimeStartOfDay: function (datetime) { | ||
return this.toHQTime( datetime ).startOf('day'); | ||
} | ||
@@ -79,0 +87,0 @@ }; |
@@ -32,5 +32,8 @@ import nuskin from './namespace.js'; | ||
* | ||
* | ||
*/ | ||
if (!nuskin.events) { | ||
/** | ||
* @namespace nuskin.events | ||
* @type {{global: {STRINGS_SERVICES_LOADED: string, CONFIGURATION_SET: string, DEVELEMENT_MODE: string}, errors: {CONFIGURATION: string, STRING_SERVICE: string, ATP: string, SAP: string, CART: string, PAYMENT: string, ADDRESS: string, PRODUCT_LOOKUP: string, PRODUCT_STATUS: string, SHIPPING_SERVICE: string, ORDER_SERVICE: string, UNEXPECTED_SYSTEM: string, INVALID_SEARCH_ADDRESS: string, NUMBER_STREET_ADDRESS: string}, authentication: {LOGIN: string, HIDE_LOGIN_POPUP: string, LOGOUT: string, LOGOUT_REQUESTED: string, LOGOUT_LEGACY: string, LOGIN_REQUESTED: string, SET_LOGIN_PARAMS: string, REQUEST_FOR_LOGIN: string, REQUEST_FOR_LOGIN_MODAL: string, INVALID_LOGIN: string, VALID: string, INVALID: string, INVALID_AUTH: string, INVALID_NEW_LOGIN_PAGE: string, USER_NOT_ALLOWED: string, INVALID_EMAIL: string, PING_COMPLETE: string, AGELOCME_LOGIN: string, ERROR_COOKIE_NAME: string, EID_LOGIN_PATH: string, INVALID_SHOPPING_COUNTRY: string, STATUS: string, ERROR_USER_NOT_FOUND: string, ERROR_LOGIN_FAILED: string, ERROR_SPONSOR_NOT_FOUND: string, ERROR_SHOPPING_NOT_ALLOWED: string, ERROR_LOGGED_OUT_FOR_INACTIVITY: string, ERROR_ACCOUNT_TERMINATED: string, ERROR_TOO_MANY_LOGIN_ATTEMPTS: string, ERROR_LOGOUT_MESSAGE: string}, account: {INIT_COMPLETE: string, VOLUME_ADDED: string, EMEASIGNUP_FLAG: string}, ops: {SITE_NAME_LOADED: string, SITE_NOT_AVAILABLE: string, SITE_NAME_CHANGED: string, SITE_PRICE_TYPES_LOADED: string, MARKET_PRICE_TYPE_SETTINGS_LOADED: string, PREFERRED: string, FLAG: string}, shop: {CART_UPDATED: string, ECOM3_CART_UPDATED: string, CART_RETURNED: string, ADD_TO_CART: string, REMOVE_FROM_CART: string, OUT_OF_STOCK: string, FAVORITES_LIST_LOADED: string, ADD_TO_FAVORITES_LIST: string, ITEM_REMOVED_FROM_FAVORITES: string, ADR_OPTIONS_READY: string, PRODUCT_SEARCH_CHANGED: string, PRODUCT_SEARCH_FAILED: string, PRODUCT_SELECTED: string, PRODUCT_SEARCH_CLEAR: string, DISPLAY_CART_CHANGED: string, AGELOC_ADR_INIT: string, CHECK_USER_SAME: string, CART_ERROR_MSG: string, CART_ITEM_UPDATED: string, CART_SCAN_CARDS_CHANGED: string, INIT_CHECKOUT: string, ADR_SHIP_DAYS_CHANGED: string, CHECKOUT_FOCUS: string, ADR_STATUS_CHANGE: string, ADD_FAVORITES_LOGIN: string, NEW_GOOGLE_MAPS_SEARCH: string, STORE_FRONT_ORDER_COMPLETE: string, OFFER_PRODUCT_REMOVED: string, OFFER_PRODUCTS_CHANGED: string, STOREFRONT_LOADED: string}, social: {SHOW_SHARE_URL: string, HIDE_SHARE_URL: string, URL_SHORTNER: string, SHORTEN_URL_ERROR: string}, video: {API_READY: string, PLAYER_READY: string, PLAYER_STATE_CHANGE: string, PLAYER_ERROR: string}, mec: {PITCH_LOADED: string, SHOW_TOAST_MSG: string, OFFER_LOADED: string, OFFER_TOTAL_UPDATED: string}, on: nuskin.events.subscribe, subscribe: nuskin.events.subscribe, emit: nuskin.events.publish, publish: nuskin.events.publish, publishError: nuskin.events.publishError, publishAjaxErrorEvent: nuskin.events.publishAjaxErrorEvent, publishAjaxError: nuskin.events.publishAjaxError, getErrorEventObject: nuskin.events.getErrorEventObject, getAjaxErrorEventObject: nuskin.events.getAjaxErrorEventObject, getMessageIdFromEventId: nuskin.events.getMessageIdFromEventId}} | ||
*/ | ||
(function () { | ||
@@ -40,3 +43,2 @@ // string constants used by default, to reference both the event type and the message string | ||
var ns = "nuskin.events."; | ||
var events = { | ||
@@ -200,2 +202,3 @@ | ||
* @param {function} eventCallback | ||
* @memberof nuskin.events | ||
*/ | ||
@@ -212,2 +215,3 @@ function subscribe(eventId, eventCallback) { | ||
* @param {object} [eventObject] | ||
* @memberof nuskin.events | ||
*/ | ||
@@ -224,2 +228,4 @@ function publish(eventId, eventObject) { | ||
* @param {{messageId: string, messageString: string}} [eventObject] - optional event object - will automatically extract the messageId from the event Id if none is passed. | ||
* @memberof nuskin.events | ||
* @private | ||
*/ | ||
@@ -243,4 +249,4 @@ function publishError(eventId, eventObject) { | ||
* @param {string} [messageString] - optional message string if an messageId lookup isn't ideal. | ||
* @memberof nuskin.events | ||
* | ||
* | ||
*/ | ||
@@ -265,2 +271,3 @@ function publishAjaxErrorEvent(eventId, url, response, messageId, messageString) { | ||
* @param {{url: string, response: *, messageId: string, messageString: string}} eventObject | ||
* @memberof nuskin.events | ||
*/ | ||
@@ -279,2 +286,3 @@ function publishAjaxError(eventId, eventObject) { | ||
* @returns {{messageId: string, messageString: string}} - messageId is for use with the localized common strings | ||
* @memberof nuskin.events | ||
*/ | ||
@@ -298,2 +306,3 @@ function getErrorEventObject(id, messageString) { | ||
* @returns {{url: string, response: *, messageId: string, messageString: string}} | ||
* @memberof nuskin.events | ||
*/ | ||
@@ -314,2 +323,3 @@ function getAjaxErrorEventObject(id, url, response, messageString) { | ||
* @returns {string} | ||
* @memberof nuskin.events | ||
*/ | ||
@@ -316,0 +326,0 @@ function getMessageIdFromEventId(id) { |
@@ -46,3 +46,9 @@ import ConfigService from './configurationService.js'; | ||
let beUser; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace FirebaseUtil | ||
*/ | ||
let FirebaseUtil = { | ||
@@ -174,2 +180,2 @@ /** | ||
export default FirebaseUtil; | ||
export default FirebaseUtil; |
import MarketSiteRegions from './MarketSiteRegions.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace GeoIPMarketRedirect | ||
*/ | ||
export default class GeoIPMarketRedirect { | ||
@@ -122,4 +129,4 @@ constructor(_geoip2) { | ||
} | ||
}); | ||
@@ -388,2 +395,2 @@ } | ||
} | ||
} |
import nuskin from './namespace.js'; // import global namespace we can attach to | ||
import RunConfigService from './runConfigService'; | ||
import ConfigurationService from './configurationService'; | ||
@@ -46,4 +45,5 @@ /** | ||
function setConfigBaseUrl(config) { | ||
if (!config.env) return; | ||
else if (config.env === 'dev') { | ||
if (!config.env) { | ||
return; | ||
} else if (config.env === 'dev') { | ||
config.baseUrl = "https://dev.nuskin.com"; | ||
@@ -66,3 +66,3 @@ } else if (config.env === 'test') { | ||
*/ | ||
nuskin.init = function(config) { | ||
nuskin.init = (config) => { | ||
if (config.env) { | ||
@@ -69,0 +69,0 @@ setConfigBaseUrl(config); |
@@ -0,1 +1,8 @@ | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace LocalStorageUtil | ||
*/ | ||
var LocalStorageUtil = function(){ | ||
@@ -74,2 +81,2 @@ 'use strict'; | ||
export default LocalStorageUtil; | ||
export default LocalStorageUtil; |
import RunConfigService from './runConfigService.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace MarketSiteRegions | ||
*/ | ||
class MarketSiteRegions { | ||
@@ -31,2 +38,2 @@ constructor() { | ||
export default new MarketSiteRegions(); | ||
export default new MarketSiteRegions(); |
/** | ||
* Created by xanderhacking on 4/19/18. | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace nsSearchBarAdapter | ||
*/ | ||
class nsSearchBarAdapter { | ||
@@ -34,2 +36,2 @@ | ||
export default new nsSearchBarAdapter(); | ||
export default new nsSearchBarAdapter(); |
@@ -7,2 +7,9 @@ /** | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace NUSAnalytics | ||
*/ | ||
class NUSAnalytics { | ||
@@ -128,3 +135,3 @@ constructor() { | ||
let price = (items[i].getProduct().getPrice() * items[i].getQty()); | ||
productString += ";" + items[i].getSku() + ";" + items[i].getQty() + ";" + price.toFixed(2) + ","; | ||
productString += ";" + items[i].sku + ";" + items[i].getQty() + ";" + price.toFixed(2) + ","; | ||
} | ||
@@ -131,0 +138,0 @@ } |
@@ -43,6 +43,3 @@ import nuskin from './namespace.js'; // import global namespace we can attach to | ||
this.onLoad = function() { | ||
var runConfig = RunConfigService.getRunConfig(); | ||
if (!runConfig.country) { | ||
throw "\nPlease initialize the system with a country.\nExample:\nnuskin.init({country:'US'});"; | ||
} | ||
var runConfig = RunConfigService.getRunConfig() || "US"; | ||
for(var x = 0; x < loadFunctions.length; x++) { | ||
@@ -91,3 +88,3 @@ if(!loadFunctions[x].hasRun) { | ||
//default environment properties | ||
RunConfigService: RunConfigService, | ||
RunConfigService: RunConfigService, | ||
secureHost: RunConfigService.getRunConfig().baseUrl, //window.location.protocol + '//' + window.location.host, | ||
@@ -232,2 +229,14 @@ countryCode: RunConfigService.getRunConfig().country || "US", | ||
}, | ||
getSubdomain: function (url) { | ||
let subdomain; | ||
if (url) { | ||
subdomain = url.split('.')[0]; | ||
} else { | ||
subdomain = window.location.hostname.split('.')[0]; | ||
} | ||
if ((subdomain.indexOf('www') === 0) || (subdomain.indexOf('dev') === 0) || (subdomain.indexOf('test') === 0) || (subdomain.indexOf('stage') === 0)) { | ||
subdomain = null; | ||
} | ||
return subdomain; | ||
}, | ||
MobileUtils: function() { | ||
@@ -234,0 +243,0 @@ 'use strict'; |
@@ -0,1 +1,8 @@ | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace PersonalOfferStorageService | ||
*/ | ||
var PersonalOfferStorageService = function () { | ||
@@ -39,2 +46,2 @@ "use strict"; | ||
export default PersonalOfferStorageService; | ||
export default PersonalOfferStorageService; |
import nuskin from './namespace.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace nuskin.site.Preferences | ||
*/ | ||
nuskin.site.Preferences = function(preferences){ | ||
@@ -60,2 +67,2 @@ "use strict"; | ||
export default nuskin.site.Preferences; | ||
export default nuskin.site.Preferences; |
import nuskin from './namespace.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace nsSearchBarAdapter | ||
*/ | ||
nuskin.site.PreferencesCookieService = function(){ | ||
@@ -63,2 +70,2 @@ | ||
export default nuskin.site.PreferencesCookieService; | ||
export default nuskin.site.PreferencesCookieService; |
@@ -5,2 +5,9 @@ import nuskin from './namespace.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace runConfigService | ||
*/ | ||
var runConfigService = function() { | ||
@@ -96,3 +103,3 @@ var RUN_CONFIG = 'run-config'; | ||
} | ||
return baseUrl; | ||
@@ -216,4 +223,6 @@ } | ||
TEST: "test.nuskin.com", | ||
TESTMYNUSKIN: "test.mynuskin.com", // For storefront in test | ||
DEV: "dev.nuskin.com", | ||
PROD: "www.nuskin.com", | ||
PRODMYNUSKIN: ".mynuskin.com", // For storefront in prod | ||
STAGE: "stage.nuskin.com" | ||
@@ -233,7 +242,7 @@ }; | ||
env = 'dev'; | ||
} else if (runConfig.baseUrl.indexOf(environment.TEST) > -1 || runConfig.baseUrl.indexOf(environment.LOCALHOST) > -1 || runConfig.baseUrl.indexOf(environment.LOCALHOST4502) > -1) { | ||
} else if (runConfig.baseUrl.indexOf(environment.TEST) > -1 || runConfig.baseUrl.indexOf(environment.TESTMYNUSKIN) > -1 || runConfig.baseUrl.indexOf(environment.LOCALHOST) > -1 || runConfig.baseUrl.indexOf(environment.LOCALHOST4502) > -1) { | ||
env = 'test'; | ||
} else if (runConfig.baseUrl.indexOf(environment.STAGE) > -1) { | ||
env = 'stage'; | ||
} else if (runConfig.baseUrl.indexOf(environment.PROD) > -1) { | ||
} else if (runConfig.baseUrl.indexOf(environment.PROD) > -1 || runConfig.baseUrl.indexOf(environment.PRODMYNUSKIN) > -1) { | ||
env = 'prod' | ||
@@ -246,3 +255,3 @@ } else { | ||
} | ||
return env; | ||
@@ -249,0 +258,0 @@ }; |
@@ -0,1 +1,8 @@ | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace SearchLocalStorageService | ||
*/ | ||
class SearchLocalStorageService { | ||
@@ -42,2 +49,2 @@ constructor() { | ||
export default new SearchLocalStorageService(); | ||
export default new SearchLocalStorageService(); |
@@ -8,4 +8,4 @@ /** | ||
* http://gomakethings.com/mit/ | ||
* @namespace smoothScroll | ||
*/ | ||
var smoothScroll = function (root) { | ||
@@ -12,0 +12,0 @@ |
import ShortenURL from './ShortenURL.js'; | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace SocialMediaShare | ||
*/ | ||
class SocialMediaShare { | ||
@@ -32,2 +39,2 @@ constructor() { | ||
export default new SocialMediaShare(); | ||
export default new SocialMediaShare(); |
@@ -0,1 +1,8 @@ | ||
/** | ||
* | ||
* BrowserDetection object is immediately executed when the page loads. | ||
* This Object is used to detect the browser and version the user is using. | ||
* | ||
* @namespace SponsorStorageService | ||
*/ | ||
var SponsorStorageService = function () { | ||
@@ -30,2 +37,2 @@ "use strict"; | ||
export default SponsorStorageService; | ||
export default SponsorStorageService; |
import nuskin from './namespace.js'; | ||
import _ from 'lodash'; | ||
@@ -12,7 +13,9 @@ var mobileState = "none"; | ||
]; | ||
// --------------------------------------------- | ||
// | ||
// Screen Geoemetry | ||
// | ||
// --------------------------------------------- | ||
/** | ||
* | ||
* Screen Geoemetry | ||
* | ||
* @namespace ScreenGeometry | ||
*/ | ||
export var ScreenGeometry = { | ||
@@ -19,0 +22,0 @@ getScreenHeight: function(){ |
@@ -0,1 +1,7 @@ | ||
/** | ||
* | ||
* StoreFrontSponsorStorageService | ||
* | ||
* @namespace StoreFrontSponsorStorageService | ||
*/ | ||
var StoreFrontSponsorStorageService = function () { | ||
@@ -22,3 +28,3 @@ "use strict"; | ||
} else { | ||
localStorage.setItem(STORAGE_KEY, sponsor); | ||
localStorage.setItem(STORAGE_KEY, JSON.stringify(sponsor)); | ||
} | ||
@@ -31,2 +37,2 @@ } | ||
export default StoreFrontSponsorStorageService; | ||
export default StoreFrontSponsorStorageService; |
@@ -5,2 +5,8 @@ import event from './event.js'; | ||
/** | ||
* | ||
* StoreFrontUtil | ||
* | ||
* @namespace StoreFrontUtil | ||
*/ | ||
var StoreFrontUtil = function storeFrontUtilInit() { | ||
@@ -58,2 +64,2 @@ // Initialize firebase configuration | ||
export default StoreFrontUtil; | ||
export default StoreFrontUtil; |
@@ -8,2 +8,8 @@ /** | ||
/** | ||
* | ||
* StringService | ||
* | ||
* @namespace StringService | ||
*/ | ||
var StringService = function() { | ||
@@ -169,2 +175,2 @@ "use strict"; | ||
export default StringService; | ||
export default StringService; |
@@ -6,2 +6,8 @@ | ||
/** | ||
* | ||
* TdcStrings | ||
* | ||
* @namespace TdcStrings | ||
*/ | ||
var TdcStrings = function() { | ||
@@ -139,2 +145,2 @@ "use strict"; | ||
export default TdcStrings; | ||
export default TdcStrings; |
import RunConfigService from './runConfigService'; | ||
/** | ||
* | ||
* UrlService | ||
* | ||
* @namespace UrlService | ||
*/ | ||
const UrlService = function() { | ||
@@ -62,3 +68,3 @@ | ||
!domain.startsWith('www.') && | ||
domain.indexOf('.nuskin.') >= 0; // Without this line you can't run in localhost mode or it will think it is storefront | ||
domain.indexOf('.mynuskin.') >= 0; // Without this line you can't run in localhost mode or it will think it is storefront | ||
} | ||
@@ -65,0 +71,0 @@ |
@@ -42,2 +42,3 @@ import './ajaxWrapper.js'; | ||
export {default as ShortenURL} from './ShortenURL.js'; | ||
export {default as SearchBarAdapter} from './nsSearchBarAdapter'; | ||
export {default as TranslationsUtil} from './translationUtil.js'; | ||
export {default as SearchBarAdapter} from './nsSearchBarAdapter'; |
import runConfigService from "./runConfigService.js"; | ||
/** | ||
* | ||
* WaitingRoomService | ||
* | ||
* @namespace WaitingRoomService | ||
*/ | ||
var WaitingRoomService = function(){ | ||
@@ -4,0 +10,0 @@ 'use strict'; |
283741
4
6763
+ Addedmoment-timezone@^0.5.17
+ Addedmoment-timezone@0.5.45(transitive)