//resources
app.siteDefaultLocale = "fr-FR";
app.siteBrandID = "BB";
app.resources.MISSINGCHK = "Veuillez cocher la case ci-dessus avant de valider votre commande.";
app.resources.MISSINGVAL = "Merci d'entrer {0}";
app.resources.MISSINGCITY = "Merci de renseigner votre ville";
app.resources.SERVER_ERROR = "La connexion au serveur a échoué!";
app.resources.MISSING_LIB = "jQuery is undefined.";
app.resources.BAD_RESPONSE = "Mauvaise réponse";
app.resources.INVALID_ADDRESS = "L'adresse est incorrecte";
app.resources.INVALID_PHONE = "Merci de mettre un numero de téléphone valide.";
app.resources.INVALID_EMAIL = "Veuillez fournir une adresse électronique valide.",
app.resources.EMAIL_WARNING = "L'adresse e-mail est introuvable/n'a pas pu être vérifiée.",
app.resources.INVALID_CPF = "forms.address.CPF.field.invalid";
app.resources.INVALID_CITY = "La ville saisie est inconnue",
app.resources.DOB_INCOMPLETE = "La date de naissance n'est pas complète.";
app.resources.DOB_AGE_ERROR = "Désolé, vous devez avoir au moins 13 ans pour continuer.";
app.resources.EQUALTO = "Veuillez fournir encore la même valeur.",
app.resources.EQUALTOEMAIL = "Merci de confirmer votre adresse email",
app.resources.INVALID_EMAILLIST = "Les adresses mail suivantes ne sont pas correctes :";
app.resources.REMOVE = "Supprimer";
app.resources.CLOSE = "Fermer";
app.resources.NEXT = "global.next";
app.resources.PREV = "Précedent";
app.resources.QTY = "Qté";
app.resources.PLEASE_SELECT = "( Merci de sélectionner )";
app.resources.MISSING_CREDIT_CARD_DATA = "Veuillez remplir tous les champs ci-dessous";
app.resources.CLICK_TO_EDIT = "Cliquer pour modifier";
app.resources.SUBMIT = "Valider";
app.resources.WRONG_DATE_FORMAT = "Merci d'entrer une date dans le format demandé";
app.resources.PRINT_NOW = "Imprimer";
// Countrys
app.resources.countrysSelector = {};
app.resources.countrysSelector.regionAmericas = "Americas";
app.resources.countrysSelector.regionApac = "APAC / ASIA";
app.resources.countrysSelector.regionEurope = "Europe";
app.resources.countrysSelector.regionAfrica = "Africa";
app.resources.countrysSelector.europe = "Europe";
app.resources.countrysSelector.international = "International";
app.resources.sessioncountrycode = "fr";
app.resources.sessioncountry= "France";
// Other State select option
app.resources.otherStateOptionName = "Other";
app.resources.otherStateOptionValue = "OTHER";
// Date Picker localisation
app.resources.dates = {};
app.resources.dates['TODAY'] = "Aujourd'hui";
app.resources.dates['WEEKHEADER'] = "Sem.";
app.resources.dates['DATE_FORMAT'] = "dd/mm/yy";
app.resources.dates['MONTH'] = [
"Janvier"
, "Février"
, "Mars"
, "Avril"
, "May"
, "Juin"
, "Juillet"
, "Août"
, "Septembre"
, "Octobre"
, "Novembre"
, "Décembre"
];
app.resources.dates['MONTH_SHORT'] = [
"Janv."
, "Févr."
, "Mars"
, "Avril"
, "Mai"
, "Juin"
, "Juil."
, "Août"
, "Sept."
, "Oct."
, "Nov."
, "Déc."
];
app.resources.dates['DAY_NAMES'] = [
"Dimanche"
, "Lundi"
, "Mardi"
, "Mercredi"
, "Jeudi"
, "Vendredi"
, "Samedi"
];
app.resources.dates['DAY_NAMES_SHORT'] = [
"Dim"
, "Lun"
, "Mar"
, "Mer"
, "Jeu"
, "Ven"
, "Sam"
];
app.resources.dates['DAY_NAMES_MIN'] = [
"D"
, "L"
, "M"
, "M"
, "J"
, "V"
, "S"
];
// product availability messages
app.resources["IN_STOCK"] = "En Stock";
app.resources["QTY_IN_STOCK"] = "{0} articles (s) en Stock";
app.resources["PREORDER"] = "Pre-Commande";
app.resources["QTY_PREORDER"] = "{0} article(s) sont commandables pour livraison dés diponibilité.";
app.resources["REMAIN_PREORDER"] = "Ces articles sont disponibles en précommande.";
app.resources["BACKORDER"] = "Back Order";
app.resources["QTY_BACKORDER"] = "Commande sur disponiblité future {0} article(s)";
app.resources["REMAIN_BACKORDER"] = "Ces articles sont .";
app.resources["NOT_AVAILABLE"] = "Non dispo.";
app.resources["REMAIN_NOT_AVAILABLE"] = "Ces articles ne sont actuellement plus disponibles. Merci de changer la quantité.";
app.resources["IN_STOCK_DATE"] = "La date d'entrée en stock prévue est {0}.";
app.resources["NON_SELECTED"] = "Pas sélectionné";
app.resources["MISSING_VAL"] = "Selectionez {0}";
app.resources["SIZECHART_TITLE"] = "grille des tailles";
app.resources["SEND_TO_FRIEND"] = "Envoyer à un ami";
app.resources["MISSING_VAL"] = "Selectionez {0}";
//shipping resources
app.resources["SHIP_STATE_LABEL"] ="Département";
app.resources["SHIP_PROVINCE_LABEL"] ="Région";
app.resources["SHIP_QualifiesFor"] = "This shipment qualifies for"
app.resources["STOREPICKUP"] = "Select pickup location"
app.resources["STOREPICKUP_POSTCODE"] = "Postcode value is required."
app.resources["STOREPICKUP_NO_GEO_MATCH"] = "Votre position actuelle semble être en dehors de notre zone d'expédition. Veuillez saisir une adresse pour effectuer une recherche directe."
app.resources["STOREPICKUP_GEO_TOOLTIP"] = "Cliquez pour utiliser votre position actuelle."
app.resources["STOREPICKUP_EMPTY_RESULT"] = "Aucun résultat"
app.resources["SHIP_TO_COUNTRY_POST_LABEL"] = "(shipping to)";
//shipping resources
app.resources["BILL_GC"] = "GIFT_CERTIFICATE";
//billing resources
app.resources["CREDIT_CARD_TYPE"] = "dwfrm_billing_paymentMethods_creditCard_type";
// bonus products messages
app.resources["BONUS_PRODUCTS"] = "Produit(s) bonus";
app.resources["SELECT_BONUS_PRODUCT"] = "sélectionner";
app.resources["BONUS_PRODUCT_MAX"] = "Le nombre maximum de produit bonus est atteint. Merci den annuler un si vous souhaitez le remplacer.";
app.resources["SIMPLE_SEARCH"] = "Entrez un mot clé ou un numéro darticle #";
// Gift Cert resources
app.resources["REG_ADDR_ERROR"] = "Nous n'avons pas pu charger l'adresse";
app.resources["GIFTCARD_CAN_NOT_BE_VALIDATED"] = "We're sorry, but the gift card number you entered is not correct.";
app.resources.loyalty = {};
app.resources.loyalty.notifyTCChange = "false";
app.resources.loyalty.getCustomerAcceptationUrl = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Account-LoyaltyGetTcAcceptationValue";
app.resources.loyalty.setCustomerAcceptationUrl = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Account-LoyaltySetTcAcceptationValue";
app.resources.loyalty.getTcAcceptationPop = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Account-LoyaltyGetTcAcceptationPopup";
app.resources.loyalty.saveCustomerEmailUrl = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Account-LoyaltySaveCustomerEmail";
//Store pickup page
app.resources.storepickup = {};
app.resources.storepickup.storesicon = "https://www.billabong.fr/on/demandware.static/Sites-BB-FR-Site/-/default/dw6c5cf403/images/icons/pushpin.png";
app.resources.storepickup.selectlabel = "Sélectionner";
app.resources.storepickup.storeicons_url = "/on/demandware.static/-/Sites-BB-FR-Library/fr_FR/v1576983619290/REPLACEME";
app.resources.storepickup.storeicons_config = null; // as JSON String
app.resources.storepickup.sessionlocale = "fr";
app.resources.storepickup.currency_symbol = "€";
app.resources.storepickup.deliveryTimeText1 = "checkout.pickstore.deliveryTimeText1";
app.resources.storepickup.deliveryTimeText2 = "checkout.pickstore.deliveryTimeText2";
app.resources.storepickup.noresultstitle = "Aucun résultat";
app.resources.storepickup.emptysearchfieldmsg = "checkout.pickstore.emptysearchfieldmsg";
//Store locator page
app.resources.storelocator = {};
app.resources.storelocator.dwClientID = "13d00e86-f1e5-4c51-abf5-af0c25ebf069";
app.resources.storelocator.sendlabel = "Envoyer adresse via";
app.resources.storelocator.emaillink = "Email";
app.resources.storelocator.viewstorehours = "Voir les horaires d'ouverture";
app.resources.storelocator.phonelabel = "Tél:";
app.resources.storelocator.dayrange = "Du lundi au dimanche";
app.resources.storelocator.monday = "Lundi";
app.resources.storelocator.tuesday = "Mardi";
app.resources.storelocator.wednesday = "Mercredi";
app.resources.storelocator.thursday = "Jeudi";
app.resources.storelocator.friday = "Vendredi";
app.resources.storelocator.saturday = "Samedi";
app.resources.storelocator.sunday = "Dimanche";
app.resources.storelocator.hoursrange = "A partir de %CLOSE% à %CLOSE%";
app.resources.storelocator.storesicon = "/on/demandware.static/Sites-BB-FR-Site/-/fr_FR/v1576983619290/images/icons/stores-icon.png";
app.resources.storelocator.outletsicon = "/on/demandware.static/Sites-BB-FR-Site/-/fr_FR/v1576983619290/images/icons/outlets-icon.png";
app.resources.storelocator.boardridersclubicon = "/on/demandware.static/Sites-BB-FR-Site/-/fr_FR/v1576983619290/images/icons/boardridersclub-icon.png";
app.resources.storelocator.dealersicon = "/on/demandware.static/Sites-BB-FR-Site/-/fr_FR/v1576983619290/images/icons/authorized-dealers-icon.png";
app.resources.storelocator.providerURL = "https://dev.virtualearth.net/REST/v1/Locations?query=";
app.resources.storelocator.providerKey = "Ait6vo6o9O126kS5OYoHkOclWg3-DY4ifecpLP3b3r49sPbXI-RoLy2fAdvP7vg_";
app.resources.storelocator.defaultLocations = '{"US":{"latitude":33.740053530431425,"longitude":-118.03146985054013},"FR":{"latitude":46.227638,"longitude":2.213749000000007},"DE":{"latitude":51.165691,"longitude":10.451526},"CH":{"latitude":46.818188,"longitude":8.227511999999933},"DK":{"latitude":56.26392,"longitude":9.50178500000004},"GB":{"latitude":55.378051,"longitude":-3.43597299999999},"RU":{"latitude":61.52401,"longitude":105.31875600000001},"ES":{"latitude":40.46366700000001,"longitude":-3.7492200000000366},"IE":{"latitude":53.41291,"longitude":-8.243889999999965},"IT":{"latitude":41.87194,"longitude":12.56738},"NL":{"latitude":52.132633,"longitude":5.2912659999999505},"BE":{"latitude":50.503887,"longitude":4.4699359999999615},"LU":{"latitude":49.815273,"longitude":6.129583000000025},"PT":{"latitude":39.39987199999999,"longitude":-8.224454000000037},"FI":{"latitude":61.92410999999999,"longitude":25.748151000000007},"BR":{"latitude":-23.5261522,"longitude":-46.6451321}}';
app.resources.storelocator.storeLocatorFilterOnline = "false";
app.resources.storelocator.noresultstitle = "Aucun résultat";
app.resources.storelocator.noresultsfound = "Aucun résultat trouvé avec vos critères de recherche";
app.resources.storelocator.noresultshelp = "Merci de bien vouloir renseigner une ville et un pays";
// Product tile
app.resources.COLOR = "Couleur";
app.resources.COLORS = "Couleurs";
app.resources["GIFT_CERT_ID"] = "input[name=dwfrm_giftcert_balance_giftCertID]";
app.resources["GIFT_CERT_FROM"] = "dwfrm_giftcert_purchase_from";
app.resources["GIFT_CERT_RECIPIENT"] = "dwfrm_giftcert_purchase_recipient";
app.resources["GIFT_CERT_RECIPIENT_EMAIL"] = "dwfrm_giftcert_purchase_recipientEmail";
app.resources["GIFT_CERT_RECIPIENT_CONF_EMAIL"] = "dwfrm_giftcert_purchase_confirmRecipientEmail";
app.resources["GIFT_CERT_RECIPIENT_MSG"] = "dwfrm_giftcert_purchase_message";
app.resources["GIFT_CERT_AMT"] = "dwfrm_giftcert_purchase_amount";
app.resources["GIFT_CERT_BALANCE"] = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/GiftCert-CheckBalance";
app.resources["GIFT_CERT_CUR_BALANCE"] = "Your current gift certificate balance is";
app.resources["GIFT_CERT_MISSINGCODE"] = "Please enter Gift Certificate Code";
app.resources["GIFT_CERT_INVALIDCODE"] = "Please check Gift Certificate Code";
app.resources["GIFT_CERT_ERROR"] = "Please enter the correct information";
app.resources["GIFT_BALANCE_ERROR_CODE"] = "Please enter a gift certificate code";
app.resources["GIFT_BALANCE_ERROR_PIN"] = "Please enter a pin code";
app.resources["GIFT_BALANCE_ERROR_DIGIT"] = "Pin code must be 4 digits";
app.resources["WISHLIST_LIST"] = "";
app.resources["WISHLIST_PROGRESS_IMAGE"] = "/on/demandware.static/Sites-BB-FR-Site/-/default/dw6dd20da0/images/loading-progress-98x22.gif";
// PDP
app.resources["SAVED_FOR_LATER"] = "Sauvegardé";
app.resources["SAVE_FOR_LATER"] = "Sauvegarder";
// Cart Wishlist
app.resources["ADD_TO_WISHLIST"] = "Favoris";
app.resources["VIEW_IN_WISHLIST"] = "Voir dans favoris";
app.resources.verticalVideoLocation = "null";
app.resources["PHONE_VALIDATION"] = {"US":{"mask":"(999) 999-9999","placeholder":"(___) ___-____","regex":"^(\\+0?1\\s)?\\(?\\d{3}\\)?[\\s.-]\\d{3}[\\s.-]\\d{4}$|^[a-zA-Z0-9]{7,20}$"},"BR":{"mask":"(99)99999-9999","multiMask":["(00)00000-0000","(00)0000-00009"],"placeholder":"(__)____-____","regex":"^([0-9]{2})?(\\([0-9]{2}\\))([0-9]{4}|[0-9]{5})-[0-9]{4}$"},"NL":{"regex":"^[\\+]*([\\-0-9][ ]*){7,15}$"},"default":{"regex":"^[\\+]*([\\-0-9][ ]*){7,20}$"}};
app.resources["ZIP_MASK"] = "";
app.resources["ZIP_PLACEHOLDER"] = "0";
app.resources["CPF_MASK"] = "0";
app.resources["CPF_PLACEHOLDER"] = "0";
app.resources["GIFT_CARD_LIMIT"] = "Oops! Please enter a gift card value between $25 and $500.";
app.resources["GIFT_CARD_SELECT"] = "Sélectionnez ou saisissez un montant";
app.resources["MONEY"] = "0,00 €";
app.resources["CITY_VALIDATION"] = '^[^0-9]+$';
//The follow snippet is executed to pass some Demandare URLs into the script
app.minicart.url = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Cart-MiniAddProduct";
app.URLs.addProductToCart = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Cart-AddProduct";
app.URLs.updateLineItem = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Cart-UpdateLineItem";
app.URLs.wishlistAddress = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/Wishlist-SetShippingAddress?AddressID=";
app.URLs.viewWishlist = "/wishlist/";
app.URLs.addProductToWishlist = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Wishlist-Add";
app.URLs.removeProductFromWishlist = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Wishlist-Remove";
app.URLs.SetShippingContext = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/Hooking-SetShippingContext";
app.URLs.SetLocalization = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/Geolocation-SetLocalization";
// S.E.O links scripting
app.URLs.userLogin = "https://www.billabong.fr/account/";
app.URLs.userRegister = "https://www.billabong.fr/account/register/";
app.URLs.renderForm = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/Addresses-RenderForm";
app.URLs.sizeChartShow = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/SizeChart-Show";
app.URLs.accountShow = "https://www.billabong.fr/account/";
app.URLs.contactUs = "/customer-help/contact/";
app.URLs.logOut = "https://www.billabong.fr/login/";
app.URLs.getShippingMethodsList = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/COShipping-UpdateShippingMethodList";
app.URLs.updateOrderTotals = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/COBilling-UpdateOrderTotals";
app.URLs.storeBillingAddress = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/COShipping-StoreUnsavedBillingAddress";
app.URLs.getProductDetail = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Product-Detail";
app.URLs.getProductUrl = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Product-Show";
app.URLs.searchUrl = "/search/";
app.URLs.getVariants = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Product-GetVariants";
app.URLs.getAvailability = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Product-GetAvailability";
app.URLs.loadingSmallImg = "/on/demandware.static/Sites-BB-FR-Site/-/default/dwa6ad45fa/images/loading-small.gif";
app.URLs.formatMoney = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Product-FormatPrices";
app.URLs.removeImg = "/on/demandware.static/Sites-BB-FR-Site/-/default/dw43347af5/images/icon_remove.gif";
app.URLs.searchsuggest = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Search-GetSuggestions";
app.URLs.searchnavigation = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Search-IncludeLeftNavigation";
app.URLs.submitDialogURL = 'https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/Page-AppResources';
app.URLs.productNav = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Product-Productnav";
app.URLs.SeverConnectionError = "La connexion au serveur a échoué!";
app.URLs.quickview_product_url = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/Proxy-Product2JSON";
app.URLs.PIConfirmDelete = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/PaymentInstruments-ConfirmDelete";
app.URLs.addressConfirmDelete = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/Address-ConfirmDelete";
app.URLs.pageInclude = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Page-Include";
app.URLs.findInStoreTemplate = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/FindInStore-Show";
app.URLs.findInStoreSearch = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/FindInStore-ProductSearch";
app.URLs.findInStoreLineItems = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/FindInStore-DisplayStores";
app.URLs.cartShow = "https://www.billabong.fr/cart/";
app.resources["NO_STORES_FOUND"] = "Sorry, but there were no stores found in this area with inventory in stock. Please try using the search box above to search in other areas.";
app.resources["phone_input_no_results_text"] = "Aucun résultat";
app.resources.getOtherRegionWebsiteJSON = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/Home-GetOtherRegionsWebsiteJSON";
// DQE - Preferences
app.DqeProxyUrl = "https://www.billabong.fr/on/demandware.store/Sites-BB-FR-Site/fr_FR/DQE-Proxy";
app.DqeEmailCheckEnabled = false;
app.DqePhoneCheckEnabled = true;
app.DqeAddressCheckEnabled = true;
app.DqeClientRNVPCheckEnabled = true;
app.DqeEmailAutocheck = false;
app.DqeEmailSuggest = false;
app.DqePhoneAutocheck = false;
app.DqePhoneNumberFormat = 2;
app.DqeCitySearch = 0;
app.DqeSearchDelay = 500;
app.DqeSingleSearchDelay = 1000;
app.DqeZipPatterns = {
'PRT': /^\d{4}([\-]\d{3})?$/, //new
'IRL': /^[A-Za-z]\d{2}\s[A-Za-z\d]{4}$/, //new
'FRA': /^\d{5}$/,
'DEU': /^\d{5}$/,
'AUT': /^\d{4}$/,
'BEL': /^\d{4}$/,
'CAN': /^[A-Z\d]{3} ?[A-Z\d]{3}$/,
'KOR': /^\d{3}[ -]?\d{3}$/,
'ESP': /^\d{5}$/,
'USA': /^([A-Z]{2})?[ -]?\d{5}[ -]?(\d{4})?$/i,
'ISR': /^\d{5}$/,
'ITA': /^\d{5}$/,
'LUX': /^\d{4}$/i,
'NLD': /^\d{4} ?([A-Z]{2})?$/,
'POL': /^\d\d-?\d{3}$/,
'PRT': /^\d{4}-?\d{3}$/,
'CZE': /^\d{3} ?\d{2}$/,
'ROU': /^\d{6}$/,
'GBR': /^[A-Z][A-Z\d]{1,3} ?\d[A-Z]{2}$/i,
'SGP': /^\d{6}$/,
'SVN': /^\d{4}$/,
'SWE': /^(SE)?-?\d{3} ?\d{2}$/,
'CHE': /^\d{4}$/,
'TUR': /^\d{5}$/,
'CHN': /^\d{6}$/,
'CHN-en': /^\d{6}$/,
'RUS': /^\d{6}$/,
'NOR': /^\d{4}$/,
'DNK': /^\d{4}$/,
'FIN': /^\d{5}$/,
'THA': /^\d{5}$/,
'MAR': /^\d{5}$/,
'HUN': /^\d{4}$/,
'HKG': /^.*$/, //Hong-kong
'HKG-en': /^.*$/, //Hong-kong
'QAT': /^.*$/, //Qatar
'NZL': /^\d{4}$/, //Nouvelle-zélande
'HRV': /^(HR)?-?\d{5}$/ //Croatie
};
// form validation zip patterns
app.FormValidationZipPatterns = {
"AT": "^\\d{4}$",
"BE": "^\\d{4}$",
"BR": "^\\d{5}([\\-]?)(\\d{3})$",
"CA": "^[AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\\d[AaBbCcEeGgHhJ-Nj-nPpRrSsTtV-Zv-z][ ]?\\d[AaBbCcEeGgHhJ-Nj-nPpRrSsTtV-Zv-z]\\d$",
"CH": "^\\d{4}$",
"DE": "^\\d{5}$",
"DK": "^\\d{4}$",
"ES": "^\\d{5}$",
"FI": "^\\d{5}$",
"FR": "^\\d{5}$",
"GB": "^[A-Pa-pR-Ur-uWYZwyz](([A-Ha-hK-Yk-y]?\\d\\d?)|(\\d[A-Ha-hJKPSTUWjkpstuw])|([A-Ha-hK-Yk-y]\\d[ABEHMNPRabehmnprV-Yv-y]))\\s?\\d[ABabD-Hd-hJLNjlnP-Up-uW-Zw-z]{2}$",
"IT": "^\\d{5}$",
"LU": "^\\d{4}$",
"NL": "^\\d{4}[ ][A-Z]{2}$",
"PT": "^\\d{4}([\\-]\\d{3})?$",
"US": "^((\\d{5}[ -]{1,1}\\d{4})|(\\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\\d[A-Za-z]\\s?\\d[A-Za-z]\\d))$"
};
//Geolocation references
app.resources["GEO_COUNTRY_CODE"] = "US";
app.resources["SHIP_TO_COUNTRY_CODE"]= "FR";
app.globalRedirectURL = "http://global.billabong.com";
// translations for ARIA attributes
app.resources.aria = {};
app.resources.aria.closesearch = "Fermer la recherche";
// Abandonned cart preferences
app.resources.abandonedCart = {
enabled : true,
provider : "AdobeCampaign",
storeEmailUrl : "/on/demandware.store/Sites-BB-FR-Site/fr_FR/AbandonedCart-StoreEmail",
storeNpkUrl : "/on/demandware.store/Sites-BB-FR-Site/fr_FR/AbandonedCart-StoreNpk"
};
// Country Context Preferences
// switched on or off via site preference > general > Site Configuration
app.resources.categoryContext = {
enabled: true,
setCategoryContextUrl: "/on/demandware.store/Sites-BB-FR-Site/fr_FR/CategoryContext-Set",
cookieName: "brCategoryContext",
contextUrls: {"men":"/homme/","women":"/femme/"}
};
// Tracking
app.resources.tracking = {
OmnitureTrackingServer : "null"
};
// translation of jQuery validate
(function ($) {
$.extend($.validator.messages, {
required : "Ce champ est obligatoire.",
remote : "Veuillez corriger ce champ.",
email : "Veuillez fournir une adresse électronique valide.",
url : "Veuillez fournir une adresse URL valide.",
cpf : "forms.address.CPF.field.invalid",
date : "Veuillez fournir une date valide.",
dateISO : "Veuillez fournir une date valide (ISO).",
number : "Veuillez fournir un numéro valide.",
digits : "Veuillez fournir seulement des chiffres.",
creditcard : "Veuillez fournir un numéro de carte de crédit valide.",
equalTo : "Veuillez fournir encore la même valeur.",
equalToIgnoreCase : "Veuillez fournir encore la même valeur.",
maxlength : $.validator.format("Veuillez fournir au plus {0} caractères."),
minlength : $.validator.format("Veuillez fournir au moins {0} caractères."),
rangelength : $.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."),
range : $.validator.format("Veuillez fournir une valeur entre {0} et {1}."),
max : $.validator.format("Veuillez fournir une valeur inférieur ou égal à {0}."),
min : $.validator.format("Veuillez fournir une valeur supérieur ou égal à {0}."),
emailConfirmIgnoreCase : "Merci de confirmer votre adresse email",
validateCountryState : "Please select a state associated with the selected country.",
regex : "Your input appears to be in the wrong format.",
zip : {
DE : "Bitte gib deine Postleitzahl mit 5 Ziffern an",
US : "Merci de saisir un code postal au format suivant: XXXXX or XXXXX-XXXX (chiffres uniquement).",
FR : "Merci de saisir un code postal composé de 5 chiffres.",
CA : "Please provide your postal code in a format like J8R 2A5.",
GB : "Merci de saisir un code postal formaté comme celui-ci YO31 1EB",
NL : "Merci de saisir un code postal formaté comme celui-ci 1114 AA",
PT : "Merci de saisir un code postal formaté comme celui-ci 1114-185",
IE : "Please provide your postal code in a format like D02 AF30.",
BR : "global.zip.validation.hint.format",
ES : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée.",
IT : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée.",
AT : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée.",
BE : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée.",
CH : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée.",
DK : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée.",
FI : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée.",
LU : "Le code postal que vous avez saisi n'est pas référencé dans notre base de donnée."
}
});
$.validator.customOptions = {
showRequiredMessages : true
};
// Pre init
// initialize the category context feature, if enabled
if (app.resources.categoryContext.enabled) {
app.processPageContext();
// we check if we have a cookie
var oldCookieJson = $.cookie.json;
$.cookie.json = false;
var categoryContextCookie = $.cookie(app.resources.categoryContext.cookieName);
$.cookie.json = oldCookieJson;
var currentCategoryContext = app.PageContext.firstLevelCategoryId;
// we check if we are on a certain category page
// do we need to override the cookie with a new value?
if (currentCategoryContext && currentCategoryContext !== categoryContextCookie) {
categoryContextCookie = currentCategoryContext;
$.get(app.resources.categoryContext.setCategoryContextUrl + '?categoryContext=' + encodeURIComponent(categoryContextCookie));
}
// add the class, if we have a value
if (categoryContextCookie) {
$('body').addClass('category-context-' + categoryContextCookie);
}
}
}(jQuery));
var checkoutForm = $("form[name$='_singleshipping']");
for (var namespace in Widgets.widgetExecutions) {
Widgets.widgetExecutions[namespace][Widgets.widgetExecutions[namespace].length] = 'DQEAddressCompletion';
}
// Address Verification System widget
Widgets.registered['DQEAddressCompletion'] = function(elem) {
var config = myEval(elem.data('config'));
var dv_shipping, dv_billing;
if (config.context == 'shipping') {
dv_shipping = new DQEValidator(config);
} else {
config.context = 'billing';
dv_billing = new DQEValidator(config);
}
};
app.URLs.DQEValidationOverlay = "/on/demandware.store/Sites-BB-FR-Site/fr_FR/DQESingle-ValidateAddress";
Widgets.widgetExecutions.overlay.push('shippingFormSubmit');
Widgets.registered['shippingFormSubmit'] = function () {
checkoutForm.submit();
};
var DQEValidator = function(config) {
// DQEValidator options -
// custom site preferences DQE Options (load the prefs)
var options = {
proxyUrl : app.DqeProxyUrl // DW-Server Proxy Url - DqeProxyUrl
, phoneCheckEnabled : app.DqePhoneCheckEnabled // Enabled or disabled the phone number Check - DqePhoneCheckEnabled
, phoneAutocheck : app.DqePhoneAutocheck // When this parameter is at true, checking is launched automatically as soon as the phone entry field is left - DqePhoneAutocheck
, phoneNumberFormat : app.DqePhoneNumberFormat // Format 1: "+33 3 39 89 88 71", 2: "0033 3 39 89 88 71", 3: "+33339898871", 4: "0033339898871" - DqePhoneNumberFormat
, addressCheckEnabled : app.DqeAddressCheckEnabled // Enabled or disabled the address Check - DqeAddressCheckEnabled
, clientRNVPCheckEnabled : app.DqeClientRNVPCheckEnabled// Enabled or disabled the client side RNVP address check - DqeClientRNVPCheckEnabled
, citySearch : 0//app.DqeCitySearch // 0 or 1 (if this parameter is present and is 1, it is possible to search for a postal code from the city field) - DqeCitySearch
, zipPatterns : app.DqeZipPatterns // Global Preference that holds the Regular expressions to test if a postal code has been entered to start searching for cities. Overwrites the internal zip patterns.
, searchDelay : app.DqeSearchDelay // The delay in milliseconds between when a keystroke occurs and when a ajax search is performed. DqeSearchDelay
, singleSearchDelay : app.DqeSingleSearchDelay // The delay in milliseconds between when a keystroke occurs and when single line address search is performed. DqeSingleSearchDelay
}
var HASH = "#"; // if you write # directly, it ends in an unrecognised error.
// gets the form id
var getFormId = function(){
//return '#RegistrationForm';
var formId = HASH + $(HASH + config.address1FieldID).closest('form').attr('id');
return formId;
};
// gets the field prefix
var getFieldIdPrefix = function(){
//return '#dwfrm_profile_address_';
var prefix = HASH + config.address1FieldID.replace('address1','');
return prefix;
};
// ---------------------------------------------------
// set some vars and form field id's
var form_id = getFormId()
, prefix = getFieldIdPrefix()
, firstName_id = prefix + 'firstName'
, lastName_id = prefix + 'lastName'
, address1_id = prefix + 'address1'
, address2_id = prefix + 'address2'
, address3_id = prefix + 'address3'
, province_id = prefix + 'stateCode'
, zip_id = prefix + 'zip'
, city_id = prefix + 'city'
, countryCode_id = prefix + 'countryCode'
, phone_id = prefix + 'phone'
, email_id = prefix + 'email'
, emailconfirm_id = prefix + 'emailconfirm'
, dqeSingleClass = '.dqeSingle'
;
// add a hidden form field for submitting the address hash
var adrhash_id = prefix + 'adrhash';
$(form_id).append('');
$(form_id).append('');
// create the addressHash and stores in a hidden form field
var createAddressHash = function() {
// there is a problem with the URI encoding. client and server side it's not the same encoding result.
// therefore we can't use a client side hash to compare with the server side hash.
/*
var zip = $(zip_id).val()
, city = $(city_id).val()
, street = $(address1_id).val()
, compl = $(address2_id).val()
, prov = $(province_id).val()
;
var addr = compl + "|" + street + "|" + prov + "|" + zip + "|" + city;
var str = addr.toLowerCase();
str = str.replace(/ä/g, "ae");
str = str.replace(/ö/g, "oe");
str = str.replace(/ü/g, "ue");
str = str.replace(/ß/g, "ss");
str = encodeURIComponent(str);
var addressHash = b64_md5(str);
$(adrhash_id).val(addressHash);
*/
// instead we use 'SUCCESS'
$(adrhash_id).val('SUCCESS');
};
// removes the addressHash from the hidden form field
var removeAddressHash = function() {
$(adrhash_id).val('');
};
// ---------------------------------------------------
// init phone check // Please note the same logic exists under DQE/JSWidget.isml
// Country code field is required on the page for the validations to be working, phone numbers are validated for specific country
if (options.phoneCheckEnabled && $(countryCode_id).length) {
$(phone_id).off('input change');
var dqe_phone = $(phone_id).dqephone({
server: options.proxyUrl
, autocheck: options.phoneAutocheck
, country: countryCode_id
, format: 2 // we get only format 2, because we change the output ourselves
// input: "0033 3 39 89 88 71"
// output: "+33 3 39 89 88 71"
//, format: options.phoneNumberFormat // 0: Numerals only, 1: With separators, 2: Basic international, 3: Full international
});
var _phone_id = phone_id.replace(HASH, '');
var _id_phone_status = 'id_phone_status_' + config.context;
var id_phone_status = HASH + _id_phone_status;
//Append this only once, with presumptions that autocomplete hook could be loaded on more than one form in the page and get appended multiple times
//and that we might have only one phone field in one page
if (!$('#' + _id_phone_status).length) {
$(phone_id).parent().append('');
}
// we detach the phone validation and create a new one, form.validation.js must be load before app.js
$(phone_id).removeClass('phone'); // detach the 'phone' validation method
$(phone_id).addClass(_phone_id);
$.validator.addMethod(_phone_id, function(phone) {
if (!$(phone_id).hasClass('errorclient')) return true;
return false;
}, app.resources.INVALID_PHONE );
dqe_phone.on('checking', function() {
$(id_phone_status).attr('style','color:grey;');
$(id_phone_status).html("Checking");
}).on('checked', function(ui, data) {
//console.log('dqe_phone checked: ' + data.status);
$(id_phone_status).attr('style','');
if (data.status) { // ok = status = 1
$(phone_id).addClass('valid');
$(phone_id).removeClass('errorclient');
// Format 1: "+33 3 39 89 88 71", 2: "0033 3 39 89 88 71", 3: "+33339898871", 4: "0033339898871"
var newPhoneNumber = data.output;
if (options.phoneNumberFormat == 2 || options.phoneNumberFormat == 4) { // replacing leading '+' with '00'
newPhoneNumber = newPhoneNumber.replace(/[+]/g, '00');
}
if (options.phoneNumberFormat == 3 || options.phoneNumberFormat == 4) { // removes all spaces
newPhoneNumber = newPhoneNumber.replace(/-|\s/g, '');
}
$(phone_id).val(newPhoneNumber);
$(id_phone_status).html('');
} else { // nok = status = 0
$(phone_id).removeClass('valid');
$(phone_id).addClass('errorclient');
$(id_phone_status).html(app.resources.INVALID_PHONE);
}
}).on("keypress", function() {
$(phone_id).removeClass('errorclient');
$(id_phone_status).html('');
}).on("change", function() {
$(phone_id).removeClass('errorclient');
$(id_phone_status).html('');
});
}
// ---------------------------------------------------
// init address check
//Work with address1 only if we have the field and the address check pref enabled
if (options.addressCheckEnabled && $(address1_id).length) {
$(address1_id).attr('data-ui-autocomplete','true');
var dqe_address = $(address1_id).dqe({
server : options.proxyUrl
, country : countryCode_id
, zip : zip_id
, city : city_id
, street : address1_id
, prov : province_id
, 'compl' : address2_id
, 'city_search' : options.citySearch
, single : address1_id
, searchDelay : options.searchDelay
, singleSearchDelay : options.singleSearchDelay
, minLengthForSuggestions : 5
});
$(zip_id).off('input change');
//Workaround to disable browser autofill on address1, so it doesnt mess with DQE Address Suggestions
$(address1_id).attr('autocomplete','disabled');
$(dqeSingleClass).attr('disabled', true);
if(config.context !== 'shipping') {
$(dqeSingleClass).attr('disabled', false);
}
if($(address1_id).val().trim().length > 0) {
$(dqeSingleClass).attr('disabled', false);
}
$('.ui-autocomplete .ui-menu-item').live('click', function() {
$(dqeSingleClass).attr('disabled', false);
});
var _id_address_status = 'id_address_status_' + config.context;
var id_address_status = HASH + _id_address_status;
$(address1_id).parent().append('');
/*
10 Address correct
20 Address correct (street not recognized, but this concerns a CEDEX or post office box)
21 Town, facade number outside limits
22 Town, facade number absent (the rest of the address is correct)
23 City, facade number outside limits
24 City, facade number absent (the rest of the address is correct)
25 If CEDEXA activated, CEDEX address unknown by CEDEXA
30 Town, street not recognized
31 Town, street not recognized (neighborhood recognized but unable to determine street)
40 Town, street absent (neighborhood recognized but unable to determine street)
41 Town, street absent
50 City, street not recognized
51 City, street not recognized (neighborhood recognized but unable to determine street)
60 City, street absent (neighborhood recognized but unable to determine street)
61 City, street absent
70 PC/City cannot be corrected (street exists)
80 PC/City cannot be corrected (street does not exist)
90 International address detected
*/
// only called if clientRNVPCheckEnabled = true
var callback_checkAddress_func_name = 'callback_checkAddress_' + config.context;
window[callback_checkAddress_func_name] = function(data) {
//console.log('callback_checkAddress called: data:' + data.data +', error:' + data.error + ', label:' + data.label);
var code = data.data;
var hasError = false;
switch(code) {
default: break;
case 10: case 20:
//console.log('address ok');
$(id_address_status).removeClass('errormessage');
$(id_address_status).html('');
createAddressHash();
break;
case 21: case 22: case 23: case 24: case 25:
//console.log('warning address not ok');
$(id_address_status).addClass('errormessage');
$(id_address_status).html(app.resources.INVALID_ADDRESS);
createAddressHash();
hasError = true;
break;
case 30: case 31: case 40: case 41: case 50: case 51: case 60: case 61: case 70: case 80: case 90:
//console.log('address not ok');
$(id_address_status).addClass('errormessage');
$(id_address_status).html(app.resources.INVALID_ADDRESS);
removeAddressHash();
hasError = true;
break;
}
if(hasError && $(form_id).valid()) {
app.showProgress();
app.ajax.load({
url: app.URLs.DQEValidationOverlay,
async: false,
callback: function (response) {
response = $.trim(response);
if (!response || response === '') {
$(form_id).submit();
} else {
$.colorbox({
html: response,
maxWidth: '635',
fixed: true,
className: 'DqeValidation-colorbox',
onComplete: function () {
app.hideProgress();
Widgets.initSome($("#cboxLoadedContent"), ['ajaxform']);
$(".btn_canceladdress").prop('type', 'button').on("click", function (e) {
e.preventDefault();
$.colorbox.close();
});
$.colorbox.resize();
return false;
}
});
}
}
});
return false;
} else {
$(".widget_addressValidation").unbind('click');
$(form_id).submit();
return true;
}
};
}
if (options.clientRNVPCheckEnabled) {
$(".widget_addressValidation").click(function (event) {
//No validation if there is selected store pickup address
if(!$('.js-selected-store-address').is(':visible')) {
event.preventDefault();
dqe_address.check(callback_checkAddress_func_name);
}
});
}
};
$(document).on('dqeSingle', function() {
var config = myEval($('.w_DQEAddressCompletion_initialized').data('config'));
new DQEValidator(config);
});
// filling the year select
var maxYear = ((new Date).getFullYear()) - 12;
var yearSelect = $('#dwfrm_signup_birthdayfields_year');
for (i = maxYear; i > 1896; i--){
yearSelect.append('');
}
/*
// preselect the fields
$( '#dwfrm_signup_birthdayfields_day option[value=' + daySelect.attr('data-targeted-value') + ']').attr('selected','selected');
$( '#dwfrm_signup_birthdayfields_month option[value=' + monthSelect.attr('data-targeted-value') + ']').attr('selected','selected');
*/
$('#dwfrm_signup_birthdayfields_year option[value="' + yearSelect.attr('data-targeted-value') + '"]').attr('selected','selected');
// set up the interest checkboxes from DW profile.custom.interests
var interests = ''.split(',');
if (interests != '') {
for (var i = 0; i < interests.length; i++) {
$('#dwfrm_signup_'+interests[i]).prop('checked', 'checked');
}
}
// check or uncheck all checkboxes
$("#dwfrm_signup_all").bind("change", function () {
$('.form-interests input:checkbox').prop('checked', this.checked);
});
// fill the hidden form field selectedInterests
$(".form-interests input:checkbox").bind("change", function () {
var target = $('#dwfrm_signup_selectedInterests');
if ($(this).attr('name') != $("#dwfrm_signup_all").attr('name')) $("#dwfrm_signup_all").prop('checked', '');
target.attr('value', '');
$('.form-interests input:checkbox').each(function ( index, value ) {
//if( value.checked && $(value).attr('name')!='dwfrm_signup_all') {
if( value.checked ) {
if ( target.attr('value') == "" ) target.attr('value', target.attr('value') + ',' + $(value).attr('name') + ',');
else target.attr('value', target.attr('value') + $(value).attr('name') + ',' );
}
});
target.attr('value', target.attr('value').replace(new RegExp('dwfrm_signup_', 'g'), '') );
target.attr('value', target.attr('value').substring(1, target.attr('value').length - 1) );
});