diff --git a/theme_boec/README.rst b/theme_boec/README.rst
new file mode 100644
index 000000000..e1e3527cc
--- /dev/null
+++ b/theme_boec/README.rst
@@ -0,0 +1,46 @@
+.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
+ :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+
+Theme Boec
+=========================
+* Attractive and modern eCommerce Website theme for Odoo 18
+
+Configuration
+=============
+* No need of additional configuration.
+
+License
+-------
+Affero General Public License, Version 3 (AGPL-3).
+(https://www.gnu.org/licenses/agpl-3.0.en.html)
+
+Company
+-------
+* `Cybrosys Techno Solutions `__
+
+Credits
+=======
+* Developer: (V18) Fouzan M, Contact: odoo@cybrosys.com
+
+Contacts
+--------
+* Mail Contact : odoo@cybrosys.com
+* Website : https://cybrosys.com
+
+Bug Tracker
+-----------
+Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
+
+Maintainer
+==========
+.. image:: https://cybrosys.com/images/logo.png
+ :target: https://cybrosys.com
+
+This module is maintained by Cybrosys Technologies.
+
+For support and more information, please visit `Our Website `__
+
+Further information
+===================
+HTML Description: ``__
diff --git a/theme_boec/__init__.py b/theme_boec/__init__.py
new file mode 100644
index 000000000..57ce4b1c1
--- /dev/null
+++ b/theme_boec/__init__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from . import models
+from . import controllers
diff --git a/theme_boec/__manifest__.py b/theme_boec/__manifest__.py
new file mode 100644
index 000000000..faa532877
--- /dev/null
+++ b/theme_boec/__manifest__.py
@@ -0,0 +1,89 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+{
+ 'name': 'Theme Boec',
+ 'version': '18.0.1.0.0',
+ 'category': 'Theme/eCommerce',
+ 'summary': "Theme Boec is an attractive and modern eCommerce Website theme",
+ 'description': "Theme Boec is new kind of Theme.The theme is very "
+ "user-friendly and suitable for your eCommerce website "
+ "with blog",
+ 'author': 'Cybrosys Techno Solutions',
+ 'company': 'Cybrosys Techno Solutions',
+ 'maintainer': 'Cybrosys Techno Solutions',
+ 'website': "https://www.cybrosys.com",
+ 'depends': ['website_blog', 'website_sale_wishlist', 'website_sale',
+ 'website_sale_comparison'],
+ 'data': [
+ 'security/ir.model.access.csv',
+ 'data/boec_config_data.xml',
+ 'views/about.xml',
+ 'views/blog_templates.xml',
+ 'views/blog_preview_templates.xml',
+ 'views/boec_config_views.xml',
+ 'views/cart_templates.xml',
+ 'views/contact_us_templates.xml',
+ 'views/footer_templates.xml',
+ 'views/header_templates.xml',
+ 'views/layout_templates.xml',
+ 'views/page_top_templates.xml',
+ 'views/product_brand_views.xml',
+ 'views/product_template_views.xml',
+ 'views/product_view_templates.xml',
+ 'views/shop_templates.xml',
+ 'views/sidebar_shop_templates.xml',
+ 'views/snippets/banner.xml',
+ 'views/snippets/blog_latest.xml',
+ 'views/snippets/deal_week.xml',
+ 'views/snippets/demo_product.xml',
+ 'views/snippets/insta_feed.xml',
+ 'views/snippets/product_tab.xml',
+ 'views/snippets/product_tab_demo.xml',
+ ],
+ 'assets': {
+ 'web.assets_frontend': [
+ 'theme_boec/static/src/js/sale_utils.js',
+ "/theme_boec/static/src/css/style.css",
+ "/theme_boec/static/src/css/style.css.map",
+ "/theme_boec/static/src/css/style.scss",
+ "/theme_boec/static/src/css/owl_carousel_min.css",
+ "/theme_boec/static/src/css/owl_theme_default_min.css",
+ "/theme_boec/static/src/js/owl.carousel.js",
+ "/theme_boec/static/src/js/owl.carousel.min.js",
+ "/theme_boec/static/src/js/jquery.countdown.min.js",
+ '/theme_boec/static/src/xml/deal_week_content.xml',
+ '/theme_boec/static/src/xml/product_tab_content.xml',
+ "/theme_boec/static/src/js/deal_week.js",
+ "/theme_boec/static/src/js/product_tab.js",
+ "/theme_boec/static/src/js/custom.js",
+ 'https://cdn.jsdelivr.net/npm/material-icons@1.13.12/iconfont/material-icons.min.css',
+ ],
+ },
+ 'images': [
+ 'static/description/banner.png',
+ 'static/description/theme_screenshot.jpg',
+ ],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'auto_install': False,
+ 'application': False,
+}
diff --git a/theme_boec/controllers/__init__.py b/theme_boec/controllers/__init__.py
new file mode 100644
index 000000000..bd0c32710
--- /dev/null
+++ b/theme_boec/controllers/__init__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from . import brand_filter_controller
+from . import product_snippets
diff --git a/theme_boec/controllers/brand_filter_controller.py b/theme_boec/controllers/brand_filter_controller.py
new file mode 100644
index 000000000..9d3c65f63
--- /dev/null
+++ b/theme_boec/controllers/brand_filter_controller.py
@@ -0,0 +1,298 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from datetime import datetime
+from werkzeug.exceptions import NotFound
+from odoo import fields, http
+from odoo.http import request
+from odoo.addons.website.models.ir_http import sitemap_qs2dom
+from odoo.addons.website.controllers.main import QueryURL
+from odoo.addons.website_sale.controllers.main import TableCompute, WebsiteSale
+from odoo.tools import float_round, groupby, lazy, SQL
+from odoo.osv import expression
+
+class ProductBrand(WebsiteSale):
+
+ def sitemap_shop(env, rule, qs):
+ """Required function for shop"""
+ if not qs or qs.lower() in '/shop':
+ yield {'loc': '/shop'}
+ Category = env['product.public.category']
+ dom = sitemap_qs2dom(qs, '/shop/category', Category._rec_name)
+ dom += env['website'].get_current_website().website_domain()
+ for cat in Category.search(dom):
+ loc = '/shop/category/%s' % request.env['ir.http']._slug(cat)
+ if not qs or qs.lower() in loc:
+ yield {'loc': loc}
+
+ @http.route([
+ '/shop',
+ '/shop/page/',
+ '/shop/category/',
+ '/shop/category//page/',
+ ], type='http', auth="public", website=True, sitemap=sitemap_shop)
+ def shop(self, page=0, brand=None, category=None, search='', min_price=0.0,
+ max_price=0.0, ppg=False, **post):
+ if not request.website.has_ecommerce_access():
+ return request.redirect('/web/login')
+ try:
+ min_price = float(min_price)
+ except ValueError:
+ min_price = 0
+ try:
+ max_price = float(max_price)
+ except ValueError:
+ max_price = 0
+
+ Category = request.env['product.public.category']
+ if category:
+ category = Category.search([('id', '=', int(category))], limit=1)
+ if not category or not category.can_access_from_current_website():
+ raise NotFound()
+ else:
+ category = Category
+
+ website = request.env['website'].get_current_website()
+ website_domain = website.website_domain()
+ if ppg:
+ try:
+ ppg = int(ppg)
+ post['ppg'] = ppg
+ except ValueError:
+ ppg = False
+ if not ppg:
+ ppg = website.shop_ppg or 20
+
+ ppr = website.shop_ppr or 4
+ gap = website.shop_gap or "16px"
+ request_args = request.httprequest.args
+ attrib_list = request_args.getlist('attribute_value')
+ attrib_values = [[int(x) for x in v.split("-")] for v in attrib_list if
+ v]
+ attributes_ids = {v[0] for v in attrib_values}
+ attrib_set = {v[1] for v in attrib_values}
+
+ brand_list = request_args.getlist('brand')
+ brand_ids = [int(brand) for brand in brand_list]
+ filter_by_tags_enabled = website.is_view_active(
+ 'website_sale.filter_products_tags')
+ if filter_by_tags_enabled:
+ tags = request_args.getlist('tags')
+ # Allow only numeric tag values to avoid internal error.
+ if tags and all(tag.isnumeric() for tag in tags):
+ post['tags'] = tags
+ tags = {int(tag) for tag in tags}
+ else:
+ post['tags'] = None
+ tags = {}
+
+ keep = QueryURL('/shop', **self._shop_get_query_url_kwargs(
+ category and int(category), search, min_price, max_price, **post))
+
+ now = datetime.timestamp(datetime.now())
+ pricelist = website.pricelist_id
+
+ if 'website_sale_pricelist_time' in request.session:
+ # Check if we need to refresh the cached pricelist
+ pricelist_save_time = request.session['website_sale_pricelist_time']
+ if pricelist_save_time < now - 60 * 60:
+ request.session.pop('website_sale_current_pl', None)
+ website.invalidate_recordset(['pricelist_id'])
+ pricelist = website.pricelist_id
+ request.session['website_sale_pricelist_time'] = now
+ request.session['website_sale_current_pl'] = pricelist.id
+ else:
+ request.session['website_sale_pricelist_time'] = now
+ request.session['website_sale_current_pl'] = pricelist.id
+
+ filter_by_price_enabled = website.is_view_active(
+ 'website_sale.filter_products_price')
+ if filter_by_price_enabled:
+ company_currency = website.company_id.sudo().currency_id
+ conversion_rate = request.env['res.currency']._get_conversion_rate(
+ company_currency, website.currency_id,
+ request.website.company_id, fields.Date.today())
+ else:
+ conversion_rate = 1
+
+ url = '/shop'
+ if search:
+ post['search'] = search
+ if brand_ids:
+ post['brand_ids'] = brand_ids
+ options = self._get_search_options(
+ category=category,
+ attrib_values=attrib_values,
+ min_price=min_price,
+ max_price=max_price,
+ conversion_rate=conversion_rate,
+ display_currency=website.currency_id,
+ **post
+ )
+ fuzzy_search_term, product_count, search_product = self._shop_lookup_products(
+ attrib_set, options, post, search, website)
+
+ filter_by_price_enabled = website.is_view_active(
+ 'website_sale.filter_products_price')
+ if filter_by_price_enabled:
+ # TODO Find an alternative way to obtain the domain through the search metadata.
+ Product = request.env['product.template'].with_context(
+ bin_size=True)
+ domain = self._get_shop_domain(search, category, attrib_values)
+
+ # This is ~4 times more efficient than a search for the cheapest and most expensive products
+ query = Product._where_calc(domain)
+ Product._apply_ir_rules(query, 'read')
+ sql = query.select(
+ SQL(
+ "COALESCE(MIN(list_price), 0) * %(conversion_rate)s, COALESCE(MAX(list_price), 0) * %(conversion_rate)s",
+ conversion_rate=conversion_rate,
+ )
+ )
+ available_min_price, available_max_price = \
+ request.env.execute_query(sql)[0]
+
+ if min_price or max_price:
+ if min_price:
+ min_price = min_price if min_price <= available_max_price else available_min_price
+ post['min_price'] = min_price
+ if max_price:
+ max_price = max_price if max_price >= available_min_price else available_max_price
+ post['max_price'] = max_price
+
+ ProductTag = request.env['product.tag']
+ if filter_by_tags_enabled and search_product:
+ all_tags = ProductTag.search(
+ expression.AND([
+ [('product_ids.is_published', '=', True),
+ ('visible_on_ecommerce', '=', True)],
+ website_domain
+ ])
+ )
+ else:
+ all_tags = ProductTag
+
+ categs_domain = [('parent_id', '=', False)] + website_domain
+ if search:
+ search_categories = Category.search(
+ [(
+ 'product_tmpl_ids', 'in', search_product.ids)] + website_domain
+ ).parents_and_self
+ categs_domain.append(('id', 'in', search_categories.ids))
+ else:
+ search_categories = Category
+ categs = lazy(lambda: Category.search(categs_domain))
+
+ if category:
+ url = "/shop/category/%s" % request.env['ir.http']._slug(category)
+
+ pager = website.pager(url=url, total=product_count, page=page, step=ppg,
+ scope=5, url_args=post)
+ offset = pager['offset']
+ products = search_product[offset:offset + ppg]
+
+ ProductAttribute = request.env['product.attribute']
+ if products:
+ # get all products without limit
+ attributes = lazy(lambda: ProductAttribute.search([
+ ('product_tmpl_ids', 'in', search_product.ids),
+ ('visibility', '=', 'visible'),
+ ]))
+ else:
+ attributes = lazy(lambda: ProductAttribute.browse(attributes_ids))
+
+ layout_mode = request.session.get('website_sale_shop_layout_mode')
+ if not layout_mode:
+ if website.viewref('website_sale.products_list_view').active:
+ layout_mode = 'list'
+ else:
+ layout_mode = 'grid'
+ request.session['website_sale_shop_layout_mode'] = layout_mode
+
+ products_prices = lazy(lambda: products._get_sales_prices(website))
+
+ attributes_values = request.env['product.attribute.value'].browse(
+ attrib_set)
+ sorted_attributes_values = attributes_values.sorted('sequence')
+ multi_attributes_values = sorted_attributes_values.filtered(
+ lambda av: av.display_type == 'multi')
+ single_attributes_values = sorted_attributes_values - multi_attributes_values
+ grouped_attributes_values = list(
+ groupby(single_attributes_values, lambda av: av.attribute_id.id))
+ grouped_attributes_values.extend(
+ [(av.attribute_id.id, [av]) for av in multi_attributes_values])
+
+ selected_attributes_hash = grouped_attributes_values and "#attribute_values=%s" % (
+ ','.join(str(v[0].id) for k, v in grouped_attributes_values)
+ ) or ''
+
+ values = {
+ 'search': fuzzy_search_term or search,
+ 'original_search': fuzzy_search_term and search,
+ 'order': post.get('order', ''),
+ 'category': category,
+ 'attrib_values': attrib_values,
+ 'attrib_set': attrib_set,
+ 'pager': pager,
+ 'products': products,
+ 'search_product': search_product,
+ 'search_count': product_count, # common for all searchbox
+ 'bins': lazy(lambda: TableCompute().process(products, ppg, ppr)),
+ 'ppg': ppg,
+ 'ppr': ppr,
+ 'gap': gap,
+ 'categories': categs,
+ 'attributes': attributes,
+ 'keep': keep,
+ 'selected_attributes_hash': selected_attributes_hash,
+ 'search_categories_ids': search_categories.ids,
+ 'layout_mode': layout_mode,
+ 'products_prices': products_prices,
+ 'get_product_prices': lambda product: lazy(
+ lambda: products_prices[product.id]),
+ 'float_round': float_round,
+ 'brand_ids': brand_ids,
+ }
+ if filter_by_price_enabled:
+ values['min_price'] = min_price or available_min_price
+ values['max_price'] = max_price or available_max_price
+ values['available_min_price'] = float_round(available_min_price, 2)
+ values['available_max_price'] = float_round(available_max_price, 2)
+ if filter_by_tags_enabled:
+ values.update({'all_tags': all_tags, 'tags': tags})
+ if category:
+ values['main_object'] = category
+ values.update(self._get_additional_extra_shop_values(values, **post))
+ return request.render("website_sale.products", values)
+
+ def _get_search_options(
+ self, category=None, attrib_values=None, tags=None, min_price=0.0,
+ max_price=0.0,
+ conversion_rate=1, **post
+ ):
+ res = super()._get_search_options(category=category,
+ attrib_values=attrib_values,
+ tags=tags, min_price=min_price,
+ max_price=max_price,
+ conversion_rate=conversion_rate,
+ **post)
+ res['brand_ids'] = post.get('brand_ids', None)
+ return res
diff --git a/theme_boec/controllers/product_snippets.py b/theme_boec/controllers/product_snippets.py
new file mode 100644
index 000000000..c6eeadfd2
--- /dev/null
+++ b/theme_boec/controllers/product_snippets.py
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from odoo import http
+from odoo.http import request
+
+
+class WebsiteProduct(http.Controller):
+
+ @http.route('/get_product_tab', auth="public", type='json', website=True)
+ def get_product_tab(self):
+ print('REACHED')
+ """Get the website published products for snippet"""
+ new_arrivals = request.env['product.template'].sudo().search_read(
+ [('website_published', '=', True)],
+ order='create_date desc', limit=12)
+ hot_deals = request.env['product.template'].sudo().search_read(
+ [('website_published', '=', True),
+ ('hot_deals', '=', True)], limit=12)
+ return {
+ 'new_arrivals': new_arrivals,
+ 'hot_deals': hot_deals,
+ 'symbol': request.env.user.company_id.currency_id.symbol
+ }
+
+ @http.route('/get_products', auth='public', type='json', website=True)
+ def get_products(self, **kwargs):
+ """Allows to get deal of the week product."""
+ boec_configuration = request.env.ref('theme_boec.boec_config_data')
+ product = boec_configuration.deal_week_product_id
+ return {
+ 'id': product.id,
+ 'name': product.name,
+ 'lst_price': product.lst_price,
+ 'product_tmpl_id': product.product_tmpl_id.id,
+ 'symbol': request.env.user.company_id.currency_id.symbol
+ }
+
+ @http.route('/get_countdown', auth='public', type='json', website=True)
+ def get_countdown(self, **kwargs):
+ """End date for the deal"""
+ return request.env.ref('theme_boec.boec_config_data').date_end
diff --git a/theme_boec/data/boec_config_data.xml b/theme_boec/data/boec_config_data.xml
new file mode 100644
index 000000000..954e85870
--- /dev/null
+++ b/theme_boec/data/boec_config_data.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+ Boec Config
+
+
+
diff --git a/theme_boec/doc/RELEASE_NOTES.md b/theme_boec/doc/RELEASE_NOTES.md
new file mode 100644
index 000000000..e677dcb75
--- /dev/null
+++ b/theme_boec/doc/RELEASE_NOTES.md
@@ -0,0 +1,6 @@
+## Module
+
+#### 29.10.2024
+#### Version 18.0.1.0.0
+#### ADD
+- Initial commit for Theme Boec
diff --git a/theme_boec/models/__init__.py b/theme_boec/models/__init__.py
new file mode 100644
index 000000000..ffeb51296
--- /dev/null
+++ b/theme_boec/models/__init__.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from . import boec_config
+from . import product_brand
+from . import product_template
+from . import theme_utils
+from . import website
diff --git a/theme_boec/models/boec_config.py b/theme_boec/models/boec_config.py
new file mode 100644
index 000000000..b1c405d56
--- /dev/null
+++ b/theme_boec/models/boec_config.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from odoo import fields, models
+
+
+class BoecConfig(models.Model):
+ """Allows to set a product that will deal of the week. It is a snippet"""
+ _name = 'boec.config'
+ _description = 'Boec Config'
+
+ name = fields.Char(string='Name', help='Name of the Deal')
+ deal_week_product_id = fields.Many2one('product.product',
+ domain=[('is_published', '=', True)],
+ string='Deal of the Week Product',
+ help='This product will be the deal'
+ 'of the week')
+ date_end = fields.Datetime(string='Counter End Date', help='End date of'
+ 'this offer')
diff --git a/theme_boec/models/product_brand.py b/theme_boec/models/product_brand.py
new file mode 100644
index 000000000..b142746bd
--- /dev/null
+++ b/theme_boec/models/product_brand.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from odoo import fields, models
+
+
+class ProductBrand(models.Model):
+ """Model for creating Brands for products."""
+ _name = 'product.brand'
+ _description = "Product Brand"
+ _rec_name = 'brand_name'
+
+ brand_name = fields.Char(required=True, string='Name', help='Name of the'
+ 'brand.')
+ sequence_no = fields.Integer(string="Sequence no", help='Sequence number of'
+ 'brand.')
+ parent_id = fields.Many2one('product.brand', string='Parent Brand',
+ index=True, help='Select the parent brand of'
+ 'the brand.')
diff --git a/theme_boec/models/product_template.py b/theme_boec/models/product_template.py
new file mode 100644
index 000000000..6f4156d99
--- /dev/null
+++ b/theme_boec/models/product_template.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from odoo import fields, models
+
+
+class ProductTemplate(models.Model):
+ """Inherited product template for adding the field Hot Sale and Product
+ Brand. While using the snippet 'Product Tab', the product with enabled
+ Hot Sale will be display."""
+ _inherit = "product.template"
+
+ hot_deals = fields.Boolean(string="Hot Sale", help='The product or services'
+ 'which are high in'
+ 'demand at a particular'
+ 'time or period')
+ brand_id = fields.Many2one('product.brand', string="Product Brand",
+ help='Enabled product can filter from website'
+ 'by brand.')
+
+ def _search_get_detail(self, website, order, options):
+ res = super()._search_get_detail(website, order, options)
+ if options.get('brand_ids', None):
+ res['base_domain'].append(
+ [('brand_id.id', 'in', options['brand_ids'])])
+ return res
diff --git a/theme_boec/models/theme_utils.py b/theme_boec/models/theme_utils.py
new file mode 100644
index 000000000..be885e67b
--- /dev/null
+++ b/theme_boec/models/theme_utils.py
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from odoo import models
+
+
+class ThemeUtils(models.AbstractModel):
+ _inherit = 'theme.utils'
+
+ def _theme_boec_post_copy(self, mod):
+ self.enable_view('theme_boec.boec_header')
+ self.disable_view('website_sale.products_add_to_cart')
+ self.disable_view('website_sale_comparison.add_to_compare')
+ self.disable_view('website_sale.product_buy_now')
+ self.disable_view('website_sale_wishlist.add_to_wishlist')
+ self.disable_view('website_sale.add_grid_or_list_option')
+ self.disable_view('website_sale.products_list_view')
+ self.disable_view('website_sale.alternative_products')
+ self.disable_view('website_sale.product_buy_now')
+ self.disable_view('website_sale.product_comment')
+ self.disable_view('website_sale.product_picture_magnify_both')
+ self.disable_view('website_sale.product_variants')
+ self.disable_view('website_sale_comparison.product_attributes_body')
+ self.disable_view('website_sale.ecom_show_extra_fields')
+ self.disable_view('website_sale.product_custom_text')
+ self.disable_view('website_sale.products_add_to_cart')
+ self.disable_view('website_sale_wishlist.product_add_to_wishlist')
+ self.disable_view('website_blog.opt_posts_loop_show_author')
+ self.disable_view('website_blog.opt_posts_loop_show_stats')
+ self.disable_view('website_blog.opt_posts_loop_show_stats')
+ self.disable_view('website_blog.opt_blog_list_view')
+ self.disable_view('website_blog.opt_blog_cards_design')
+ self.disable_view('website_blog.opt_blog_cover_post')
+ self.disable_view('website_blog.opt_blog_cover_post_fullwidth_design')
+ self.disable_view('website_blog.opt_blog_post_breadcrumb')
+ self.disable_view('website_blog.opt_blog_post_sidebar')
diff --git a/theme_boec/models/website.py b/theme_boec/models/website.py
new file mode 100644
index 000000000..8c89fc516
--- /dev/null
+++ b/theme_boec/models/website.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+#############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+#
+# Copyright (C) 2024-TODAY Cybrosys Technologies()
+# Author: Cybrosys Techno Solutions()
+#
+# You can modify it under the terms of the GNU AFFERO
+# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details.
+#
+# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+# (AGPL v3) along with this program.
+# If not, see .
+#
+#############################################################################
+from odoo import models
+
+
+class Website(models.Model):
+ """Inherited website fo apply brand feature."""
+ _inherit = "website"
+
+ def get_brands(self):
+ """Returning all brands"""
+ return self.env['product.brand'].search([])
diff --git a/theme_boec/security/ir.model.access.csv b/theme_boec/security/ir.model.access.csv
new file mode 100644
index 000000000..aa7f4d335
--- /dev/null
+++ b/theme_boec/security/ir.model.access.csv
@@ -0,0 +1,3 @@
+id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
+access_product_brand_user,access.product.brand.user,model_product_brand,,1,1,1,1
+access_boec_config_user,access.boec.config.user,model_boec_config,base.group_user,1,1,1,1
diff --git a/theme_boec/static/description/assets/icons/check.png b/theme_boec/static/description/assets/icons/check.png
new file mode 100644
index 000000000..c8e85f51d
Binary files /dev/null and b/theme_boec/static/description/assets/icons/check.png differ
diff --git a/theme_boec/static/description/assets/icons/chevron.png b/theme_boec/static/description/assets/icons/chevron.png
new file mode 100644
index 000000000..2089293d6
Binary files /dev/null and b/theme_boec/static/description/assets/icons/chevron.png differ
diff --git a/theme_boec/static/description/assets/icons/cogs.png b/theme_boec/static/description/assets/icons/cogs.png
new file mode 100644
index 000000000..95d0bad62
Binary files /dev/null and b/theme_boec/static/description/assets/icons/cogs.png differ
diff --git a/theme_boec/static/description/assets/icons/consultation.png b/theme_boec/static/description/assets/icons/consultation.png
new file mode 100644
index 000000000..8319d4baa
Binary files /dev/null and b/theme_boec/static/description/assets/icons/consultation.png differ
diff --git a/theme_boec/static/description/assets/icons/ecom-black.png b/theme_boec/static/description/assets/icons/ecom-black.png
new file mode 100644
index 000000000..a9385ff13
Binary files /dev/null and b/theme_boec/static/description/assets/icons/ecom-black.png differ
diff --git a/theme_boec/static/description/assets/icons/education-black.png b/theme_boec/static/description/assets/icons/education-black.png
new file mode 100644
index 000000000..3eb09b27b
Binary files /dev/null and b/theme_boec/static/description/assets/icons/education-black.png differ
diff --git a/theme_boec/static/description/assets/icons/hotel-black.png b/theme_boec/static/description/assets/icons/hotel-black.png
new file mode 100644
index 000000000..130f613be
Binary files /dev/null and b/theme_boec/static/description/assets/icons/hotel-black.png differ
diff --git a/theme_boec/static/description/assets/icons/license.png b/theme_boec/static/description/assets/icons/license.png
new file mode 100644
index 000000000..a5869797e
Binary files /dev/null and b/theme_boec/static/description/assets/icons/license.png differ
diff --git a/theme_boec/static/description/assets/icons/lifebuoy.png b/theme_boec/static/description/assets/icons/lifebuoy.png
new file mode 100644
index 000000000..658d56ccc
Binary files /dev/null and b/theme_boec/static/description/assets/icons/lifebuoy.png differ
diff --git a/theme_boec/static/description/assets/icons/manufacturing-black.png b/theme_boec/static/description/assets/icons/manufacturing-black.png
new file mode 100644
index 000000000..697eb0e9f
Binary files /dev/null and b/theme_boec/static/description/assets/icons/manufacturing-black.png differ
diff --git a/theme_boec/static/description/assets/icons/pos-black.png b/theme_boec/static/description/assets/icons/pos-black.png
new file mode 100644
index 000000000..97c0f90c1
Binary files /dev/null and b/theme_boec/static/description/assets/icons/pos-black.png differ
diff --git a/theme_boec/static/description/assets/icons/puzzle.png b/theme_boec/static/description/assets/icons/puzzle.png
new file mode 100644
index 000000000..65cf854e7
Binary files /dev/null and b/theme_boec/static/description/assets/icons/puzzle.png differ
diff --git a/theme_boec/static/description/assets/icons/restaurant-black.png b/theme_boec/static/description/assets/icons/restaurant-black.png
new file mode 100644
index 000000000..4a35eb939
Binary files /dev/null and b/theme_boec/static/description/assets/icons/restaurant-black.png differ
diff --git a/theme_boec/static/description/assets/icons/service-black.png b/theme_boec/static/description/assets/icons/service-black.png
new file mode 100644
index 000000000..301ab51cb
Binary files /dev/null and b/theme_boec/static/description/assets/icons/service-black.png differ
diff --git a/theme_boec/static/description/assets/icons/trading-black.png b/theme_boec/static/description/assets/icons/trading-black.png
new file mode 100644
index 000000000..9398ba2f1
Binary files /dev/null and b/theme_boec/static/description/assets/icons/trading-black.png differ
diff --git a/theme_boec/static/description/assets/icons/training.png b/theme_boec/static/description/assets/icons/training.png
new file mode 100644
index 000000000..884ca024d
Binary files /dev/null and b/theme_boec/static/description/assets/icons/training.png differ
diff --git a/theme_boec/static/description/assets/icons/update.png b/theme_boec/static/description/assets/icons/update.png
new file mode 100644
index 000000000..ecbc5a01a
Binary files /dev/null and b/theme_boec/static/description/assets/icons/update.png differ
diff --git a/theme_boec/static/description/assets/icons/user.png b/theme_boec/static/description/assets/icons/user.png
new file mode 100644
index 000000000..6ffb23d9f
Binary files /dev/null and b/theme_boec/static/description/assets/icons/user.png differ
diff --git a/theme_boec/static/description/assets/icons/wrench.png b/theme_boec/static/description/assets/icons/wrench.png
new file mode 100644
index 000000000..6c04dea0f
Binary files /dev/null and b/theme_boec/static/description/assets/icons/wrench.png differ
diff --git a/theme_boec/static/description/assets/misc/categories.png b/theme_boec/static/description/assets/misc/categories.png
new file mode 100644
index 000000000..bedf1e0b1
Binary files /dev/null and b/theme_boec/static/description/assets/misc/categories.png differ
diff --git a/theme_boec/static/description/assets/misc/check-box.png b/theme_boec/static/description/assets/misc/check-box.png
new file mode 100644
index 000000000..42caf24b9
Binary files /dev/null and b/theme_boec/static/description/assets/misc/check-box.png differ
diff --git a/theme_boec/static/description/assets/misc/compass.png b/theme_boec/static/description/assets/misc/compass.png
new file mode 100644
index 000000000..d5fed8faa
Binary files /dev/null and b/theme_boec/static/description/assets/misc/compass.png differ
diff --git a/theme_boec/static/description/assets/misc/corporate.png b/theme_boec/static/description/assets/misc/corporate.png
new file mode 100644
index 000000000..2eb13edbf
Binary files /dev/null and b/theme_boec/static/description/assets/misc/corporate.png differ
diff --git a/theme_boec/static/description/assets/misc/customer-support.png b/theme_boec/static/description/assets/misc/customer-support.png
new file mode 100644
index 000000000..79efc72ed
Binary files /dev/null and b/theme_boec/static/description/assets/misc/customer-support.png differ
diff --git a/theme_boec/static/description/assets/misc/cybrosys-logo.png b/theme_boec/static/description/assets/misc/cybrosys-logo.png
new file mode 100644
index 000000000..cc3cc0ccf
Binary files /dev/null and b/theme_boec/static/description/assets/misc/cybrosys-logo.png differ
diff --git a/theme_boec/static/description/assets/misc/features.png b/theme_boec/static/description/assets/misc/features.png
new file mode 100644
index 000000000..b41769f77
Binary files /dev/null and b/theme_boec/static/description/assets/misc/features.png differ
diff --git a/theme_boec/static/description/assets/misc/logo.png b/theme_boec/static/description/assets/misc/logo.png
new file mode 100644
index 000000000..478462d3e
Binary files /dev/null and b/theme_boec/static/description/assets/misc/logo.png differ
diff --git a/theme_boec/static/description/assets/misc/pictures.png b/theme_boec/static/description/assets/misc/pictures.png
new file mode 100644
index 000000000..56d255fe9
Binary files /dev/null and b/theme_boec/static/description/assets/misc/pictures.png differ
diff --git a/theme_boec/static/description/assets/misc/pie-chart.png b/theme_boec/static/description/assets/misc/pie-chart.png
new file mode 100644
index 000000000..426e05244
Binary files /dev/null and b/theme_boec/static/description/assets/misc/pie-chart.png differ
diff --git a/theme_boec/static/description/assets/misc/right-arrow.png b/theme_boec/static/description/assets/misc/right-arrow.png
new file mode 100644
index 000000000..730984a06
Binary files /dev/null and b/theme_boec/static/description/assets/misc/right-arrow.png differ
diff --git a/theme_boec/static/description/assets/misc/star.png b/theme_boec/static/description/assets/misc/star.png
new file mode 100644
index 000000000..2eb9ab29f
Binary files /dev/null and b/theme_boec/static/description/assets/misc/star.png differ
diff --git a/theme_boec/static/description/assets/misc/support.png b/theme_boec/static/description/assets/misc/support.png
new file mode 100644
index 000000000..4f18b8b82
Binary files /dev/null and b/theme_boec/static/description/assets/misc/support.png differ
diff --git a/theme_boec/static/description/assets/misc/whatsapp.png b/theme_boec/static/description/assets/misc/whatsapp.png
new file mode 100644
index 000000000..d513a5356
Binary files /dev/null and b/theme_boec/static/description/assets/misc/whatsapp.png differ
diff --git a/theme_boec/static/description/assets/modules/1.png b/theme_boec/static/description/assets/modules/1.png
new file mode 100644
index 000000000..5238bdeab
Binary files /dev/null and b/theme_boec/static/description/assets/modules/1.png differ
diff --git a/theme_boec/static/description/assets/modules/2.png b/theme_boec/static/description/assets/modules/2.png
new file mode 100644
index 000000000..1ae7cfe3b
Binary files /dev/null and b/theme_boec/static/description/assets/modules/2.png differ
diff --git a/theme_boec/static/description/assets/modules/3.png b/theme_boec/static/description/assets/modules/3.png
new file mode 100644
index 000000000..3c3ff1afb
Binary files /dev/null and b/theme_boec/static/description/assets/modules/3.png differ
diff --git a/theme_boec/static/description/assets/modules/4.png b/theme_boec/static/description/assets/modules/4.png
new file mode 100644
index 000000000..3fae4631e
Binary files /dev/null and b/theme_boec/static/description/assets/modules/4.png differ
diff --git a/theme_boec/static/description/assets/modules/5.gif b/theme_boec/static/description/assets/modules/5.gif
new file mode 100644
index 000000000..2a5f8e659
Binary files /dev/null and b/theme_boec/static/description/assets/modules/5.gif differ
diff --git a/theme_boec/static/description/assets/modules/6.png b/theme_boec/static/description/assets/modules/6.png
new file mode 100644
index 000000000..7f2815273
Binary files /dev/null and b/theme_boec/static/description/assets/modules/6.png differ
diff --git a/theme_boec/static/description/banner.png b/theme_boec/static/description/banner.png
new file mode 100644
index 000000000..c8ebdbd2b
Binary files /dev/null and b/theme_boec/static/description/banner.png differ
diff --git a/theme_boec/static/description/icon.png b/theme_boec/static/description/icon.png
new file mode 100644
index 000000000..6d69869c3
Binary files /dev/null and b/theme_boec/static/description/icon.png differ
diff --git a/theme_boec/static/description/images/1.jpg b/theme_boec/static/description/images/1.jpg
new file mode 100644
index 000000000..86337bc07
Binary files /dev/null and b/theme_boec/static/description/images/1.jpg differ
diff --git a/theme_boec/static/description/images/2.jpg b/theme_boec/static/description/images/2.jpg
new file mode 100644
index 000000000..075316292
Binary files /dev/null and b/theme_boec/static/description/images/2.jpg differ
diff --git a/theme_boec/static/description/images/3.jpg b/theme_boec/static/description/images/3.jpg
new file mode 100644
index 000000000..2eb95e59a
Binary files /dev/null and b/theme_boec/static/description/images/3.jpg differ
diff --git a/theme_boec/static/description/images/4.jpg b/theme_boec/static/description/images/4.jpg
new file mode 100644
index 000000000..9637b66ea
Binary files /dev/null and b/theme_boec/static/description/images/4.jpg differ
diff --git a/theme_boec/static/description/images/5.jpg b/theme_boec/static/description/images/5.jpg
new file mode 100644
index 000000000..68aba8e85
Binary files /dev/null and b/theme_boec/static/description/images/5.jpg differ
diff --git a/theme_boec/static/description/images/6.jpg b/theme_boec/static/description/images/6.jpg
new file mode 100644
index 000000000..90cb876d3
Binary files /dev/null and b/theme_boec/static/description/images/6.jpg differ
diff --git a/theme_boec/static/description/images/Cybrosys R.png b/theme_boec/static/description/images/Cybrosys R.png
new file mode 100644
index 000000000..da4058087
Binary files /dev/null and b/theme_boec/static/description/images/Cybrosys R.png differ
diff --git a/theme_boec/static/description/images/Cybrosys.png b/theme_boec/static/description/images/Cybrosys.png
new file mode 100644
index 000000000..d76b5bafb
Binary files /dev/null and b/theme_boec/static/description/images/Cybrosys.png differ
diff --git a/theme_boec/static/description/images/Poster-modal.psd b/theme_boec/static/description/images/Poster-modal.psd
new file mode 100644
index 000000000..ad22908b9
Binary files /dev/null and b/theme_boec/static/description/images/Poster-modal.psd differ
diff --git a/theme_boec/static/description/images/banner.png b/theme_boec/static/description/images/banner.png
new file mode 100644
index 000000000..c8ebdbd2b
Binary files /dev/null and b/theme_boec/static/description/images/banner.png differ
diff --git a/theme_boec/static/description/images/boec_deal.png b/theme_boec/static/description/images/boec_deal.png
new file mode 100644
index 000000000..9a1bf0371
Binary files /dev/null and b/theme_boec/static/description/images/boec_deal.png differ
diff --git a/theme_boec/static/description/images/boec_hot_sales.png b/theme_boec/static/description/images/boec_hot_sales.png
new file mode 100644
index 000000000..a0ef75180
Binary files /dev/null and b/theme_boec/static/description/images/boec_hot_sales.png differ
diff --git a/theme_boec/static/description/images/capture (1).png b/theme_boec/static/description/images/capture (1).png
new file mode 100644
index 000000000..8824deafc
Binary files /dev/null and b/theme_boec/static/description/images/capture (1).png differ
diff --git a/theme_boec/static/description/images/check.png b/theme_boec/static/description/images/check.png
new file mode 100644
index 000000000..c8e85f51d
Binary files /dev/null and b/theme_boec/static/description/images/check.png differ
diff --git a/theme_boec/static/description/images/chevron.png b/theme_boec/static/description/images/chevron.png
new file mode 100644
index 000000000..2089293d6
Binary files /dev/null and b/theme_boec/static/description/images/chevron.png differ
diff --git a/theme_boec/static/description/images/cogs.png b/theme_boec/static/description/images/cogs.png
new file mode 100644
index 000000000..95d0bad62
Binary files /dev/null and b/theme_boec/static/description/images/cogs.png differ
diff --git a/theme_boec/static/description/images/consultation.png b/theme_boec/static/description/images/consultation.png
new file mode 100644
index 000000000..8319d4baa
Binary files /dev/null and b/theme_boec/static/description/images/consultation.png differ
diff --git a/theme_boec/static/description/images/cybro-logo-oca-no-text.png b/theme_boec/static/description/images/cybro-logo-oca-no-text.png
new file mode 100644
index 000000000..180d15dd6
Binary files /dev/null and b/theme_boec/static/description/images/cybro-logo-oca-no-text.png differ
diff --git a/theme_boec/static/description/images/cybro-logo-oca.png b/theme_boec/static/description/images/cybro-logo-oca.png
new file mode 100644
index 000000000..90e4c9cb9
Binary files /dev/null and b/theme_boec/static/description/images/cybro-logo-oca.png differ
diff --git a/theme_boec/static/description/images/demo-1.png b/theme_boec/static/description/images/demo-1.png
new file mode 100644
index 000000000..edcd5c8f0
Binary files /dev/null and b/theme_boec/static/description/images/demo-1.png differ
diff --git a/theme_boec/static/description/images/demo-2.jpg b/theme_boec/static/description/images/demo-2.jpg
new file mode 100644
index 000000000..d2bcde9ec
Binary files /dev/null and b/theme_boec/static/description/images/demo-2.jpg differ
diff --git a/theme_boec/static/description/images/demo-3.jpg b/theme_boec/static/description/images/demo-3.jpg
new file mode 100644
index 000000000..e7ceda1ad
Binary files /dev/null and b/theme_boec/static/description/images/demo-3.jpg differ
diff --git a/theme_boec/static/description/images/demo-4.jpg b/theme_boec/static/description/images/demo-4.jpg
new file mode 100644
index 000000000..937840370
Binary files /dev/null and b/theme_boec/static/description/images/demo-4.jpg differ
diff --git a/theme_boec/static/description/images/demo-5.jpg b/theme_boec/static/description/images/demo-5.jpg
new file mode 100644
index 000000000..d86e0e76c
Binary files /dev/null and b/theme_boec/static/description/images/demo-5.jpg differ
diff --git a/theme_boec/static/description/images/ecom-black.png b/theme_boec/static/description/images/ecom-black.png
new file mode 100644
index 000000000..a9385ff13
Binary files /dev/null and b/theme_boec/static/description/images/ecom-black.png differ
diff --git a/theme_boec/static/description/images/education-black.png b/theme_boec/static/description/images/education-black.png
new file mode 100644
index 000000000..3eb09b27b
Binary files /dev/null and b/theme_boec/static/description/images/education-black.png differ
diff --git a/theme_boec/static/description/images/email.svg b/theme_boec/static/description/images/email.svg
new file mode 100644
index 000000000..15291cdc3
--- /dev/null
+++ b/theme_boec/static/description/images/email.svg
@@ -0,0 +1,33 @@
+
diff --git a/theme_boec/static/description/images/hero.png b/theme_boec/static/description/images/hero.png
new file mode 100644
index 000000000..e7610e6e9
Binary files /dev/null and b/theme_boec/static/description/images/hero.png differ
diff --git a/theme_boec/static/description/images/hotel-black.png b/theme_boec/static/description/images/hotel-black.png
new file mode 100644
index 000000000..130f613be
Binary files /dev/null and b/theme_boec/static/description/images/hotel-black.png differ
diff --git a/theme_boec/static/description/images/laptop-screenshots.jpg b/theme_boec/static/description/images/laptop-screenshots.jpg
new file mode 100644
index 000000000..15e2af19b
Binary files /dev/null and b/theme_boec/static/description/images/laptop-screenshots.jpg differ
diff --git a/theme_boec/static/description/images/license.png b/theme_boec/static/description/images/license.png
new file mode 100644
index 000000000..a5869797e
Binary files /dev/null and b/theme_boec/static/description/images/license.png differ
diff --git a/theme_boec/static/description/images/lifebuoy.png b/theme_boec/static/description/images/lifebuoy.png
new file mode 100644
index 000000000..658d56ccc
Binary files /dev/null and b/theme_boec/static/description/images/lifebuoy.png differ
diff --git a/theme_boec/static/description/images/manufacturing-black.png b/theme_boec/static/description/images/manufacturing-black.png
new file mode 100644
index 000000000..697eb0e9f
Binary files /dev/null and b/theme_boec/static/description/images/manufacturing-black.png differ
diff --git a/theme_boec/static/description/images/new_arrivals.jpg b/theme_boec/static/description/images/new_arrivals.jpg
new file mode 100644
index 000000000..b0ff79222
Binary files /dev/null and b/theme_boec/static/description/images/new_arrivals.jpg differ
diff --git a/theme_boec/static/description/images/phone-screenshots.jpg b/theme_boec/static/description/images/phone-screenshots.jpg
new file mode 100644
index 000000000..3979435d9
Binary files /dev/null and b/theme_boec/static/description/images/phone-screenshots.jpg differ
diff --git a/theme_boec/static/description/images/phone.svg b/theme_boec/static/description/images/phone.svg
new file mode 100644
index 000000000..b7bd7f251
--- /dev/null
+++ b/theme_boec/static/description/images/phone.svg
@@ -0,0 +1,3 @@
+
diff --git a/theme_boec/static/description/images/photo-capture.png b/theme_boec/static/description/images/photo-capture.png
new file mode 100644
index 000000000..06c111758
Binary files /dev/null and b/theme_boec/static/description/images/photo-capture.png differ
diff --git a/theme_boec/static/description/images/pngwing.jpg b/theme_boec/static/description/images/pngwing.jpg
new file mode 100644
index 000000000..b4ff4e91d
Binary files /dev/null and b/theme_boec/static/description/images/pngwing.jpg differ
diff --git a/theme_boec/static/description/images/pos-black.png b/theme_boec/static/description/images/pos-black.png
new file mode 100644
index 000000000..97c0f90c1
Binary files /dev/null and b/theme_boec/static/description/images/pos-black.png differ
diff --git a/theme_boec/static/description/images/poster.psd b/theme_boec/static/description/images/poster.psd
new file mode 100644
index 000000000..281991bda
Binary files /dev/null and b/theme_boec/static/description/images/poster.psd differ
diff --git a/theme_boec/static/description/images/puzzle.png b/theme_boec/static/description/images/puzzle.png
new file mode 100644
index 000000000..65cf854e7
Binary files /dev/null and b/theme_boec/static/description/images/puzzle.png differ
diff --git a/theme_boec/static/description/images/restaurant-black.png b/theme_boec/static/description/images/restaurant-black.png
new file mode 100644
index 000000000..4a35eb939
Binary files /dev/null and b/theme_boec/static/description/images/restaurant-black.png differ
diff --git a/theme_boec/static/description/images/service-black.png b/theme_boec/static/description/images/service-black.png
new file mode 100644
index 000000000..301ab51cb
Binary files /dev/null and b/theme_boec/static/description/images/service-black.png differ
diff --git a/theme_boec/static/description/images/star (1) 2.svg b/theme_boec/static/description/images/star (1) 2.svg
new file mode 100644
index 000000000..5ae9f507a
--- /dev/null
+++ b/theme_boec/static/description/images/star (1) 2.svg
@@ -0,0 +1,9 @@
+
diff --git a/theme_boec/static/description/images/support (1) 1.svg b/theme_boec/static/description/images/support (1) 1.svg
new file mode 100644
index 000000000..7d37a8f30
--- /dev/null
+++ b/theme_boec/static/description/images/support (1) 1.svg
@@ -0,0 +1,9 @@
+
diff --git a/theme_boec/static/description/images/support-email.svg b/theme_boec/static/description/images/support-email.svg
new file mode 100644
index 000000000..eb70370d6
--- /dev/null
+++ b/theme_boec/static/description/images/support-email.svg
@@ -0,0 +1,6 @@
+
diff --git a/theme_boec/static/description/images/theme-boec-template.jpg b/theme_boec/static/description/images/theme-boec-template.jpg
new file mode 100644
index 000000000..2ad9d62d7
Binary files /dev/null and b/theme_boec/static/description/images/theme-boec-template.jpg differ
diff --git a/theme_boec/static/description/images/tick-mark.svg b/theme_boec/static/description/images/tick-mark.svg
new file mode 100644
index 000000000..2dbb40187
--- /dev/null
+++ b/theme_boec/static/description/images/tick-mark.svg
@@ -0,0 +1,17 @@
+
diff --git a/theme_boec/static/description/images/trading-black.png b/theme_boec/static/description/images/trading-black.png
new file mode 100644
index 000000000..9398ba2f1
Binary files /dev/null and b/theme_boec/static/description/images/trading-black.png differ
diff --git a/theme_boec/static/description/images/training.png b/theme_boec/static/description/images/training.png
new file mode 100644
index 000000000..884ca024d
Binary files /dev/null and b/theme_boec/static/description/images/training.png differ
diff --git a/theme_boec/static/description/images/update.png b/theme_boec/static/description/images/update.png
new file mode 100644
index 000000000..ecbc5a01a
Binary files /dev/null and b/theme_boec/static/description/images/update.png differ
diff --git a/theme_boec/static/description/images/user.png b/theme_boec/static/description/images/user.png
new file mode 100644
index 000000000..6ffb23d9f
Binary files /dev/null and b/theme_boec/static/description/images/user.png differ
diff --git a/theme_boec/static/description/images/whatsapp 1.svg b/theme_boec/static/description/images/whatsapp 1.svg
new file mode 100644
index 000000000..0bfaf8fc6
--- /dev/null
+++ b/theme_boec/static/description/images/whatsapp 1.svg
@@ -0,0 +1,9 @@
+
diff --git a/theme_boec/static/description/images/whatsapp.svg b/theme_boec/static/description/images/whatsapp.svg
new file mode 100644
index 000000000..b618aea1d
--- /dev/null
+++ b/theme_boec/static/description/images/whatsapp.svg
@@ -0,0 +1,33 @@
+
diff --git a/theme_boec/static/description/images/wrench.png b/theme_boec/static/description/images/wrench.png
new file mode 100644
index 000000000..6c04dea0f
Binary files /dev/null and b/theme_boec/static/description/images/wrench.png differ
diff --git a/theme_boec/static/description/index.html b/theme_boec/static/description/index.html
new file mode 100644
index 000000000..f4438ff68
--- /dev/null
+++ b/theme_boec/static/description/index.html
@@ -0,0 +1,802 @@
+
+
+
+
+
+
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Supports:
+
+
+ Community
+
+
+ Enterprise
+
+
+
+
+ Availability:
+
+
+ Odoo Online
+
+
+ Odoo.sh
+
+
+ On Premise
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Theme Boec is a new kind of Theme. The theme is a very user-friendly and is suitable for your
+ eCommerce website with blog.
+ It is the most powerful, easy to use theme. Many custom designed snippets facilitates to add
+ better
+ user experience.
+ Contains Hot sales, New arrival and Deal of the week with Counter snippets that are configured
+ from
+ the backend.
+ It has instagram feed snippet and deal of the week snippet with counter.
+ It is a fully Responsive Theme with a premium design and attractive front-end theme.
+ it contains price filter and brand filter options by default, and it easily configures from
+ backend.
+ This theme is a perfect choice for your online store you are looking for. This theme is fully
+ customized
+ the eCommerce website, shop view, custom categories view, product view, contact us page, cart,
+ blog,
+ blog preview...etc.
+
+
+
+
Overview
+
+
+
+ Theme Boec V17 is an Attractive Front-end Theme for Your Odoo
+ 17 Website.
+ This Theme Makes Your Page More Stylish And Beautiful.
+ This is an Advanced and Elegant Frontend Theme for Odoo
+ 17
+ And Can Offer a Perfect Choice for Your Odoo Website.
+
+
+
+ Custom Designed Snippets for better
+ user experience
+
+
+ Hot sales, New arrival and Deal of the week
+
+
+ Fully Responsive Theme with a Premium Design
+
+
+ Contains Price Filter and Brand Filter Options by Default
+
+ A Clean layout and New Font Style
+
+ Customized shop view, custom categories view, product view, contact us page, cart,
+ blog, blog preview...etc
+
+
+
+
+
+
+
+
+
Desktop View
+
+
+
+ It is easy to customize and use. Just drag and drop the building blocks to make attractive
+ webpages.
+
+
+
+
+
+
+
+
+
+
+
+
+
Mobile View
+
+
+
+ User-friendly and modern looking theme makes your page more Stylish And Beautiful.
+ It is easy to customize and use. Just drag and drop the building blocks to make attractive
+ webpages.Customizable building blocks in home page design helps you to edit them as per
+ needs.
+
+
+
+
+
+
+
+
+
+
+
Overview
+
+
+
+ It is an attractive and modern eCommerce Website theme. It makes your eCommerce website is attractive.
+ Just drag & drop the building blocks you need to easily build your layout.
+ Theme Boec is a perfect choice for your online store you are looking for.
+
+
+
+
+
+
+
+
+
+
+
+
Hot Sales and New Arrivals
+
+
+
+ Hot sales and New arrivals are the snippets that are configured from the backend. You can easily add products
+ to the Hot sales. New arrivals are automatically taken the newly arrived products.
+
+
+
+
+
+
+
+
Deal of the Week
+
+
+
+ Deal of the week snippet have Counter for giving a premium look the deal of the week product and its counter
+ are easily configurable from the backend.
+
+
+
+
+
+
+
+
Cart
+
+
+
+ The cart display your products in a stylish way. it will display the all needed details of
+ the product
+
+
+
+
+
+
+
+
Blog Preview
+
+
+
+ Theme Boec have a fully customized blog preview with big cover image of the blog with
+ share
+ buttons.
+
+
+
+
+
+
+
+
Product Preview
+
+
+
It has a fully customized Product preview with full details of the product with an
+ attractive design.
'],
+ animateOut: 'fadeOut'
+ });
+
+ function counter() {
+ var buttons = $('.owl-dots button');
+ buttons.each(function(index, item) {
+ $(item).find('span').text(index + 1);
+ });
+ }
+ //add another class for banner_added
+ var banner = $(".banner_added");
+ var banner_id = banner.data("id");
+ $("div").addClass(banner_id);
+ banner.addClass("banner_hide");
+
+ var url = window.location;
+ // Will only work if string in href matches with location
+ $('ul.navbar-nav a[href="' + url + '"]').parent().addClass('active');
+ // Will also work for relative and absolute hrefs
+ $('ul.navbar-nav a').filter(function() {
+ return this.href == url;
+ }).parent().addClass('active');
+
+ // // Add active class to the current button in Navbar (highlight it)
+ var header = document.getElementById("myDIV");
+ var btns = header.getElementsByClassName("nav-link");
+ for (var i = 0; i < btns.length; i++) {
+ btns[i].addEventListener("click", function() {
+ var current = document.getElementsByClassName("active");
+ current[0].className = current[0].className.replace(" active", "");
+ this.className += " active";
+ });
+ }
+ //Add active class to the current button (highlight it)
+ var header = document.getElementById("myDIV");
+ var btns = header.getElementsByClassName("btn");
+ for (var i = 0; i < btns.length; i++) {
+ btns[i].addEventListener("click", function() {
+ var current = document.getElementsByClassName("active");
+ if (current.length > 0) {
+ current[0].className = current[0].className.replace(" active", "");
+ }
+ this.className += " active";
+ });
+ }
+ //spinner jquery--quantity
+ jQuery('
+
-
').insertAfter('.quantity input');
+ jQuery('.quantity').each(function() {
+ var spinner = jQuery(this),
+ input = spinner.find('input[type="number"]'),
+ btnUp = spinner.find('.quantity-up'),
+ btnDown = spinner.find('.quantity-down'),
+ min = input.attr('min'),
+ max = input.attr('max');
+ btnUp.click(function() {
+ var oldValue = parseFloat(input.val());
+ if (oldValue >= max) {
+ var newVal = oldValue;
+ } else {
+ var newVal = oldValue + 1;
+ }
+ spinner.find("input").val(newVal);
+ spinner.find("input").trigger("change");
+ });
+ btnDown.click(function() {
+ var oldValue = parseFloat(input.val());
+ if (oldValue <= min) {
+ var newVal = oldValue;
+ } else {
+ var newVal = oldValue - 1;
+ }
+ spinner.find("input").val(newVal);
+ spinner.find("input").trigger("change");
+ });
+ });
+ //shop jquery--card head
+ $('.card-header').click(function() {
+ $(this).find('i').toggleClass('fas fa-angle-down fas fa-angle-up');
+ });
+ //Tab
+ $("#tile-1 .nav-tabs a").click(function() {
+ var position = $(this).parent().position();
+ var width = $(this).parent().width();
+ });
+ var actWidth = $("#tile-1 .nav-tabs").find(".active").parent("li").width();
+ var actPosition = $("#tile-1 .nav-tabs .active").position();
+ });
diff --git a/theme_boec/static/src/js/deal_week.js b/theme_boec/static/src/js/deal_week.js
new file mode 100644
index 000000000..b6add37b0
--- /dev/null
+++ b/theme_boec/static/src/js/deal_week.js
@@ -0,0 +1,40 @@
+/** @odoo-module **/
+
+import { renderToElement } from "@web/core/utils/render";
+import publicWidget from "@web/legacy/js/public/public_widget";
+import { rpc } from "@web/core/network/rpc";
+
+//created a public widget class for deal week snippet
+publicWidget.registry.DealWeek = publicWidget.Widget.extend({
+ selector: '.deal_week_snippet_class',
+ async start() {
+ await this._super(...arguments);
+ const result = await rpc("/get_products", {});
+ if (result){
+ this.$target.empty().html(renderToElement('theme_boec.deal_week', {product_id: result}))
+ const time = await rpc("/get_countdown", {});
+ if (time){
+ let end_date = new Date(time).getTime();
+ let days, hours, minutes, seconds;
+ let countdown_div = this.$el.find('#countdown')[0];
+ setInterval(function() {
+ const current_date = new Date().getTime();
+ let seconds_left = (end_date - current_date) / 1000;
+ days = parseInt(seconds_left / 86400);
+ seconds_left = seconds_left % 86400;
+ hours = parseInt(seconds_left / 3600);
+ seconds_left = seconds_left % 3600;
+ minutes = parseInt(seconds_left / 60);
+ seconds = parseInt(seconds_left % 60);
+ if (countdown_div) {
+ countdown_div.innerHTML = '' + days + ' ' + hours + ' ' +
+ minutes + ' ' + seconds + ' ';
+ }
+ }, 1000);
+ }
+ }
+
+ },
+});
+
+//export default publicWidget.registry.DealWeek;
\ No newline at end of file
diff --git a/theme_boec/static/src/js/jquery.countdown.min.js b/theme_boec/static/src/js/jquery.countdown.min.js
new file mode 100644
index 000000000..99b363168
--- /dev/null
+++ b/theme_boec/static/src/js/jquery.countdown.min.js
@@ -0,0 +1,22 @@
+/*!
+ * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)
+ * Copyright (c) 2016 Edson Hilios
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.firstTick=!0,this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var a,b=new Date;return a=this.finalDate.getTime()-b.getTime(),a=Math.ceil(a/1e3),a=!this.options.elapse&&a<0?0:Math.abs(a),this.totalSecsLeft===a||this.firstTick?void(this.firstTick=!1):(this.totalSecsLeft=a,this.elapsed=b>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-b.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},void(this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish"))))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});
\ No newline at end of file
diff --git a/theme_boec/static/src/js/owl.carousel.js b/theme_boec/static/src/js/owl.carousel.js
new file mode 100644
index 000000000..e2086aff2
--- /dev/null
+++ b/theme_boec/static/src/js/owl.carousel.js
@@ -0,0 +1,3438 @@
+/**
+ * Owl Carousel v2.3.4
+ * Copyright 2013-2018 David Deutsch
+ * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
+ */
+/**
+ */
+;(function($, window, document, undefined) {
+
+ /**
+ * Creates a carousel.
+ * @class The Owl Carousel.
+ * @public
+ * @param {HTMLElement|jQuery} element - The element to create the carousel for.
+ * @param {Object} [options] - The options
+ */
+ function Owl(element, options) {
+
+ /**
+ * Current settings for the carousel.
+ * @public
+ */
+ this.settings = null;
+
+ /**
+ * Current options set by the caller including defaults.
+ * @public
+ */
+ this.options = $.extend({}, Owl.Defaults, options);
+
+ /**
+ * Plugin element.
+ * @public
+ */
+ this.$element = $(element);
+
+ /**
+ * Proxied event handlers.
+ * @protected
+ */
+ this._handlers = {};
+
+ /**
+ * References to the running plugins of this carousel.
+ * @protected
+ */
+ this._plugins = {};
+
+ /**
+ * Currently suppressed events to prevent them from being retriggered.
+ * @protected
+ */
+ this._supress = {};
+
+ /**
+ * Absolute current position.
+ * @protected
+ */
+ this._current = null;
+
+ /**
+ * Animation speed in milliseconds.
+ * @protected
+ */
+ this._speed = null;
+
+ /**
+ * Coordinates of all items in pixel.
+ * @todo The name of this member is missleading.
+ * @protected
+ */
+ this._coordinates = [];
+
+ /**
+ * Current breakpoint.
+ * @todo Real media queries would be nice.
+ * @protected
+ */
+ this._breakpoint = null;
+
+ /**
+ * Current width of the plugin element.
+ */
+ this._width = null;
+
+ /**
+ * All real items.
+ * @protected
+ */
+ this._items = [];
+
+ /**
+ * All cloned items.
+ * @protected
+ */
+ this._clones = [];
+
+ /**
+ * Merge values of all items.
+ * @todo Maybe this could be part of a plugin.
+ * @protected
+ */
+ this._mergers = [];
+
+ /**
+ * Widths of all items.
+ */
+ this._widths = [];
+
+ /**
+ * Invalidated parts within the update process.
+ * @protected
+ */
+ this._invalidated = {};
+
+ /**
+ * Ordered list of workers for the update process.
+ * @protected
+ */
+ this._pipe = [];
+
+ /**
+ * Current state information for the drag operation.
+ * @todo #261
+ * @protected
+ */
+ this._drag = {
+ time: null,
+ target: null,
+ pointer: null,
+ stage: {
+ start: null,
+ current: null
+ },
+ direction: null
+ };
+
+ /**
+ * Current state information and their tags.
+ * @type {Object}
+ * @protected
+ */
+ this._states = {
+ current: {},
+ tags: {
+ 'initializing': [ 'busy' ],
+ 'animating': [ 'busy' ],
+ 'dragging': [ 'interacting' ]
+ }
+ };
+
+ $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) {
+ this._handlers[handler] = $.proxy(this[handler], this);
+ }, this));
+
+ $.each(Owl.Plugins, $.proxy(function(key, plugin) {
+ this._plugins[key.charAt(0).toLowerCase() + key.slice(1)]
+ = new plugin(this);
+ }, this));
+
+ $.each(Owl.Workers, $.proxy(function(priority, worker) {
+ this._pipe.push({
+ 'filter': worker.filter,
+ 'run': $.proxy(worker.run, this)
+ });
+ }, this));
+
+ this.setup();
+ this.initialize();
+ }
+
+ /**
+ * Default options for the carousel.
+ * @public
+ */
+ Owl.Defaults = {
+ items: 3,
+ loop: false,
+ center: false,
+ rewind: false,
+ checkVisibility: true,
+
+ mouseDrag: true,
+ touchDrag: true,
+ pullDrag: true,
+ freeDrag: false,
+
+ margin: 0,
+ stagePadding: 0,
+
+ merge: false,
+ mergeFit: true,
+ autoWidth: false,
+
+ startPosition: 0,
+ rtl: false,
+
+ smartSpeed: 250,
+ fluidSpeed: false,
+ dragEndSpeed: false,
+
+ responsive: {},
+ responsiveRefreshRate: 200,
+ responsiveBaseElement: window,
+
+ fallbackEasing: 'swing',
+ slideTransition: '',
+
+ info: false,
+
+ nestedItemSelector: false,
+ itemElement: 'div',
+ stageElement: 'div',
+
+ refreshClass: 'owl-refresh',
+ loadedClass: 'owl-loaded',
+ loadingClass: 'owl-loading',
+ rtlClass: 'owl-rtl',
+ responsiveClass: 'owl-responsive',
+ dragClass: 'owl-drag',
+ itemClass: 'owl-item',
+ stageClass: 'owl-stage',
+ stageOuterClass: 'owl-stage-outer',
+ grabClass: 'owl-grab'
+ };
+
+ /**
+ * Enumeration for width.
+ * @public
+ * @readonly
+ * @enum {String}
+ */
+ Owl.Width = {
+ Default: 'default',
+ Inner: 'inner',
+ Outer: 'outer'
+ };
+
+ /**
+ * Enumeration for types.
+ * @public
+ * @readonly
+ * @enum {String}
+ */
+ Owl.Type = {
+ Event: 'event',
+ State: 'state'
+ };
+
+ /**
+ * Contains all registered plugins.
+ * @public
+ */
+ Owl.Plugins = {};
+
+ /**
+ * List of workers involved in the update process.
+ */
+ Owl.Workers = [ {
+ filter: [ 'width', 'settings' ],
+ run: function() {
+ this._width = this.$element.width();
+ }
+ }, {
+ filter: [ 'width', 'items', 'settings' ],
+ run: function(cache) {
+ cache.current = this._items && this._items[this.relative(this._current)];
+ }
+ }, {
+ filter: [ 'items', 'settings' ],
+ run: function() {
+ this.$stage.children('.cloned').remove();
+ }
+ }, {
+ filter: [ 'width', 'items', 'settings' ],
+ run: function(cache) {
+ var margin = this.settings.margin || '',
+ grid = !this.settings.autoWidth,
+ rtl = this.settings.rtl,
+ css = {
+ 'width': 'auto',
+ 'margin-left': rtl ? margin : '',
+ 'margin-right': rtl ? '' : margin
+ };
+
+ !grid && this.$stage.children().css(css);
+
+ cache.css = css;
+ }
+ }, {
+ filter: [ 'width', 'items', 'settings' ],
+ run: function(cache) {
+ var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
+ merge = null,
+ iterator = this._items.length,
+ grid = !this.settings.autoWidth,
+ widths = [];
+
+ cache.items = {
+ merge: false,
+ width: width
+ };
+
+ while (iterator--) {
+ merge = this._mergers[iterator];
+ merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge;
+
+ cache.items.merge = merge > 1 || cache.items.merge;
+
+ widths[iterator] = !grid ? this._items[iterator].width() : width * merge;
+ }
+
+ this._widths = widths;
+ }
+ }, {
+ filter: [ 'items', 'settings' ],
+ run: function() {
+ var clones = [],
+ items = this._items,
+ settings = this.settings,
+ // TODO: Should be computed from number of min width items in stage
+ view = Math.max(settings.items * 2, 4),
+ size = Math.ceil(items.length / 2) * 2,
+ repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0,
+ append = '',
+ prepend = '';
+
+ repeat /= 2;
+
+ while (repeat > 0) {
+ // Switch to only using appended clones
+ clones.push(this.normalize(clones.length / 2, true));
+ append = append + items[clones[clones.length - 1]][0].outerHTML;
+ clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true));
+ prepend = items[clones[clones.length - 1]][0].outerHTML + prepend;
+ repeat -= 1;
+ }
+
+ this._clones = clones;
+
+ $(append).addClass('cloned').appendTo(this.$stage);
+ $(prepend).addClass('cloned').prependTo(this.$stage);
+ }
+ }, {
+ filter: [ 'width', 'items', 'settings' ],
+ run: function() {
+ var rtl = this.settings.rtl ? 1 : -1,
+ size = this._clones.length + this._items.length,
+ iterator = -1,
+ previous = 0,
+ current = 0,
+ coordinates = [];
+
+ while (++iterator < size) {
+ previous = coordinates[iterator - 1] || 0;
+ current = this._widths[this.relative(iterator)] + this.settings.margin;
+ coordinates.push(previous + current * rtl);
+ }
+
+ this._coordinates = coordinates;
+ }
+ }, {
+ filter: [ 'width', 'items', 'settings' ],
+ run: function() {
+ var padding = this.settings.stagePadding,
+ coordinates = this._coordinates,
+ css = {
+ 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2,
+ 'padding-left': padding || '',
+ 'padding-right': padding || ''
+ };
+
+ this.$stage.css(css);
+ }
+ }, {
+ filter: [ 'width', 'items', 'settings' ],
+ run: function(cache) {
+ var iterator = this._coordinates.length,
+ grid = !this.settings.autoWidth,
+ items = this.$stage.children();
+
+ if (grid && cache.items.merge) {
+ while (iterator--) {
+ cache.css.width = this._widths[this.relative(iterator)];
+ items.eq(iterator).css(cache.css);
+ }
+ } else if (grid) {
+ cache.css.width = cache.items.width;
+ items.css(cache.css);
+ }
+ }
+ }, {
+ filter: [ 'items' ],
+ run: function() {
+ this._coordinates.length < 1 && this.$stage.removeAttr('style');
+ }
+ }, {
+ filter: [ 'width', 'items', 'settings' ],
+ run: function(cache) {
+ cache.current = cache.current ? this.$stage.children().index(cache.current) : 0;
+ cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current));
+ this.reset(cache.current);
+ }
+ }, {
+ filter: [ 'position' ],
+ run: function() {
+ this.animate(this.coordinates(this._current));
+ }
+ }, {
+ filter: [ 'width', 'position', 'items', 'settings' ],
+ run: function() {
+ var rtl = this.settings.rtl ? 1 : -1,
+ padding = this.settings.stagePadding * 2,
+ begin = this.coordinates(this.current()) + padding,
+ end = begin + this.width() * rtl,
+ inner, outer, matches = [], i, n;
+
+ for (i = 0, n = this._coordinates.length; i < n; i++) {
+ inner = this._coordinates[i - 1] || 0;
+ outer = Math.abs(this._coordinates[i]) + padding * rtl;
+
+ if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
+ || (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
+ matches.push(i);
+ }
+ }
+
+ this.$stage.children('.active').removeClass('active');
+ this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active');
+
+ this.$stage.children('.center').removeClass('center');
+ if (this.settings.center) {
+ this.$stage.children().eq(this.current()).addClass('center');
+ }
+ }
+ } ];
+
+ /**
+ * Create the stage DOM element
+ */
+ Owl.prototype.initializeStage = function() {
+ this.$stage = this.$element.find('.' + this.settings.stageClass);
+
+ // if the stage is already in the DOM, grab it and skip stage initialization
+ if (this.$stage.length) {
+ return;
+ }
+
+ this.$element.addClass(this.options.loadingClass);
+
+ // create stage
+ this.$stage = $('<' + this.settings.stageElement + '>', {
+ "class": this.settings.stageClass
+ }).wrap( $( '', {
+ "class": this.settings.stageOuterClass
+ }));
+
+ // append stage
+ this.$element.append(this.$stage.parent());
+ };
+
+ /**
+ * Create item DOM elements
+ */
+ Owl.prototype.initializeItems = function() {
+ var $items = this.$element.find('.owl-item');
+
+ // if the items are already in the DOM, grab them and skip item initialization
+ if ($items.length) {
+ this._items = $items.get().map(function(item) {
+ return $(item);
+ });
+
+ this._mergers = this._items.map(function() {
+ return 1;
+ });
+
+ this.refresh();
+
+ return;
+ }
+
+ // append content
+ this.replace(this.$element.children().not(this.$stage.parent()));
+
+ // check visibility
+ if (this.isVisible()) {
+ // update view
+ this.refresh();
+ } else {
+ // invalidate width
+ this.invalidate('width');
+ }
+
+ this.$element
+ .removeClass(this.options.loadingClass)
+ .addClass(this.options.loadedClass);
+ };
+
+ /**
+ * Initializes the carousel.
+ * @protected
+ */
+ Owl.prototype.initialize = function() {
+ this.enter('initializing');
+ this.trigger('initialize');
+
+ this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl);
+
+ if (this.settings.autoWidth && !this.is('pre-loading')) {
+ var imgs, nestedSelector, width;
+ imgs = this.$element.find('img');
+ nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
+ width = this.$element.children(nestedSelector).width();
+
+ if (imgs.length && width <= 0) {
+ this.preloadAutoWidthImages(imgs);
+ }
+ }
+
+ this.initializeStage();
+ this.initializeItems();
+
+ // register event handlers
+ this.registerEventHandlers();
+
+ this.leave('initializing');
+ this.trigger('initialized');
+ };
+
+ /**
+ * @returns {Boolean} visibility of $element
+ * if you know the carousel will always be visible you can set `checkVisibility` to `false` to
+ * prevent the expensive browser layout forced reflow the $element.is(':visible') does
+ */
+ Owl.prototype.isVisible = function() {
+ return this.settings.checkVisibility
+ ? this.$element.is(':visible')
+ : true;
+ };
+
+ /**
+ * Setups the current settings.
+ * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
+ * @todo Support for media queries by using `matchMedia` would be nice.
+ * @public
+ */
+ Owl.prototype.setup = function() {
+ var viewport = this.viewport(),
+ overwrites = this.options.responsive,
+ match = -1,
+ settings = null;
+
+ if (!overwrites) {
+ settings = $.extend({}, this.options);
+ } else {
+ $.each(overwrites, function(breakpoint) {
+ if (breakpoint <= viewport && breakpoint > match) {
+ match = Number(breakpoint);
+ }
+ });
+
+ settings = $.extend({}, this.options, overwrites[match]);
+ if (typeof settings.stagePadding === 'function') {
+ settings.stagePadding = settings.stagePadding();
+ }
+ delete settings.responsive;
+
+ // responsive class
+ if (settings.responsiveClass) {
+ this.$element.attr('class',
+ this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)
+ );
+ }
+ }
+
+ this.trigger('change', { property: { name: 'settings', value: settings } });
+ this._breakpoint = match;
+ this.settings = settings;
+ this.invalidate('settings');
+ this.trigger('changed', { property: { name: 'settings', value: this.settings } });
+ };
+
+ /**
+ * Updates option logic if necessery.
+ * @protected
+ */
+ Owl.prototype.optionsLogic = function() {
+ if (this.settings.autoWidth) {
+ this.settings.stagePadding = false;
+ this.settings.merge = false;
+ }
+ };
+
+ /**
+ * Prepares an item before add.
+ * @todo Rename event parameter `content` to `item`.
+ * @protected
+ * @returns {jQuery|HTMLElement} - The item container.
+ */
+ Owl.prototype.prepare = function(item) {
+ var event = this.trigger('prepare', { content: item });
+
+ if (!event.data) {
+ event.data = $('<' + this.settings.itemElement + '/>')
+ .addClass(this.options.itemClass).append(item)
+ }
+
+ this.trigger('prepared', { content: event.data });
+
+ return event.data;
+ };
+
+ /**
+ * Updates the view.
+ * @public
+ */
+ Owl.prototype.update = function() {
+ var i = 0,
+ n = this._pipe.length,
+ filter = $.proxy(function(p) { return this[p] }, this._invalidated),
+ cache = {};
+
+ while (i < n) {
+ if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
+ this._pipe[i].run(cache);
+ }
+ i++;
+ }
+
+ this._invalidated = {};
+
+ !this.is('valid') && this.enter('valid');
+ };
+
+ /**
+ * Gets the width of the view.
+ * @public
+ * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
+ * @returns {Number} - The width of the view in pixel.
+ */
+ Owl.prototype.width = function(dimension) {
+ dimension = dimension || Owl.Width.Default;
+ switch (dimension) {
+ case Owl.Width.Inner:
+ case Owl.Width.Outer:
+ return this._width;
+ default:
+ return this._width - this.settings.stagePadding * 2 + this.settings.margin;
+ }
+ };
+
+ /**
+ * Refreshes the carousel primarily for adaptive purposes.
+ * @public
+ */
+ Owl.prototype.refresh = function() {
+ this.enter('refreshing');
+ this.trigger('refresh');
+
+ this.setup();
+
+ this.optionsLogic();
+
+ this.$element.addClass(this.options.refreshClass);
+
+ this.update();
+
+ this.$element.removeClass(this.options.refreshClass);
+
+ this.leave('refreshing');
+ this.trigger('refreshed');
+ };
+
+ /**
+ * Checks window `resize` event.
+ * @protected
+ */
+ Owl.prototype.onThrottledResize = function() {
+ window.clearTimeout(this.resizeTimer);
+ this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate);
+ };
+
+ /**
+ * Checks window `resize` event.
+ * @protected
+ */
+ Owl.prototype.onResize = function() {
+ if (!this._items.length) {
+ return false;
+ }
+
+ if (this._width === this.$element.width()) {
+ return false;
+ }
+
+ if (!this.isVisible()) {
+ return false;
+ }
+
+ this.enter('resizing');
+
+ if (this.trigger('resize').isDefaultPrevented()) {
+ this.leave('resizing');
+ return false;
+ }
+
+ this.invalidate('width');
+
+ this.refresh();
+
+ this.leave('resizing');
+ this.trigger('resized');
+ };
+
+ /**
+ * Registers event handlers.
+ * @todo Check `msPointerEnabled`
+ * @todo #261
+ * @protected
+ */
+ Owl.prototype.registerEventHandlers = function() {
+ if ($.support.transition) {
+ this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this));
+ }
+
+ if (this.settings.responsive !== false) {
+ this.on(window, 'resize', this._handlers.onThrottledResize);
+ }
+
+ if (this.settings.mouseDrag) {
+ this.$element.addClass(this.options.dragClass);
+ this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this));
+ this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false });
+ }
+
+ if (this.settings.touchDrag){
+ this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this));
+ this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this));
+ }
+ };
+
+ /**
+ * Handles `touchstart` and `mousedown` events.
+ * @todo Horizontal swipe threshold as option
+ * @todo #261
+ * @protected
+ * @param {Event} event - The event arguments.
+ */
+ Owl.prototype.onDragStart = function(event) {
+ var stage = null;
+
+ if (event.which === 3) {
+ return;
+ }
+
+ if ($.support.transform) {
+ stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(',');
+ stage = {
+ x: stage[stage.length === 16 ? 12 : 4],
+ y: stage[stage.length === 16 ? 13 : 5]
+ };
+ } else {
+ stage = this.$stage.position();
+ stage = {
+ x: this.settings.rtl ?
+ stage.left + this.$stage.width() - this.width() + this.settings.margin :
+ stage.left,
+// y: stage.top
+ };
+ }
+
+ if (this.is('animating')) {
+ $.support.transform ? this.animate(stage.x) : this.$stage.stop()
+ this.invalidate('position');
+ }
+
+ this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown');
+
+ this.speed(0);
+
+ this._drag.time = new Date().getTime();
+ this._drag.target = $(event.target);
+ this._drag.stage.start = stage;
+ this._drag.stage.current = stage;
+ this._drag.pointer = this.pointer(event);
+
+ $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this));
+
+ $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) {
+ var delta = this.difference(this._drag.pointer, this.pointer(event));
+
+ $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this));
+
+ if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) {
+ return;
+ }
+
+ event.preventDefault();
+
+ this.enter('dragging');
+ this.trigger('drag');
+ }, this));
+ };
+
+ /**
+ * Handles the `touchmove` and `mousemove` events.
+ * @todo #261
+ * @protected
+ * @param {Event} event - The event arguments.
+ */
+ Owl.prototype.onDragMove = function(event) {
+ var minimum = null,
+ maximum = null,
+ pull = null,
+ delta = this.difference(this._drag.pointer, this.pointer(event)),
+ stage = this.difference(this._drag.stage.start, delta);
+
+ if (!this.is('dragging')) {
+ return;
+ }
+
+ event.preventDefault();
+
+ if (this.settings.loop) {
+ minimum = this.coordinates(this.minimum());
+ maximum = this.coordinates(this.maximum() + 1) - minimum;
+ stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum;
+ } else {
+ minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
+ maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
+ pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0;
+ stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull);
+ }
+
+ this._drag.stage.current = stage;
+
+ this.animate(stage.x);
+ };
+
+ /**
+ * Handles the `touchend` and `mouseup` events.
+ * @todo #261
+ * @todo Threshold for click event
+ * @protected
+ * @param {Event} event - The event arguments.
+ */
+ Owl.prototype.onDragEnd = function(event) {
+ var delta = this.difference(this._drag.pointer, this.pointer(event)),
+ stage = this._drag.stage.current,
+ direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right';
+
+ $(document).off('.owl.core');
+
+ this.$element.removeClass(this.options.grabClass);
+
+ if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) {
+ this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
+ this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction));
+ this.invalidate('position');
+ this.update();
+
+ this._drag.direction = direction;
+
+ if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) {
+ this._drag.target.one('click.owl.core', function() { return false; });
+ }
+ }
+
+ if (!this.is('dragging')) {
+ return;
+ }
+
+ this.leave('dragging');
+ this.trigger('dragged');
+ };
+
+ /**
+ * Gets absolute position of the closest item for a coordinate.
+ * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
+ * @protected
+ * @param {Number} coordinate - The coordinate in pixel.
+ * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`.
+ * @return {Number} - The absolute position of the closest item.
+ */
+ Owl.prototype.closest = function(coordinate, direction) {
+ var position = -1,
+ pull = 30,
+ width = this.width(),
+ coordinates = this.coordinates();
+
+ if (!this.settings.freeDrag) {
+ // check closest item
+ $.each(coordinates, $.proxy(function(index, value) {
+ // on a left pull, check on current index
+ if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) {
+ position = index;
+ // on a right pull, check on previous index
+ // to do so, subtract width from value and set position = index + 1
+ } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) {
+ position = index + 1;
+ } else if (this.op(coordinate, '<', value)
+ && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) {
+ position = direction === 'left' ? index + 1 : index;
+ }
+ return position === -1;
+ }, this));
+ }
+
+ if (!this.settings.loop) {
+ // non loop boundries
+ if (this.op(coordinate, '>', coordinates[this.minimum()])) {
+ position = coordinate = this.minimum();
+ } else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
+ position = coordinate = this.maximum();
+ }
+ }
+
+ return position;
+ };
+
+ /**
+ * Animates the stage.
+ * @todo #270
+ * @public
+ * @param {Number} coordinate - The coordinate in pixels.
+ */
+ Owl.prototype.animate = function(coordinate) {
+ var animate = this.speed() > 0;
+
+ this.is('animating') && this.onTransitionEnd();
+
+ if (animate) {
+ this.enter('animating');
+ this.trigger('translate');
+ }
+
+ if ($.support.transform3d && $.support.transition) {
+ this.$stage.css({
+ transform: 'translate3d(' + coordinate + 'px,0px,0px)',
+ transition: (this.speed() / 1000) + 's' + (
+ this.settings.slideTransition ? ' ' + this.settings.slideTransition : ''
+ )
+ });
+ } else if (animate) {
+ this.$stage.animate({
+ left: coordinate + 'px'
+ }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this));
+ } else {
+ this.$stage.css({
+ left: coordinate + 'px'
+ });
+ }
+ };
+
+ /**
+ * Checks whether the carousel is in a specific state or not.
+ * @param {String} state - The state to check.
+ * @returns {Boolean} - The flag which indicates if the carousel is busy.
+ */
+ Owl.prototype.is = function(state) {
+ return this._states.current[state] && this._states.current[state] > 0;
+ };
+
+ /**
+ * Sets the absolute position of the current item.
+ * @public
+ * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
+ * @returns {Number} - The absolute position of the current item.
+ */
+ Owl.prototype.current = function(position) {
+ if (position === undefined) {
+ return this._current;
+ }
+
+ if (this._items.length === 0) {
+ return undefined;
+ }
+
+ position = this.normalize(position);
+
+ if (this._current !== position) {
+ var event = this.trigger('change', { property: { name: 'position', value: position } });
+
+ if (event.data !== undefined) {
+ position = this.normalize(event.data);
+ }
+
+ this._current = position;
+
+ this.invalidate('position');
+
+ this.trigger('changed', { property: { name: 'position', value: this._current } });
+ }
+
+ return this._current;
+ };
+
+ /**
+ * Invalidates the given part of the update routine.
+ * @param {String} [part] - The part to invalidate.
+ * @returns {Array.} - The invalidated parts.
+ */
+ Owl.prototype.invalidate = function(part) {
+ if ($.type(part) === 'string') {
+ this._invalidated[part] = true;
+ this.is('valid') && this.leave('valid');
+ }
+ return $.map(this._invalidated, function(v, i) { return i });
+ };
+
+ /**
+ * Resets the absolute position of the current item.
+ * @public
+ * @param {Number} position - The absolute position of the new item.
+ */
+ Owl.prototype.reset = function(position) {
+ position = this.normalize(position);
+
+ if (position === undefined) {
+ return;
+ }
+
+ this._speed = 0;
+ this._current = position;
+
+ this.suppress([ 'translate', 'translated' ]);
+
+ this.animate(this.coordinates(position));
+
+ this.release([ 'translate', 'translated' ]);
+ };
+
+ /**
+ * Normalizes an absolute or a relative position of an item.
+ * @public
+ * @param {Number} position - The absolute or relative position to normalize.
+ * @param {Boolean} [relative=false] - Whether the given position is relative or not.
+ * @returns {Number} - The normalized position.
+ */
+ Owl.prototype.normalize = function(position, relative) {
+ var n = this._items.length,
+ m = relative ? 0 : this._clones.length;
+
+ if (!this.isNumeric(position) || n < 1) {
+ position = undefined;
+ } else if (position < 0 || position >= n + m) {
+ position = ((position - m / 2) % n + n) % n + m / 2;
+ }
+
+ return position;
+ };
+
+ /**
+ * Converts an absolute position of an item into a relative one.
+ * @public
+ * @param {Number} position - The absolute position to convert.
+ * @returns {Number} - The converted position.
+ */
+ Owl.prototype.relative = function(position) {
+ position -= this._clones.length / 2;
+ return this.normalize(position, true);
+ };
+
+ /**
+ * Gets the maximum position for the current item.
+ * @public
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
+ * @returns {Number}
+ */
+ Owl.prototype.maximum = function(relative) {
+ var settings = this.settings,
+ maximum = this._coordinates.length,
+ iterator,
+ reciprocalItemsWidth,
+ elementWidth;
+
+ if (settings.loop) {
+ maximum = this._clones.length / 2 + this._items.length - 1;
+ } else if (settings.autoWidth || settings.merge) {
+ iterator = this._items.length;
+ if (iterator) {
+ reciprocalItemsWidth = this._items[--iterator].width();
+ elementWidth = this.$element.width();
+ while (iterator--) {
+ reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin;
+ if (reciprocalItemsWidth > elementWidth) {
+ break;
+ }
+ }
+ }
+ maximum = iterator + 1;
+ } else if (settings.center) {
+ maximum = this._items.length - 1;
+ } else {
+ maximum = this._items.length - settings.items;
+ }
+
+ if (relative) {
+ maximum -= this._clones.length / 2;
+ }
+
+ return Math.max(maximum, 0);
+ };
+
+ /**
+ * Gets the minimum position for the current item.
+ * @public
+ * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
+ * @returns {Number}
+ */
+ Owl.prototype.minimum = function(relative) {
+ return relative ? 0 : this._clones.length / 2;
+ };
+
+ /**
+ * Gets an item at the specified relative position.
+ * @public
+ * @param {Number} [position] - The relative position of the item.
+ * @return {jQuery|Array.} - The item at the given position or all items if no position was given.
+ */
+ Owl.prototype.items = function(position) {
+ if (position === undefined) {
+ return this._items.slice();
+ }
+
+ position = this.normalize(position, true);
+ return this._items[position];
+ };
+
+ /**
+ * Gets an item at the specified relative position.
+ * @public
+ * @param {Number} [position] - The relative position of the item.
+ * @return {jQuery|Array.} - The item at the given position or all items if no position was given.
+ */
+ Owl.prototype.mergers = function(position) {
+ if (position === undefined) {
+ return this._mergers.slice();
+ }
+
+ position = this.normalize(position, true);
+ return this._mergers[position];
+ };
+
+ /**
+ * Gets the absolute positions of clones for an item.
+ * @public
+ * @param {Number} [position] - The relative position of the item.
+ * @returns {Array.} - The absolute positions of clones for the item or all if no position was given.
+ */
+ Owl.prototype.clones = function(position) {
+ var odd = this._clones.length / 2,
+ even = odd + this._items.length,
+ map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 };
+
+ if (position === undefined) {
+ return $.map(this._clones, function(v, i) { return map(i) });
+ }
+
+ return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
+ };
+
+ /**
+ * Sets the current animation speed.
+ * @public
+ * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
+ * @returns {Number} - The current animation speed in milliseconds.
+ */
+ Owl.prototype.speed = function(speed) {
+ if (speed !== undefined) {
+ this._speed = speed;
+ }
+
+ return this._speed;
+ };
+
+ /**
+ * Gets the coordinate of an item.
+ * @todo The name of this method is missleanding.
+ * @public
+ * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
+ * @returns {Number|Array.} - The coordinate of the item in pixel or all coordinates.
+ */
+ Owl.prototype.coordinates = function(position) {
+ var multiplier = 1,
+ newPosition = position - 1,
+ coordinate;
+
+ if (position === undefined) {
+ return $.map(this._coordinates, $.proxy(function(coordinate, index) {
+ return this.coordinates(index);
+ }, this));
+ }
+
+ if (this.settings.center) {
+ if (this.settings.rtl) {
+ multiplier = -1;
+ newPosition = position + 1;
+ }
+
+ coordinate = this._coordinates[position];
+ coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier;
+ } else {
+ coordinate = this._coordinates[newPosition] || 0;
+ }
+
+ coordinate = Math.ceil(coordinate);
+
+ return coordinate;
+ };
+
+ /**
+ * Calculates the speed for a translation.
+ * @protected
+ * @param {Number} from - The absolute position of the start item.
+ * @param {Number} to - The absolute position of the target item.
+ * @param {Number} [factor=undefined] - The time factor in milliseconds.
+ * @returns {Number} - The time in milliseconds for the translation.
+ */
+ Owl.prototype.duration = function(from, to, factor) {
+ if (factor === 0) {
+ return 0;
+ }
+
+ return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
+ };
+
+ /**
+ * Slides to the specified item.
+ * @public
+ * @param {Number} position - The position of the item.
+ * @param {Number} [speed] - The time in milliseconds for the transition.
+ */
+ Owl.prototype.to = function(position, speed) {
+ var current = this.current(),
+ revert = null,
+ distance = position - this.relative(current),
+ direction = (distance > 0) - (distance < 0),
+ items = this._items.length,
+ minimum = this.minimum(),
+ maximum = this.maximum();
+
+ if (this.settings.loop) {
+ if (!this.settings.rewind && Math.abs(distance) > items / 2) {
+ distance += direction * -1 * items;
+ }
+
+ position = current + distance;
+ revert = ((position - minimum) % items + items) % items + minimum;
+
+ if (revert !== position && revert - distance <= maximum && revert - distance > 0) {
+ current = revert - distance;
+ position = revert;
+ this.reset(current);
+ }
+ } else if (this.settings.rewind) {
+ maximum += 1;
+ position = (position % maximum + maximum) % maximum;
+ } else {
+ position = Math.max(minimum, Math.min(maximum, position));
+ }
+
+ this.speed(this.duration(current, position, speed));
+ this.current(position);
+
+ if (this.isVisible()) {
+ this.update();
+ }
+ };
+
+ /**
+ * Slides to the next item.
+ * @public
+ * @param {Number} [speed] - The time in milliseconds for the transition.
+ */
+ Owl.prototype.next = function(speed) {
+ speed = speed || false;
+ this.to(this.relative(this.current()) + 1, speed);
+ };
+
+ /**
+ * Slides to the previous item.
+ * @public
+ * @param {Number} [speed] - The time in milliseconds for the transition.
+ */
+ Owl.prototype.prev = function(speed) {
+ speed = speed || false;
+ this.to(this.relative(this.current()) - 1, speed);
+ };
+
+ /**
+ * Handles the end of an animation.
+ * @protected
+ * @param {Event} event - The event arguments.
+ */
+ Owl.prototype.onTransitionEnd = function(event) {
+
+ // if css2 animation then event object is undefined
+ if (event !== undefined) {
+ event.stopPropagation();
+
+ // Catch only owl-stage transitionEnd event
+ if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
+ return false;
+ }
+ }
+
+ this.leave('animating');
+ this.trigger('translated');
+ };
+
+ /**
+ * Gets viewport width.
+ * @protected
+ * @return {Number} - The width in pixel.
+ */
+ Owl.prototype.viewport = function() {
+ var width;
+ if (this.options.responsiveBaseElement !== window) {
+ width = $(this.options.responsiveBaseElement).width();
+ } else if (window.innerWidth) {
+ width = window.innerWidth;
+ } else if (document.documentElement && document.documentElement.clientWidth) {
+ width = document.documentElement.clientWidth;
+ } else {
+ console.warn('Can not detect viewport width.');
+ }
+ return width;
+ };
+
+ /**
+ * Replaces the current content.
+ * @public
+ * @param {HTMLElement|jQuery|String} content - The new content.
+ */
+ Owl.prototype.replace = function(content) {
+ this.$stage.empty();
+ this._items = [];
+
+ if (content) {
+ content = (content instanceof jQuery) ? content : $(content);
+ }
+
+ if (this.settings.nestedItemSelector) {
+ content = content.find('.' + this.settings.nestedItemSelector);
+ }
+
+ content.filter(function() {
+ return this.nodeType === 1;
+ }).each($.proxy(function(index, item) {
+ item = this.prepare(item);
+ this.$stage.append(item);
+ this._items.push(item);
+ this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
+ }, this));
+
+ this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
+
+ this.invalidate('items');
+ };
+
+ /**
+ * Adds an item.
+ * @todo Use `item` instead of `content` for the event arguments.
+ * @public
+ * @param {HTMLElement|jQuery|String} content - The item content to add.
+ * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
+ */
+ Owl.prototype.add = function(content, position) {
+ var current = this.relative(this._current);
+
+ position = position === undefined ? this._items.length : this.normalize(position, true);
+ content = content instanceof jQuery ? content : $(content);
+
+ this.trigger('add', { content: content, position: position });
+
+ content = this.prepare(content);
+
+ if (this._items.length === 0 || position === this._items.length) {
+ this._items.length === 0 && this.$stage.append(content);
+ this._items.length !== 0 && this._items[position - 1].after(content);
+ this._items.push(content);
+ this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
+ } else {
+ this._items[position].before(content);
+ this._items.splice(position, 0, content);
+ this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1);
+ }
+
+ this._items[current] && this.reset(this._items[current].index());
+
+ this.invalidate('items');
+
+ this.trigger('added', { content: content, position: position });
+ };
+
+ /**
+ * Removes an item by its position.
+ * @todo Use `item` instead of `content` for the event arguments.
+ * @public
+ * @param {Number} position - The relative position of the item to remove.
+ */
+ Owl.prototype.remove = function(position) {
+ position = this.normalize(position, true);
+
+ if (position === undefined) {
+ return;
+ }
+
+ this.trigger('remove', { content: this._items[position], position: position });
+
+ this._items[position].remove();
+ this._items.splice(position, 1);
+ this._mergers.splice(position, 1);
+
+ this.invalidate('items');
+
+ this.trigger('removed', { content: null, position: position });
+ };
+
+ /**
+ * Preloads images with auto width.
+ * @todo Replace by a more generic approach
+ * @protected
+ */
+ Owl.prototype.preloadAutoWidthImages = function(images) {
+ images.each($.proxy(function(i, element) {
+ this.enter('pre-loading');
+ element = $(element);
+ $(new Image()).one('load', $.proxy(function(e) {
+ element.attr('src', e.target.src);
+ element.css('opacity', 1);
+ this.leave('pre-loading');
+ !this.is('pre-loading') && !this.is('initializing') && this.refresh();
+ }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina'));
+ }, this));
+ };
+
+ /**
+ * Destroys the carousel.
+ * @public
+ */
+ Owl.prototype.destroy = function() {
+
+ this.$element.off('.owl.core');
+ this.$stage.off('.owl.core');
+ $(document).off('.owl.core');
+
+ if (this.settings.responsive !== false) {
+ window.clearTimeout(this.resizeTimer);
+ this.off(window, 'resize', this._handlers.onThrottledResize);
+ }
+
+ for (var i in this._plugins) {
+ this._plugins[i].destroy();
+ }
+
+ this.$stage.children('.cloned').remove();
+
+ this.$stage.unwrap();
+ this.$stage.children().contents().unwrap();
+ this.$stage.children().unwrap();
+ this.$stage.remove();
+ this.$element
+ .removeClass(this.options.refreshClass)
+ .removeClass(this.options.loadingClass)
+// .removeClass(this.options.loadedClass)
+ .removeClass(this.options.rtlClass)
+ .removeClass(this.options.dragClass)
+ .removeClass(this.options.grabClass)
+ .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), ''))
+ .removeData('owl.carousel');
+ };
+
+ /**
+ * Operators to calculate right-to-left and left-to-right.
+ * @protected
+ * @param {Number} [a] - The left side operand.
+ * @param {String} [o] - The operator.
+ * @param {Number} [b] - The right side operand.
+ */
+ Owl.prototype.op = function(a, o, b) {
+ var rtl = this.settings.rtl;
+ switch (o) {
+ case '<':
+ return rtl ? a > b : a < b;
+ case '>':
+ return rtl ? a < b : a > b;
+ case '>=':
+ return rtl ? a <= b : a >= b;
+ case '<=':
+ return rtl ? a >= b : a <= b;
+ default:
+ break;
+ }
+ };
+
+ /**
+ * Attaches to an internal event.
+ * @protected
+ * @param {HTMLElement} element - The event source.
+ * @param {String} event - The event name.
+ * @param {Function} listener - The event handler to attach.
+ * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not.
+ */
+ Owl.prototype.on = function(element, event, listener, capture) {
+ if (element.addEventListener) {
+ element.addEventListener(event, listener, capture);
+ } else if (element.attachEvent) {
+ element.attachEvent('on' + event, listener);
+ }
+ };
+
+ /**
+ * Detaches from an internal event.
+ * @protected
+ * @param {HTMLElement} element - The event source.
+ * @param {String} event - The event name.
+ * @param {Function} listener - The attached event handler to detach.
+ * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
+ */
+ Owl.prototype.off = function(element, event, listener, capture) {
+ if (element.removeEventListener) {
+ element.removeEventListener(event, listener, capture);
+ } else if (element.detachEvent) {
+ element.detachEvent('on' + event, listener);
+ }
+ };
+
+ /**
+ * Triggers a public event.
+ * @todo Remove `status`, `relatedTarget` should be used instead.
+ * @protected
+ * @param {String} name - The event name.
+ * @param {*} [data=null] - The event data.
+ * @param {String} [namespace=carousel] - The event namespace.
+ * @param {String} [state] - The state which is associated with the event.
+ * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not.
+ * @returns {Event} - The event arguments.
+ */
+ Owl.prototype.trigger = function(name, data, namespace, state, enter) {
+ var status = {
+ item: { count: this._items.length, index: this.current() }
+ }, handler = $.camelCase(
+ $.grep([ 'on', name, namespace ], function(v) { return v })
+ .join('-').toLowerCase()
+ ), event = $.Event(
+ [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
+ $.extend({ relatedTarget: this }, status, data)
+ );
+
+ if (!this._supress[name]) {
+ $.each(this._plugins, function(name, plugin) {
+ if (plugin.onTrigger) {
+ plugin.onTrigger(event);
+ }
+ });
+
+ this.register({ type: Owl.Type.Event, name: name });
+ this.$element.trigger(event);
+
+ if (this.settings && typeof this.settings[handler] === 'function') {
+ this.settings[handler].call(this, event);
+ }
+ }
+
+ return event;
+ };
+
+ /**
+ * Enters a state.
+ * @param name - The state name.
+ */
+ Owl.prototype.enter = function(name) {
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
+ if (this._states.current[name] === undefined) {
+ this._states.current[name] = 0;
+ }
+
+ this._states.current[name]++;
+ }, this));
+ };
+
+ /**
+ * Leaves a state.
+ * @param name - The state name.
+ */
+ Owl.prototype.leave = function(name) {
+ $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) {
+ this._states.current[name]--;
+ }, this));
+ };
+
+ /**
+ * Registers an event or state.
+ * @public
+ * @param {Object} object - The event or state to register.
+ */
+ Owl.prototype.register = function(object) {
+ if (object.type === Owl.Type.Event) {
+ if (!$.event.special[object.name]) {
+ $.event.special[object.name] = {};
+ }
+
+ if (!$.event.special[object.name].owl) {
+ var _default = $.event.special[object.name]._default;
+ $.event.special[object.name]._default = function(e) {
+ if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) {
+ return _default.apply(this, arguments);
+ }
+ return e.namespace && e.namespace.indexOf('owl') > -1;
+ };
+ $.event.special[object.name].owl = true;
+ }
+ } else if (object.type === Owl.Type.State) {
+ if (!this._states.tags[object.name]) {
+ this._states.tags[object.name] = object.tags;
+ } else {
+ this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags);
+ }
+
+ this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) {
+ return $.inArray(tag, this._states.tags[object.name]) === i;
+ }, this));
+ }
+ };
+
+ /**
+ * Suppresses events.
+ * @protected
+ * @param {Array.} events - The events to suppress.
+ */
+ Owl.prototype.suppress = function(events) {
+ $.each(events, $.proxy(function(index, event) {
+ this._supress[event] = true;
+ }, this));
+ };
+
+ /**
+ * Releases suppressed events.
+ * @protected
+ * @param {Array.} events - The events to release.
+ */
+ Owl.prototype.release = function(events) {
+ $.each(events, $.proxy(function(index, event) {
+ delete this._supress[event];
+ }, this));
+ };
+
+ /**
+ * Gets unified pointer coordinates from event.
+ * @todo #261
+ * @protected
+ * @param {Event} - The `mousedown` or `touchstart` event.
+ * @returns {Object} - Contains `x` and `y` coordinates of current pointer position.
+ */
+ Owl.prototype.pointer = function(event) {
+ var result = { x: null, y: null };
+
+ event = event.originalEvent || event || window.event;
+
+ event = event.touches && event.touches.length ?
+ event.touches[0] : event.changedTouches && event.changedTouches.length ?
+ event.changedTouches[0] : event;
+
+ if (event.pageX) {
+ result.x = event.pageX;
+ result.y = event.pageY;
+ } else {
+ result.x = event.clientX;
+ result.y = event.clientY;
+ }
+
+ return result;
+ };
+
+ /**
+ * Determines if the input is a Number or something that can be coerced to a Number
+ * @protected
+ * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested
+ * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number
+ */
+ Owl.prototype.isNumeric = function(number) {
+ return !isNaN(parseFloat(number));
+ };
+
+ /**
+ * Gets the difference of two vectors.
+ * @todo #261
+ * @protected
+ * @param {Object} - The first vector.
+ * @param {Object} - The second vector.
+ * @returns {Object} - The difference.
+ */
+ Owl.prototype.difference = function(first, second) {
+ return {
+ x: first.x - second.x,
+ y: first.y - second.y
+ };
+ };
+
+ /**
+ * The jQuery Plugin for the Owl Carousel
+ * @todo Navigation plugin `next` and `prev`
+ * @public
+ */
+ $.fn.owlCarousel = function(option) {
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ return this.each(function() {
+ var $this = $(this),
+ data = $this.data('owl.carousel');
+
+ if (!data) {
+ data = new Owl(this, typeof option == 'object' && option);
+ $this.data('owl.carousel', data);
+
+ $.each([
+ 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'
+ ], function(i, event) {
+ data.register({ type: Owl.Type.Event, name: event });
+ data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) {
+ if (e.namespace && e.relatedTarget !== this) {
+ this.suppress([ event ]);
+ data[event].apply(this, [].slice.call(arguments, 1));
+ this.release([ event ]);
+ }
+ }, data));
+ });
+ }
+
+ if (typeof option == 'string' && option.charAt(0) !== '_') {
+ data[option].apply(data, args);
+ }
+ });
+ };
+
+ /**
+ * The constructor for the jQuery Plugin
+ * @public
+ */
+ $.fn.owlCarousel.Constructor = Owl;
+
+})(window.Zepto || window.jQuery, window, document);
+
+/**
+ * AutoRefresh Plugin
+ * @version 2.3.4
+ * @author Artus Kolanowski
+ * @author David Deutsch
+ * @license The MIT License (MIT)
+ */
+;(function($, window, document, undefined) {
+
+ /**
+ * Creates the auto refresh plugin.
+ * @class The Auto Refresh Plugin
+ * @param {Owl} carousel - The Owl Carousel
+ */
+ var AutoRefresh = function(carousel) {
+ /**
+ * Reference to the core.
+ * @protected
+ * @type {Owl}
+ */
+ this._core = carousel;
+
+ /**
+ * Refresh interval.
+ * @protected
+ * @type {number}
+ */
+ this._interval = null;
+
+ /**
+ * Whether the element is currently visible or not.
+ * @protected
+ * @type {Boolean}
+ */
+ this._visible = null;
+
+ /**
+ * All event handlers.
+ * @protected
+ * @type {Object}
+ */
+ this._handlers = {
+ 'initialized.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this._core.settings.autoRefresh) {
+ this.watch();
+ }
+ }, this)
+ };
+
+ // set default options
+ this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
+
+ // register event handlers
+ this._core.$element.on(this._handlers);
+ };
+
+ /**
+ * Default options.
+ * @public
+ */
+ AutoRefresh.Defaults = {
+ autoRefresh: true,
+ autoRefreshInterval: 500
+ };
+
+ /**
+ * Watches the element.
+ */
+ AutoRefresh.prototype.watch = function() {
+ if (this._interval) {
+ return;
+ }
+
+ this._visible = this._core.isVisible();
+ this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
+ };
+
+ /**
+ * Refreshes the element.
+ */
+ AutoRefresh.prototype.refresh = function() {
+ if (this._core.isVisible() === this._visible) {
+ return;
+ }
+
+ this._visible = !this._visible;
+
+ this._core.$element.toggleClass('owl-hidden', !this._visible);
+
+ this._visible && (this._core.invalidate('width') && this._core.refresh());
+ };
+
+ /**
+ * Destroys the plugin.
+ */
+ AutoRefresh.prototype.destroy = function() {
+ var handler, property;
+
+ window.clearInterval(this._interval);
+
+ for (handler in this._handlers) {
+ this._core.$element.off(handler, this._handlers[handler]);
+ }
+ for (property in Object.getOwnPropertyNames(this)) {
+ typeof this[property] != 'function' && (this[property] = null);
+ }
+ };
+
+ $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
+
+})(window.Zepto || window.jQuery, window, document);
+
+/**
+ * Lazy Plugin
+ * @version 2.3.4
+ * @author Bartosz Wojciechowski
+ * @author David Deutsch
+ * @license The MIT License (MIT)
+ */
+;(function($, window, document, undefined) {
+
+ /**
+ * Creates the lazy plugin.
+ * @class The Lazy Plugin
+ * @param {Owl} carousel - The Owl Carousel
+ */
+ var Lazy = function(carousel) {
+
+ /**
+ * Reference to the core.
+ * @protected
+ * @type {Owl}
+ */
+ this._core = carousel;
+
+ /**
+ * Already loaded items.
+ * @protected
+ * @type {Array.}
+ */
+ this._loaded = [];
+
+ /**
+ * Event handlers.
+ * @protected
+ * @type {Object}
+ */
+ this._handlers = {
+ 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
+ if (!e.namespace) {
+ return;
+ }
+
+ if (!this._core.settings || !this._core.settings.lazyLoad) {
+ return;
+ }
+
+ if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
+ var settings = this._core.settings,
+ n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
+ i = ((settings.center && n * -1) || 0),
+ position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
+ clones = this._core.clones().length,
+ load = $.proxy(function(i, v) { this.load(v) }, this);
+ //TODO: Need documentation for this new option
+ if (settings.lazyLoadEager > 0) {
+ n += settings.lazyLoadEager;
+ // If the carousel is looping also preload images that are to the "left"
+ if (settings.loop) {
+ position -= settings.lazyLoadEager;
+ n++;
+ }
+ }
+
+ while (i++ < n) {
+ this.load(clones / 2 + this._core.relative(position));
+ clones && $.each(this._core.clones(this._core.relative(position)), load);
+ position++;
+ }
+ }
+ }, this)
+ };
+
+ // set the default options
+ this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
+
+ // register event handler
+ this._core.$element.on(this._handlers);
+ };
+
+ /**
+ * Default options.
+ * @public
+ */
+ Lazy.Defaults = {
+ lazyLoad: false,
+ lazyLoadEager: 0
+ };
+
+ /**
+ * Loads all resources of an item at the specified position.
+ * @param {Number} position - The absolute position of the item.
+ * @protected
+ */
+ Lazy.prototype.load = function(position) {
+ var $item = this._core.$stage.children().eq(position),
+ $elements = $item && $item.find('.owl-lazy');
+
+ if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
+ return;
+ }
+
+ $elements.each($.proxy(function(index, element) {
+ var $element = $(element), image,
+ url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
+
+ this._core.trigger('load', { element: $element, url: url }, 'lazy');
+
+ if ($element.is('img')) {
+ $element.one('load.owl.lazy', $.proxy(function() {
+ $element.css('opacity', 1);
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
+ }, this)).attr('src', url);
+ } else if ($element.is('source')) {
+ $element.one('load.owl.lazy', $.proxy(function() {
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
+ }, this)).attr('srcset', url);
+ } else {
+ image = new Image();
+ image.onload = $.proxy(function() {
+ $element.css({
+ 'background-image': 'url("' + url + '")',
+ 'opacity': '1'
+ });
+ this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
+ }, this);
+ image.src = url;
+ }
+ }, this));
+
+ this._loaded.push($item.get(0));
+ };
+
+ /**
+ * Destroys the plugin.
+ * @public
+ */
+ Lazy.prototype.destroy = function() {
+ var handler, property;
+
+ for (handler in this.handlers) {
+ this._core.$element.off(handler, this.handlers[handler]);
+ }
+ for (property in Object.getOwnPropertyNames(this)) {
+ typeof this[property] != 'function' && (this[property] = null);
+ }
+ };
+
+ $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
+
+})(window.Zepto || window.jQuery, window, document);
+
+/**
+ * AutoHeight Plugin
+ * @version 2.3.4
+ * @author Bartosz Wojciechowski
+ * @author David Deutsch
+ * @license The MIT License (MIT)
+ */
+;(function($, window, document, undefined) {
+
+ /**
+ * Creates the auto height plugin.
+ * @class The Auto Height Plugin
+ * @param {Owl} carousel - The Owl Carousel
+ */
+ var AutoHeight = function(carousel) {
+ /**
+ * Reference to the core.
+ * @protected
+ * @type {Owl}
+ */
+ this._core = carousel;
+
+ this._previousHeight = null;
+
+ /**
+ * All event handlers.
+ * @protected
+ * @type {Object}
+ */
+ this._handlers = {
+ 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this._core.settings.autoHeight) {
+ this.update();
+ }
+ }, this),
+ 'changed.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
+ this.update();
+ }
+ }, this),
+ 'loaded.owl.lazy': $.proxy(function(e) {
+ if (e.namespace && this._core.settings.autoHeight
+ && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
+ this.update();
+ }
+ }, this)
+ };
+
+ // set default options
+ this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
+
+ // register event handlers
+ this._core.$element.on(this._handlers);
+ this._intervalId = null;
+ var refThis = this;
+
+ // These changes have been taken from a PR by gavrochelegnou proposed in #1575
+ // and have been made compatible with the latest jQuery version
+ $(window).on('load', function() {
+ if (refThis._core.settings.autoHeight) {
+ refThis.update();
+ }
+ });
+
+ // Autoresize the height of the carousel when window is resized
+ // When carousel has images, the height is dependent on the width
+ // and should also change on resize
+ $(window).resize(function() {
+ if (refThis._core.settings.autoHeight) {
+ if (refThis._intervalId != null) {
+ clearTimeout(refThis._intervalId);
+ }
+
+ refThis._intervalId = setTimeout(function() {
+ refThis.update();
+ }, 250);
+ }
+ });
+
+ };
+
+ /**
+ * Default options.
+ * @public
+ */
+ AutoHeight.Defaults = {
+ autoHeight: false,
+ autoHeightClass: 'owl-height'
+ };
+
+ /**
+ * Updates the view.
+ */
+ AutoHeight.prototype.update = function() {
+ var start = this._core._current,
+ end = start + this._core.settings.items,
+ lazyLoadEnabled = this._core.settings.lazyLoad,
+ visible = this._core.$stage.children().toArray().slice(start, end),
+ heights = [],
+ maxheight = 0;
+
+ $.each(visible, function(index, item) {
+ heights.push($(item).height());
+ });
+
+ maxheight = Math.max.apply(null, heights);
+
+ if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
+ maxheight = this._previousHeight;
+ }
+
+ this._previousHeight = maxheight;
+
+ this._core.$stage.parent()
+ .height(maxheight)
+ .addClass(this._core.settings.autoHeightClass);
+ };
+
+ AutoHeight.prototype.destroy = function() {
+ var handler, property;
+
+ for (handler in this._handlers) {
+ this._core.$element.off(handler, this._handlers[handler]);
+ }
+ for (property in Object.getOwnPropertyNames(this)) {
+ typeof this[property] !== 'function' && (this[property] = null);
+ }
+ };
+
+ $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
+
+})(window.Zepto || window.jQuery, window, document);
+
+/**
+ * Video Plugin
+ * @version 2.3.4
+ * @author Bartosz Wojciechowski
+ * @author David Deutsch
+ * @license The MIT License (MIT)
+ */
+;(function($, window, document, undefined) {
+
+ /**
+ * Creates the video plugin.
+ * @class The Video Plugin
+ * @param {Owl} carousel - The Owl Carousel
+ */
+ var Video = function(carousel) {
+ /**
+ * Reference to the core.
+ * @protected
+ * @type {Owl}
+ */
+ this._core = carousel;
+
+ /**
+ * Cache all video URLs.
+ * @protected
+ * @type {Object}
+ */
+ this._videos = {};
+
+ /**
+ * Current playing item.
+ * @protected
+ * @type {jQuery}
+ */
+ this._playing = null;
+
+ /**
+ * All event handlers.
+ * @todo The cloned content removale is too late
+ * @protected
+ * @type {Object}
+ */
+ this._handlers = {
+ 'initialized.owl.carousel': $.proxy(function(e) {
+ if (e.namespace) {
+ this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
+ }
+ }, this),
+ 'resize.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
+ e.preventDefault();
+ }
+ }, this),
+ 'refreshed.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this._core.is('resizing')) {
+ this._core.$stage.find('.cloned .owl-video-frame').remove();
+ }
+ }, this),
+ 'changed.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && e.property.name === 'position' && this._playing) {
+ this.stop();
+ }
+ }, this),
+ 'prepared.owl.carousel': $.proxy(function(e) {
+ if (!e.namespace) {
+ return;
+ }
+
+ var $element = $(e.content).find('.owl-video');
+
+ if ($element.length) {
+ $element.css('display', 'none');
+ this.fetch($element, $(e.content));
+ }
+ }, this)
+ };
+
+ // set default options
+ this._core.options = $.extend({}, Video.Defaults, this._core.options);
+
+ // register event handlers
+ this._core.$element.on(this._handlers);
+
+ this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
+ this.play(e);
+ }, this));
+ };
+
+ /**
+ * Default options.
+ * @public
+ */
+ Video.Defaults = {
+ video: false,
+ videoHeight: false,
+ videoWidth: false
+ };
+
+ /**
+ * Gets the video ID and the type (YouTube/Vimeo/vzaar only).
+ * @protected
+ * @param {jQuery} target - The target containing the video data.
+ * @param {jQuery} item - The item containing the video.
+ */
+ Video.prototype.fetch = function(target, item) {
+ var type = (function() {
+ if (target.attr('data-vimeo-id')) {
+ return 'vimeo';
+ } else if (target.attr('data-vzaar-id')) {
+ return 'vzaar'
+ } else {
+ return 'youtube';
+ }
+ })(),
+ id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
+ width = target.attr('data-width') || this._core.settings.videoWidth,
+ height = target.attr('data-height') || this._core.settings.videoHeight,
+ url = target.attr('href');
+
+ if (url) {
+
+ /*
+ Parses the id's out of the following urls (and probably more):
+ https://www.youtube.com/watch?v=:id
+ https://youtu.be/:id
+ https://vimeo.com/:id
+ https://vimeo.com/channels/:channel/:id
+ https://vimeo.com/groups/:group/videos/:id
+ https://app.vzaar.com/videos/:id
+
+ Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
+ */
+
+ id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
+
+ if (id[3].indexOf('youtu') > -1) {
+ type = 'youtube';
+ } else if (id[3].indexOf('vimeo') > -1) {
+ type = 'vimeo';
+ } else if (id[3].indexOf('vzaar') > -1) {
+ type = 'vzaar';
+ } else {
+ throw new Error('Video URL not supported.');
+ }
+ id = id[6];
+ } else {
+ throw new Error('Missing video URL.');
+ }
+
+ this._videos[url] = {
+ type: type,
+ id: id,
+ width: width,
+ height: height
+ };
+
+ item.attr('data-video', url);
+
+ this.thumbnail(target, this._videos[url]);
+ };
+
+ /**
+ * Creates video thumbnail.
+ * @protected
+ * @param {jQuery} target - The target containing the video data.
+ * @param {Object} info - The video info object.
+ * @see `fetch`
+ */
+ Video.prototype.thumbnail = function(target, video) {
+ var tnLink,
+ icon,
+ path,
+ dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
+ customTn = target.find('img'),
+ srcType = 'src',
+ lazyClass = '',
+ settings = this._core.settings,
+ create = function(path) {
+ icon = '';
+
+ if (settings.lazyLoad) {
+ tnLink = $('',{
+ "class": 'owl-video-tn ' + lazyClass,
+ "srcType": path
+ });
+ } else {
+ tnLink = $( '', {
+ "class": "owl-video-tn",
+ "style": 'opacity:1;background-image:url(' + path + ')'
+ });
+ }
+ target.after(tnLink);
+ target.after(icon);
+ };
+
+ // wrap video content into owl-video-wrapper div
+ target.wrap( $( '', {
+ "class": "owl-video-wrapper",
+ "style": dimensions
+ }));
+
+ if (this._core.settings.lazyLoad) {
+ srcType = 'data-src';
+ lazyClass = 'owl-lazy';
+ }
+
+ // custom thumbnail
+ if (customTn.length) {
+ create(customTn.attr(srcType));
+ customTn.remove();
+ return false;
+ }
+
+ if (video.type === 'youtube') {
+ path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
+ create(path);
+ } else if (video.type === 'vimeo') {
+ $.ajax({
+ type: 'GET',
+ url: '//vimeo.com/api/v2/video/' + video.id + '.json',
+ jsonp: 'callback',
+ dataType: 'jsonp',
+ success: function(data) {
+ path = data[0].thumbnail_large;
+ create(path);
+ }
+ });
+ } else if (video.type === 'vzaar') {
+ $.ajax({
+ type: 'GET',
+ url: '//vzaar.com/api/videos/' + video.id + '.json',
+ jsonp: 'callback',
+ dataType: 'jsonp',
+ success: function(data) {
+ path = data.framegrab_url;
+ create(path);
+ }
+ });
+ }
+ };
+
+ /**
+ * Stops the current video.
+ * @public
+ */
+ Video.prototype.stop = function() {
+ this._core.trigger('stop', null, 'video');
+ this._playing.find('.owl-video-frame').remove();
+ this._playing.removeClass('owl-video-playing');
+ this._playing = null;
+ this._core.leave('playing');
+ this._core.trigger('stopped', null, 'video');
+ };
+
+ /**
+ * Starts the current video.
+ * @public
+ * @param {Event} event - The event arguments.
+ */
+ Video.prototype.play = function(event) {
+ var target = $(event.target),
+ item = target.closest('.' + this._core.settings.itemClass),
+ video = this._videos[item.attr('data-video')],
+ width = video.width || '100%',
+ height = video.height || this._core.$stage.height(),
+ html,
+ iframe;
+
+ if (this._playing) {
+ return;
+ }
+
+ this._core.enter('playing');
+ this._core.trigger('play', null, 'video');
+
+ item = this._core.items(this._core.relative(item.index()));
+
+ this._core.reset(item.index());
+
+ html = $( '' );
+ html.attr( 'height', height );
+ html.attr( 'width', width );
+ if (video.type === 'youtube') {
+ html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
+ } else if (video.type === 'vimeo') {
+ html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
+ } else if (video.type === 'vzaar') {
+ html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
+ }
+
+ iframe = $(html).wrap( '' ).insertAfter(item.find('.owl-video'));
+
+ this._playing = item.addClass('owl-video-playing');
+ };
+
+ /**
+ * Checks whether an video is currently in full screen mode or not.
+ * @todo Bad style because looks like a readonly method but changes members.
+ * @protected
+ * @returns {Boolean}
+ */
+ Video.prototype.isInFullScreen = function() {
+ var element = document.fullscreenElement || document.mozFullScreenElement ||
+ document.webkitFullscreenElement;
+
+ return element && $(element).parent().hasClass('owl-video-frame');
+ };
+
+ /**
+ * Destroys the plugin.
+ */
+ Video.prototype.destroy = function() {
+ var handler, property;
+
+ this._core.$element.off('click.owl.video');
+
+ for (handler in this._handlers) {
+ this._core.$element.off(handler, this._handlers[handler]);
+ }
+ for (property in Object.getOwnPropertyNames(this)) {
+ typeof this[property] != 'function' && (this[property] = null);
+ }
+ };
+
+ $.fn.owlCarousel.Constructor.Plugins.Video = Video;
+
+})(window.Zepto || window.jQuery, window, document);
+
+/**
+ * Animate Plugin
+ * @version 2.3.4
+ * @author Bartosz Wojciechowski
+ * @author David Deutsch
+ * @license The MIT License (MIT)
+ */
+;(function($, window, document, undefined) {
+
+ /**
+ * Creates the animate plugin.
+ * @class The Navigation Plugin
+ * @param {Owl} scope - The Owl Carousel
+ */
+ var Animate = function(scope) {
+ this.core = scope;
+ this.core.options = $.extend({}, Animate.Defaults, this.core.options);
+ this.swapping = true;
+ this.previous = undefined;
+ this.next = undefined;
+
+ this.handlers = {
+ 'change.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && e.property.name == 'position') {
+ this.previous = this.core.current();
+ this.next = e.property.value;
+ }
+ }, this),
+ 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
+ if (e.namespace) {
+ this.swapping = e.type == 'translated';
+ }
+ }, this),
+ 'translate.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
+ this.swap();
+ }
+ }, this)
+ };
+
+ this.core.$element.on(this.handlers);
+ };
+
+ /**
+ * Default options.
+ * @public
+ */
+ Animate.Defaults = {
+ animateOut: false,
+ animateIn: false
+ };
+
+ /**
+ * Toggles the animation classes whenever an translations starts.
+ * @protected
+ * @returns {Boolean|undefined}
+ */
+ Animate.prototype.swap = function() {
+
+ if (this.core.settings.items !== 1) {
+ return;
+ }
+
+ if (!$.support.animation || !$.support.transition) {
+ return;
+ }
+
+ this.core.speed(0);
+
+ var left,
+ clear = $.proxy(this.clear, this),
+ previous = this.core.$stage.children().eq(this.previous),
+ next = this.core.$stage.children().eq(this.next),
+ incoming = this.core.settings.animateIn,
+ outgoing = this.core.settings.animateOut;
+
+ if (this.core.current() === this.previous) {
+ return;
+ }
+
+ if (outgoing) {
+ left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
+ previous.one($.support.animation.end, clear)
+ .css( { 'left': left + 'px' } )
+ .addClass('animated owl-animated-out')
+ .addClass(outgoing);
+ }
+
+ if (incoming) {
+ next.one($.support.animation.end, clear)
+ .addClass('animated owl-animated-in')
+ .addClass(incoming);
+ }
+ };
+
+ Animate.prototype.clear = function(e) {
+ $(e.target).css( { 'left': '' } )
+ .removeClass('animated owl-animated-out owl-animated-in')
+ .removeClass(this.core.settings.animateIn)
+ .removeClass(this.core.settings.animateOut);
+ this.core.onTransitionEnd();
+ };
+
+ /**
+ * Destroys the plugin.
+ * @public
+ */
+ Animate.prototype.destroy = function() {
+ var handler, property;
+
+ for (handler in this.handlers) {
+ this.core.$element.off(handler, this.handlers[handler]);
+ }
+ for (property in Object.getOwnPropertyNames(this)) {
+ typeof this[property] != 'function' && (this[property] = null);
+ }
+ };
+
+ $.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
+
+})(window.Zepto || window.jQuery, window, document);
+
+/**
+ * Autoplay Plugin
+ * @version 2.3.4
+ * @author Bartosz Wojciechowski
+ * @author Artus Kolanowski
+ * @author David Deutsch
+ * @author Tom De Caluwé
+ * @license The MIT License (MIT)
+ */
+;(function($, window, document, undefined) {
+
+ /**
+ * Creates the autoplay plugin.
+ * @class The Autoplay Plugin
+ * @param {Owl} scope - The Owl Carousel
+ */
+ var Autoplay = function(carousel) {
+ /**
+ * Reference to the core.
+ * @protected
+ * @type {Owl}
+ */
+ this._core = carousel;
+
+ /**
+ * The autoplay timeout id.
+ * @type {Number}
+ */
+ this._call = null;
+
+ /**
+ * Depending on the state of the plugin, this variable contains either
+ * the start time of the timer or the current timer value if it's
+ * paused. Since we start in a paused state we initialize the timer
+ * value.
+ * @type {Number}
+ */
+ this._time = 0;
+
+ /**
+ * Stores the timeout currently used.
+ * @type {Number}
+ */
+ this._timeout = 0;
+
+ /**
+ * Indicates whenever the autoplay is paused.
+ * @type {Boolean}
+ */
+ this._paused = true;
+
+ /**
+ * All event handlers.
+ * @protected
+ * @type {Object}
+ */
+ this._handlers = {
+ 'changed.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && e.property.name === 'settings') {
+ if (this._core.settings.autoplay) {
+ this.play();
+ } else {
+ this.stop();
+ }
+ } else if (e.namespace && e.property.name === 'position' && this._paused) {
+ // Reset the timer. This code is triggered when the position
+ // of the carousel was changed through user interaction.
+ this._time = 0;
+ }
+ }, this),
+ 'initialized.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this._core.settings.autoplay) {
+ this.play();
+ }
+ }, this),
+ 'play.owl.autoplay': $.proxy(function(e, t, s) {
+ if (e.namespace) {
+ this.play(t, s);
+ }
+ }, this),
+ 'stop.owl.autoplay': $.proxy(function(e) {
+ if (e.namespace) {
+ this.stop();
+ }
+ }, this),
+ 'mouseover.owl.autoplay': $.proxy(function() {
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
+ this.pause();
+ }
+ }, this),
+ 'mouseleave.owl.autoplay': $.proxy(function() {
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
+ this.play();
+ }
+ }, this),
+ 'touchstart.owl.core': $.proxy(function() {
+ if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
+ this.pause();
+ }
+ }, this),
+ 'touchend.owl.core': $.proxy(function() {
+ if (this._core.settings.autoplayHoverPause) {
+ this.play();
+ }
+ }, this)
+ };
+
+ // register event handlers
+ this._core.$element.on(this._handlers);
+
+ // set default options
+ this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
+ };
+
+ /**
+ * Default options.
+ * @public
+ */
+ Autoplay.Defaults = {
+ autoplay: false,
+ autoplayTimeout: 5000,
+ autoplayHoverPause: false,
+ autoplaySpeed: false
+ };
+
+ /**
+ * Transition to the next slide and set a timeout for the next transition.
+ * @private
+ * @param {Number} [speed] - The animation speed for the animations.
+ */
+ Autoplay.prototype._next = function(speed) {
+ this._call = window.setTimeout(
+ $.proxy(this._next, this, speed),
+ this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
+ );
+
+ if (this._core.is('interacting') || document.hidden) {
+ return;
+ }
+ this._core.next(speed || this._core.settings.autoplaySpeed);
+ }
+
+ /**
+ * Reads the current timer value when the timer is playing.
+ * @public
+ */
+ Autoplay.prototype.read = function() {
+ return new Date().getTime() - this._time;
+ };
+
+ /**
+ * Starts the autoplay.
+ * @public
+ * @param {Number} [timeout] - The interval before the next animation starts.
+ * @param {Number} [speed] - The animation speed for the animations.
+ */
+ Autoplay.prototype.play = function(timeout, speed) {
+ var elapsed;
+
+ if (!this._core.is('rotating')) {
+ this._core.enter('rotating');
+ }
+
+ timeout = timeout || this._core.settings.autoplayTimeout;
+
+ // Calculate the elapsed time since the last transition. If the carousel
+ // wasn't playing this calculation will yield zero.
+ elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
+
+ if (this._paused) {
+ // Start the clock.
+ this._time = this.read();
+ this._paused = false;
+ } else {
+ // Clear the active timeout to allow replacement.
+ window.clearTimeout(this._call);
+ }
+
+ // Adjust the origin of the timer to match the new timeout value.
+ this._time += this.read() % timeout - elapsed;
+
+ this._timeout = timeout;
+ this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
+ };
+
+ /**
+ * Stops the autoplay.
+ * @public
+ */
+ Autoplay.prototype.stop = function() {
+ if (this._core.is('rotating')) {
+ // Reset the clock.
+ this._time = 0;
+ this._paused = true;
+
+ window.clearTimeout(this._call);
+ this._core.leave('rotating');
+ }
+ };
+
+ /**
+ * Pauses the autoplay.
+ * @public
+ */
+ Autoplay.prototype.pause = function() {
+ if (this._core.is('rotating') && !this._paused) {
+ // Pause the clock.
+ this._time = this.read();
+ this._paused = true;
+
+ window.clearTimeout(this._call);
+ }
+ };
+
+ /**
+ * Destroys the plugin.
+ */
+ Autoplay.prototype.destroy = function() {
+ var handler, property;
+
+ this.stop();
+
+ for (handler in this._handlers) {
+ this._core.$element.off(handler, this._handlers[handler]);
+ }
+ for (property in Object.getOwnPropertyNames(this)) {
+ typeof this[property] != 'function' && (this[property] = null);
+ }
+ };
+
+ $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
+
+})(window.Zepto || window.jQuery, window, document);
+
+/**
+ * Navigation Plugin
+ * @version 2.3.4
+ * @author Artus Kolanowski
+ * @author David Deutsch
+ * @license The MIT License (MIT)
+ */
+;(function($, window, document, undefined) {
+ 'use strict';
+
+ /**
+ * Creates the navigation plugin.
+ * @class The Navigation Plugin
+ * @param {Owl} carousel - The Owl Carousel.
+ */
+ var Navigation = function(carousel) {
+ /**
+ * Reference to the core.
+ * @protected
+ * @type {Owl}
+ */
+ this._core = carousel;
+
+ /**
+ * Indicates whether the plugin is initialized or not.
+ * @protected
+ * @type {Boolean}
+ */
+ this._initialized = false;
+
+ /**
+ * The current paging indexes.
+ * @protected
+ * @type {Array}
+ */
+ this._pages = [];
+
+ /**
+ * All DOM elements of the user interface.
+ * @protected
+ * @type {Object}
+ */
+ this._controls = {};
+
+ /**
+ * Markup for an indicator.
+ * @protected
+ * @type {Array.}
+ */
+ this._templates = [];
+
+ /**
+ * The carousel element.
+ * @type {jQuery}
+ */
+ this.$element = this._core.$element;
+
+ /**
+ * Overridden methods of the carousel.
+ * @protected
+ * @type {Object}
+ */
+ this._overrides = {
+ next: this._core.next,
+ prev: this._core.prev,
+ to: this._core.to
+ };
+
+ /**
+ * All event handlers.
+ * @protected
+ * @type {Object}
+ */
+ this._handlers = {
+ 'prepared.owl.carousel': $.proxy(function(e) {
+ if (e.namespace && this._core.settings.dotsData) {
+ this._templates.push('