{"version":3,"sources":["mshop-product-page.js"],"names":["mshopProductPage","_configuration","_selectedProductId","_fancyBoxOptions","_fancyBoxSlides","_isDesktop","_currentReviewsPage","_loadedReviews","_isLoadingMoreReviews","_isSavingReview","_isSavingStockReminder","_isSubmittingFlashSaleForm","$_addToCartArea","$_addToCartFormProduct","$_addToCartAdwordsProduct","$_imageGallery","$_loadMoreReviewsBar","$_loadMoreReviewsButton","$_loadMoreReviewsHint","$_loadMoreReviewsProgress","$_mainImage","$_outOfStockReminder","$_outOfStockReminderButton","$_outOfStockReminderEmail","$_outOfStockReminderForm","$_outOfStockReminderMessage","$_productPrice","$_productStock","$_reviews","$_selectedVariantName","$_thumbnails","$_variants","$_writeReviewCallout","$_writeReviewFormBody","$_writeReviewFormBodyContainer","$_writeReviewFormBodyMessage","$_writeReviewFormBodyShadow","$_writeReviewFormButton","$_writeReviewFormMessage","$_writeReviewFormName","$_writeReviewFormNameContainer","$_writeReviewFormNameMessage","$_writeReviewFormRating","$_writeReviewFormTitle","$_writeReviewFormTitleContainer","$_writeReviewFormTitleMessage","$_accordionReviewsInput","$_accordionShippingInput","$_writeReviewArea","$_freeFreightLine","$_regularFreightLine","$_salesHint","$_flashSaleHintArea","$_flashSaleHint","$_flashSaleHintFormMessage","$_flashSaleHintSuccessMessage","$_flashSaleHintFormButton","$_flashSaleHintFormInput","$_flashSaleHintTitle","$_flashSaleHintDescription","$_flashSaleAddToCartHash","_swiper","boot","XmxApp","isDesktop","window","naeProductConfiguration","selectedProductId","Math","min","reviewSummary","totalReviews","pageSize","loop","infobar","buttons","slideShow","fullScreen","thumbs","closeBtn","touch","keyboard","focus","closeClickOutside","jQuery","on","onOutOfStockFormSubmit","onProductRatingClick","onProductFreightClick","onVariantClick","onLoadMoreReviewsButtonClick","onWriteReviewButtonClick","onWriteReviewFormSubmit","onWriteReviewFormNameInteraction","onWriteReviewFormTitleInteraction","onWriteReviewFormBodyInteraction","parent","next","onFlashSaleHintHeadClick","onFlashSaleHintFormSubmit","updateGallery","googleClickId","isCompletelyOutOfStock","extractHttpGetParameter","ajax","url","dataType","type","data","productId","storeId","location","href","clickId","ga","eventCategory","eventAction","productData","sku","eventLabel","nonInteraction","sendStockAlerts","isComingFromGoogleAdwords","updatePrice","updateFlashSaleHint","sales","elapsedHours","getCurrentTimestamp","time","quantitySold","floor","quantity","speed","hint","translations","salesInfo","replace","html","show","updateSalesHint","toggleClass","event","email","validationMessage","hash","val","toLowerCase","trim","validateEmailAddress","addClass","generateHashCode","removeClass","attr","success","response","$line1","$line2","$freight","$freightCaption","$oldPrice","$saving","$price","saving","discountInfo","round","flashSalePrice","price","save","empty","appendTo","formatPrice","readMoreAboutShipping","shipping","freeAt","freeShipping","hide","shipsForX","formatAmount","fee","updateFlashSalePrice","cartHash","complete","stopPropagation","preventDefault","now","showFlashSaleHint","flashSaleStart","flashSaleEnd","title","description","flashSaleMode","flashSaleTitlePercentDiscount","flashSaleTitleAmountDiscount","flashSaleTitleFixedPrice","savingPercent","finalPrice","savingAmount","savingPercentString","savingAmountString","priceAmountString","flashSaleDescription","rating","name","body","hasValidationErrors","minimumBodyLength","pleaseEnterAName","pleaseEnterATitle","pleaseEnterABody","length","pleaseEnterALongerBody","updateInputFieldLengthIndicator","$textarea","coolLength","awesomeLength","rockstarLength","$indicator","reviewRockstarLength","reviewAwesomeLength","reviewCoolLength","reviewMinLength","updateTextareaLengthIndicator","content","height","outerHeight","css","updateReviewFormTextareaSize","$inputField","maxLength","page","loadedPercent","reviews","review","$review","$reviewHead","$stars","$starIcon","$title","$reviewBody","$truncateOverlay","$truncateButton","$truncateButtonTitle","$reviewFooter","$reviewInput","$truncate","$description","$reviewAuthor","$reviewCertificate","$response","$responseTitle","$responseBody","$responseBodyDescription","reviewIndex","star","id","isTruncated","prop","readMore","reviewFooter","author","date","isVerified","verifiedPurchase","customerServiceResponse","addReviews","noMoreReviewsToLoad","reviewProgress","$line3","$campaignBadge","$unitPrice","basePrice","isAdwordsPrice","adwordsPrice","baseUnitValue","adwordsDiscountInfo","campaignBadge","baseUnitMeasure","formatUnit","klarnaPayment","$klarnaPaymentHint","$klarnaLogo","$klarnaLabel","monthlyPayment","months","onSwiperSlideChange","realIndex","onSwiperSlideClick","button","fancybox","open","onMainImageClick","onThumbnailClick","mediaIndex","this","slideToLoop","imageData","lastImage","$thumbnail","$thumbnailImage","$thumbnailPicture","$mobileThumbnailSource","$desktopThumbnailSource","$swiperContainer","$swiperButtonNext","$swiperButtonPrevious","$swiperWrapper","$swiperSlide","$videoTitle","$videoIcon","$swiperImage","$swiperPicture","$swiperImageSource","galleryImage","totalNumberOfSlides","imageIndex","destroy","images","galleryIndex","mobileThumbnailUrl","desktopThumbnailUrl","label","gallery","media","src","push","zoomImageUrl","opts","index","className","match","join","videoUrl","galleryIndexB","video","Swiper","containerModifierClass","wrapperClass","slideClass","slideActiveClass","slideVisibleClass","slidePrevClass","slideNextClass","centeredSlides","spaceBetween","loopedSlides","preventClicksPropagation","simulateTouch","threshold","grabCursor","navigation","nextEl","prevEl","disabledClass","slideChange","click","changeSelectedProduct","stockColor","stockLabel","isInStock","variantData","$variant","variantIndex","variants","optionLabel","$content","scrollOffset","animate","scrollTop","offset","top","construct"],"mappings":"AAAA,IAAIA,iBAAmB,WAKnB,IAAIC,EACAC,EACAC,EACAC,EAEAC,EACAC,EACAC,EACAC,EACAC,EACHC,EACAC,EAKAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEAC,EAEAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACGC,EACAC,EACAC,EAGHC,EACAC,EACAC,EAGAC,EACAC,EAGAC,EACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GApEGC,GAAU,KAyEd,SAASC,KAEXzD,EAAa0D,OAAOC,YACd/D,EAAiBgE,OAAOC,wBAC3BhE,EA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HwO,UAAW,WAEPpT,OA1yDW,GAgzDvB9D,iBAAiBkX","file":"mshop-product-page-4.0.2.min.js","sourcesContent":["var mshopProductPage = (function()\r\n{\r\n /**\r\n * \r\n */\r\n var _configuration;\r\n var _selectedProductId;\r\n var _fancyBoxOptions;\r\n var _fancyBoxSlides;\r\n var _swiper = null;\r\n var _isDesktop;\r\n var _currentReviewsPage;\r\n var _loadedReviews;\r\n var _isLoadingMoreReviews;\r\n var _isSavingReview;\r\n\tvar _isSavingStockReminder;\r\n\tvar _isSubmittingFlashSaleForm;\r\n\r\n /**\r\n *\r\n */\r\n\tvar $_addToCartArea;\r\n\tvar $_addToCartFormProduct;\r\n\tvar $_addToCartAdwordsProduct;\r\n\tvar $_imageGallery;\r\n\tvar $_loadMoreReviewsBar;\r\n\tvar $_loadMoreReviewsButton;\r\n\tvar $_loadMoreReviewsHint;\r\n\tvar $_loadMoreReviewsProgress;\r\n\tvar $_mainImage;\r\n\tvar $_outOfStockReminder;\r\n\tvar $_outOfStockReminderButton;\r\n\tvar $_outOfStockReminderEmail;\r\n\tvar $_outOfStockReminderForm;\r\n\tvar $_outOfStockReminderMessage;\r\n\tvar $_productFreight;\r\n\tvar $_productPrice;\r\n\tvar $_productRating;\r\n\tvar $_productStock;\r\n\tvar $_reviews;\r\n\tvar $_selectedVariantName;\r\n\tvar $_thumbnails;\r\n\tvar $_variants;\r\n\tvar $_writeReviewCallout;\r\n\tvar $_writeReviewFormBody;\r\n\tvar $_writeReviewFormBodyContainer;\r\n\tvar $_writeReviewFormBodyMessage;\r\n\tvar $_writeReviewFormBodyShadow;\r\n\tvar $_writeReviewFormButton;\r\n\tvar $_writeReviewFormMessage;\r\n\tvar $_writeReviewFormName;\r\n\tvar $_writeReviewFormNameContainer;\r\n\tvar $_writeReviewFormNameMessage;\r\n\tvar $_writeReviewFormRating;\r\n\tvar $_writeReviewFormTitle;\r\n\tvar $_writeReviewFormTitleContainer;\r\n\tvar $_writeReviewFormTitleMessage;\r\n var $_accordionReviewsInput;\r\n var $_accordionShippingInput;\r\n var $_writeReviewArea;\r\n var $_writeReviewButton;\r\n var $_writeReviewForm;\r\n\tvar $_freeFreightLine;\r\n\tvar $_regularFreightLine;\r\n\tvar $_salesHint;\r\n\r\n\t// Flash Sale\r\n\tvar $_flashSaleHintArea;\r\n\tvar $_flashSaleHint;\r\n\tvar $_flashSaleHintHead;\r\n\tvar $_flashSaleHintForm;\r\n\tvar $_flashSaleHintFormMessage;\r\n\tvar $_flashSaleHintSuccessMessage;\r\n\tvar $_flashSaleHintFormButton;\r\n\tvar $_flashSaleHintFormInput;\r\n\tvar $_flashSaleHintTitle;\r\n\tvar $_flashSaleHintDescription;\r\n\tvar $_flashSaleAddToCartHash;\r\n\r\n /**\r\n * Executed one page is loaded\r\n */\r\n function boot()\r\n {\r\n\t\t_isDesktop = XmxApp.isDesktop(); \r\n _configuration = window.naeProductConfiguration;\r\n \t_selectedProductId = _configuration.selectedProductId;\r\n \t_currentReviewsPage = 1;\r\n \t_loadedReviews = Math.min(_configuration.reviewSummary.totalReviews, _configuration.reviewSummary.pageSize);\r\n \t_isLoadingMoreReviews = false;\r\n \t_isSavingReview = false;\r\n\t\t_isSavingStockReminder = false;\r\n\t\t_isSubmittingFlashSaleForm = false;\r\n\r\n // Settings for the fancy box\r\n _fancyBoxOptions =\r\n {\r\n loop: true,\r\n\r\n // 1/5 and previous/next buttons on top\r\n infobar: true, \r\n\r\n // buttons in the top right corner\r\n buttons: true, \r\n\r\n // What buttons should appear in the toolbar\r\n slideShow: true,\r\n fullScreen: true,\r\n thumbs: true,\r\n closeBtn: true,\r\n\r\n // Enable gestures (tap, zoom, pan and pinch)\r\n touch: true,\r\n\r\n // Enable keyboard navigation\r\n keyboard: true,\r\n\r\n // Try to focus on first focusable element after opening\r\n focus: true,\r\n\r\n // Close when clicked outside of the content\r\n closeClickOutside: true\r\n };\r\n\r\n // Hook the add to cart button\r\n\t\t//$_addToCartButton = jQuery('#add-to-cart-button');\r\n\t\t$_addToCartArea = jQuery('#add-to-cart-area');\r\n\t\t$_addToCartFormProduct = jQuery('#add-to-cart-form-product');\r\n\t\t$_addToCartAdwordsProduct = jQuery('#add-to-cart-form-adwords-product');\r\n\r\n\t\t// Freight cost in shipping tab\r\n\t\t$_freeFreightLine = jQuery('#free-freigt-line');\r\n\t\t$_regularFreightLine = jQuery('#regular-freight-line');\r\n\r\n\t\t// Hook out of stock area\r\n\t\t$_outOfStockReminder = jQuery('#out-of-stock-reminder');\r\n\t\t$_outOfStockReminderForm = jQuery('#out-of-stock-reminder-form');\r\n\t\t$_outOfStockReminderForm.on('submit', onOutOfStockFormSubmit);\r\n\t\t$_outOfStockReminderButton = jQuery('#out-of-stock-reminder-button');\r\n\t\t$_outOfStockReminderEmail = jQuery('#out-of-stock-reminder-email');\r\n\t\t$_outOfStockReminderMessage = jQuery('#out-of-stock-reminder-message');\r\n\r\n \t// Make the star rating header clickable\r\n \t$_accordionReviewsInput = jQuery('#accordion-reviews');\r\n\t\t$_productRating = jQuery('#product-rating');\r\n\t\t$_productRating.on('click', onProductRatingClick);\r\n\r\n \t// Make the freight clickable\r\n \t$_accordionShippingInput = jQuery('#accordion-shipping');\r\n\t\t$_productFreight = jQuery('#product-freight');\r\n\t\t$_productFreight.on('click', onProductFreightClick);\r\n\r\n\t\t// Make the variants clickable\r\n\t\t$_variants = jQuery('#product-variants > .xmx-product-variation');\r\n\t\t$_variants.on('click', onVariantClick);\r\n\r\n\t\t// Hook the variant name\r\n\t\t$_selectedVariantName = jQuery('#selected-variant-name');\r\n\r\n\t\t// Hook the stock\r\n\t\t$_productStock = jQuery('#product-stock');\r\n\r\n\t\t// Hook the price\r\n\t\t$_productPrice = jQuery('#product-price');\r\n\r\n\t\t// Hook the thumbnails and main image\r\n\t\t$_thumbnails = jQuery('#thumbnails');\r\n\t\t$_mainImage = jQuery('#main-image');\r\n\t\t$_imageGallery = jQuery('#image-gallery');\r\n\r\n\t\t// Hook the review area\r\n\t\t$_reviews = jQuery('#reviews');\r\n\t\t$_loadMoreReviewsHint = jQuery('#load-more-reviews-hint');\r\n\t\t$_loadMoreReviewsBar = jQuery('#load-more-reviews-bar');\r\n\t\t$_loadMoreReviewsProgress = jQuery('#load-more-reviews-progress');\r\n\t\t$_loadMoreReviewsButton = jQuery('#load-more-reviews-button');\r\n\t\t$_loadMoreReviewsButton.on('click', onLoadMoreReviewsButtonClick);\r\n\r\n // Make the \"Write Review\" button clickable\r\n $_writeReviewArea = jQuery('#write-review-area');\r\n $_writeReviewCallout = jQuery('#write-review-callout');\r\n $_writeReviewButton = jQuery('#write-review-button');\r\n $_writeReviewButton.on('click', onWriteReviewButtonClick);\r\n $_writeReviewFormButton = jQuery('#write-review-form-button');\r\n $_writeReviewForm = jQuery('#write-review-form');\r\n \t$_writeReviewForm.on('submit', onWriteReviewFormSubmit);\r\n\r\n \t// Review Form Star Rating\r\n\t\t$_writeReviewFormRating = jQuery('#write-review-form-rating');\r\n\r\n\t\t// Review Form Name Input\r\n\t\t$_writeReviewFormName = jQuery('#write-review-form-name');\r\n\t\t$_writeReviewFormName.on('paste', onWriteReviewFormNameInteraction);\r\n\t\t$_writeReviewFormName.on('keyup', onWriteReviewFormNameInteraction);\r\n\t\t$_writeReviewFormName.on('keydown', onWriteReviewFormNameInteraction);\r\n\t\t$_writeReviewFormName.on('blur', onWriteReviewFormNameInteraction);\r\n\r\n\t\t// Review Form Title Input\r\n\t\t$_writeReviewFormTitle = jQuery('#write-review-form-title');\r\n\t\t$_writeReviewFormTitle.on('paste', onWriteReviewFormTitleInteraction);\r\n\t\t$_writeReviewFormTitle.on('keyup', onWriteReviewFormTitleInteraction);\r\n\t\t$_writeReviewFormTitle.on('keydown', onWriteReviewFormTitleInteraction);\r\n\t\t$_writeReviewFormTitle.on('blur', onWriteReviewFormTitleInteraction);\r\n\r\n\t\t// Review Form Body Text Area\r\n\t\t$_writeReviewFormBodyShadow = jQuery('#write-review-form-body-shadow');\r\n\t\t$_writeReviewFormBody = jQuery('#write-review-form-body');\r\n\t\t$_writeReviewFormBody.on('paste', onWriteReviewFormBodyInteraction);\r\n\t\t$_writeReviewFormBody.on('keyup', onWriteReviewFormBodyInteraction);\r\n\t\t$_writeReviewFormBody.on('keydown', onWriteReviewFormBodyInteraction);\r\n\t\t$_writeReviewFormBody.on('blur', onWriteReviewFormBodyInteraction);\r\n\r\n\t\t// Validation messages\r\n\t\t$_writeReviewFormNameMessage = $_writeReviewFormName.parent().next();\r\n\t\t$_writeReviewFormTitleMessage = $_writeReviewFormTitle.parent().next();\r\n\t\t$_writeReviewFormBodyMessage = $_writeReviewFormBody.parent().next();\r\n\r\n\t\t// Input field wraps\r\n\t\t$_writeReviewFormNameContainer = $_writeReviewFormName.parent().parent();\r\n\t\t$_writeReviewFormTitleContainer = $_writeReviewFormTitle.parent().parent();\r\n\t\t$_writeReviewFormBodyContainer = $_writeReviewFormBody.parent().parent();\r\n\r\n\t\t// Success message\r\n\t\t$_writeReviewFormMessage = jQuery('#write-review-form-message');\r\n\r\n\t\t// Flash Sale\r\n\t\t$_flashSaleHintArea = jQuery('#xmx-flash-sale-hint-area');\r\n\t\t$_flashSaleHint = jQuery('#xmx-flash-sale-hint');\r\n\t\t$_flashSaleHintHead = jQuery('#xmx-flash-sale-hint-head');\r\n\t\t$_flashSaleHintHead.on('click', onFlashSaleHintHeadClick);\r\n\t\t$_flashSaleHintForm = jQuery('#xmx-flash-sale-hint-form');\r\n\t\t$_flashSaleHintForm.on('submit', onFlashSaleHintFormSubmit);\r\n\t\t$_flashSaleHintFormMessage = jQuery('#xmx-flash-sale-hint-form-message');\r\n\t\t$_flashSaleHintSuccessMessage = jQuery('#xmx-flash-sale-hint-success-message');\r\n\t\t$_flashSaleHintFormButton = jQuery('#xmx-flash-sale-hint-form-button');\r\n\t\t$_flashSaleHintFormInput = jQuery('#xmx-flash-sale-hint-form-input');\r\n\t\t$_flashSaleHintTitle = jQuery('#xmx-flash-sale-hint-title');\r\n\t\t$_flashSaleHintDescription = jQuery('#xmx-flash-sale-hint-description');\r\n\t\t$_flashSaleAddToCartHash = jQuery('#add-to-cart-form-flash');\r\n\r\n\t\t// Qty. sold\r\n\t\t$_salesHint = jQuery('#product-sales');\r\n\r\n // Start the gallery\r\n updateGallery();\r\n\r\n\t\tsendStockAlerts();\r\n\t\t\r\n\t\t// If the visitor is coming from Google Adwords, update the price\r\n\t\tif (XmxApp.isComingFromGoogleAdwords())\r\n\t\t{\r\n\t\t\tupdatePrice();\r\n\t\t}\r\n\r\n\t\t// Update flash sale hint\r\n\t\tupdateFlashSaleHint();\r\n\r\n\t\t// Update sales int\r\n\t\tupdateSalesHint();\r\n }\r\n\r\n\t/**\r\n\t * User has clicked flash sale head\r\n\t */\r\n\tfunction onFlashSaleHintHeadClick()\r\n\t{\r\n\t\t$_flashSaleHint.toggleClass('xmx-flash-sale-hint--open');\r\n\t}\r\n\r\n\t/**\r\n\t * User has submitted flash sale form\r\n\t * \r\n\t * @param {event} event \r\n\t */\r\n\tfunction onFlashSaleHintFormSubmit(event)\r\n\t{\r\n\t\tvar email;\r\n\t\tvar validationMessage;\r\n\t\tvar hash;\r\n\r\n\t\t// Do not submit twice\r\n\t\tif (!_isSubmittingFlashSaleForm)\r\n\t\t{\r\n\t\t\t// Check that the email address is not empty\r\n\t\t\temail = $_flashSaleHintFormInput.val().toLowerCase().trim();\r\n\t\t\tvalidationMessage = XmxApp.validateEmailAddress(email);\r\n\r\n\t\t\tif (validationMessage != '')\r\n\t\t\t{\r\n\t\t\t\t// Validation failed\r\n\t\t\t\t$_flashSaleHintFormMessage.html(validationMessage);\r\n\t\t\t\t$_flashSaleHintFormMessage.addClass('xmx-flash-sale-hint-form-message--visible');\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\thash = XmxApp.generateHashCode(email);\r\n\r\n\t\t\t\t// Block clicking twice\r\n\t\t\t\t_isSubmittingFlashSaleForm = true;\r\n\r\n\t\t\t\t// Validation passed\r\n\t\t\t\t$_flashSaleHintFormMessage.removeClass('xmx-flash-sale-hint-form-message--visible');\r\n\t\t\t\t$_flashSaleHintFormMessage.html('');\r\n\r\n\t\t\t\t// Show the ajax loader\r\n\t\t\t\t$_flashSaleHintFormInput.attr('disabled', true);\r\n\t\t\t\t$_flashSaleHintFormButton.attr('disabled', true);\r\n\r\n\t\t\t\t// Tell the server\r\n\t\t\t\t// Post the data\r\n\t\t\t\tjQuery.ajax\r\n\t\t\t\t({\r\n\t\t\t\t\turl: '/ajax/product/flashsale',\r\n\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\ttype: 'post',\r\n\t\t\t\t\tdata:\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t'productId': _selectedProductId,\r\n\t\t\t\t\t\t'storeId': _configuration.storeId,\r\n\t\t\t\t\t\t'email': email,\r\n\t\t\t\t\t\t'hash': hash\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsuccess: function (response)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (response.success)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Reset the form\r\n\t\t\t\t\t\t\t$_flashSaleHintFormInput.val('');\r\n\r\n\t\t\t\t\t\t\t// Update the price visible for the user\r\n\t\t\t\t\t\t\tupdateFlashSalePrice();\r\n\r\n\t\t\t\t\t\t\t// Tell the add to cart form, it is a flash sale\r\n\r\n\t\t\t\t\t\t\t// Hide the hint\r\n\t\t\t\t\t\t\t$_flashSaleHint.hide();\r\n\r\n\t\t\t\t\t\t\t// Show the success message\r\n\t\t\t\t\t\t\t$_flashSaleHintSuccessMessage.addClass('xmx-message--visible');\r\n\r\n\t\t\t\t\t\t\t// Update the add to cart form, so that the flash sale price is \r\n\t\t\t\t\t\t\t// whenever the user adds it to the cart\r\n\t\t\t\t\t\t\t$_flashSaleAddToCartHash.val(response.cartHash);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcomplete: function ()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// We are not saving anymore\r\n\t\t\t\t\t\t_isSubmittingFlashSaleForm = false;\r\n\r\n\t\t\t\t\t\t// Remove loading bubbles\r\n\t\t\t\t\t\t$_flashSaleHintFormInput.attr('disabled', false);\r\n\t\t\t\t\t\t$_flashSaleHintFormButton.attr('disabled', false);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Always cancel the event\r\n\t\tevent.stopPropagation();\r\n\t\tevent.preventDefault();\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tfunction updateSalesHint()\r\n\t{\r\n\t\t// If there is no sales info, get out of here\r\n\t\tif (_configuration.sales === null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar elapsedHours = (XmxApp.getCurrentTimestamp() - _configuration.sales.time) / (60 * 60);\r\n\t\tvar quantitySold = Math.floor(_configuration.sales.quantity + _configuration.sales.speed * elapsedHours);\r\n\t\tvar hint = _configuration.translations.salesInfo.replace('$1', quantitySold);\r\n\r\n\t\t$_salesHint.html(hint);\r\n\t\t$_salesHint.show();\r\n\t}\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tfunction updateFlashSaleHint()\r\n\t{\r\n\t\tvar productData = _configuration.productData[_selectedProductId];\r\n\t\tvar now = XmxApp.getCurrentTimestamp();\r\n\t\tvar showFlashSaleHint = false;\r\n\r\n\t\tif (productData.flashSalePrice > 0)\r\n\t\t{\r\n\t\t\tif (now >= productData.flashSaleStart)\r\n\t\t\t{\r\n\t\t\t\tif (now <= productData.flashSaleEnd)\r\n\t\t\t\t{\r\n\t\t\t\t\tshowFlashSaleHint = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!showFlashSaleHint)\r\n\t\t{\r\n\t\t\t$_flashSaleHintArea.hide();\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t// Update title and description\r\n\t\t\tvar title = '';\r\n\t\t\tvar description = '';\r\n\r\n\t\t\tswitch (productData.flashSaleMode)\r\n\t\t\t{\r\n\t\t\t\t// Save an additional X%\r\n\t\t\t\tcase 'percent-discount':\r\n\t\t\t\t{\r\n\t\t\t\t\ttitle = _configuration.translations.flashSaleTitlePercentDiscount;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Save an additional X kr\r\n\t\t\t\tcase 'amount-discount':\r\n\t\t\t\t{\r\n\t\t\t\t\ttitle = _configuration.translations.flashSaleTitleAmountDiscount;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Get for it for X kr\r\n\t\t\t\tcase 'fixed-price':\r\n\t\t\t\t{\r\n\t\t\t\t\ttitle = _configuration.translations.flashSaleTitleFixedPrice;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Replace placeholders\r\n\t\t\tvar savingPercent = 100 - Math.round(productData.flashSalePrice * 100 / productData.finalPrice);\r\n\t\t\tvar savingAmount = productData.finalPrice - productData.flashSalePrice;\r\n\r\n\t\t\tvar savingPercentString = savingPercent + '%';\r\n\t\t\tvar savingAmountString = XmxApp.formatAmount(savingAmount);\r\n\t\t\tvar priceAmountString = XmxApp.formatAmount(productData.flashSalePrice);\r\n\r\n\t\t\ttitle = title.replace('$1', savingPercentString);\r\n\t\t\ttitle = title.replace('$2', savingAmountString);\r\n\t\t\ttitle = title.replace('$3', priceAmountString);\r\n\r\n\t\t\tdescription = _configuration.translations.flashSaleDescription;\r\n\t\t\tdescription = description.replace('$1', savingPercentString);\r\n\t\t\tdescription = description.replace('$2', savingAmountString);\r\n\t\t\tdescription = description.replace('$3', priceAmountString);\r\n\r\n\t\t\t// Update elements\r\n\t\t\t$_flashSaleAddToCartHash.val('');\r\n\t\t\t$_flashSaleHintFormMessage.removeClass('xmx-flash-sale-hint-form-message--visible');\r\n\t\t\t$_flashSaleHintFormMessage.html('');\r\n\t\t\t$_flashSaleHintSuccessMessage.removeClass('xmx-message--visible');\r\n\t\t\t$_flashSaleHintDescription.html(description);\r\n\t\t\t$_flashSaleHintTitle.html(title);\r\n\t\t\t$_flashSaleHintArea.show();\r\n\t\t\t$_flashSaleHint.show();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the price UI\r\n\t */\r\n\tfunction updateFlashSalePrice()\r\n\t{\r\n\t\tvar productData = _configuration.productData[_selectedProductId];\r\n\t\tvar $line1;\r\n\t\tvar $line2;\r\n\t\tvar $freight;\r\n\t\tvar $freightCaption;\r\n\t\tvar $oldPrice;\r\n\t\tvar $saving;\r\n\t\tvar $price;\r\n\t\tvar saving;\r\n\t\tvar discountInfo;\r\n\r\n\t\t// Calculate saving %\r\n\t\tsaving = 100 - Math.round(productData.flashSalePrice * 100 / productData.price);\r\n\t\tdiscountInfo = _configuration.translations.save + ' ' + saving + '%';\r\n\r\n\t\t// Throw away the old info\r\n\t\t$_productPrice.empty();\r\n\r\n\t\t// Add line 1\r\n\t\t$line1 = jQuery('
');\r\n\t\t$line1.addClass('xmx-product-detail-price-line-1');\r\n\t\t$line1.appendTo($_productPrice);\r\n\r\n\t\t// Add line 2\r\n\t\t$line2 = jQuery('
');\r\n\t\t$line2.addClass('xmx-product-detail-price-line-2');\r\n\t\t$line2.appendTo($_productPrice);\r\n\r\n\t\t$oldPrice = jQuery('
');\r\n\t\t$oldPrice.addClass('xmx-product-detail-price-old');\r\n\t\t$oldPrice.html(XmxApp.formatPrice(productData.price));\r\n\t\t$oldPrice.appendTo($line1);\r\n\r\n\t\t$saving = jQuery('
');\r\n\t\t$saving.addClass('xmx-product-detail-price-saving');\r\n\t\t$saving.html(discountInfo);\r\n\t\t$saving.appendTo($line1);\r\n\r\n\t\t// Build the price\r\n\t\t$price = jQuery('
');\r\n\t\t$price.addClass('xmx-product-detail-price-special');\r\n\t\t$price.html(XmxApp.formatPrice(productData.flashSalePrice));\r\n\t\t$price.appendTo($line2);\r\n\r\n\t\t// Build shipping\r\n\t\t$freight = jQuery('
');\r\n\t\t$freight.addClass('xmx-product-detail-price-freight');\r\n\t\t$freight.attr('id', 'product-freight');\r\n\t\t$freight.attr('title', _configuration.translations.readMoreAboutShipping);\r\n\t\t$freight.appendTo($line2);\r\n\r\n\t\t// Re-hook it\r\n\t\t$_productFreight = $freight;\r\n\t\t$_productFreight.on('click', onProductFreightClick);\r\n\r\n\t\t// Caption the freight\r\n\t\t$freightCaption = jQuery('');\r\n\t\t$freightCaption.addClass('xmx-product-detail-price-freight-inner');\r\n\r\n\t\tif (productData.flashSalePrice >= _configuration.shipping.freeAt)\r\n\t\t{\r\n\t\t\t$freightCaption.html(_configuration.translations.freeShipping);\r\n\r\n\t\t\t// Update price in shipping tab\r\n\t\t\t$_freeFreightLine.show();\r\n\t\t\t$_regularFreightLine.hide();\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$freightCaption.html(_configuration.translations.shipsForX.replace('%1', XmxApp.formatAmount(_configuration.shipping.fee)));\r\n\r\n\t\t\t// Update price in shipping tab\r\n\t\t\t$_freeFreightLine.hide();\r\n\t\t\t$_regularFreightLine.show();\r\n\t\t}\r\n\r\n\t\t$freightCaption.appendTo($freight);\r\n\t}\r\n\r\n /**\r\n * Sends an alert if the visitor comes from Google Adwords and sees an out of stock\r\n * product.\r\n */\r\n function sendStockAlerts()\r\n {\r\n \tvar googleClickId;\r\n\r\n \tif (_configuration.isCompletelyOutOfStock)\r\n \t{\r\n \t\t// Google Adwords\r\n \t\tgoogleClickId = XmxApp.extractHttpGetParameter('gclid');\r\n\r\n \t\tif (googleClickId != '')\r\n \t\t{\r\n\t\t\t\tjQuery.ajax\r\n\t\t\t\t({\r\n\t\t\t\t\turl: '/ajax/product/googleAdwordsAlert',\r\n\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\ttype: 'post',\r\n\t\t\t\t\tdata:\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t'productId': _selectedProductId,\r\n\t\t\t\t\t\t'storeId': _configuration.storeId,\r\n\t\t\t\t\t\t'url': window.location.href,\r\n\t\t\t\t\t\t'clickId': googleClickId\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n \t\t}\r\n\r\n \t\t// Google Analytics\r\n\t\t\tif (typeof ga !== 'undefined')\r\n\t\t\t{\r\n\t\t\t\tga('send', 'event', \r\n\t\t\t\t{\r\n\t\t\t\t\t'eventCategory': 'Out of Stock Product View',\r\n\t\t\t\t\t'eventAction': _configuration.productData[_selectedProductId].sku,\r\n\t\t\t\t\t'eventLabel': googleClickId, \r\n\t\t\t\t\t'nonInteraction': true\r\n\t\t\t\t});\r\n\t\t\t}\r\n \t}\r\n }\r\n\r\n /**\r\n * A user is submitting the \"please send me an email once its back\" form\r\n */\r\n function onOutOfStockFormSubmit()\r\n {\r\n \tvar email = $_outOfStockReminderEmail.val().trim();\r\n\r\n \t// No realy validation for now\r\n \tif (email == '')\r\n \t{\r\n \t\treturn false;\r\n \t}\r\n\r\n \t// If we are already saving things, get out of here\r\n \tif (_isSavingStockReminder)\r\n \t{\r\n \t\treturn false;\r\n \t}\r\n\r\n \t_isSavingStockReminder = true;\r\n\r\n \t// Disable the button and show the loading bubbles\r\n \t$_outOfStockReminderButton.attr('disabled', true);\r\n \t$_outOfStockReminderButton.addClass('xmx-button--loading');\r\n\r\n \t// Post the data\r\n\t\tjQuery.ajax\r\n\t\t({\r\n\t\t\turl: '/ajax/product/postStockReminder',\r\n\t\t\tdataType: 'json',\r\n\t\t\ttype: 'post',\r\n\t\t\tdata:\r\n\t\t\t{\r\n\t\t\t\t'productId': _selectedProductId,\r\n\t\t\t\t'storeId': _configuration.storeId,\r\n\t\t\t\t'email': email\r\n\t\t\t\t// TODO: checksum\r\n\t\t\t},\r\n\t\t\tsuccess: function(response)\r\n\t\t\t{\r\n\t\t\t\tif (response.success)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Reset the form\r\n\t\t\t\t\t$_outOfStockReminderEmail.val('');\r\n\r\n\t\t\t\t\t// Hide the form\r\n\t\t\t\t\t$_outOfStockReminderForm.hide();\r\n\r\n\t\t\t\t\t// Show the message\r\n\t\t\t\t\t$_outOfStockReminderMessage.addClass('xmx-message--visible');\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcomplete: function()\r\n\t\t\t{\r\n\t\t\t\t// We are not saving anymore\r\n\t\t\t\t_isSavingStockReminder = false;\r\n\r\n\t\t\t\t// Disable the button and hide the loading bubbles\r\n\t\t\t\t$_outOfStockReminderButton.attr('disabled', false);\r\n\t\t\t\t$_outOfStockReminderButton.removeClass('xmx-button--loading');\r\n\t\t\t}\r\n\t\t});\r\n\r\n \treturn false;\r\n }\r\n\r\n /**\r\n * The user has submittedthe \"Post Review\" form\r\n *\r\n * This solution is not elegant, but does the job for now\r\n */\r\n function onWriteReviewFormSubmit()\r\n {\r\n \tvar rating;\r\n \tvar name;\r\n \tvar title;\r\n \tvar body;\r\n \tvar hasValidationErrors = false;\r\n \tvar minimumBodyLength = $_writeReviewFormBody.data('cool-length');\r\n\r\n \t// The rating is always present, since its a star rating\r\n \trating = $_writeReviewFormRating.val();\r\n\r\n \t// Check that the name is present\r\n\t\tname = $_writeReviewFormName.val().trim();\r\n\r\n\t\tif (name == '')\r\n\t\t{\r\n\t\t\t$_writeReviewFormNameMessage.html(_configuration.translations.pleaseEnterAName);\r\n\t\t\t$_writeReviewFormNameContainer.addClass('xmx-form-field--error');\r\n\t\t\t$_writeReviewFormNameContainer.addClass('xmx-form-field--show-message');\r\n\t\t\thasValidationErrors = true;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$_writeReviewFormNameContainer.removeClass('xmx-form-field--error');\r\n\t\t\t$_writeReviewFormNameContainer.removeClass('xmx-form-field--show-message');\r\n\t\t}\r\n\r\n\t\t// Check that the title is present\r\n\t\ttitle = $_writeReviewFormTitle.val().trim();\r\n\r\n\t\tif (title == '')\r\n\t\t{\r\n\t\t\t$_writeReviewFormTitleMessage.html(_configuration.translations.pleaseEnterATitle);\r\n\t\t\t$_writeReviewFormTitleContainer.addClass('xmx-form-field--error');\r\n\t\t\t$_writeReviewFormTitleContainer.addClass('xmx-form-field--show-message');\r\n\t\t\thasValidationErrors = true;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$_writeReviewFormTitleContainer.removeClass('xmx-form-field--error');\r\n\t\t\t$_writeReviewFormTitleContainer.removeClass('xmx-form-field--show-message');\r\n\t\t}\r\n\r\n\t\t// Check that the body is present\r\n\t\tbody = $_writeReviewFormBody.val().trim();\r\n\r\n\t\tif (body == '')\r\n\t\t{\r\n\t\t\t$_writeReviewFormBodyMessage.html(_configuration.translations.pleaseEnterABody);\r\n\t\t\t$_writeReviewFormBodyContainer.addClass('xmx-form-field--error');\r\n\t\t\t$_writeReviewFormBodyContainer.addClass('xmx-form-field--show-message');\r\n\t\t\thasValidationErrors = true;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t// Check that the body is of minimum length\r\n\t\t\tif (body.length < minimumBodyLength)\r\n\t\t\t{\r\n\t\t\t\t$_writeReviewFormBodyMessage.html(_configuration.translations.pleaseEnterALongerBody);\r\n\t\t\t\t$_writeReviewFormBodyContainer.addClass('xmx-form-field--error');\r\n\t\t\t\t$_writeReviewFormBodyContainer.addClass('xmx-form-field--show-message');\r\n\t\t\t\thasValidationErrors = true;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$_writeReviewFormBodyContainer.removeClass('xmx-form-field--error');\r\n\t\t\t\t$_writeReviewFormBodyContainer.removeClass('xmx-form-field--show-message');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If we have validation errors, get the hell out of here\r\n\t\tif (hasValidationErrors)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n \t// If we are already saving the review, abort\r\n \tif (_isSavingReview)\r\n \t{\r\n\t\t\treturn false;\r\n \t}\r\n\r\n \t// Remember that we are saving the review\r\n \t_isSavingReview = true;\r\n\r\n \t// Disable the button and show the loading bubbles\r\n \t$_writeReviewFormButton.attr('disabled', true);\r\n \t$_writeReviewFormButton.addClass('xmx-button--loading');\r\n\r\n \t// Get some new reviews\r\n\t\tjQuery.ajax\r\n\t\t({\r\n\t\t\turl: '/ajax/product/postReview',\r\n\t\t\tdataType: 'json',\r\n\t\t\ttype: 'post',\r\n\t\t\tdata:\r\n\t\t\t{\r\n\t\t\t\t'productId': _configuration.productId,\r\n\t\t\t\t'storeId': _configuration.storeId,\r\n\t\t\t\t'rating': rating,\r\n\t\t\t\t'name': name,\r\n\t\t\t\t'title': title,\r\n\t\t\t\t'body': body\r\n\t\t\t},\r\n\t\t\tsuccess: function(response)\r\n\t\t\t{\r\n\t\t\t\tif (response.success)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Reset the form\r\n\t\t\t\t\t$_writeReviewFormRating.val(5);\r\n\t\t\t\t\t$_writeReviewFormName.val('');\r\n\t\t\t\t\t$_writeReviewFormTitle.val('');\r\n\t\t\t\t\t$_writeReviewFormBody.val('');\r\n\r\n\t\t\t\t\t// And disable it\r\n\t\t\t\t\t$_writeReviewFormRating.attr('disabled', true);\r\n\t\t\t\t\t$_writeReviewFormName.attr('disabled', true);\r\n\t\t\t\t\t$_writeReviewFormTitle.attr('disabled', true);\r\n\t\t\t\t\t$_writeReviewFormBody.attr('disabled', true);\r\n\r\n\t\t\t\t\t// Show the message\r\n\t\t\t\t\t$_writeReviewFormButton.hide();\r\n\t\t\t\t\t$_writeReviewFormMessage.show();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcomplete: function()\r\n\t\t\t{\r\n\t\t\t\t// We are not saving anymore\r\n\t\t\t\t_isSavingReview = false;\r\n\r\n\t\t\t\t// Disable the button and hide the loading bubbles\r\n\t\t\t\t$_writeReviewFormButton.attr('disabled', false);\r\n\t\t\t\t$_writeReviewFormButton.removeClass('xmx-button--loading');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn false;\r\n }\r\n\r\n /** \r\n * Called after the user has done something with the review form name\r\n */\r\n function onWriteReviewFormNameInteraction()\r\n {\r\n \t// Update the length indicator\r\n \tupdateInputFieldLengthIndicator($_writeReviewFormName);\r\n\r\n \t// Remove the error message\r\n\t\t$_writeReviewFormNameContainer.removeClass('xmx-form-field--error');\r\n\t\t$_writeReviewFormNameContainer.removeClass('xmx-form-field--show-message');\r\n }\r\n\r\n /** \r\n * Called after the user has done something with the review form title\r\n */\r\n function onWriteReviewFormTitleInteraction()\r\n {\r\n \t// Update the length indicator\r\n \tupdateInputFieldLengthIndicator($_writeReviewFormTitle);\r\n\r\n \t// Remove the error message\r\n\t\t$_writeReviewFormTitleContainer.removeClass('xmx-form-field--error');\r\n\t\t$_writeReviewFormTitleContainer.removeClass('xmx-form-field--show-message');\r\n }\r\n\r\n /** \r\n * Called after the user has done something with the review form title\r\n */\r\n function onWriteReviewFormBodyInteraction()\r\n {\r\n \t// Update the length indicator\r\n \tupdateTextareaLengthIndicator($_writeReviewFormBody);\r\n \tupdateReviewFormTextareaSize();\r\n\r\n \t// Remove the error message\r\n\t\t$_writeReviewFormBodyContainer.removeClass('xmx-form-field--error');\r\n\t\t$_writeReviewFormBodyContainer.removeClass('xmx-form-field--show-message');\r\n }\r\n\r\n /**\r\n * Updates the size of the review form body. The same \"could\" be done\r\n * with the contenteditable=\"true\", but nah..\r\n */\r\n function updateReviewFormTextareaSize()\r\n {\r\n \tvar content;\r\n \tvar height;\r\n\r\n \t// Get the content from the text area\r\n \tcontent = $_writeReviewFormBody.val();\r\n\r\n \t// Replace all line breaks\r\n \tcontent = content.replace(/\\n/g, '
');\r\n\r\n \t// Add one more character, as the last line break at the \r\n \t// end of the string does not seem to count\r\n \tcontent += '
a';\r\n\r\n \t// Copy over the content from the text area to the shadow\r\n \t$_writeReviewFormBodyShadow.html(content);\r\n\r\n \t// Measure the height of the shadow\r\n \theight = $_writeReviewFormBodyShadow.outerHeight();\r\n\r\n \t// And set the height of the text area\r\n \t$_writeReviewFormBody.css('height', height + 'px');\r\n }\r\n\r\n\t/**\r\n\t * Updates the length indicator of an input field\r\n\t */\r\n\tfunction updateTextareaLengthIndicator($textarea)\r\n\t{\r\n\t\tvar coolLength = $textarea.data('cool-length');\r\n\t\tvar awesomeLength = $textarea.data('awesome-length');\r\n\t\tvar rockstarLength = $textarea.data('rockstar-length');\r\n\t\tvar length = $textarea.val().trim().length;\r\n\t\tvar $indicator = $textarea.next();\r\n\r\n\t\tif (length >= rockstarLength)\r\n\t\t{\r\n\t\t\t$indicator.html(_configuration.translations.reviewRockstarLength + ' (' + length + ' / ' + coolLength + ')');\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tif (length >= awesomeLength)\r\n\t\t\t{\r\n\t\t\t\t$indicator.html(_configuration.translations.reviewAwesomeLength + ' (' + length + ' / ' + coolLength + ')');\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tif (length >= coolLength)\r\n\t\t\t\t{\r\n\t\t\t\t\t$indicator.html(_configuration.translations.reviewCoolLength + ' (' + length + ' / ' + coolLength + ')');\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\t$indicator.html(_configuration.translations.reviewMinLength + ' (' + length + ' / ' + coolLength + ')');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the length indicator of an input field\r\n\t */\r\n\tfunction updateInputFieldLengthIndicator($inputField)\r\n\t{\r\n\t\tvar maxLength = $inputField.attr('maxlength');\r\n\t\tvar length = $inputField.val().trim().length;\r\n\t\tvar $indicator = $inputField.next();\r\n\r\n\t\t$indicator.html(length + ' / ' + maxLength);\r\n\t}\r\n\r\n /**\r\n * The user has clicked the \"Load More Reviews\" button\r\n */\r\n function onLoadMoreReviewsButtonClick()\r\n {\r\n \t// Do not load twice\r\n \tif (_isLoadingMoreReviews)\r\n \t{\r\n \t\treturn;\r\n \t}\r\n\r\n \t// Remember we are loading\r\n \t_isLoadingMoreReviews = true;\r\n\r\n \t// Disable the button and show the loading bubbles\r\n \t$_loadMoreReviewsButton.attr('disabled', true);\r\n \t$_loadMoreReviewsButton.addClass('xmx-button--loading');\r\n\r\n \t// Get some new reviews\r\n\t\tjQuery.ajax\r\n\t\t({\r\n\t\t\turl: '/ajax/product/loadReviews',\r\n\t\t\tdataType: 'json',\r\n\t\t\ttype: 'post',\r\n\t\t\tdata:\r\n\t\t\t{\r\n\t\t\t\t'productId': _configuration.productId,\r\n\t\t\t\t'storeId': _configuration.storeId,\r\n\t\t\t\t'page': _currentReviewsPage + 1\r\n\t\t\t},\r\n\t\t\tsuccess: function(response)\r\n\t\t\t{\r\n\t\t\t\tvar loadedPercent;\r\n\r\n\t\t\t\tif (response.success)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Add the reviews HTML\r\n\t\t\t\t\taddReviews(response.reviews);\r\n\r\n\t\t\t\t\t// Update the pagination\r\n\t\t\t\t\t_loadedReviews += response.reviews.length;\r\n\t\t\t\t\t_currentReviewsPage++;\r\n\r\n\t\t\t\t\t// If we have loaded all reviews, hide the \"load more\" area\r\n\t\t\t\t\tif (_loadedReviews >= _configuration.reviewSummary.totalReviews)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Hide the progress bar\r\n\t\t\t\t\t\t$_loadMoreReviewsProgress.hide();\r\n\r\n\t\t\t\t\t\t// \"No more reviews to load\"\r\n\t\t\t\t\t\t$_loadMoreReviewsHint.html(_configuration.translations.noMoreReviewsToLoad);\r\n\r\n\t\t\t\t\t\t// Hide le button\r\n\t\t\t\t\t\t$_loadMoreReviewsButton.hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Calculate the %\r\n\t\t\t\t\t\tloadedPercent = _loadedReviews * 100 / _configuration.reviewSummary.totalReviews;\r\n\r\n\t\t\t\t\t\t// Update the progress bar\r\n\t\t\t\t\t\t$_loadMoreReviewsBar.css('width', loadedPercent + '%');\r\n\r\n\t\t\t\t\t\t// Update the hint\r\n\t\t\t\t\t\t$_loadMoreReviewsHint.html(_configuration.translations.reviewProgress.replace('%1', _loadedReviews).replace('%2', _configuration.reviewSummary.totalReviews));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcomplete: function()\r\n\t\t\t{\r\n\t\t\t\t// We are not loading anymore\r\n\t\t\t\t_isLoadingMoreReviews = false;\r\n\r\n\t\t\t\t// Disable the button and hide the loading bubbles\r\n\t\t\t\t$_loadMoreReviewsButton.attr('disabled', false);\r\n\t\t\t\t$_loadMoreReviewsButton.removeClass('xmx-button--loading');\r\n\t\t\t}\r\n\t\t});\r\n }\r\n\r\n /**\r\n * Adds freshly loaded reviews to the HTML\r\n */\r\n function addReviews(reviews)\r\n {\r\n \tvar review;\r\n \tvar $review;\r\n \tvar $reviewHead;\r\n \tvar $stars;\r\n \tvar $starIcon;\r\n \tvar $title;\r\n\t\tvar $reviewBody;\r\n\t\tvar $truncateOverlay;\r\n\t\tvar $truncateButton;\r\n\t\tvar $truncateButtonTitle;\r\n\t\tvar $reviewFooter;\r\n\t\tvar $reviewInput;\r\n\t\tvar $truncate;\r\n var $description;\r\n var $reviewAuthor;\r\n var $reviewCertificate;\r\n var $response;\r\n var $responseTitle;\r\n var $responseBody;\r\n var $responseBodyDescription;\r\n\r\n \tfor (var reviewIndex in reviews)\r\n \t{\r\n\t\t\treview = reviews[reviewIndex];\r\n\r\n\t\t\t$review = jQuery('
');\r\n\t\t\t$review.addClass('xmx-review');\r\n\t\t\t$review.appendTo($_reviews);\r\n\r\n\t\t\t// Build the review head\r\n\t\t\t$reviewHead = jQuery('
');\r\n\t\t\t$reviewHead.addClass('xmx-review-head');\r\n\t\t\t$reviewHead.appendTo($review);\r\n\r\n\t\t\t// Build the stars\r\n\t\t\t$stars = jQuery('
');\r\n\t\t\t$stars.addClass('xmx-rating');\r\n\t\t\t$stars.appendTo($reviewHead);\r\n\r\n\t\t\t// Add the star icons\r\n\t\t\tfor (var star = 1; star <= 5; star++)\r\n\t\t\t{\r\n\t\t\t\t$starIcon = jQuery('
');\r\n\r\n\t\t\t\tif (review.rating >= star)\r\n\t\t\t\t{\r\n\t\t\t\t\t$starIcon.addClass('xmx-icon-star');\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\tif (review.rating >= star - 0.5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$starIcon.addClass('xmx-icon-star-half');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$starIcon.addClass('xmx-icon-star-empty');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$starIcon.appendTo($stars);\r\n\t\t\t}\r\n\r\n\t\t\t// Build the title\r\n if (review.title != '')\r\n {\r\n $title = jQuery('
');\r\n $title.addClass('xmx-review-title');\r\n $title.attr('title', review.title);\r\n $title.html(review.title);\r\n $title.appendTo($reviewHead);\r\n }\r\n\r\n if (review.body != '')\r\n {\r\n // Build the body\r\n $reviewBody = jQuery('
');\r\n $reviewBody.addClass('xmx-review-body');\r\n $reviewBody.appendTo($review);\r\n\r\n $reviewInput = jQuery('
');\r\n $reviewInput.attr('type', 'checkbox');\r\n $reviewInput.attr('name', 'review-' + review.id);\r\n $reviewInput.attr('id', 'review-' + review.id);\r\n $reviewInput.addClass('xmx-truncate-input');\r\n\r\n if (review.isTruncated)\r\n {\r\n $reviewInput.prop('checked', true);\r\n }\r\n\r\n $reviewInput.appendTo($reviewBody);\r\n\r\n // Truncate component\r\n $truncate = jQuery('
');\r\n $truncate.addClass('xmx-truncate');\r\n $truncate.appendTo($reviewBody);\r\n\r\n // Description\r\n $description = jQuery('
');\r\n $description.addClass('xmx-description');\r\n $description.html(review.body);\r\n $description.appendTo($truncate);\r\n\r\n // Add the truncation things\r\n $truncateOverlay = jQuery('
');\r\n $truncateOverlay.addClass('xmx-truncate-overlay');\r\n $truncateOverlay.appendTo($truncate);\r\n\r\n // Add the truncate button\r\n $truncateButton = jQuery('