diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php index 3329f8aaf93c6b5d9a813f06de710f75634eb939..ec10318fd59913fcf938c896d4033c601668360b 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php @@ -116,15 +116,18 @@ class Checkbox extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra */ protected function _getCheckboxHtml($value, $checked) { - $html = '<input type="checkbox" '; + $html = '<label class="data-grid-checkbox-cell-inner" '; + $html .= ' for="id_' . $this->escapeHtml($value) . '">'; + $html .= '<input type="checkbox" '; $html .= 'name="' . $this->getColumn()->getFieldName() . '" '; $html .= 'value="' . $this->escapeHtml($value) . '" '; + $html .= 'id="id_' . $this->escapeHtml($value) . '" '; $html .= 'class="' . ($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox') . - ' admin__control-checkbox' . - '"'; + ' admin__control-checkbox' . '"'; $html .= $checked . $this->getDisabled() . '/>'; - $html .= '<label></label>'; + $html .= '<label for="id_' . $this->escapeHtml($value) . '"></label>'; + $html .= '</label>'; /* ToDo UI: add class="admin__field-label" after some refactoring _fields.less */ return $html; } diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml index 9e1c939c542386dea232351f7be694945c4dd984..db9087984db1f0ff501b540055618e949a599cb2 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml @@ -466,7 +466,7 @@ click: function () { (function ($) { $.ajax({ - url: '<?php /* @escapeNotVerified */ echo $block->getMoveUrl() ?>//', + url: '<?php /* @escapeNotVerified */ echo $block->getMoveUrl() ?>', method: 'POST', data: pd.join(""), showLoader: true diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js index 030962f2f06413a56129efbbbc6aa3c6d8b4830a..1b5fbe954b89d8bb5edab7477dc7785c0f4ca6c3 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js @@ -761,8 +761,5 @@ define([ } }; - jQuery(document).ready(function(){ - productConfigure = new ProductConfigure(); - }); - + productConfigure = new ProductConfigure(); }); \ No newline at end of file diff --git a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php index 98aa6bb7e710ab1492fff90a66ae24dd7f5391ea..e692ea59d2d6ef1b97ea0b81a6458c8773907cf4 100644 --- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php +++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php @@ -6,6 +6,7 @@ namespace Magento\CatalogSearch\Model\Adapter\Mysql\Filter; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\CatalogSearch\Model\Search\TableMapper; use Magento\Eav\Model\Config; use Magento\Framework\App\ResourceConnection; @@ -97,7 +98,7 @@ class Preprocessor implements PreprocessorInterface */ private function processQueryWithField(FilterInterface $filter, $isNegation, $query) { - /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ + /** @var Attribute $attribute */ $attribute = $this->config->getAttribute(Product::ENTITY, $filter->getField()); if ($filter->getField() === 'price') { $resultQuery = str_replace( @@ -114,24 +115,16 @@ class Preprocessor implements PreprocessorInterface $this->connection->quoteIdentifier($alias . '.' . $attribute->getAttributeCode()), $query ); - } elseif ($filter->getType() === FilterInterface::TYPE_TERM - && in_array($attribute->getFrontendInput(), ['select', 'multiselect'], true) + } elseif ( + $filter->getType() === FilterInterface::TYPE_TERM && + in_array($attribute->getFrontendInput(), ['select', 'multiselect'], true) ) { - $alias = $this->tableMapper->getMappingAlias($filter); - if (is_array($filter->getValue())) { - $value = sprintf( - '%s IN (%s)', - ($isNegation ? 'NOT' : ''), - implode(',', $filter->getValue()) - ); - } else { - $value = ($isNegation ? '!' : '') . '= ' . $filter->getValue(); - } - $resultQuery = sprintf( - '%1$s.value %2$s', - $alias, - $value - ); + $resultQuery = $this->processTermSelect($filter, $isNegation); + } elseif ( + $filter->getType() === FilterInterface::TYPE_RANGE && + in_array($attribute->getBackendType(), ['decimal', 'int'], true) + ) { + $resultQuery = $this->processRangeNumeric($filter, $query, $attribute); } else { $table = $attribute->getBackendTable(); $select = $this->connection->select(); @@ -161,4 +154,57 @@ class Preprocessor implements PreprocessorInterface return $resultQuery; } + + /** + * @param FilterInterface $filter + * @param string $query + * @param Attribute $attribute + * @return string + */ + private function processRangeNumeric(FilterInterface $filter, $query, $attribute) + { + $tableSuffix = $attribute->getBackendType() === 'decimal' ? '_decimal' : ''; + $table = $this->resource->getTableName("catalog_product_index_eav{$tableSuffix}"); + $select = $this->connection->select(); + + $currentStoreId = $this->scopeResolver->getScope()->getId(); + + $select->from(['main_table' => $table], 'entity_id') + ->columns([$filter->getField() => 'main_table.value']) + ->where('main_table.attribute_id = ?', $attribute->getAttributeId()) + ->where('main_table.store_id = ?', $currentStoreId) + ->having($query); + + $resultQuery = 'search_index.entity_id IN ( + select entity_id from ' . $this->conditionManager->wrapBrackets($select) . ' as filter + )'; + + return $resultQuery; + } + + /** + * @param FilterInterface $filter + * @param bool $isNegation + * @return string + */ + private function processTermSelect(FilterInterface $filter, $isNegation) + { + $alias = $this->tableMapper->getMappingAlias($filter); + if (is_array($filter->getValue())) { + $value = sprintf( + '%s IN (%s)', + ($isNegation ? 'NOT' : ''), + implode(',', $filter->getValue()) + ); + } else { + $value = ($isNegation ? '!' : '') . '= ' . $filter->getValue(); + } + $resultQuery = sprintf( + '%1$s.value %2$s', + $alias, + $value + ); + + return $resultQuery; + } } diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml index 704568283748a660aed1941410b28ebf1e99b622..3f192bc072f9a7f9fa54393cf3eb22d9bc5eaa77 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml @@ -33,6 +33,12 @@ newAttributeSetContainer = $('[data-role=affected-attribute-set-new-name-container]'), existingAttributeSetContainer = $('[data-role=affected-attribute-set-existing-name-container]'); + $form.find('input[type=text]').on('keypress',function(e){ + if(e.keyCode === 13){ + e.preventDefault(); + $form.closest('[data-role=modal]').find('button[data-action=confirm]').click(); + } + }); $('[data-form=edit-product]').append($('<input>', { type: 'hidden', @@ -48,6 +54,9 @@ }, buttons: [{ text: '<?php /* @escapeNotVerified */ echo __('Confirm'); ?>', + attr: { + 'data-action': 'confirm' + }, 'class': 'action-secondary', click: function() { var affectedAttributeSetId = $form.find('input[name=affected-attribute-set]:checked').val(); diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml index 87435ac42e867730101a2752f0cd1c95747d0fb2..e47123ca4322c75030941a8382f9fb8072a703ac 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/layout/groupedproduct_popup_grid.xml @@ -24,11 +24,17 @@ <arguments> <argument name="id" xsi:type="string">grouped_grid_popup</argument> </arguments> - <block class="Magento\Backend\Block\Widget\Grid\Column" as="entity_id"> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="entity_ids"> <arguments> - <argument name="header" xsi:type="string" translate="true">ID</argument> <argument name="type" xsi:type="string">skip-list</argument> <argument name="renderer" xsi:type="string">Magento\Backend\Block\Widget\Grid\Column\Renderer\Checkbox</argument> + <argument name="name" xsi:type="string">entity_ids</argument> + <argument name="index" xsi:type="string">entity_id</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="entity_id"> + <arguments> + <argument name="header" xsi:type="string" translate="true">ID</argument> <argument name="index" xsi:type="string">entity_id</argument> </arguments> </block> diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js index b7badba6e79c142c8c1a92e0d60cdb41500507d4..1e497ed7b8231de9c057b986dc1f6c0387aa6aa2 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js +++ b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js @@ -132,7 +132,7 @@ define([ if (!target.is('input')) { target.closest('[data-role=row]') - .find('[data-column=entity_id] input') + .find('[data-column=entity_ids] input') .prop('checked', function (element, value) { return !value; }) @@ -142,7 +142,7 @@ define([ popup.on( 'change', - '[data-role=row] [data-column=entity_id] input', + '[data-role=row] [data-column=entity_ids] input', $.proxy(function (event) { var element = $(event.target), product = {}; @@ -175,12 +175,12 @@ define([ return $(element).val(); }).toArray(); ajaxSettings.data.filter = $.extend(ajaxSettings.data.filter || {}, { - 'entity_id': ids + 'entity_ids': ids }); }) .on('gridajax', function (event, ajaxRequest) { ajaxRequest.done(function () { - popup.find('[data-role=row] [data-column=entity_id] input') + popup.find('[data-role=row] [data-column=entity_ids] input') .each(function (index, element) { var $element = $(element); $element.prop('checked', !!selectedProductList[$element.val()]); diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php index 4cd75e3313d2cee2f4185bfe5b734235e6205dfc..6dca0a90a8c32d5dd42af32eaccb3a4dc1d74a38 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php @@ -120,7 +120,7 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended { $html = '<input type="text" name="' . $this->getFilterElementName( $attribute->getAttributeCode() - ) . '" class="input-text input-text-export-filter"'; + ) . '" class="admin__control-text input-text input-text-export-filter"'; if ($value) { $html .= ' value="' . $this->escapeHtml($value) . '"'; } @@ -190,7 +190,7 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended ':</strong> ' . '<input type="text" name="' . $name . - '[]" class="input-text input-text-range"' . + '[]" class="admin__control-text input-text input-text-range"' . ' value="' . $fromValue . '"/> ' . @@ -200,7 +200,7 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended ) . ':</strong> <input type="text" name="' . $name . - '[]" class="input-text input-text-range" value="' . + '[]" class="admin__control-text input-text input-text-range" value="' . $toValue . '" />'; } @@ -236,7 +236,7 @@ class Filter extends \Magento\Backend\Block\Widget\Grid\Extended $arguments = [ 'name' => $this->getFilterElementName($attribute->getAttributeCode()), 'id' => $this->getFilterElementId($attribute->getAttributeCode()), - 'class' => 'select select-export-filter', + 'class' => 'admin__control-select select select-export-filter', ]; /** @var $selectBlock \Magento\Framework\View\Element\Html\Select */ $selectBlock = $this->_layout->createBlock( diff --git a/app/code/Magento/ImportExport/view/adminhtml/templates/export/form/after.phtml b/app/code/Magento/ImportExport/view/adminhtml/templates/export/form/after.phtml index ace41a768af027afaabce0a4877678e5d10abe8c..929fcf56bb537acede9cc11cf5c57ba57f292b2f 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/templates/export/form/after.phtml +++ b/app/code/Magento/ImportExport/view/adminhtml/templates/export/form/after.phtml @@ -6,8 +6,8 @@ // @codingStandardsIgnoreFile ?> -<fieldset class="fieldset" id="export_filter_container" style="display:none;"> - <legend class="legend"> +<fieldset class="admin__fieldset" id="export_filter_container" style="display:none;"> + <legend class="admin__legend"> <span><?php /* @escapeNotVerified */ echo __('Entity Attributes'); ?></span> </legend> <br /> diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Tokens.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Tokens.php index e8654ef4fd3d3eded0d52557415294199801a8aa..f48a5e033b93f3845b7794b4e12d4f8ad2acd5f2 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Tokens.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Tokens.php @@ -37,7 +37,7 @@ class Tokens extends \Magento\Backend\Block\Widget\Form\Generic $fieldset = $form->addFieldset( 'base_fieldset', - ['legend' => __('Integration Tokens for Extensions'), 'class' => 'fieldset-wide'] + ['legend' => __('Integration Tokens for Extensions'), 'class' => ' fieldset-wide'] ); foreach ($this->getFormFields() as $field) { diff --git a/app/code/Magento/Integration/view/adminhtml/templates/integration/activate/permissions/tab/webapi.phtml b/app/code/Magento/Integration/view/adminhtml/templates/integration/activate/permissions/tab/webapi.phtml index 52539a96e184a358ebfab50ff4f22df118ddd8c3..ba9ed08ce44b9a1d6b3a5fb4eb686d0cc05cc1ad 100644 --- a/app/code/Magento/Integration/view/adminhtml/templates/integration/activate/permissions/tab/webapi.phtml +++ b/app/code/Magento/Integration/view/adminhtml/templates/integration/activate/permissions/tab/webapi.phtml @@ -11,7 +11,7 @@ // @codingStandardsIgnoreFile ?> -<fieldset class="fieldset form-inline entry-edit"> +<fieldset class="admin__fieldset form-inline entry-edit"> <?php if ($block->isTreeEmpty()): ?> <p class="empty"><?php /* @escapeNotVerified */ echo __('No permissions requested'); ?></p> <?php else: ?> diff --git a/app/code/Magento/Payment/view/frontend/web/js/model/credit-card-validation/validator.js b/app/code/Magento/Payment/view/frontend/web/js/model/credit-card-validation/validator.js index 660f3e3c0471f40d168481723d316bfcf792c0ed..2812437f379e491bd301392e3d60afebe3e13dfa 100644 --- a/app/code/Magento/Payment/view/frontend/web/js/model/credit-card-validation/validator.js +++ b/app/code/Magento/Payment/view/frontend/web/js/model/credit-card-validation/validator.js @@ -21,13 +21,34 @@ "use strict"; $.each({ + 'validate-card-type': [ + function (number, item, allowedTypes) { + var cardInfo, + i, + l; + + if (!creditCardNumberValidator(number).isValid) { + return false; + } else { + cardInfo = creditCardNumberValidator(number).card; + + for (i = 0, l = allowedTypes.length; i < l; i++) { + if (cardInfo.title == allowedTypes[i].type) { + return true; + } + } + return false; + } + }, + 'Please enter a valid credit card type number.' + ], 'validate-card-number': [ /** * Validate credit card number based on mod 10 * @param number - credit card number * @return {boolean} */ - function (number) { + function (number) { return creditCardNumberValidator(number).isValid; }, 'Please enter a valid credit card number.' diff --git a/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html b/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html index 2df219f3dddf1df4770c7248310c9514682e6f68..7db455786537c37bf09c7a02fe9ca365f887de32 100644 --- a/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html +++ b/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html @@ -50,7 +50,7 @@ id: getCode() + '_cc_number', title: $t('Credit Card Number'), 'data-container': getCode() + '-cc-number', - 'data-validate': JSON.stringify({'required-number':true, 'validate-card-number':'#' + getCode() + '_cc_type', 'validate-cc-type':'#' + getCode() + '_cc_type'})}, + 'data-validate': JSON.stringify({'required-number':true, 'validate-card-type':getCcAvailableTypesValues(), 'validate-card-number':'#' + getCode() + '_cc_type', 'validate-cc-type':'#' + getCode() + '_cc_type'})}, enable: isActive($parents), value: creditCardNumber, valueUpdate: 'keyup' "/> diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/video-modal.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/video-modal.js index f7e0e72de69c1037285fb71a1f7786614ed3f43d..a6e13f100fee793bea8e7acc11d76f3af11ae21a 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/video-modal.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/video-modal.js @@ -4,56 +4,54 @@ */ define([ 'jquery', + 'productGallery', 'jquery/ui', 'Magento_Ui/js/modal/modal', 'mage/translate', 'mage/backend/tree-suggest', 'mage/backend/validation' -], function ($) { +], function ($, productGallery) { 'use strict'; - $.widget('mage.productGallery', - $.mage.productGallery, - { - - /** - * Fired when windget initialization start - * @private - */ - _create: function () { - this._bind(); - }, - - /** - * Bind events - * @private - */ - _bind: function () { - $(this.element).on('click', this.showModal.bind(this)); - $('.gallery.ui-sortable').on('openDialog', $.proxy(this._onOpenDialog, this)); - }, - - /** - * Open dialog for external video - * @private - */ - _onOpenDialog: function (e, imageData) { - - if (imageData['media_type'] !== 'external-video') { - return; - } - this.showModal(); - }, - - /** - * Fired on trigger "openModal" - */ - showModal: function () { - - $('#new-video').modal('openModal'); + $.widget('mage.productGallery', productGallery, { + + /** + * * Fired when widget initialization start + * @private + */ + _create: function () { + this._bind(); + }, + + /** + * Bind events + * @private + */ + _bind: function () { + $(this.element).on('click', this.showModal.bind(this)); + $('.gallery.ui-sortable').on('openDialog', $.proxy(this._onOpenDialog, this)); + }, + + /** + * Open dialog for external video + * @private + */ + _onOpenDialog: function (e, imageData) { + + if (imageData['media_type'] !== 'external-video') { + return; } + this.showModal(); + }, + + /** + * Fired on trigger "openModal" + */ + showModal: function () { + + $('#new-video').modal('openModal'); } - ); + }); return $.mage.productGallery; }); diff --git a/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml index 18417e1619da5d56717ce8602c53bf6359d44ac5..59d2ef3e2cd953c3d86661a6ce93b652701d8362 100644 --- a/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/ProductVideo/view/frontend/layout/catalog_product_view.xml @@ -6,10 +6,6 @@ */ --> <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> - <head> - <link src="Magento_ProductVideo::js/fotorama-add-video-events.js"/> - <link src="Magento_ProductVideo::js/load-player.js"/> - </head> <body> <referenceContainer name="product.info.media"> <block class="Magento\ProductVideo\Block\Product\View\Gallery" name="product.info.media.video" after="product.info.media.image" template="product/view/gallery.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index 90f8b04c5c70b9d4d9fbb88d70e08bd307c83d04..1bde25b44a4fd95346b4cdd3b69e57f6243ec2e8 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -64,20 +64,22 @@ define([ }, 10); }; - this.dataArea.onLoad = this.dataArea.onLoad.wrap(function(proceed) { - proceed(); - this._parent.itemsArea.setNode($(this._parent.getAreaId('items'))); - this._parent.itemsArea.onLoad(); - }); + if (jQuery('#' + this.getAreaId('items')).is(':visible')) { + this.dataArea.onLoad = this.dataArea.onLoad.wrap(function(proceed) { + proceed(); + this._parent.itemsArea.setNode($(this._parent.getAreaId('items'))); + this._parent.itemsArea.onLoad(); + }); - this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) { - proceed(); - if ($(searchAreaId) && !$(searchAreaId).visible()) { - this.addControlButton(searchButton); - } - }); - this.areasLoaded(); - this.itemsArea.onLoad(); + this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) { + proceed(); + if ($(searchAreaId) && !$(searchAreaId).visible()) { + this.addControlButton(searchButton); + } + }); + this.areasLoaded(); + this.itemsArea.onLoad(); + } }).bind(this)); jQuery('#edit_form') @@ -85,7 +87,6 @@ define([ jQuery(this).trigger('realOrder'); }) .on('realOrder', this._realSubmit.bind(this)); - }, areasLoaded: function(){ diff --git a/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js b/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js index 8daa9999633ac16af713551813a11e9128ecb522..8a1ffe15de04bdabed5d9e3b6f9072abb8057e15 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/sticky/sticky.js @@ -73,12 +73,6 @@ define([ $.async(this.stickyContainerSelector, this, this.initContainerNode); - $.async(this.stickyElementSelector, - this.listing(), - this.initStickyListingNode); - $.async(this.stickyElementSelector, - this.toolbar(), - this.initStickyToolbarNode); return this; }, @@ -154,6 +148,13 @@ define([ $.async(this.rightDataGridCapSelector, node, this.initRightDataGridCap); + + $.async(this.stickyElementSelector, + this.listing(), + this.initStickyListingNode); + $.async(this.stickyElementSelector, + this.toolbar(), + this.initStickyToolbarNode); }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/storage.js b/app/code/Magento/Ui/view/base/web/js/lib/core/storage.js index 62f87dcd432d2ddec9b8ba11b01442cc8a5e92d5..1ffc8c880e485f1859d784bb32eb6aa32f7c94fc 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/storage.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/storage.js @@ -11,8 +11,72 @@ define([ 'use strict'; var root = 'appData', + localStorage = window.localStorage, + hasSupport, storage; + /** + * Flag which indicates whether localStorage is supported. + */ + hasSupport = (function () { + var key = '_storageSupported'; + + try { + localStorage.setItem(key, 'true'); + + if (localStorage.getItem(key) === 'true') { + localStorage.removeItem(key); + + return true; + } + + return false; + } catch (e) { + return false; + } + })(); + + if (!hasSupport) { + localStorage = { + _data: {}, + + /** + * Sets value of the specified item. + * + * @param {String} key - Key of the property. + * @param {*} value - Properties' value. + */ + setItem: function (key, value) { + this._data[key] = value + ''; + }, + + /** + * Retrieves specfied item. + * + * @param {String} key - Key of the property to be retrieved. + */ + getItem: function (key) { + return this._data[key]; + }, + + /** + * Removes specfied item. + * + * @param {String} key - Key of the property to be removed. + */ + removeItem: function (key) { + delete this._data[key]; + }, + + /** + * Removes all items. + */ + clear: function () { + this._data = {}; + } + }; + } + /** * Extracts and parses data stored in localStorage by the * key specified in 'root' varaible. diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modal.js b/app/code/Magento/Ui/view/base/web/js/modal/modal.js index e99f818068534b4578bdebc4b4f3ef2dc36becc3..b6dd6da1651a64bb521d938291867e90c6a8a1cd 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modal.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modal.js @@ -22,7 +22,7 @@ define([ */ var transitionEvent = (function () { var transition, - elementStyle = document.body.style, + elementStyle = document.createElement('div').style, transitions = { 'transition': 'transitionend', 'OTransition': 'oTransitionEnd', diff --git a/app/code/Magento/Wishlist/CustomerData/Wishlist.php b/app/code/Magento/Wishlist/CustomerData/Wishlist.php index 2c4379872b8abf1136d02b1fc068c71afbf6c661..c937e334992c272815cd03f1cd2ee74daab80286 100644 --- a/app/code/Magento/Wishlist/CustomerData/Wishlist.php +++ b/app/code/Magento/Wishlist/CustomerData/Wishlist.php @@ -3,7 +3,6 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Wishlist\CustomerData; use Magento\Customer\CustomerData\SectionSourceInterface; @@ -24,9 +23,9 @@ class Wishlist implements SectionSourceInterface protected $wishlistHelper; /** - * @var \Magento\Catalog\Helper\Image + * @var \Magento\Catalog\Helper\ImageFactory */ - protected $imageHelper; + protected $imageHelperFactory; /** * @var \Magento\Framework\App\ViewInterface @@ -41,17 +40,17 @@ class Wishlist implements SectionSourceInterface /** * @param \Magento\Wishlist\Helper\Data $wishlistHelper * @param \Magento\Wishlist\Block\Customer\Sidebar $block - * @param \Magento\Catalog\Helper\Image $imageHelper + * @param \Magento\Catalog\Helper\ImageFactory $imageHelperFactory * @param \Magento\Framework\App\ViewInterface $view */ public function __construct( \Magento\Wishlist\Helper\Data $wishlistHelper, \Magento\Wishlist\Block\Customer\Sidebar $block, - \Magento\Catalog\Helper\Image $imageHelper, + \Magento\Catalog\Helper\ImageFactory $imageHelperFactory, \Magento\Framework\App\ViewInterface $view ) { $this->wishlistHelper = $wishlistHelper; - $this->imageHelper = $imageHelper; + $this->imageHelperFactory = $imageHelperFactory; $this->block = $block; $this->view = $view; } @@ -100,35 +99,77 @@ class Wishlist implements SectionSourceInterface protected function getItems() { $this->view->loadLayout(); + $collection = $this->wishlistHelper->getWishlistItemCollection(); $collection->clear()->setPageSize(self::SIDEBAR_ITEMS_NUMBER) ->setInStockFilter(true)->setOrder('added_at'); + $items = []; - /** @var \Magento\Wishlist\Model\Item $wishlistItem */ foreach ($collection as $wishlistItem) { - $product = $wishlistItem->getProduct(); - $this->imageHelper->init($product, 'wishlist_sidebar_block'); - $items[] = [ - 'image' => [ - 'src' => $this->imageHelper->getUrl(), - 'alt' => $this->imageHelper->getLabel(), - 'width' => $this->imageHelper->getWidth(), - 'height' => $this->imageHelper->getHeight(), - ], - 'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem), - 'product_name' => $product->getName(), - 'product_price' => $this->block->getProductPriceHtml( - $product, - \Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, - \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, - ['item' => $wishlistItem] - ), - 'product_is_saleable_and_visible' => $product->isSaleable() && $product->isVisibleInSiteVisibility(), - 'product_has_required_options' => $product->getTypeInstance()->hasRequiredOptions($product), - 'add_to_cart_params' => $this->wishlistHelper->getAddToCartParams($wishlistItem, true), - 'delete_item_params' => $this->wishlistHelper->getRemoveParams($wishlistItem, true), - ]; + $items[] = $this->getItemData($wishlistItem); } return $items; } + + /** + * Retrieve wishlist item data + * + * @param \Magento\Wishlist\Model\Item $wishlistItem + * @return array + */ + protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem) + { + $product = $wishlistItem->getProduct(); + return [ + 'image' => $this->getImageData($product), + 'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem), + 'product_name' => $product->getName(), + 'product_price' => $this->block->getProductPriceHtml( + $product, + \Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, + \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, + ['item' => $wishlistItem] + ), + 'product_is_saleable_and_visible' => $product->isSaleable() && $product->isVisibleInSiteVisibility(), + 'product_has_required_options' => $product->getTypeInstance()->hasRequiredOptions($product), + 'add_to_cart_params' => $this->wishlistHelper->getAddToCartParams($wishlistItem, true), + 'delete_item_params' => $this->wishlistHelper->getRemoveParams($wishlistItem, true), + ]; + } + + /** + * Retrieve product image data + * + * @param \Magento\Catalog\Model\Product $product + * @return \Magento\Catalog\Block\Product\Image + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + protected function getImageData($product) + { + /** @var \Magento\Catalog\Helper\Image $helper */ + $helper = $this->imageHelperFactory->create() + ->init($product, 'wishlist_sidebar_block'); + + $template = $helper->getFrame() + ? 'Magento_Catalog/product/image' + : 'Magento_Catalog/product/image_with_borders'; + + $imagesize = $helper->getResizedImageInfo(); + + $width = $helper->getFrame() + ? $helper->getWidth() + : (!empty($imagesize[0]) ? $imagesize[0] : $helper->getWidth()); + + $height = $helper->getFrame() + ? $helper->getHeight() + : (!empty($imagesize[1]) ? $imagesize[1] : $helper->getHeight()); + + return [ + 'template' => $template, + 'src' => $helper->getUrl(), + 'width' => $width, + 'height' => $height, + 'alt' => $helper->getLabel(), + ]; + } } diff --git a/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php b/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php index 24368820dc4df78f31f2bb407631a4a7caadd564..470be780e1269ea0f56088a151171820e67c1368 100644 --- a/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php @@ -46,16 +46,24 @@ class WishlistTest extends \PHPUnit_Framework_TestCase $this->sidebarMock = $this->getMockBuilder('Magento\Wishlist\Block\Customer\Sidebar') ->disableOriginalConstructor() ->getMock(); + $this->viewMock = $this->getMockBuilder('Magento\Framework\App\ViewInterface') + ->getMockForAbstractClass(); + $this->catalogImageHelperMock = $this->getMockBuilder('Magento\Catalog\Helper\Image') ->disableOriginalConstructor() ->getMock(); - $this->viewMock = $this->getMockBuilder('Magento\Framework\App\ViewInterface') - ->getMockForAbstractClass(); + $imageHelperFactory = $this->getMockBuilder('Magento\Catalog\Helper\ImageFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $imageHelperFactory->expects($this->any()) + ->method('create') + ->willReturn($this->catalogImageHelperMock); $this->model = new Wishlist( $this->wishlistHelperMock, $this->sidebarMock, - $this->catalogImageHelperMock, + $imageHelperFactory, $this->viewMock ); } @@ -83,6 +91,7 @@ class WishlistTest extends \PHPUnit_Framework_TestCase 'items' => [ [ 'image' => [ + 'template' => 'Magento_Catalog/product/image', 'src' => $imageUrl, 'alt' => $imageLabel, 'width' => $imageWidth, @@ -165,6 +174,12 @@ class WishlistTest extends \PHPUnit_Framework_TestCase $this->catalogImageHelperMock->expects($this->once()) ->method('getHeight') ->willReturn($imageHeight); + $this->catalogImageHelperMock->expects($this->any()) + ->method('getFrame') + ->willReturn(true); + $this->catalogImageHelperMock->expects($this->once()) + ->method('getResizedImageInfo') + ->willReturn([]); $this->wishlistHelperMock->expects($this->once()) ->method('getProductUrl') @@ -251,6 +266,7 @@ class WishlistTest extends \PHPUnit_Framework_TestCase 'items' => [ [ 'image' => [ + 'template' => 'Magento_Catalog/product/image', 'src' => $imageUrl, 'alt' => $imageLabel, 'width' => $imageWidth, @@ -266,6 +282,7 @@ class WishlistTest extends \PHPUnit_Framework_TestCase ], [ 'image' => [ + 'template' => 'Magento_Catalog/product/image', 'src' => $imageUrl, 'alt' => $imageLabel, 'width' => $imageWidth, @@ -342,6 +359,12 @@ class WishlistTest extends \PHPUnit_Framework_TestCase $this->catalogImageHelperMock->expects($this->exactly(2)) ->method('getHeight') ->willReturn($imageHeight); + $this->catalogImageHelperMock->expects($this->any()) + ->method('getFrame') + ->willReturn(true); + $this->catalogImageHelperMock->expects($this->exactly(2)) + ->method('getResizedImageInfo') + ->willReturn([]); $this->wishlistHelperMock->expects($this->exactly(2)) ->method('getProductUrl') diff --git a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml index bab2e79a75f3310e63bbe5352f47818e81cd74a0..1d7eb6e7dcc73247b72d1999701a863eb97aaf7c 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml @@ -26,7 +26,7 @@ $wishlistHelper = $this->helper('Magento\Wishlist\Helper\Data'); <li class="product-item"> <div class="product-item-info"> <a class="product-item-photo" data-bind="attr: { href: product_url, title: product_name }"> - <!-- ko template: {name: 'Magento_Wishlist/product_image', data: $data.image} --><!-- /ko --> + <!-- ko template: {name: $data.image.template, data: $data.image} --><!-- /ko --> </a> <div class="product-item-details"> <strong class="product-item-name"> diff --git a/app/code/Magento/Wishlist/view/frontend/web/template/product_image.html b/app/code/Magento/Wishlist/view/frontend/web/template/product_image.html deleted file mode 100644 index da88b3236c986563e459da8021213663f556158a..0000000000000000000000000000000000000000 --- a/app/code/Magento/Wishlist/view/frontend/web/template/product_image.html +++ /dev/null @@ -1,7 +0,0 @@ -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<img class="photo image" data-bind="attr: {src: src, alt: alt}, style: {width: width + 'px', height: height + 'px'}" /> diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 7390b3177b8360a5f41fd5cdfe839e1cbf56fa1c..9f624fea87ed90b28856fa0be9b5632e31471ea3 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -2640,8 +2640,8 @@ } // -// Configuration -> Design -// -------------------------------------- + // Configuration -> Design + // -------------------------------------- #row_design_theme_ua_regexp .design_theme_ua_regexp { float: left; @@ -2654,6 +2654,16 @@ clear: both; } + // + // Configuration -> Advanced -> System -> Notifications section + // -------------------------------------- + + #row_system_adminnotification_last_update { + .value { + vertical-align: bottom; + } + } + // // CMS -> Banners // -------------------------------------- diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml index 1654b19df2435385286d09db719cb4314f15fdba..530018bf81c4741e9785564800a14f39a3397ac1 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml @@ -129,7 +129,6 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductVisibleInCategory" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductInStock" /> - <constraint name="Magento\Bundle\Test\Constraint\AssertGroupedPriceOnBundleProductPage" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" /> <constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" /> diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php index 7a4e4b605ef4b7c64a09c0ac6d613159167002c2..252a96620ece4f2838e057bd5ec1753d4f6729e1 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php @@ -58,6 +58,7 @@ class AssertCatalogPriceRuleAppliedShoppingCart extends AbstractConstraint . "\nActual: " . $actualPrice . "\n" ); } + $checkoutCartPage->getTotalsBlock()->waitForShippingPriceBlock(); $actualPrices['sub_total'] = $checkoutCartPage->getTotalsBlock()->getSubtotal(); $actualPrices['grand_total'] = $checkoutCartPage->getTotalsBlock()->getGrandTotal(); $expectedPrices['sub_total'] = $cartPrice['sub_total']; diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php index 8b2bfcbd56d4f4f3b90a03d9ecdad7b39d322efd..738bb89e949b6476bf67fbb1407b2be3e06ae192 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php @@ -251,4 +251,14 @@ class Totals extends Block sleep(1); $this->waitForElementNotVisible($this->blockWaitElement); } + + /** + * Wait for shipping block to appear + * + * @return bool|null + */ + public function waitForShippingPriceBlock() + { + $this->waitForElementVisible($this->shippingPriceBlockSelector, Locator::SELECTOR_CSS); + } } diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php index 55b341dc6d3b72224065b2c9b41e3bc05264834a..caa07b91ce7efd9d88bc031c324ca400c69d1d7c 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php @@ -37,7 +37,7 @@ class Grid extends GridInterface * * @var string */ - protected $selectItem = '[data-column=entity_id] input'; + protected $selectItem = '[data-column=entity_ids] input'; /** * Press 'Add Selected Products' button diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/jscs/.jscsrc b/dev/tests/static/testsuite/Magento/Test/Js/_files/jscs/.jscsrc index b8071503882e23246959a4b515edeb435a1f325c..0a4404817de4742085a59692e1a321fbb23cef13 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/jscs/.jscsrc +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/jscs/.jscsrc @@ -75,6 +75,7 @@ "disallowTrailingComma": true, "disallowTrailingWhitespace": true, "disallowYodaConditions": true, + "maxErrors": null, "requireBlocksOnNewline": true, "requireDotNotation": "except_snake_case", "requireCamelCaseOrUpperCaseIdentifiers": true, diff --git a/lib/web/fotorama/fotorama.min.js b/lib/web/fotorama/fotorama.min.js new file mode 100644 index 0000000000000000000000000000000000000000..dbce341e32242af7a80a4fb2d659857b8e5eb692 --- /dev/null +++ b/lib/web/fotorama/fotorama.min.js @@ -0,0 +1,5 @@ +/*! + * Fotorama 4.6.4 | http://fotorama.io/license/ + */ +fotoramaVersion="4.6.4",function(t,e,n,o,i){"use strict";function r(t){var e="bez_"+o.makeArray(arguments).join("_").replace(".","p");if("function"!=typeof o.easing[e]){var n=function(t,e){var n=[null,null],o=[null,null],i=[null,null],r=function(r,a){return i[a]=3*t[a],o[a]=3*(e[a]-t[a])-i[a],n[a]=1-i[a]-o[a],r*(i[a]+r*(o[a]+r*n[a]))},a=function(t){return i[0]+t*(2*o[0]+3*n[0]*t)},s=function(t){for(var e,n=t,o=0;++o<14&&(e=r(n,0)-t,!(Math.abs(e)<.001));)n-=e/a(n);return n};return function(t){return r(s(t),1)}};o.easing[e]=function(e,o,i,r,a){return r*n([t[0],t[1]],[t[2],t[3]])(o/a)+i}}return e}function a(){}function s(t,e,n){return Math.max(isNaN(e)?-1/0:e,Math.min(isNaN(n)?1/0:n,t))}function u(t,e){return t.match(/ma/)&&t.match(/-?\d+(?!d)/g)[t.match(/3d/)?"vertical"===e?13:12:"vertical"===e?5:4]}function l(t,e){return On?+u(t.css("transform"),e):+t.css("vertical"===e?"top":"left").replace("px","")}function c(t,e){var n={};if(On)switch(e){case"vertical":n.transform="translate3d(0, "+t+"px,0)";break;case"list":break;default:n.transform="translate3d("+t+"px,0,0)"}else"vertical"===e?n.top=t:n.left=t;return n}function d(t){return{"transition-duration":t+"ms"}}function f(t,e){return isNaN(t)?e:t}function h(t,e){return f(+String(t).replace(e||"px",""))}function m(t){return/%$/.test(t)?h(t,"%"):i}function p(t,e){return f(m(t)/100*e,h(t))}function v(t){return(!isNaN(h(t))||!isNaN(h(t,"%")))&&t}function g(t,e,n,o){return(t-(o||0))*(e+(n||0))}function w(t,e,n,o){return-Math.round(t/(e+(n||0))-(o||0))}function y(t){var e=t.data();if(!e.tEnd){var n=t[0],o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};V(n,o[Tn.prefixed("transition")],function(t){e.tProp&&t.propertyName.match(e.tProp)&&e.onEndFn()}),e.tEnd=!0}}function b(t,e,n,o){var i,r=t.data();r&&(r.onEndFn=function(){i||(i=!0,clearTimeout(r.tT),n())},r.tProp=e,clearTimeout(r.tT),r.tT=setTimeout(function(){r.onEndFn()},1.5*o),y(t))}function x(t,e){var n=t.navdir||"horizontal";if(t.length){var o=t.data();On?(t.css(d(0)),o.onEndFn=a,clearTimeout(o.tT)):t.stop();var i=_(e,function(){return l(t,n)});return t.css(c(i,n)),i}}function _(){for(var t,e=0,n=arguments.length;n>e&&(t=e?arguments[e]():arguments[e],"number"!=typeof t);e++);return t}function C(t,e){return Math.round(t+(e-t)/1.5)}function k(){return k.p=k.p||("https:"===n.protocol?"https://":"http://"),k.p}function T(t){var n=e.createElement("a");return n.href=t,n}function P(t,e){if("string"!=typeof t)return t;t=T(t);var n,o;if(t.host.match(/youtube\.com/)&&t.search){if(n=t.search.split("v=")[1]){var i=n.indexOf("&");-1!==i&&(n=n.substring(0,i)),o="youtube"}}else t.host.match(/youtube\.com|youtu\.be/)?(n=t.pathname.replace(/^\/(embed\/|v\/)?/,"").replace(/\/.*/,""),o="youtube"):t.host.match(/vimeo\.com/)&&(o="vimeo",n=t.pathname.replace(/^\/(video\/)?/,"").replace(/\/.*/,""));return n&&o||!e||(n=t.href,o="custom"),n?{id:n,type:o,s:t.search.replace(/^\?/,""),p:k()}:!1}function S(t,e,n){var i,r,a=t.video;return"youtube"===a.type?(r=k()+"img.youtube.com/vi/"+a.id+"/default.jpg",i=r.replace(/\/default.jpg$/,"/hqdefault.jpg"),t.thumbsReady=!0):"vimeo"===a.type?o.ajax({url:k()+"vimeo.com/api/v2/video/"+a.id+".json",dataType:"jsonp",success:function(o){t.thumbsReady=!0,M(e,{img:o[0].thumbnail_large,thumb:o[0].thumbnail_small},t.i,n)}}):t.thumbsReady=!0,{img:i,thumb:r}}function M(t,e,n,i){for(var r=0,a=t.length;a>r;r++){var s=t[r];if(s.i===n&&s.thumbsReady){var u={videoReady:!0};u[to]=u[no]=u[eo]=!1,i.splice(r,1,o.extend({},s,u,e));break}}}function E(t){function e(t,e,i){var r=t.children("img").eq(0),a=t.attr("href"),s=t.attr("src"),u=r.attr("src"),l=e.video,c=i?P(a,l===!0):!1;c?a=!1:c=l,n(t,r,o.extend(e,{video:c,img:e.img||a||s||u,thumb:e.thumb||u||s||a}))}function n(t,e,n){var i=n.thumb&&n.img!==n.thumb,r=h(n.width||t.attr("width")),a=h(n.height||t.attr("height"));o.extend(n,{width:r,height:a,thumbratio:K(n.thumbratio||h(n.thumbwidth||e&&e.attr("width")||i||r)/h(n.thumbheight||e&&e.attr("height")||i||a))})}var i=[];return t.children().each(function(){var t=o(this),r=H(o.extend(t.data(),{id:t.attr("id")}));if(t.is("a, img"))e(t,r,!0);else{if(t.is(":empty"))return;n(t,null,o.extend(r,{html:this,_html:t.html()}))}i.push(r)}),i}function F(t){return 0===t.offsetWidth&&0===t.offsetHeight}function j(t){return!o.contains(e.documentElement,t)}function z(t,e,n,o){return z.i||(z.i=1,z.ii=[!0]),o=o||z.i,"undefined"==typeof z.ii[o]&&(z.ii[o]=!0),t()?e():z.ii[o]&&setTimeout(function(){z.ii[o]&&z(t,e,n,o)},n||100),z.i++}function N(t,e){var n=t.data(),o=n.measures;if(o&&(!n.l||n.l.W!==o.width||n.l.H!==o.height||n.l.r!==o.ratio||n.l.w!==e.w||n.l.h!==e.h)){var i=s(e.h,0,o.height),r=i*o.ratio;po.setRatio(t,r,i),n.l={W:o.width,H:o.height,r:o.ratio,w:e.w,h:e.h}}return!0}function $(t,e){var n=t[0];n.styleSheet?n.styleSheet.cssText=e:t.html(e)}function q(t,e,n,o){return e===n?!1:"vertical"===o?e>=t?"top":t>=n?"bottom":"top bottom":e>=t?"left":t>=n?"right":"left right"}function L(t,e,n){n=n||{},t.each(function(){var t,i=o(this),r=i.data();r.clickOn||(r.clickOn=!0,o.extend(oe(i,{onStart:function(e){t=e,(n.onStart||a).call(this,e)},onMove:n.onMove||a,onTouchEnd:n.onTouchEnd||a,onEnd:function(n){n.moved||e.call(this,t)}}),{noMove:!0}))})}function A(t,e){return'<div class="'+t+'">'+(e||"")+"</div>"}function I(t){return"."+t}function O(t){var e='<iframe src="'+t.p+t.type+".com/embed/"+t.id+'" frameborder="0" allowfullscreen></iframe>';return e}function D(t){for(var e=t.length;e;){var n=Math.floor(Math.random()*e--),o=t[e];t[e]=t[n],t[n]=o}return t}function R(t){return"[object Array]"==Object.prototype.toString.call(t)&&o.map(t,function(t){return o.extend({},t)})}function W(t,e,n){t.scrollLeft(e||0).scrollTop(n||0)}function H(t){if(t){var e={};return o.each(t,function(t,n){e[t.toLowerCase()]=n}),e}}function K(t){if(t){var e=+t;return isNaN(e)?(e=t.split("/"),+e[0]/+e[1]||i):e}}function V(t,e,n,o){e&&(t.addEventListener?t.addEventListener(e,n,!!o):t.attachEvent("on"+e,n))}function B(t,e){return t>e.max?t=e.max:t<e.min&&(t=e.min),t}function Q(t,e,n,o,i,r,a){var s,u,l;return"horizontal"===a?(u=t.thumbwidth,l=r.width()):(u=t.thumbheight,l=r.height()),s=(u+t.margin)*(n+1)>=l-o?"horizontal"===a?-i.position().left:-i.position().top:(u+t.margin)*n<=Math.abs(o)?"horizontal"===a?-i.position().left+l-(u+t.margin):-i.position().top+l-(u+t.margin):o,s=B(s,e),s||0}function X(t){return!!t.getAttribute("disabled")}function U(t){return{tabindex:-1*t+"",disabled:t}}function Y(t,e){V(t,"keyup",function(n){X(t)||13==n.keyCode&&e.call(t,n)})}function G(t,e){V(t,"focus",t.onfocusin=function(n){e.call(t,n)},!0)}function J(t,e){t.preventDefault?t.preventDefault():t.returnValue=!1,e&&t.stopPropagation&&t.stopPropagation()}function Z(t){return t?">":"<"}function te(t,e){var n=t.data(),i=Math.round(e.pos),r=function(){n&&n.sliding&&(n.sliding=!1),(e.onEnd||a)()};"undefined"!=typeof e.overPos&&e.overPos!==e.pos&&(i=e.overPos);var s=o.extend(c(i,e.direction),e.width&&{width:e.width},e.height&&{height:e.height});n&&n.sliding&&(n.sliding=!0),On?(t.css(o.extend(d(e.time),s)),e.time>10?b(t,"transform",r,e.time):r()):t.stop().animate(s,e.time,io,r)}function ee(t,e,n,i,r,s){var u="undefined"!=typeof s;if(u||(r.push(arguments),Array.prototype.push.call(arguments,r.length),!(r.length>1))){t=t||o(t),e=e||o(e);var l=t[0],c=e[0],d="crossfade"===i.method,f=function(){if(!f.done){f.done=!0;var t=(u||r.shift())&&r.shift();t&&ee.apply(this,t),(i.onEnd||a)(!!t)}},h=i.time/(s||1);n.removeClass(Ke+" "+He),t.stop().addClass(Ke),e.stop().addClass(He),d&&c&&t.fadeTo(0,0),t.fadeTo(d?h:0,1,d&&f),e.fadeTo(h,0,f),l&&d||c||f()}}function ne(t){var e=(t.touches||[])[0]||t;t._x=e.pageX,t._y=e.clientY,t._now=o.now()}function oe(t,n){function i(t){return f=o(t.target),b.checked=p=v=w=!1,c||b.flow||t.touches&&t.touches.length>1||t.which>1||lo&&lo.type!==t.type&&fo||(p=n.select&&f.is(n.select,y))?p:(m="touchstart"===t.type,v=f.is("a, a *",y),h=b.control,g=b.noMove||b.noSwipe||h?16:b.snap?0:4,ne(t),d=lo=t,co=t.type.replace(/down|start/,"move").replace(/Down/,"Move"),(n.onStart||a).call(y,t,{control:h,$target:f}),c=b.flow=!0,void((!m||b.go)&&J(t)))}function r(t){if(t.touches&&t.touches.length>1||Kn&&!t.isPrimary||co!==t.type||!c)return c&&s(),void(n.onTouchEnd||a)();ne(t);var e=Math.abs(t._x-d._x),o=Math.abs(t._y-d._y),i=e-o,r=(b.go||b.x||i>=0)&&!b.noSwipe,u=0>i;m&&!b.checked?(c=r)&&J(t):(J(t),(n.onMove||a).call(y,t,{touch:m})),!w&&Math.sqrt(Math.pow(e,2)+Math.pow(o,2))>g&&(w=!0),b.checked=b.checked||r||u}function s(t){(n.onTouchEnd||a)();var e=c;b.control=c=!1,e&&(b.flow=!1),!e||v&&!b.checked||(t&&J(t),fo=!0,clearTimeout(ho),ho=setTimeout(function(){fo=!1},1e3),(n.onEnd||a).call(y,{moved:w,$target:f,control:h,touch:m,startEvent:d,aborted:!t||"MSPointerCancel"===t.type}))}function u(){b.flow||setTimeout(function(){b.flow=!0},10)}function l(){b.flow&&setTimeout(function(){b.flow=!1},Bn)}var c,d,f,h,m,p,v,g,w,y=t[0],b={};return Kn?(V(y,"MSPointerDown",i),V(e,"MSPointerMove",r),V(e,"MSPointerCancel",s),V(e,"MSPointerUp",s)):(V(y,"touchstart",i),V(y,"touchmove",r),V(y,"touchend",s),V(e,"touchstart",u),V(e,"touchend",l),V(e,"touchcancel",l),qn.on("scroll",l),t.on("mousedown",i),Ln.on("mousemove",r).on("mouseup",s)),mo=Tn.touch?"a":"div",t.on("click",mo,function(t){b.checked&&J(t)}),b}function ie(t,e){function n(n,o){S=!0,l=d="vertical"===_?n._y:n._x,v=n._now,p=[[v,l]],f=h=F.noMove||o?0:x(t,(e.getPos||a)()),(e.onStart||a).call(M,n)}function i(e,o){w=F.min,y=F.max,b=F.snap,_=F.direction||"horizontal",t.navdir=_,k=e.altKey,S=P=!1,T=o.control,T||E.sliding||n(e)}function r(o,i){F.noSwipe||(S||n(o),d="vertical"===_?o._y:o._x,p.push([o._now,d]),h=f-(l-d),m=q(h,w,y,_),w>=h?h=C(h,w):h>=y&&(h=C(h,y)),F.noMove||(t.css(c(h,_)),P||(P=!0,i.touch||Kn||t.addClass(un)),(e.onMove||a).call(M,o,{pos:h,edge:m})))}function u(i){if(!F.noSwipe||!i.moved){S||n(i.startEvent,!0),i.touch||Kn||t.removeClass(un),g=o.now();for(var r,u,l,c,m,v,x,C,T,P=g-Bn,E=null,j=Qn,z=e.friction,N=p.length-1;N>=0;N--){if(r=p[N][0],u=Math.abs(r-P),null===E||l>u)E=r,c=p[N][1];else if(E===P||u>l)break;l=u}x=s(h,w,y);var $=c-d,q=$>=0,L=g-E,A=L>Bn,I=!A&&h!==f&&x===h;b&&(x=s(Math[I?q?"floor":"ceil":"round"](h/b)*b,w,y),w=y=x),I&&(b||x===h)&&(T=-($/L),j*=s(Math.abs(T),e.timeLow,e.timeHigh),m=Math.round(h+T*j/z),b||(x=m),(!q&&m>y||q&&w>m)&&(v=q?w:y,C=m-v,b||(x=v),C=s(x+.03*C,v-50,v+50),j=Math.abs((h-C)/(T/z)))),j*=k?10:1,(e.onEnd||a).call(M,o.extend(i,{moved:i.moved||A&&b,pos:h,newPos:x,overPos:C,time:j,dir:_}))}}var l,d,f,h,m,p,v,g,w,y,b,_,k,T,P,S,M=t[0],E=t.data(),F={};return F=o.extend(oe(e.$wrap,o.extend({},e,{onStart:i,onMove:r,onEnd:u})),F)}function re(t,e){var n,i,r,s=t[0],u={prevent:{}};return V(s,Vn,function(t){var s=t.wheelDeltaY||-1*t.deltaY||0,l=t.wheelDeltaX||-1*t.deltaX||0,c=Math.abs(l)&&!Math.abs(s),d=Z(0>l),f=i===d,h=o.now(),m=Bn>h-r;i=d,r=h,c&&u.ok&&(!u.prevent[d]||n)&&(J(t,!0),n&&f&&m||(e.shift&&(n=!0,clearTimeout(u.t),u.t=setTimeout(function(){n=!1},Xn)),(e.onEnd||a)(t,e.shift?d:l)))}),u}function ae(){o.each(o.Fotorama.instances,function(t,e){e.index=t})}function se(t){o.Fotorama.instances.push(t),ae()}function ue(t){o.Fotorama.instances.splice(t.index,1),ae()}var le="fotorama",ce="fotorama__fullscreen",de=le+"__wrap",fe=de+"--css2",he=de+"--css3",me=de+"--video",pe=de+"--fade",ve=de+"--slide",ge=de+"--no-controls",we=de+"--no-shadows",ye=de+"--pan-y",be=de+"--rtl",xe=de+"--no-captions",_e=de+"--toggle-arrows",Ce=le+"__stage",ke=Ce+"__frame",Te=ke+"--video",Pe=Ce+"__shaft",Se=le+"__grab",Me=le+"__pointer",Ee=le+"__arr",Fe=Ee+"--disabled",je=Ee+"--prev",ze=Ee+"--next",Ne=le+"__nav",$e=Ne+"-wrap",qe=Ne+"__shaft",Le=$e+"--vertical",Ae=$e+"--list",Ie=$e+"--horizontal",Oe=Ne+"--dots",De=Ne+"--thumbs",Re=Ne+"__frame",We=le+"__fade",He=We+"-front",Ke=We+"-rear",Ve=le+"__shadow",Be=Ve+"s",Qe=Be+"--left",Xe=Be+"--right",Ue=Be+"--top",Ye=Be+"--bottom",Ge=le+"__active",Je=le+"__select",Ze=le+"--hidden",tn=le+"--fullscreen",en=le+"__fullscreen-icon",nn=le+"__error",on=le+"__loading",rn=le+"__loaded",an=rn+"--full",sn=rn+"--img",un=le+"__grabbing",ln=le+"__img",cn=ln+"--full",dn=le+"__thumb",fn=dn+"__arr--left",hn=dn+"__arr--right",mn=dn+"-border",pn=le+"__html",vn=le+"-video-container",gn=le+"__video",wn=gn+"-play",yn=gn+"-close",bn=le+"__spinner",xn=le+"_horizontal_ratio",_n=le+"_vertical_ratio",Cn=o&&o.fn.jquery.split(".");if(!Cn||Cn[0]<1||1==Cn[0]&&Cn[1]<8)throw"Fotorama requires jQuery 1.8 or later and will not run without it.";var kn={},Tn=function(t,e,n){function o(t){g.cssText=t}function i(t,e){return typeof t===e}function r(t,e){return!!~(""+t).indexOf(e)}function a(t,e){for(var o in t){var i=t[o];if(!r(i,"-")&&g[i]!==n)return"pfx"==e?i:!0}return!1}function s(t,e,o){for(var r in t){var a=e[t[r]];if(a!==n)return o===!1?t[r]:i(a,"function")?a.bind(o||e):a}return!1}function u(t,e,n){var o=t.charAt(0).toUpperCase()+t.slice(1),r=(t+" "+b.join(o+" ")+o).split(" ");return i(e,"string")||i(e,"undefined")?a(r,e):(r=(t+" "+x.join(o+" ")+o).split(" "),s(r,e,n))}var l,c,d,f="2.8.3",h={},m=e.documentElement,p="modernizr",v=e.createElement(p),g=v.style,w=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),y="Webkit Moz O ms",b=y.split(" "),x=y.toLowerCase().split(" "),_={},C=[],k=C.slice,T=function(t,n,o,i){var r,a,s,u,l=e.createElement("div"),c=e.body,d=c||e.createElement("body");if(parseInt(o,10))for(;o--;)s=e.createElement("div"),s.id=i?i[o]:p+(o+1),l.appendChild(s);return r=["­",'<style id="s',p,'">',t,"</style>"].join(""),l.id=p,(c?l:d).innerHTML+=r,d.appendChild(l),c||(d.style.background="",d.style.overflow="hidden",u=m.style.overflow,m.style.overflow="hidden",m.appendChild(d)),a=n(l,t),c?l.parentNode.removeChild(l):(d.parentNode.removeChild(d),m.style.overflow=u),!!a},P={}.hasOwnProperty;d=i(P,"undefined")||i(P.call,"undefined")?function(t,e){return e in t&&i(t.constructor.prototype[e],"undefined")}:function(t,e){return P.call(t,e)},Function.prototype.bind||(Function.prototype.bind=function(t){var e=this;if("function"!=typeof e)throw new TypeError;var n=k.call(arguments,1),o=function(){if(this instanceof o){var i=function(){};i.prototype=e.prototype;var r=new i,a=e.apply(r,n.concat(k.call(arguments)));return Object(a)===a?a:r}return e.apply(t,n.concat(k.call(arguments)))};return o}),_.touch=function(){var n;return"ontouchstart"in t||t.DocumentTouch&&e instanceof DocumentTouch?n=!0:T(["@media (",w.join("touch-enabled),("),p,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(t){n=9===t.offsetTop}),n},_.csstransforms3d=function(){var t=!!u("perspective");return t&&"webkitPerspective"in m.style&&T("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(e){t=9===e.offsetLeft&&3===e.offsetHeight}),t},_.csstransitions=function(){return u("transition")};for(var S in _)d(_,S)&&(c=S.toLowerCase(),h[c]=_[S](),C.push((h[c]?"":"no-")+c));return h.addTest=function(t,e){if("object"==typeof t)for(var o in t)d(t,o)&&h.addTest(o,t[o]);else{if(t=t.toLowerCase(),h[t]!==n)return h;e="function"==typeof e?e():e,"undefined"!=typeof enableClasses&&enableClasses&&(m.className+=" "+(e?"":"no-")+t),h[t]=e}return h},o(""),v=l=null,h._version=f,h._prefixes=w,h._domPrefixes=x,h._cssomPrefixes=b,h.testProp=function(t){return a([t])},h.testAllProps=u,h.testStyles=T,h.prefixed=function(t,e,n){return e?u(t,e,n):u(t,"pfx")},h}(t,e),Pn={ok:!1,is:function(){return!1},request:function(){},cancel:function(){},event:"",prefix:""},Sn="webkit moz o ms khtml".split(" ");if("undefined"!=typeof e.cancelFullScreen)Pn.ok=!0;else for(var Mn=0,En=Sn.length;En>Mn;Mn++)if(Pn.prefix=Sn[Mn],"undefined"!=typeof e[Pn.prefix+"CancelFullScreen"]){Pn.ok=!0;break}Pn.ok&&(Pn.event=Pn.prefix+"fullscreenchange",Pn.is=function(){switch(this.prefix){case"":return e.fullScreen;case"webkit":return e.webkitIsFullScreen;default:return e[this.prefix+"FullScreen"]}},Pn.request=function(t){return""===this.prefix?t.requestFullScreen():t[this.prefix+"RequestFullScreen"]()},Pn.cancel=function(){return""===this.prefix?e.cancelFullScreen():e[this.prefix+"CancelFullScreen"]()});var Fn,jn={lines:12,length:5,width:2,radius:7,corners:1,rotate:15,color:"rgba(128, 128, 128, .75)",hwaccel:!0},zn={top:"auto",left:"auto",className:""};!function(t,e){Fn=e()}(this,function(){function t(t,n){var o,i=e.createElement(t||"div");for(o in n)i[o]=n[o];return i}function n(t){for(var e=1,n=arguments.length;n>e;e++)t.appendChild(arguments[e]);return t}function o(t,e,n,o){var i=["opacity",e,~~(100*t),n,o].join("-"),r=.01+n/o*100,a=Math.max(1-(1-t)/e*(100-r),t),s=f.substring(0,f.indexOf("Animation")).toLowerCase(),u=s&&"-"+s+"-"||"";return m[i]||(p.insertRule("@"+u+"keyframes "+i+"{0%{opacity:"+a+"}"+r+"%{opacity:"+t+"}"+(r+.01)+"%{opacity:1}"+(r+e)%100+"%{opacity:"+t+"}100%{opacity:"+a+"}}",p.cssRules.length),m[i]=1),i}function r(t,e){var n,o,r=t.style;for(e=e.charAt(0).toUpperCase()+e.slice(1),o=0;o<h.length;o++)if(n=h[o]+e,r[n]!==i)return n;return r[e]!==i?e:void 0}function a(t,e){for(var n in e)t.style[r(t,n)||n]=e[n];return t}function s(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)t[o]===i&&(t[o]=n[o])}return t}function u(t){for(var e={x:t.offsetLeft,y:t.offsetTop};t=t.offsetParent;)e.x+=t.offsetLeft,e.y+=t.offsetTop;return e}function l(t,e){return"string"==typeof t?t:t[e%t.length]}function c(t){return"undefined"==typeof this?new c(t):void(this.opts=s(t||{},c.defaults,v))}function d(){function e(e,n){return t("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',n)}p.addRule(".spin-vml","behavior:url(#default#VML)"),c.prototype.lines=function(t,o){function i(){return a(e("group",{coordsize:c+" "+c,coordorigin:-u+" "+-u}),{width:c,height:c})}function r(t,r,s){n(f,n(a(i(),{rotation:360/o.lines*t+"deg",left:~~r}),n(a(e("roundrect",{arcsize:o.corners}),{width:u,height:o.width,left:o.radius,top:-o.width>>1,filter:s}),e("fill",{color:l(o.color,t),opacity:o.opacity}),e("stroke",{opacity:0}))))}var s,u=o.length+o.width,c=2*u,d=2*-(o.width+o.length)+"px",f=a(i(),{position:"absolute",top:d,left:d});if(o.shadow)for(s=1;s<=o.lines;s++)r(s,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(s=1;s<=o.lines;s++)r(s);return n(t,f)},c.prototype.opacity=function(t,e,n,o){var i=t.firstChild;o=o.shadow&&o.lines||0,i&&e+o<i.childNodes.length&&(i=i.childNodes[e+o],i=i&&i.firstChild,i=i&&i.firstChild,i&&(i.opacity=n))}}var f,h=["webkit","Moz","ms","O"],m={},p=function(){var o=t("style",{type:"text/css"});return n(e.getElementsByTagName("head")[0],o),o.sheet||o.styleSheet}(),v={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"};c.defaults={},s(c.prototype,{spin:function(e){this.stop();var n,o,i=this,r=i.opts,s=i.el=a(t(0,{className:r.className}),{position:r.position,width:0,zIndex:r.zIndex}),l=r.radius+r.length+r.width;if(e&&(e.insertBefore(s,e.firstChild||null),o=u(e),n=u(s),a(s,{left:("auto"==r.left?o.x-n.x+(e.offsetWidth>>1):parseInt(r.left,10)+l)+"px",top:("auto"==r.top?o.y-n.y+(e.offsetHeight>>1):parseInt(r.top,10)+l)+"px"})),s.setAttribute("role","progressbar"),i.lines(s,i.opts),!f){var c,d=0,h=(r.lines-1)*(1-r.direction)/2,m=r.fps,p=m/r.speed,v=(1-r.opacity)/(p*r.trail/100),g=p/r.lines;!function w(){d++;for(var t=0;t<r.lines;t++)c=Math.max(1-(d+(r.lines-t)*g)%p*v,r.opacity),i.opacity(s,t*r.direction+h,c,r);i.timeout=i.el&&setTimeout(w,~~(1e3/m))}()}return i},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=i),this},lines:function(e,i){function r(e,n){return a(t(),{position:"absolute",width:i.length+i.width+"px",height:i.width+"px",background:e,boxShadow:n,transformOrigin:"left",transform:"rotate("+~~(360/i.lines*u+i.rotate)+"deg) translate("+i.radius+"px,0)",borderRadius:(i.corners*i.width>>1)+"px"})}for(var s,u=0,c=(i.lines-1)*(1-i.direction)/2;u<i.lines;u++)s=a(t(),{position:"absolute",top:1+~(i.width/2)+"px",transform:i.hwaccel?"translate3d(0,0,0)":"",opacity:i.opacity,animation:f&&o(i.opacity,i.trail,c+u*i.direction,i.lines)+" "+1/i.speed+"s linear infinite"}),i.shadow&&n(s,a(r("#000","0 0 4px #000"),{top:"2px"})),n(e,n(s,r(l(i.color,u),"0 0 1px rgba(0,0,0,.1)")));return e},opacity:function(t,e,n){e<t.childNodes.length&&(t.childNodes[e].style.opacity=n)}});var g=a(t("group"),{behavior:"url(#default#VML)"});return!r(g,"transform")&&g.adj?d():f=r(g,"animation"),c});var Nn,$n,qn=o(t),Ln=o(e),An="quirks"===n.hash.replace("#",""),In=Tn.csstransforms3d,On=In&&!An,Dn=In||"CSS1Compat"===e.compatMode,Rn=Pn.ok,Wn=navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i),Hn=!On||Wn,Kn=navigator.msPointerEnabled,Vn="onwheel"in e.createElement("div")?"wheel":e.onmousewheel!==i?"mousewheel":"DOMMouseScroll",Bn=250,Qn=300,Xn=1400,Un=5e3,Yn=2,Gn=64,Jn=500,Zn=333,to="$stageFrame",eo="$navDotFrame",no="$navThumbFrame",oo="auto",io=r([.1,0,.25,1]),ro=1200,ao=1,so={width:null,minwidth:null,maxwidth:"100%",height:null,minheight:null,maxheight:null,ratio:null,margin:Yn,nav:"dots",navposition:"bottom",navwidth:null,thumbwidth:Gn,thumbheight:Gn,thumbmargin:Yn,thumbborderwidth:Yn,allowfullscreen:!1,transition:"slide",clicktransition:null,transitionduration:Qn,captions:!0,startindex:0,loop:!1,autoplay:!1,stopautoplayontouch:!0,keyboard:!1,arrows:!0,click:!0,swipe:!1,trackpad:!1,shuffle:!1,direction:"ltr",shadows:!0,spinner:null,showcaption:!0,navdir:"horizontal",navarrows:!0,navtype:"thumbs"},uo={left:!0,right:!0,down:!1,up:!1,space:!1,home:!1,end:!1};z.stop=function(t){z.ii[t]=!1};var lo,co,fo,ho,mo,po=function(){function t(t,e,n){var o=e/n;1>=o?(t.parent().removeClass(xn),t.parent().addClass(_n)):(t.parent().removeClass(_n),t.parent().addClass(xn))}function e(t,e,n){var r=n;t.attr(r)||t.attr(r)===i||t.attr(r,e),t.find("["+r+"]").length&&t.find("["+r+"]").each(function(){o(this).attr(r,e)})}function n(t,e,n){var o,i=!1;return o=t.showCaption===n||t.showCaption===!0?!0:!1,e?(t.caption&&o&&(i=!0),i):!1}return{setRatio:t,setThumbAttr:e,isExpectedCaption:n}}(po||{},jQuery);jQuery.Fotorama=function(n,r){function a(){o.each(Ro,function(t,e){if(!e.i){e.i=Ei++;var n=P(e.video,!0);if(n){var o={};e.video=n,e.img||e.thumb?e.thumbsReady=!0:o=S(e,Ro,Ti),M(Ro,{img:o.img,thumb:o.thumb},e.i,Ti)}}})}function u(t){return mi[t]||Ti.fullScreen}function f(){if($i!==i)if("vertical"==r.navdir){var t=r.thumbwidth+r.thumbmargin;$i.css("left",t),Ii.css("right",t),Xi.css("right",t),Ni.css("width",Ni.css("width")+t),qi.css("max-width",Ni.width()-t)}else $i.css("left",""),Ii.css("right",""),Xi.css("right",""),Ni.css("width",Ni.css("width")+t),qi.css("max-width","")}function m(t){var e,n="keydown."+le,o=le+Pi,i="keydown."+o,a="keyup."+o,s="resize."+o+" orientationchange."+o;t?(Ln.on(i,function(t){var n,o;Vo&&27===t.keyCode?(n=!0,Eo(Vo,!0,!0)):(Ti.fullScreen||r.keyboard&&!Ti.index)&&(27===t.keyCode?(n=!0,Ti.cancelFullScreen()):t.shiftKey&&32===t.keyCode&&u("space")||37===t.keyCode&&u("left")||38===t.keyCode&&u("up")?(Ti.longPress.progress(),o="<"):32===t.keyCode&&u("space")||39===t.keyCode&&u("right")||40===t.keyCode&&u("down")?(Ti.longPress.progress(),o=">"):36===t.keyCode&&u("home")?(Ti.longPress.progress(),o="<<"):35===t.keyCode&&u("end")&&(Ti.longPress.progress(),o=">>")),(n||o)&&J(t),e={index:o,slow:t.altKey,user:!0},o&&(Ti.longPress.inProgress?Ti.showWhileLongPress(e):Ti.show(e))}),t&&Ln.on(a,function(){Ti.longPress.inProgress&&Ti.showEndLongPress({user:!0}),Ti.longPress.reset()}),Ti.index||Ln.off(n).on(n,"textarea, input, select",function(t){!$n.hasClass(ce)&&t.stopPropagation()}),qn.on(s,Ti.resize)):(Ln.off(i),qn.off(s))}function y(t){t!==y.f&&(t?(n.addClass(le+" "+Si).before(zi).before(ji),se(Ti)):(zi.detach(),ji.detach(),n.html(Fi.urtext).removeClass(Si),ue(Ti)),m(t),y.f=t)}function b(){Ro=Ti.data=Ro||R(r.data)||E(n),Wo=Ti.size=Ro.length,Do.ok&&r.shuffle&&D(Ro),a(),tr=oe(tr),Wo&&y(!0)}function C(){var t=2>Wo||Vo;or.noMove=t||si,or.noSwipe=t||!r.swipe,!di&&qi.toggleClass(Se,!r.click&&!or.noMove&&!or.noSwipe),Kn&&Ni.toggleClass(ye,!or.noSwipe)}function k(t){t===!0&&(t=""),r.autoplay=Math.max(+t||Un,1.5*ci)}function T(t){t.navarrows&&"thumbs"===t.nav?(Bi.show(),Qi.show()):(Bi.hide(),Qi.hide())}function F(t,e){return Math.floor(Ni.width()/(e.thumbwidth+e.thumbmargin))}function X(){function t(t,n){e[t?"add":"remove"].push(n)}r.nav&&"dots"!==r.nav||(r.navdir="horizontal"),Ti.options=r=H(r),ao=F(Ni,r),si="crossfade"===r.transition||"dissolve"===r.transition,ei=r.loop&&(Wo>2||si&&(!di||"slide"!==di)),ci=+r.transitionduration||Qn,hi="rtl"===r.direction,mi=o.extend({},r.keyboard&&uo,r.keyboard),T(r);var e={add:[],remove:[]};Wo>1?(ni=r.nav,ii="top"===r.navposition,e.remove.push(Je),Oi.toggle(r.arrows)):(ni=!1,Oi.hide()),Cn(),Ko=new Fn(o.extend(jn,r.spinner,zn,{direction:hi?-1:1})),Yn(),so(),io(),r.autoplay&&k(r.autoplay),ui=h(r.thumbwidth)||Gn,li=h(r.thumbheight)||Gn,ir.ok=ar.ok=r.trackpad&&!Hn,C(),wo(r,[nr]),oi="thumbs"===ni,Di.filter(":hidden")&&ni&&Di.show(),oi?(Mn(Wo,"navThumb"),Ho=Ki,ki=no,$(ji,o.Fotorama.jst.style({w:ui,h:li,b:r.thumbborderwidth,m:r.thumbmargin,s:Pi,q:!Dn})),Ri.addClass(De).removeClass(Oe)):"dots"===ni?(Mn(Wo,"navDot"),Ho=Hi,ki=eo,Ri.addClass(Oe).removeClass(De)):(Di.hide(),ni=!1,Ri.removeClass(De+" "+Oe)),ni&&(ii?Di.insertBefore($i):Di.insertAfter($i),Wn.nav=!1,Wn(Ho,Wi,"nav")),ri=r.allowfullscreen,ri?(Xi.prependTo($i),ai=Rn&&"native"===ri):(Xi.detach(),ai=!1),t(si,pe),t(!si,ve),t(!r.captions,xe),t(hi,be),t("always"!==r.arrows,_e),fi=r.shadows&&!Hn,t(!fi,we),Ni.addClass(e.add.join(" ")).removeClass(e.remove.join(" ")),er=o.extend({},r),f()}function ne(t){return 0>t?(Wo+t%Wo)%Wo:t>=Wo?t%Wo:t}function oe(t){return s(t,0,Wo-1)}function ae(t){return ei?ne(t):oe(t)}function We(t){return t>0||ei?t-1:!1}function He(t){return Wo-1>t||ei?t+1:!1}function Ke(){or.min=ei?-1/0:-g(Wo-1,nr.w,r.margin,Xo),or.max=ei?1/0:-g(0,nr.w,r.margin,Xo),or.snap=nr.w+r.margin}function Ve(){var t="vertical"===r.navdir,e=t?Wi.height():Wi.width(),n=t?nr.h:nr.nw;rr.min=Math.min(0,n-e),rr.max=0,rr.direction=r.navdir,Wi.toggleClass(Se,!(rr.noMove=rr.min===rr.max))}function un(t,e,n){if("number"==typeof t){t=new Array(t);var i=!0}return o.each(t,function(t,o){if(i&&(o=t),"number"==typeof o){var r=Ro[ne(o)];if(r){var a="$"+e+"Frame",s=r[a];n.call(this,t,o,r,s,a,s&&s.data())}}})}function dn(t,e,n,o){(!pi||"*"===pi&&o===ti)&&(t=v(r.width)||v(t)||Jn,e=v(r.height)||v(e)||Zn,Ti.resize({width:t,ratio:r.ratio||n||t/e},0,o!==ti&&"*"))}function xn(t,e,n,i){un(t,e,function(t,a,s,u,l,c){function d(t){var e=ne(a);yo(t,{index:e,src:b,frame:Ro[e]})}function f(){g.remove(),o.Fotorama.cache[b]="error",s.html&&"stage"===e||!x||x===b?(!b||s.html||p?"stage"===e&&(u.trigger("f:load").removeClass(on+" "+nn).addClass(rn),d("load"),dn()):(u.trigger("f:error").removeClass(on).addClass(nn),d("error")),c.state="error",!(Wo>1&&Ro[a]===s)||s.html||s.deleted||s.video||p||(s.deleted=!0,Ti.splice(a,1))):(s[y]=b=x,xn([a],e,n,!0))}function h(){o.Fotorama.measures[b]=w.measures=o.Fotorama.measures[b]||{width:v.width,height:v.height,ratio:v.width/v.height},dn(w.measures.width,w.measures.height,w.measures.ratio,a),g.off("load error").addClass(ln+(p?" "+cn:"")).prependTo(u),u.hasClass(ke)&&!u.hasClass(vn)&&u.attr("href",g.attr("src")),N(g,(o.isFunction(n)?n():n)||nr),o.Fotorama.cache[b]=c.state="loaded",setTimeout(function(){u.trigger("f:load").removeClass(on+" "+nn).addClass(rn+" "+(p?an:sn)),"stage"===e?d("load"):(s.thumbratio===oo||!s.thumbratio&&r.thumbratio===oo)&&(s.thumbratio=w.measures.ratio,Io())},0)}function m(){var t=10;z(function(){return!_i||!t--&&!Hn},function(){h()})}if(u){var p=Ti.fullScreen&&s.full&&s.full!==s.img&&!c.$full&&"stage"===e;if(!c.$img||i||p){var v=new Image,g=o(v),w=g.data();c[p?"$full":"$img"]=g;var y="stage"===e?p?"full":"img":"thumb",b=s[y],x=p?null:s["stage"===e?"thumb":"img"];if("navThumb"===e&&(u=c.$wrap),!b)return void f();o.Fotorama.cache[b]?!function _(){"error"===o.Fotorama.cache[b]?f():"loaded"===o.Fotorama.cache[b]?setTimeout(m,0):setTimeout(_,100)}():(o.Fotorama.cache[b]="*",g.on("load",m).on("error",f)),c.state="",v.src=b,c.data.caption&&(v.alt=c.data.caption||""),po.isExpectedCaption(s,r.showcaption)&&o(v).attr("aria-labelledby",s.labelledby)}}})}function _n(t){Zi.append(Ko.spin().el).appendTo(t)}function Cn(){Zi.detach(),Ko&&Ko.stop()}function kn(){var t=Bo[to];t&&!t.data().state&&(_n(t),t.on("f:load f:error",function(){t.off("f:load f:error"),Cn()}))}function Sn(t){Y(t,qo),G(t,function(){setTimeout(function(){W(Ri)},0),fo({time:ci,guessIndex:o(this).data().eq,minMax:rr})})}function Mn(t,e){un(t,e,function(t,n,i,a,s,u){if(!a){a=i[s]=Ni[s].clone(),u=a.data(),u.data=i;var l=a[0],c="labelledby"+o.now();"stage"===e?(i.html&&o('<div class="'+pn+'"></div>').append(i._html?o(i.html).removeAttr("id").html(i._html):i.html).appendTo(a),i.id&&(c=i.id||c),i.labelledby=c,po.isExpectedCaption(i,r.showcaption)&&o(o.Fotorama.jst.frameCaption({caption:i.caption,labelledby:c})).appendTo(a),i.video&&a.addClass(Te).append(Yi.clone()),G(l,function(){setTimeout(function(){W($i)},0),zo({index:u.eq,user:!0})}),Li=Li.add(a)):"navDot"===e?(Sn(l),Hi=Hi.add(a)):"navThumb"===e&&(Sn(l),u.$wrap=a.children(":first"),Ki=Ki.add(a),i.video&&u.$wrap.append(Yi.clone()))}})}function En(t,e){return t&&t.length&&N(t,e)}function An(t){un(t,"stage",function(t,e,n,i,a,s){if(i){var u=ne(e);s.eq=u,ur[to][u]=i.css(o.extend({left:si?0:g(e,nr.w,r.margin,Xo)},si&&d(0))),j(i[0])&&(i.appendTo(qi),Eo(n.$video)),En(s.$img,nr),En(s.$full,nr),!i.hasClass(ke)||"false"===i.attr("aria-hidden")&&i.hasClass(Ge)||i.attr("aria-hidden","true")}})}function In(t,e){var n,i;"thumbs"!==ni||isNaN(t)||(n=-t,i=-t+nr.nw,"vertical"===r.navdir&&(t-=r.thumbheight,i=-t+nr.h),Ki.each(function(){var t=o(this),a=t.data(),s=a.eq,u=function(){return{h:li,w:a.w}},l=u(),c="vertical"===r.navdir?a.t>i:a.l>i;l.w=a.w,a.l+a.w<n||c||En(a.$img,l)||e&&xn([s],"navThumb",u)}))}function Wn(t,e,n){if(!Wn[n]){var i="nav"===n&&oi,a=0,s=0;e.append(t.filter(function(){for(var t,e=o(this),n=e.data(),i=0,r=Ro.length;r>i;i++)if(n.data===Ro[i]){t=!0,n.eq=i;break}return t||e.remove()&&!1}).sort(function(t,e){return o(t).data().eq-o(e).data().eq}).each(function(){var t=o(this),e=t.data();po.setThumbAttr(t,e.data.caption,"aria-label")}).each(function(){if(i){var t=o(this),e=t.data(),n=Math.round(li*e.data.thumbratio)||ui,u=Math.round(ui/e.data.thumbratio)||li;e.t=s,e.h=u,e.l=a,e.w=n,t.css({width:n}),s+=u+r.thumbmargin,a+=n+r.thumbmargin}})),Wn[n]=!0}}function Vn(t){return t-lr>nr.w/3}function Xn(t){return!(ei||tr+t&&tr-Wo+t||Vo)}function Yn(){var t=Xn(0),e=Xn(1);Ai.toggleClass(Fe,t).attr(U(t)),Ii.toggleClass(Fe,e).attr(U(e))}function io(){var t=!1,e=!1;if("thumbs"!==r.navtype||r.loop||(t=0==tr?!0:!1,e=tr==r.data.length-1?!0:!1),"slides"===r.navtype){var n=l(Wi,r.navdir);t=n>=rr.max?!0:!1,e=n<=rr.min?!0:!1}Bi.toggleClass(Fe,t).attr(U(t)),Qi.toggleClass(Fe,e).attr(U(e))}function so(){ir.ok&&(ir.prevent={"<":Xn(0),">":Xn(1)})}function lo(t){var e,n,o,i,a=t.data();oi?(e=a.l,n=a.t,o=a.w,i=a.h):(e=t.position().left,o=t.width());var s={c:e+o/2,min:-e+10*r.thumbmargin,max:-e+nr.w-o-10*r.thumbmargin},u={c:n+i/2,min:-n+10*r.thumbmargin,max:-n+nr.h-i-10*r.thumbmargin};return"vertical"===r.navdir?u:s}function co(t){var e=Bo[ki].data();te(Vi,{time:1.2*t,pos:"vertical"===r.navdir?e.t:e.l,width:e.w,height:e.h,direction:r.navdir})}function fo(t){var e,n,o,i,a,u,c,d,f=Ro[t.guessIndex][ki],h=r.navtype;f&&("thumbs"===h?(e=rr.min!==rr.max,o=t.minMax||e&&lo(Bo[ki]),i=e&&(t.keep&&fo.t?fo.l:s((t.coo||nr.nw/2)-lo(f).c,o.min,o.max)),a=e&&(t.keep&&fo.l?fo.l:s((t.coo||nr.nw/2)-lo(f).c,o.min,o.max)),u="vertical"===r.navdir?i:a,c=e&&s(u,rr.min,rr.max)||0,n=1.1*t.time,te(Wi,{time:n,pos:c,direction:r.navdir,onEnd:function(){In(c,!0),io()}}),Mo(Ri,q(c,rr.min,rr.max,r.navdir)),fo.l=u):(d=l(Wi,r.navdir),n=1.11*t.time,c=Q(r,rr,t.guessIndex,d,f,Di,r.navdir),te(Wi,{time:n,pos:c,direction:r.navdir,onEnd:function(){In(c,!0),io() +}}),Mo(Ri,q(c,rr.min,rr.max,r.navdir))))}function ho(){mo(ki),sr[ki].push(Bo[ki].addClass(Ge).attr("data-active",!0))}function mo(t){for(var e=sr[t];e.length;)e.shift().removeClass(Ge).attr("data-active",!1)}function vo(t){var e=ur[t];o.each(Qo,function(t,n){delete e[ne(n)]}),o.each(e,function(t,n){delete e[t],n.detach()})}function go(t){Xo=Uo=tr;var e=Bo[to];e&&(mo(to),sr[to].push(e.addClass(Ge).attr("data-active",!0)),e.hasClass(ke)&&e.attr("aria-hidden","false"),t||Ti.showStage.onEnd(!0),x(qi,0,!0),vo(to),An(Qo),Ke(),Ve(),Y(qi[0],function(){n.hasClass(tn)||(Ti.requestFullScreen(),o(Ui).trigger("focus"))}))}function wo(t,e){t&&o.each(e,function(e,n){n&&o.extend(n,{width:t.width||n.width,height:t.height,minwidth:t.minwidth,maxwidth:t.maxwidth,minheight:t.minheight,maxheight:t.maxheight,ratio:K(t.ratio)})})}function yo(t,e){n.trigger(le+":"+t,[Ti,e])}function bo(){clearTimeout(xo.t),_i=1,r.stopautoplayontouch?Ti.stopAutoplay():yi=!0}function xo(){_i&&(r.stopautoplayontouch||(_o(),Co()),xo.t=setTimeout(function(){_i=0},Qn+Bn))}function _o(){yi=!(!Vo&&!bi)}function Co(){if(clearTimeout(Co.t),z.stop(Co.w),!r.autoplay||yi)return void(Ti.autoplay&&(Ti.autoplay=!1,yo("stopautoplay")));Ti.autoplay||(Ti.autoplay=!0,yo("startautoplay"));var t=tr,e=Bo[to].data();Co.w=z(function(){return e.state||t!==tr},function(){Co.t=setTimeout(function(){if(!yi&&t===tr){var e=Zo,n=Ro[e][to].data();Co.w=z(function(){return n.state||e!==Zo},function(){yi||e!==Zo||Ti.show(ei?Z(!hi):Zo)})}},r.autoplay)})}function ko(t){var e;return"object"!=typeof t?(e=t,t={}):e=t.index,e=">"===e?Uo+1:"<"===e?Uo-1:"<<"===e?0:">>"===e?Wo-1:e,e=isNaN(e)?i:e,e="undefined"==typeof e?tr||0:e}function To(t){Ti.activeIndex=tr=ae(t),Go=We(tr),Jo=He(tr),Zo=ne(tr+(hi?-1:1)),Qo=[tr,Go,Jo],Uo=ei?t:tr}function Po(t){var e=Math.abs(Yo-Uo),n=_(t.time,function(){return Math.min(ci*(1+(e-1)/12),2*ci)});return t.slow&&(n*=10),n}function So(){Ti.fullScreen&&(Ti.fullScreen=!1,Rn&&Pn.cancel(Mi),$n.removeClass(ce),Nn.removeClass(ce),n.removeClass(tn).insertAfter(zi),nr=o.extend({},xi),Eo(Vo,!0,!0),$o("x",!1),Ti.resize(),xn(Qo,"stage"),W(qn,gi,vi),yo("fullscreenexit"))}function Mo(t,e){fi&&(t.removeClass(Qe+" "+Xe),t.removeClass(Ue+" "+Ye),e&&!Vo&&t.addClass(e.replace(/^|\s/g," "+Be+"--")))}function Eo(t,e,n){e&&(Ni.removeClass(me),Vo=!1,C()),t&&t!==Vo&&(t.remove(),yo("unloadvideo")),n&&(_o(),Co())}function Fo(t){Ni.toggleClass(ge,t)}function jo(t){if(!or.flow){var e=t?t.pageX:jo.x,n=e&&!Xn(Vn(e))&&r.click;jo.p!==n&&$i.toggleClass(Me,n)&&(jo.p=n,jo.x=e)}}function zo(t){clearTimeout(zo.t),r.clicktransition&&r.clicktransition!==r.transition?setTimeout(function(){var e=r.transition;Ti.setOptions({transition:r.clicktransition}),di=e,zo.t=setTimeout(function(){Ti.show(t)},10)},0):Ti.show(t)}function No(t,e){var n=t.target,i=o(n);i.hasClass(wn)?Ti.playVideo():n===Ui?Ti.toggleFullScreen():Vo?n===Ji&&Eo(Vo,!0,!0):e?Fo():r.click&&zo({index:t.shiftKey||Z(Vn(t._x)),slow:t.altKey,user:!0})}function $o(t,e){or[t]=rr[t]=e}function qo(t){var e=o(this).data().eq;zo("thumbs"===r.navtype?{index:e,slow:t.altKey,user:!0,coo:t._x-Ri.offset().left}:{index:e,slow:t.altKey,user:!0})}function Lo(t){zo({index:Oi.index(this)?">":"<",slow:t.altKey,user:!0})}function Ao(t){G(t,function(){setTimeout(function(){W($i)},0),Fo(!1)})}function Io(){if(b(),X(),!Io.i){Io.i=!0;var t=r.startindex;tr=Xo=Uo=Yo=ti=ae(t)||0}if(Wo){if(Oo())return;Vo&&Eo(Vo,!0),Qo=[],vo(to),Io.ok=!0,Ti.show({index:tr,time:0}),Ti.resize()}else Ti.destroy()}function Oo(){return!Oo.f===hi?(Oo.f=hi,tr=Wo-1-tr,Ti.reverse(),!0):void 0}function Do(){Do.ok&&(Do.ok=!1,yo("ready"))}Nn=o("html"),$n=o("body");var Ro,Wo,Ho,Ko,Vo,Bo,Qo,Xo,Uo,Yo,Go,Jo,Zo,ti,ei,ni,oi,ii,ri,ai,si,ui,li,ci,di,fi,hi,mi,pi,vi,gi,wi,yi,bi,xi,_i,Ci,ki,Ti=this,Pi=o.now(),Si=le+Pi,Mi=n[0],Ei=1,Fi=n.data(),ji=o("<style></style>"),zi=o(A(Ze)),Ni=n.find(I(de)),$i=Ni.find(I(Ce)),qi=($i[0],n.find(I(Pe))),Li=o(),Ai=n.find(I(je)),Ii=n.find(I(ze)),Oi=n.find(I(Ee)),Di=n.find(I($e)),Ri=Di.find(I(Ne)),Wi=Ri.find(I(qe)),Hi=o(),Ki=o(),Vi=(qi.data(),Wi.data(),n.find(I(mn))),Bi=n.find(I(fn)),Qi=n.find(I(hn)),Xi=n.find(I(en)),Ui=Xi[0],Yi=o(A(wn)),Gi=n.find(I(yn)),Ji=Gi[0],Zi=o(A(bn)),tr=!1,er={},nr={},or={},ir={},rr={},ar={},sr={},ur={},lr=0,cr=[];Ni[to]=o(Tn.touch?'<a class="'+ke+'" target="_blank"></a>':'<div class="'+ke+'"></div>'),Ni[no]=o(o.Fotorama.jst.thumb()),Ni[eo]=o(o.Fotorama.jst.dots()),sr[to]=[],sr[no]=[],sr[eo]=[],ur[to]={},Ni.addClass(On?he:fe),Fi.fotorama=this,Ti.startAutoplay=function(t){return Ti.autoplay?this:(yi=bi=!1,k(t||r.autoplay),Co(),this)},Ti.stopAutoplay=function(){return Ti.autoplay&&(yi=bi=!0,Co()),this},Ti.showSlide=function(t){var e,n=l(Wi,r.navdir),o=550,i="horizontal"===r.navdir?r.thumbwidth:r.thumbheight,a=function(){io()};"next"===t&&(e=n-(i+r.margin)*ao),"prev"===t&&(e=n+(i+r.margin)*ao),e=B(e,rr),In(e,!0),te(Wi,{time:o,pos:e,direction:r.navdir,onEnd:a})},Ti.showWhileLongPress=function(t){if(!Ti.longPress.singlePressInProgress){var e=ko(t);To(e);var n=Po(t)/50,o=Bo;Ti.activeFrame=Bo=Ro[tr];var i=o===Bo&&!t.user;return Ti.showNav(i,t,n),this}},Ti.showEndLongPress=function(t){if(!Ti.longPress.singlePressInProgress){var e=ko(t);To(e);var n=Po(t)/50,o=Bo;Ti.activeFrame=Bo=Ro[tr];var i=o===Bo&&!t.user;return Ti.showStage(i,t,n),wi="undefined"!=typeof Yo&&Yo!==tr,Yo=tr,this}},Ti.showStage=function(t,e,n){Eo(Vo,Bo.i!==Ro[ne(Xo)].i),Mn(Qo,"stage"),An(Hn?[Uo]:[Uo,We(Uo),He(Uo)]),$o("go",!0),t||yo("show",{user:e.user,time:n}),yi=!0;var o=e.overPos,i=Ti.showStage.onEnd=function(n){if(!i.ok){if(i.ok=!0,n||go(!0),t||yo("showend",{user:e.user}),!n&&di&&di!==r.transition)return Ti.setOptions({transition:di}),void(di=!1);kn(),xn(Qo,"stage"),$o("go",!1),so(),jo(),_o(),Co()}};if(si){var a=Bo[to],s=Ro[Yo]&&tr!==Yo?Ro[Yo][to]:null;ee(a,s,Li,{time:n,method:r.transition,onEnd:i},cr)}else te(qi,{pos:-g(Uo,nr.w,r.margin,Xo),overPos:o,time:n,onEnd:i});Yn()},Ti.showNav=function(t,e,n){if(io(),ni){ho();var o=oe(tr+s(Uo-Yo,-1,1));fo({time:n,coo:o!==tr&&e.coo,guessIndex:"undefined"!=typeof e.coo?o:tr,keep:t}),oi&&co(n)}},Ti.show=function(t){Ti.longPress.singlePressInProgress=!0;var e=ko(t);To(e);var n=Po(t),o=Bo;Ti.activeFrame=Bo=Ro[tr];var i=o===Bo&&!t.user;return Ti.showStage(i,t,n),Ti.showNav(i,t,n),wi="undefined"!=typeof Yo&&Yo!==tr,Yo=tr,Ti.longPress.singlePressInProgress=!1,this},Ti.requestFullScreen=function(){return ri&&!Ti.fullScreen&&(vi=qn.scrollTop(),gi=qn.scrollLeft(),W(qn),$o("x",!0),xi=o.extend({},nr),n.addClass(tn).appendTo($n.addClass(ce)),Nn.addClass(ce),Eo(Vo,!0,!0),Ti.fullScreen=!0,ai&&Pn.request(Mi),Ti.resize(),xn(Qo,"stage"),kn(),yo("fullscreenenter")),this},Ti.cancelFullScreen=function(){return ai&&Pn.is()?Pn.cancel(e):So(),this},Ti.toggleFullScreen=function(){return Ti[(Ti.fullScreen?"cancel":"request")+"FullScreen"]()},V(e,Pn.event,function(){!Ro||Pn.is()||Vo||So()}),Ti.resize=function(e){if(!Ro)return this;var n=arguments[1]||0,i=arguments[2];ao=F(Ni,r),wo(Ti.fullScreen?{width:o(t).width(),maxwidth:null,minwidth:null,height:o(t).height(),maxheight:null,minheight:null}:H(e),[nr,i||Ti.fullScreen||r]);var a=nr.width,u=nr.height,l=nr.ratio,c=qn.height()-(ni?Ri.height():0);if(v(a)&&(Ni.css({width:""}),Ni.css({height:""}),$i.css({width:""}),$i.css({height:""}),$i.css({"line-height":""}),qi.css({width:""}),qi.css({height:""}),Ri.css({width:""}),Ri.css({height:""}),Ni.css({minWidth:nr.minwidth||0,maxWidth:nr.maxwidth||ro}),a=nr.W=nr.w=Ni.width(),nr.nw=ni&&p(r.navwidth,a)||a,qi.css({width:nr.w,marginLeft:(nr.W-nr.w)/2}),u=p(u,c),u=u||l&&a/l)){if(a=Math.round(a),u=nr.h=Math.round(s(u,p(nr.minheight,c),p(nr.maxheight,c))),$i.css({width:a,height:u,"line-height":u+"px"}),"vertical"!==r.navdir||Ti.fullscreen||Ri.width(r.thumbwidth+2*r.thumbmargin),"horizontal"!==r.navdir||Ti.fullscreen||Ri.height(r.thumbheight+2*r.thumbmargin),"vertical"===r.navdir&&Ti.fullScreen&&$i.css("height",o(t).height()),"horizontal"===r.navdir&&Ti.fullScreen&&$i.css("height",o(t).height()-(r.thumbheight+2*r.thumbmargin)),ni){switch(r.navdir){case"vertical":Di.removeClass(Ie),Di.removeClass(Ae),Di.addClass(Le),Ri.stop().animate({height:nr.h,width:r.thumbwidth},n);break;case"list":Di.removeClass(Le),Di.removeClass(Ie),Di.addClass(Ae);break;default:Di.removeClass(Le),Di.removeClass(Ae),Di.addClass(Ie),Ri.stop().animate({width:nr.nw},n)}go(),fo({guessIndex:tr,time:n,keep:!0}),oi&&Wn.nav&&co(n)}pi=i||!0,Do.ok=!0,Do()}return lr=$i.offset().left,f(),this},Ti.setOptions=function(t){return o.extend(r,t),Io(),this},Ti.shuffle=function(){return Ro&&D(Ro)&&Io(),this},Ti.longPress={threshold:1,count:0,thumbSlideTime:20,progress:function(){this.inProgress||(this.count++,this.inProgress=this.count>this.threshold)},end:function(){this.inProgress&&(this.isEnded=!0)},reset:function(){this.count=0,this.inProgress=!1,this.isEnded=!1}},Ti.destroy=function(){return Ti.cancelFullScreen(),Ti.stopAutoplay(),Ro=Ti.data=null,y(),Qo=[],vo(to),Io.ok=!1,this},Ti.playVideo=function(){var t=Bo,e=t.video,n=tr;return"object"==typeof e&&t.videoReady&&(ai&&Ti.fullScreen&&Ti.cancelFullScreen(),z(function(){return!Pn.is()||n!==tr},function(){n===tr&&(t.$video=t.$video||o(A(gn)).append(O(e)),t.$video.appendTo(t[to]),Ni.addClass(me),Vo=t.$video,C(),Oi.blur(),Xi.blur(),yo("loadvideo"))})),this},Ti.stopVideo=function(){return Eo(Vo,!0,!0),this},$i.on("mousemove",jo),or=ie(qi,{onStart:bo,onMove:function(t,e){Mo($i,e.edge)},onTouchEnd:xo,onEnd:function(t){Mo($i);var e=(Kn&&!Ci||t.touch)&&r.arrows&&"always"!==r.arrows;if(t.moved||e&&t.pos!==t.newPos&&!t.control){var n=w(t.newPos,nr.w,r.margin,Xo);Ti.show({index:n,time:si?ci:t.time,overPos:t.overPos,user:!0})}else t.aborted||t.control||No(t.startEvent,e)},timeLow:1,timeHigh:1,friction:2,select:"."+Je+", ."+Je+" *",$wrap:$i,direction:"horizontal"}),rr=ie(Wi,{onStart:bo,onMove:function(t,e){Mo(Ri,e.edge)},onTouchEnd:xo,onEnd:function(t){function e(){fo.l=t.newPos,_o(),Co(),In(t.newPos,!0),io()}if(t.moved)t.pos!==t.newPos?(yi=!0,te(Wi,{time:t.time,pos:t.newPos,overPos:t.overPos,direction:r.navdir,onEnd:e}),In(t.newPos),fi&&Mo(Ri,q(t.newPos,rr.min,rr.max,t.dir))):e();else{var n=t.$target.closest("."+Re,Wi)[0];n&&qo.call(n,t.startEvent)}},timeLow:.5,timeHigh:2,friction:5,$wrap:Ri,direction:r.navdir}),ir=re($i,{shift:!0,onEnd:function(t,e){bo(),xo(),Ti.show({index:e,slow:t.altKey})}}),ar=re(Ri,{onEnd:function(t,e){bo(),xo();var n=x(Wi)+.25*e;Wi.css(c(s(n,rr.min,rr.max),r.navdir)),fi&&Mo(Ri,q(n,rr.min,rr.max,r.navdir)),ar.prevent={"<":n>=rr.max,">":n<=rr.min},clearTimeout(ar.t),ar.t=setTimeout(function(){fo.l=n,In(n,!0)},Bn),In(n)}}),Ni.hover(function(){setTimeout(function(){_i||Fo(!(Ci=!0))},0)},function(){Ci&&Fo(!(Ci=!1))}),L(Oi,function(t){J(t),Lo.call(this,t)},{onStart:function(){bo(),or.control=!0},onTouchEnd:xo}),L(Bi,function(t){J(t),"thumbs"===r.navtype?Ti.show("<"):Ti.showSlide("prev")}),L(Qi,function(t){J(t),"thumbs"===r.navtype?Ti.show(">"):Ti.showSlide("next")}),Oi.each(function(){Y(this,function(t){Lo.call(this,t)}),Ao(this)}),Y(Ui,function(){Ti.toggleFullScreen(),o(Ui).trigger("focus")}),Ao(Ui),o.each("load push pop shift unshift reverse sort splice".split(" "),function(t,e){Ti[e]=function(){return Ro=Ro||[],"load"!==e?Array.prototype[e].apply(Ro,arguments):arguments[0]&&"object"==typeof arguments[0]&&arguments[0].length&&(Ro=R(arguments[0])),Io(),Ti}}),Io()},o.fn.fotorama=function(e){return this.each(function(){var n=this,i=o(this),r=i.data(),a=r.fotorama;a?a.setOptions(e,!0):z(function(){return!F(n)},function(){r.urtext=i.html(),new o.Fotorama(i,o.extend({},so,t.fotoramaDefaults,e,r))})})},o.Fotorama.instances=[],o.Fotorama.cache={},o.Fotorama.measures={},o=o||{},o.Fotorama=o.Fotorama||{},o.Fotorama.jst=o.Fotorama.jst||{},o.Fotorama.jst.dots=function(){{var t="";kn.escape}return t+='<div class="fotorama__nav__frame fotorama__nav__frame--dot" tabindex="0" role="button" data-gallery-role="nav-frame" data-nav-type="thumb" aria-label>\r\n <div class="fotorama__dot"></div>\r\n</div>'},o.Fotorama.jst.frameCaption=function(t){{var e,n="";kn.escape}return n+='<div class="fotorama__caption" aria-hidden="true">\r\n <div class="fotorama__caption__wrap" id="'+(null==(e=t.labelledby)?"":e)+'">'+(null==(e=t.caption)?"":e)+"</div>\r\n</div>\r\n"},o.Fotorama.jst.style=function(t){{var e,n="";kn.escape}return n+=".fotorama"+(null==(e=t.s)?"":e)+" .fotorama__nav--thumbs .fotorama__nav__frame{\r\npadding:"+(null==(e=t.m)?"":e)+"px;\r\nheight:"+(null==(e=t.h)?"":e)+"px}\r\n.fotorama"+(null==(e=t.s)?"":e)+" .fotorama__thumb-border{\r\nheight:"+(null==(e=t.h)?"":e)+"px;\r\nborder-width:"+(null==(e=t.b)?"":e)+"px;\r\nmargin-top:"+(null==(e=t.m)?"":e)+"px}"},o.Fotorama.jst.thumb=function(){{var t="";kn.escape}return t+='<div class="fotorama__nav__frame fotorama__nav__frame--thumb" tabindex="0" role="button" data-gallery-role="nav-frame" data-nav-type="thumb" aria-label>\r\n <div class="fotorama__thumb">\r\n </div>\r\n</div>'}}(window,document,location,"undefined"!=typeof jQuery&&jQuery); \ No newline at end of file diff --git a/lib/web/mage/validation/url.js b/lib/web/mage/validation/url.js index 5361d9522787650bd470d9941153527b192ff781..40fe32c9a5bc9d08207fe8bd3a969b35ff4eb164 100644 --- a/lib/web/mage/validation/url.js +++ b/lib/web/mage/validation/url.js @@ -35,6 +35,8 @@ define([], function () { path.indexOf('vbscript:') !== -1) { return false; } + + return true; }, /** @@ -44,7 +46,7 @@ define([], function () { * @returns {String} */ sanitize: function (path) { - return path.Replace('[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]', ''); + return path.replace('[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]', ''); } }; });