diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index 69fad35..0000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "bower_components" -} diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index e717f5e..0000000 --- a/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 07f8695..c940cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -node_modules/ -bower_components/ -.sass-cache/ -.idea/ -.tmp/ \ No newline at end of file +.idea +node_modules +bower_components diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index d8b4ce0..0000000 --- a/.jshintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "strict": true, - "bitwise": true, - "curly": true, - "eqeqeq": true, - "latedef": false, - "noarg": true, - "undef": true, - "unused": false, - "validthis": true, - "jasmine": true, - "globals": { - "angular": false, - "inject": false, - "module": false - } -} diff --git a/.yo-rc.json b/.yo-rc.json deleted file mode 100644 index a9b0c4f..0000000 --- a/.yo-rc.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "generator-gulp-angular": { - "version": "0.12.1", - "props": { - "angularVersion": "~1.4.0", - "angularModules": [], - "jQuery": { - "key": "jquery2" - }, - "resource": { - "key": "none", - "module": null - }, - "router": { - "key": "none", - "module": null - }, - "ui": { - "key": "none", - "module": null - }, - "cssPreprocessor": { - "key": "less", - "extension": "less" - }, - "jsPreprocessor": { - "key": "none", - "extension": "js", - "srcExtension": "js" - }, - "htmlPreprocessor": { - "key": "none", - "extension": "html" - }, - "bootstrapComponents": { - "name": null, - "version": null, - "key": null, - "module": null - }, - "foundationComponents": { - "name": null, - "version": null, - "key": null, - "module": null - }, - "paths": { - "src": "src", - "dist": "dist", - "e2e": "e2e", - "tmp": ".tmp" - } - } - } -} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 9772ce0..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,81 +0,0 @@ - module.exports = function(grunt) { - var config = {}; - - - //src =============================== - var src; - config.src = src = { - sassMain: 'scss/main.scss', - distFolder: 'examples/css/app.dist.css', - devFolder: 'examples/css/app.dev.css', - sassFolder: 'scss/**/*.scss', - serverPort: 8000 - - }; - - - //Watch =============================== - config.watch = { - scripts: { - files: ["<%= src.sassFolder %>"], - tasks: ["dev", "sass:dist"] - //,tasks: ["dev",'sass:dist'] - } - } - - - //Sass =============================== - var sass; - config.sass = sass = {}; - - //distribution - sass.dist = { - options: { - style: "compressed", - noCache: true, - sourcemap: 'none', - update: true - }, - files: { - "<%= src.distFolder %>": "<%= src.sassMain %>" - } - }; - - //development env. - sass.dev = { - options: { - style: "expanded", - lineNumber: true, - }, - files: { - "<%= src.devFolder %>": "<%= src.sassMain %>" - } - }; - - //grunt serve =============================== - config.connect = { - server: { - options: { - livereload: true, - port: "<%= src.serverPort %>" - } - } - }; - - - - //Register custom tasks =============================== - grunt.registerTask('default', ['dev']); - grunt.registerTask('dev', ['sass:dev']); - grunt.registerTask('dist', ['sass:dist']); - grunt.registerTask('serve', ['connect:server', 'watch']); - require('time-grunt')(grunt); - require('load-grunt-tasks')(grunt, { - scope: 'devDependencies' - }); - - - //General setup =============================== - grunt.initConfig(config); - - }; diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 54b30bb..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2015 Devmark https://github.com/devmark/angular-slick-carousel - -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. diff --git a/README.md b/README.md deleted file mode 100644 index 68c6f08..0000000 --- a/README.md +++ /dev/null @@ -1,192 +0,0 @@ -angular-slick-carousel -====================== - -angular 2 above take a look https://github.com/devmark/ngx-slick - - -[![Join the chat at https://gitter.im/devmark/angular-slick-carousel](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/devmark/angular-slick-carousel?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -Angular directive for [slick-carousel](http://kenwheeler.github.io/slick/) - - -## Summary - -- [Usage](#usage) -- [Attributes & Event](#attributes--event) -- [Enable/disable slick](#enabledisable-slick) -- [Method](#method) -- [Slide data](#slide-data) -- [Global Config](#global-config) -- [faq](#faq) -- [Examples](#examples) -- [Creator](#creator) - - - -## Usage ------ - -- Using [bower](http://bower.io/) to install it. `bower install angular-slick-carousel` -- Add `jquery`, `angular`, `slick-carousel` and `angular-slick-carousel` to your code. - -```html - - - - - - - -``` - -- Add the sortable module as a dependency to your application module: `slickCarousel` - -```js -var myAppModule = angular.module('MyApp', ['slickCarousel']) -``` - -This directive allows you to use the slick-carousel plugin as -an angular directive. It can be specified in your HTML -as either a `
` attribute or a `` element. - -```html - - ... - - - - -``` - -## Attributes & Event -`settings`: optional `Object` containing any of the slick options. Consult [here](http://kenwheeler.github.io/slick/#settings). - - `enabled` should slick be enabled or not. Default to true. Example below - - `method` optional containing slick method. discussed [below](#method) in detail - - `event` optional containing slick event - -```javascript -$scope.slickConfig = { - enabled: true, - autoplay: true, - draggable: false, - autoplaySpeed: 3000, - method: {}, - event: { - beforeChange: function (event, slick, currentSlide, nextSlide) { - }, - afterChange: function (event, slick, currentSlide, nextSlide) { - } - } -}; -``` -## Enable/disable slick -Slick can be easily switched on and off by using `enabled` settings flag. -```js - $scope.slickConfig = { - enabled: true, - } - $scope.toggleSlick = function() { - $scope.slickConfig.enabled = !$scope.slickConfig.enabled; - } -``` -```html - - ... - - -``` - - -## Method -1. All the functions in the plugin are exposed through a control -attribute. -2. To utilize this architecture, and have two-way data-binding, -define an empty control handle on scope: -```js - $scope.slickConfig = { - method: {} - } -``` -3. Pass it as the value to control attribute. Now, you can call any plugin methods -as shown in the example. - -```html - - - - - - - -``` - -## Slide data -For change slide content, you have to set `ng-if` to destroy and init it - -- controller: -```js - $scope.number = [{label: 1}, {label: 2}, {label: 3}, {label: 4}, {label: 5}, {label: 6}, {label: 7}, {label: 8}]; - $scope.numberLoaded = true; - $scope.numberUpdate = function(){ - $scope.numberLoaded = false; // disable slick - - //number update - - $scope.numberLoaded = true; // enable slick - }; -``` -- html: -```html - - - -
-
-
-
-``` - -## Global config - ```js - config(['slickCarouselConfig', function (slickCarouselConfig) { - slickCarouselConfig.dots = true; - slickCarouselConfig.autoplay = false; - }]) - ``` - -## FAQ -Q: After change data, could i keep the current slide index? -A: For this directive, this will destroy and init slick when updating data. You could get current index by event. -example: -```js - $scope.currentIndex = 0; - $scope.slickConfig = { - event: { - afterChange: function (event, slick, currentSlide, nextSlide) { - $scope.currentIndex = currentSlide; // save current index each time - } - init: function (event, slick) { - slick.slickGoTo($scope.currentIndex); // slide to correct index when init - } - } - }; -``` - -## Examples - -Now to run the samples in your local machine you just need to run: - -```sh -grunt serve -``` - -so you will start a web server on http://localhost:8000 - -now acess the folder examples: http://localhost:8000/examples/#/ - - -## Creator -[@devmark](https://github.com/devmark) diff --git a/bower.json b/bower.json deleted file mode 100644 index c32afe0..0000000 --- a/bower.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "angular-slick-carousel", - "version": "3.1.7", - "homepage": "https://github.com/devmark/angular-slick-carousel", - "authors": [ - "DevMark " - ], - "description": "Angular directive for slick carousel", - "keywords": [ - "angular", - "directive", - "slick", - "carousel", - "slick-carousel" - ], - "license": "MIT", - "main": [ - "dist/angular-slick.js" - ], - "dependencies": { - "slick-carousel": "~1.6.0", - "angular": ">=1.3.0" - }, - "devDependencies": { - "angular-mocks": "~1.4.0", - "angular-route": "~1.4.0", - "jquery": "~2.1.4", - "bootstrap": "~3.3.5" - }, - "resolutions": { - "jquery": "~2.1.4", - "angular": "~1.4.0" - } -} diff --git a/examples/css/app.css b/css/app.css similarity index 100% rename from examples/css/app.css rename to css/app.css diff --git a/examples/fonts/pacifico.eot b/css/pacifico.eot similarity index 100% rename from examples/fonts/pacifico.eot rename to css/pacifico.eot diff --git a/examples/fonts/pacifico.svg b/css/pacifico.svg similarity index 100% rename from examples/fonts/pacifico.svg rename to css/pacifico.svg diff --git a/examples/fonts/pacifico.ttf b/css/pacifico.ttf similarity index 100% rename from examples/fonts/pacifico.ttf rename to css/pacifico.ttf diff --git a/examples/fonts/pacifico.woff b/css/pacifico.woff similarity index 100% rename from examples/fonts/pacifico.woff rename to css/pacifico.woff diff --git a/dist/angular-slick.js b/dist/angular-slick.js index b4c3778..8df6c65 100644 --- a/dist/angular-slick.js +++ b/dist/angular-slick.js @@ -1,301 +1,171 @@ /*! * angular-slick-carousel - * DevMark + * DevMark ,Karan Batra-Daitch * https://github.com/devmark/angular-slick-carousel - * Version: 3.1.7 - 2016-08-04T06:17:55.528Z + * Version: 3.0.2 - 2015-07-21T11:01:43.965Z * License: MIT */ -'use strict'; +(function () { + 'use strict'; -angular - .module('slickCarousel', []) - //global config - .constant('slickCarouselConfig', { - method: {}, - event: {} - }) - .directive('slick', [ - '$timeout', 'slickCarouselConfig', function ($timeout, slickCarouselConfig) { - var slickMethodList, slickEventList; - slickMethodList = ['slickGoTo', 'slickNext', 'slickPrev', 'slickPause', 'slickPlay', 'slickAdd', 'slickRemove', 'slickFilter', 'slickUnfilter', 'unslick']; - slickEventList = ['afterChange', 'beforeChange', 'breakpoint', 'destroy', 'edge', 'init', 'reInit', 'setPosition', 'swipe', 'lazyLoaded', 'lazyLoadError']; - - return { - scope: { - settings: '=', - enabled: '@', - accessibility: '@', - adaptiveHeight: '@', - autoplay: '@', - autoplaySpeed: '@', - arrows: '@', - asNavFor: '@', - appendArrows: '@', - prevArrow: '@', - nextArrow: '@', - centerMode: '@', - centerPadding: '@', - cssEase: '@', - customPaging: '&', - dots: '@', - draggable: '@', - fade: '@', - focusOnSelect: '@', - easing: '@', - edgeFriction: '@', - infinite: '@', - initialSlide: '@', - lazyLoad: '@', - mobileFirst: '@', - pauseOnHover: '@', - pauseOnDotsHover: '@', - respondTo: '@', - responsive: '=?', - rows: '@', - slide: '@', - slidesPerRow: '@', - slidesToShow: '@', - slidesToScroll: '@', - speed: '@', - swipe: '@', - swipeToSlide: '@', - touchMove: '@', - touchThreshold: '@', - useCSS: '@', - variableWidth: '@', - vertical: '@', - verticalSwiping: '@', - rtl: '@' - }, - restrict: 'AE', - link: function (scope, element, attr) { - //hide slider - angular.element(element).css('display', 'none'); - - var options, initOptions, destroy, init, destroyAndInit, currentIndex; - - initOptions = function () { - options = angular.extend(angular.copy(slickCarouselConfig), { - enabled: scope.enabled !== 'false', - accessibility: scope.accessibility !== 'false', - adaptiveHeight: scope.adaptiveHeight === 'true', - autoplay: scope.autoplay === 'true', - autoplaySpeed: scope.autoplaySpeed != null ? parseInt(scope.autoplaySpeed, 10) : 3000, - arrows: scope.arrows !== 'false', - asNavFor: scope.asNavFor ? scope.asNavFor : void 0, - appendArrows: scope.appendArrows ? angular.element(scope.appendArrows) : angular.element(element), - prevArrow: scope.prevArrow ? angular.element(scope.prevArrow) : void 0, - nextArrow: scope.nextArrow ? angular.element(scope.nextArrow) : void 0, - centerMode: scope.centerMode === 'true', - centerPadding: scope.centerPadding || '50px', - cssEase: scope.cssEase || 'ease', - customPaging: attr.customPaging ? function (slick, index) { - return scope.customPaging({slick: slick, index: index}); - } : void 0, - dots: scope.dots === 'true', - draggable: scope.draggable !== 'false', - fade: scope.fade === 'true', - focusOnSelect: scope.focusOnSelect === 'true', - easing: scope.easing || 'linear', - edgeFriction: scope.edgeFriction || 0.15, - infinite: scope.infinite !== 'false', - initialSlide: parseInt(scope.initialSlide) || 0, - lazyLoad: scope.lazyLoad || 'ondemand', - mobileFirst: scope.mobileFirst === 'true', - pauseOnHover: scope.pauseOnHover !== 'false', - pauseOnDotsHover: scope.pauseOnDotsHover === "true", - respondTo: scope.respondTo != null ? scope.respondTo : 'window', - responsive: scope.responsive || void 0, - rows: scope.rows != null ? parseInt(scope.rows, 10) : 1, - slide: scope.slide || '', - slidesPerRow: scope.slidesPerRow != null ? parseInt(scope.slidesPerRow, 10) : 1, - slidesToShow: scope.slidesToShow != null ? parseInt(scope.slidesToShow, 10) : 1, - slidesToScroll: scope.slidesToScroll != null ? parseInt(scope.slidesToScroll, 10) : 1, - speed: scope.speed != null ? parseInt(scope.speed, 10) : 300, - swipe: scope.swipe !== 'false', - swipeToSlide: scope.swipeToSlide === 'true', - touchMove: scope.touchMove !== 'false', - touchThreshold: scope.touchThreshold ? parseInt(scope.touchThreshold, 10) : 5, - useCSS: scope.useCSS !== 'false', - variableWidth: scope.variableWidth === 'true', - vertical: scope.vertical === 'true', - verticalSwiping: scope.verticalSwiping === 'true', - rtl: scope.rtl === 'true' - }, scope.settings); - - }; - - destroy = function () { - var slickness = angular.element(element); - if (slickness.hasClass('slick-initialized')) { - slickness.remove('slick-list'); - slickness.slick('unslick'); - } - - return slickness; - }; - - init = function () { - initOptions(); - - var slickness = angular.element(element); - - if (angular.element(element).hasClass('slick-initialized')) { - if (options.enabled) { - return slickness.slick('getSlick'); - } else { - destroy(); - } - } else { - if (!options.enabled) { - return; - } - // Event - slickness.on('init', function (event, slick) { - if (typeof options.event.init !== 'undefined') { - options.event.init(event, slick); + var __indexOf = [].indexOf || function (item) { + for (var i = 0, l = this.length; i < l; i++) { + if (i in this && this[i] === item) { + return i; } - if (typeof currentIndex !== 'undefined') { - return slick.slideHandler(currentIndex); - } - }); - - $timeout(function () { - angular.element(element).css('display', 'block'); - slickness.not('.slick-initialized').slick(options); - }); } - - scope.internalControl = options.method || {}; - - // Method - slickMethodList.forEach(function (value) { - scope.internalControl[value] = function () { - var args; - args = Array.prototype.slice.call(arguments); - args.unshift(value); - slickness.slick.apply(element, args); - }; - }); - - // Event - slickness.on('afterChange', function (event, slick, currentSlide) { - currentIndex = currentSlide; - if (typeof options.event.afterChange !== 'undefined') { - $timeout(function () { - scope.$apply(function () { - options.event.afterChange(event, slick, currentSlide); - }); - }); - } - }); - - slickness.on('beforeChange', function (event, slick, currentSlide, nextSlide) { - if (typeof options.event.beforeChange !== 'undefined') { - $timeout(function () { - $timeout(function () { - scope.$apply(function () { - options.event.beforeChange(event, slick, currentSlide, nextSlide); - }); - }); - }); - } - }); - - slickness.on('reInit', function (event, slick) { - if (typeof options.event.reInit !== 'undefined') { - $timeout(function () { - scope.$apply(function () { - options.event.reInit(event, slick); - }); - }); - } - }); - - if (typeof options.event.breakpoint !== 'undefined') { - slickness.on('breakpoint', function (event, slick, breakpoint) { - $timeout(function () { - scope.$apply(function () { - options.event.breakpoint(event, slick, breakpoint); - }); - }); - }); - } - if (typeof options.event.destroy !== 'undefined') { - slickness.on('destroy', function (event, slick) { - $timeout(function () { - scope.$apply(function () { - options.event.destroy(event, slick); - }); - }); - }); - } - if (typeof options.event.edge !== 'undefined') { - slickness.on('edge', function (event, slick, direction) { - $timeout(function () { - scope.$apply(function () { - options.event.edge(event, slick, direction); - }); - }); - }); - } - - if (typeof options.event.setPosition !== 'undefined') { - slickness.on('setPosition', function (event, slick) { - $timeout(function () { - scope.$apply(function () { - options.event.setPosition(event, slick); - }); - }); - }); - } - if (typeof options.event.swipe !== 'undefined') { - slickness.on('swipe', function (event, slick, direction) { - $timeout(function () { - scope.$apply(function () { - options.event.swipe(event, slick, direction); - }); - }); - }); - } - if (typeof options.event.lazyLoaded !== 'undefined') { - slickness.on('lazyLoaded', function (event, slick, image, imageSource) { - $timeout(function () { - scope.$apply(function () { - options.event.lazyLoaded(event, slick, image, imageSource); - }); - }); - }); - } - if (typeof options.event.lazyLoadError !== 'undefined') { - slickness.on('lazyLoadError', function (event, slick, image, imageSource) { - $timeout(function () { - scope.$apply(function () { - options.event.lazyLoadError(event, slick, image, imageSource); - }); - }); - }); - } - }; - - destroyAndInit = function () { - destroy(); - init(); - }; - - element.one('$destroy', function () { - destroy(); - }); - - return scope.$watch('settings', function (newVal, oldVal) { - if (newVal !== null) { - return destroyAndInit(); + return -1; + }; + + angular + .module('slickCarousel', []) + + //global config + .constant('slickCarouselConfig', { + autoplay: true, + dots: true, + autoplaySpeed: 3000, + lazyLoad: 'ondemand', + method: {}, + event: {} + }) + .directive('slick', [ + '$timeout', 'slickCarouselConfig', '$compile', function ($timeout, slickCarouselConfig, $compile) { + var slickOptionList, slickMethodList, slickEventList; + slickOptionList = ['accessibility', 'adaptiveHeight', 'autoplay', 'autoplaySpeed', 'asNavFor', 'appendArrows', 'prevArrow', 'nextArrow', 'centerMode', 'centerPadding', 'cssEase', 'customPaging', 'dots', 'draggable', 'fade', 'focusOnSelect', 'edgeFriction', 'infinite', 'initialSlide', 'lazyLoad', 'mobileFirst', 'pauseOnHover', 'pauseOnDotsHover', 'respondTo', 'rows', 'slide', 'slidesPerRow', 'slidesToShow', 'slidesToScroll', 'speed', 'swipe', 'swipeToSlide', 'touchMove', 'touchThreshold', 'useCSS', 'variableWidth', 'vertical', 'verticalSwiping', 'rtl']; + slickMethodList = ['slickGoTo', 'slickNext', 'slickPrev', 'slickPause', 'slickPlay', 'slickAdd', 'slickRemove', 'slickFilter', 'slickUnfilter', 'unslick']; + slickEventList = ['afterChange', 'beforeChange', 'breakpoint', 'destroy', 'edge', 'init', 'reInit', 'setPosition', 'swipe']; + + return { + scope: { + settings: '=', + data: '=' + }, + restrict: 'AE', + link: function (scope, element, attr) { + var options, initOptions, destroy, init, destroyAndInit; + + initOptions = function () { + options = angular.extend(angular.copy(slickCarouselConfig), scope.settings); + angular.forEach(attr, function (value, key) { + if (__indexOf.call(slickOptionList, key) >= 0) { + options[key] = scope.$eval(value); + } + }); + }; + + destroy = function () { + //remove current slides + var slickness = element.slick('getSlick'); + for (var i = 0; i < slickness.slideCount; i++) { + element.slick('slickRemove', i); + } + slickness = element.slick('unslick'); + return slickness; + }; + + init = function () { + return $timeout(function () { + initOptions(); + var slickness; + + if (angular.element(element).hasClass('slick-initialized')) { + slickness = element.slick('getSlick'); + } else { + slickness = element.slick(options); + } + + scope.internalControl = options.method || {}; + + // Method + slickMethodList.forEach(function (value) { + scope.internalControl[value] = function () { + var args; + args = Array.prototype.slice.call(arguments); + args.unshift(value); + slickness.slick.apply(element, args); + }; + }); + + // Event + slickness.on('afterChange', function (event, slick, currentSlide, nextSlide) { + if (typeof options.event.afterChange !== 'undefined') { + options.event.afterChange(event, slick, currentSlide, nextSlide); + } + }); + + if (typeof options.event.beforeChange !== 'undefined') { + slickness.on('beforeChange', function (event, slick, currentSlide, nextSlide) { + options.event.beforeChange(event, slick, currentSlide, nextSlide); + }); + } + if (typeof options.event.breakpoint !== 'undefined') { + slickness.on('breakpoint', function (event, slick, breakpoint) { + options.event.breakpoint(event, slick, breakpoint); + }); + } + if (typeof options.event.destroy !== 'undefined') { + slickness.on('destroy', function (event, slick) { + options.event.destroy(event, slick); + }); + } + if (typeof options.event.edge !== 'undefined') { + slickness.on('edge', function (event, slick, direction) { + options.event.edge(event, slick, direction); + }); + } + + slickness.on('init', function (event, slick) { + if (typeof options.event.init !== 'undefined') { + options.event.init(event, slick); + } + }); + + if (typeof options.event.reInit !== 'undefined') { + slickness.on('reInit', function (event, slick) { + options.event.reInit(event, slick); + }); + } + if (typeof options.event.setPosition !== 'undefined') { + slickness.on('setPosition', function (event, slick) { + options.event.setPosition(event, slick); + }); + } + if (typeof options.event.swipe !== 'undefined') { + slickness.on('swipe', function (event, slick, direction) { + options.event.swipe(event, slick, direction); + }); + } + }); + }; + + destroyAndInit = function () { + if (angular.element(element).hasClass('slick-initialized')) { + destroy(); + } + + return $timeout(function () { + return init(); + }, 1); + }; + + scope.$watch('settings', function (newVal, oldVal) { + if (newVal !== null) { + return destroyAndInit(); + } + }, true); + + return scope.$watch('data', function (newVal, oldVal) { + if (!angular.equals(newVal, oldVal)) { + destroyAndInit(); + } + }, true); + + } + }; } - }, true); + ]); - } - }; - } - ]); +})(); \ No newline at end of file diff --git a/dist/angular-slick.min.js b/dist/angular-slick.min.js index e1e46e6..d83c1f5 100644 --- a/dist/angular-slick.min.js +++ b/dist/angular-slick.min.js @@ -1,8 +1,8 @@ /*! * angular-slick-carousel - * DevMark + * DevMark ,Karan Batra-Daitch * https://github.com/devmark/angular-slick-carousel - * Version: 3.1.7 - 2016-08-04T06:17:55.528Z + * Version: 3.0.2 - 2015-07-21T11:01:43.965Z * License: MIT */ -"use strict";angular.module("slickCarousel",[]).constant("slickCarouselConfig",{method:{},event:{}}).directive("slick",["$timeout","slickCarouselConfig",function(e,n){var i,t;return i=["slickGoTo","slickNext","slickPrev","slickPause","slickPlay","slickAdd","slickRemove","slickFilter","slickUnfilter","unslick"],t=["afterChange","beforeChange","breakpoint","destroy","edge","init","reInit","setPosition","swipe","lazyLoaded","lazyLoadError"],{scope:{settings:"=",enabled:"@",accessibility:"@",adaptiveHeight:"@",autoplay:"@",autoplaySpeed:"@",arrows:"@",asNavFor:"@",appendArrows:"@",prevArrow:"@",nextArrow:"@",centerMode:"@",centerPadding:"@",cssEase:"@",customPaging:"&",dots:"@",draggable:"@",fade:"@",focusOnSelect:"@",easing:"@",edgeFriction:"@",infinite:"@",initialSlide:"@",lazyLoad:"@",mobileFirst:"@",pauseOnHover:"@",pauseOnDotsHover:"@",respondTo:"@",responsive:"=?",rows:"@",slide:"@",slidesPerRow:"@",slidesToShow:"@",slidesToScroll:"@",speed:"@",swipe:"@",swipeToSlide:"@",touchMove:"@",touchThreshold:"@",useCSS:"@",variableWidth:"@",vertical:"@",verticalSwiping:"@",rtl:"@"},restrict:"AE",link:function(t,o,a){angular.element(o).css("display","none");var r,s,l,d,u,c;return s=function(){r=angular.extend(angular.copy(n),{enabled:"false"!==t.enabled,accessibility:"false"!==t.accessibility,adaptiveHeight:"true"===t.adaptiveHeight,autoplay:"true"===t.autoplay,autoplaySpeed:null!=t.autoplaySpeed?parseInt(t.autoplaySpeed,10):3e3,arrows:"false"!==t.arrows,asNavFor:t.asNavFor?t.asNavFor:void 0,appendArrows:angular.element(t.appendArrows?t.appendArrows:o),prevArrow:t.prevArrow?angular.element(t.prevArrow):void 0,nextArrow:t.nextArrow?angular.element(t.nextArrow):void 0,centerMode:"true"===t.centerMode,centerPadding:t.centerPadding||"50px",cssEase:t.cssEase||"ease",customPaging:a.customPaging?function(e,n){return t.customPaging({slick:e,index:n})}:void 0,dots:"true"===t.dots,draggable:"false"!==t.draggable,fade:"true"===t.fade,focusOnSelect:"true"===t.focusOnSelect,easing:t.easing||"linear",edgeFriction:t.edgeFriction||.15,infinite:"false"!==t.infinite,initialSlide:parseInt(t.initialSlide)||0,lazyLoad:t.lazyLoad||"ondemand",mobileFirst:"true"===t.mobileFirst,pauseOnHover:"false"!==t.pauseOnHover,pauseOnDotsHover:"true"===t.pauseOnDotsHover,respondTo:null!=t.respondTo?t.respondTo:"window",responsive:t.responsive||void 0,rows:null!=t.rows?parseInt(t.rows,10):1,slide:t.slide||"",slidesPerRow:null!=t.slidesPerRow?parseInt(t.slidesPerRow,10):1,slidesToShow:null!=t.slidesToShow?parseInt(t.slidesToShow,10):1,slidesToScroll:null!=t.slidesToScroll?parseInt(t.slidesToScroll,10):1,speed:null!=t.speed?parseInt(t.speed,10):300,swipe:"false"!==t.swipe,swipeToSlide:"true"===t.swipeToSlide,touchMove:"false"!==t.touchMove,touchThreshold:t.touchThreshold?parseInt(t.touchThreshold,10):5,useCSS:"false"!==t.useCSS,variableWidth:"true"===t.variableWidth,vertical:"true"===t.vertical,verticalSwiping:"true"===t.verticalSwiping,rtl:"true"===t.rtl},t.settings)},l=function(){var e=angular.element(o);return e.hasClass("slick-initialized")&&(e.remove("slick-list"),e.slick("unslick")),e},d=function(){s();var n=angular.element(o);if(angular.element(o).hasClass("slick-initialized")){if(r.enabled)return n.slick("getSlick");l()}else{if(!r.enabled)return;n.on("init",function(e,n){return"undefined"!=typeof r.event.init&&r.event.init(e,n),"undefined"!=typeof c?n.slideHandler(c):void 0}),e(function(){angular.element(o).css("display","block"),n.not(".slick-initialized").slick(r)})}t.internalControl=r.method||{},i.forEach(function(e){t.internalControl[e]=function(){var i;i=Array.prototype.slice.call(arguments),i.unshift(e),n.slick.apply(o,i)}}),n.on("afterChange",function(n,i,o){c=o,"undefined"!=typeof r.event.afterChange&&e(function(){t.$apply(function(){r.event.afterChange(n,i,o)})})}),n.on("beforeChange",function(n,i,o,a){"undefined"!=typeof r.event.beforeChange&&e(function(){e(function(){t.$apply(function(){r.event.beforeChange(n,i,o,a)})})})}),n.on("reInit",function(n,i){"undefined"!=typeof r.event.reInit&&e(function(){t.$apply(function(){r.event.reInit(n,i)})})}),"undefined"!=typeof r.event.breakpoint&&n.on("breakpoint",function(n,i,o){e(function(){t.$apply(function(){r.event.breakpoint(n,i,o)})})}),"undefined"!=typeof r.event.destroy&&n.on("destroy",function(n,i){e(function(){t.$apply(function(){r.event.destroy(n,i)})})}),"undefined"!=typeof r.event.edge&&n.on("edge",function(n,i,o){e(function(){t.$apply(function(){r.event.edge(n,i,o)})})}),"undefined"!=typeof r.event.setPosition&&n.on("setPosition",function(n,i){e(function(){t.$apply(function(){r.event.setPosition(n,i)})})}),"undefined"!=typeof r.event.swipe&&n.on("swipe",function(n,i,o){e(function(){t.$apply(function(){r.event.swipe(n,i,o)})})}),"undefined"!=typeof r.event.lazyLoaded&&n.on("lazyLoaded",function(n,i,o,a){e(function(){t.$apply(function(){r.event.lazyLoaded(n,i,o,a)})})}),"undefined"!=typeof r.event.lazyLoadError&&n.on("lazyLoadError",function(n,i,o,a){e(function(){t.$apply(function(){r.event.lazyLoadError(n,i,o,a)})})})},u=function(){l(),d()},o.one("$destroy",function(){l()}),t.$watch("settings",function(e,n){return null!==e?u():void 0},!0)}}}]); \ No newline at end of file +!function(){"use strict";var e=[].indexOf||function(e){for(var n=0,t=this.length;t>n;n++)if(n in this&&this[n]===e)return n;return-1};angular.module("slickCarousel",[]).constant("slickCarouselConfig",{autoplay:!0,dots:!0,autoplaySpeed:3e3,lazyLoad:"ondemand",method:{},event:{}}).directive("slick",["$timeout","slickCarouselConfig","$compile",function(n,t,i){var o,a,r;return o=["accessibility","adaptiveHeight","autoplay","autoplaySpeed","asNavFor","appendArrows","prevArrow","nextArrow","centerMode","centerPadding","cssEase","customPaging","dots","draggable","fade","focusOnSelect","edgeFriction","infinite","initialSlide","lazyLoad","mobileFirst","pauseOnHover","pauseOnDotsHover","respondTo","rows","slide","slidesPerRow","slidesToShow","slidesToScroll","speed","swipe","swipeToSlide","touchMove","touchThreshold","useCSS","variableWidth","vertical","verticalSwiping","rtl"],a=["slickGoTo","slickNext","slickPrev","slickPause","slickPlay","slickAdd","slickRemove","slickFilter","slickUnfilter","unslick"],r=["afterChange","beforeChange","breakpoint","destroy","edge","init","reInit","setPosition","swipe"],{scope:{settings:"=",data:"="},restrict:"AE",link:function(i,r,s){var l,c,u,d,f;return c=function(){l=angular.extend(angular.copy(t),i.settings),angular.forEach(s,function(n,t){e.call(o,t)>=0&&(l[t]=i.$eval(n))})},u=function(){for(var e=r.slick("getSlick"),n=0;n\n' + - ' * <%= pkg.authors %>\n' + - ' * <%= pkg.homepage %>\n' + - ' * Version: <%= pkg.version %> - <%= timestamp %>\n' + - ' * License: <%= pkg.license %>\n' + - ' */\n\n\n' -}; - -gulp.task('default', ['build', 'test']); -gulp.task('build', ['scripts', 'styles']); -gulp.task('test', ['build', 'karma']); - -gulp.task('watch', ['build'], function () { -//gulp.task('watch', ['build', 'karma-watch'], function () { - gulp.watch(['src/**/*.{js,html}'], ['build']); -}); - -gulp.task('clean', function (cb) { - del(['dist'], cb); -}); - -gulp.task('scripts', ['clean'], function () { - - var buildTemplates = function () { - return gulp.src('src/**/*.html') - .pipe(minifyHtml({ - empty: true, - spare: true, - quotes: true - })) - .pipe(templateCache({module: 'slickCarousel'})); - }; - - var buildLib = function () { - return gulp.src(['src/common.js', 'src/*.js']) - .pipe(plumber({ - errorHandler: handleError - })) - .pipe(jshint()); - //.pipe(jshint.reporter('jshint-stylish')) - //.pipe(jshint.reporter('fail')); - }; - - return es.merge(buildLib(), buildTemplates()) - .pipe(plumber({ - errorHandler: handleError - })) - .pipe(concat('angular-slick.js')) - .pipe(header(config.banner, { - timestamp: (new Date()).toISOString(), pkg: config.pkg - })) - .pipe(gulp.dest('dist')) - .pipe(uglify({preserveComments: 'some'})) - .pipe(rename({extname: '.min.js'})) - .pipe(gulp.dest('dist')); -}); - -gulp.task('styles', ['clean'], function () { - - return gulp.src('src/common.css') - .pipe(header(config.banner, { - timestamp: (new Date()).toISOString(), pkg: config.pkg - })) - .pipe(rename('select.css')) - .pipe(gulp.dest('dist')) - .pipe(minifyCSS()) - .pipe(rename({ext: '.min.css'})) - .pipe(gulp.dest('dist')); - -}); - -gulp.task('karma', ['build'], function () { - karma.start({configFile: __dirname + '/karma.conf.js', singleRun: true}); -}); - -gulp.task('karma-watch', ['build'], function () { - karma.start({configFile: __dirname + '/karma.conf.js', singleRun: false}); -}); - -var handleError = function (err) { - console.log(err.toString()); - this.emit('end'); -}; \ No newline at end of file diff --git a/examples/index.html b/index.html similarity index 51% rename from examples/index.html rename to index.html index 51e1ba7..b864b2d 100644 --- a/examples/index.html +++ b/index.html @@ -5,11 +5,11 @@ Angular Slick Carousel - - - + + + - + @@ -27,9 +27,6 @@
-

to see the samples runing use that command line in your terminal: python -m SimpleHTTPServer

-

After this acess that page from this link: http://localhost:8000/examples/

-
@@ -47,22 +44,20 @@ - - - - - - + + - + + + - + diff --git a/js/app.js b/js/app.js new file mode 100644 index 0000000..6358a83 --- /dev/null +++ b/js/app.js @@ -0,0 +1,112 @@ +'use strict'; + +angular.module('slickExampleApp', ['slickCarousel', 'ngRoute']) + .config(['$routeProvider', function ($routeProvider) { + $routeProvider + .when('/', { + templateUrl: 'views/home.html', + controller: 'SlickController' + }) + .otherwise({ + redirectTo: '/' + }); + }]) + .controller('SlickController', function ($scope, $timeout, $compile) { + $scope.number = [{label: 1}, {label: 2}, {label: 3}, {label: 4}, {label: 5}, {label: 6}, {label: 7}, {label: 8}]; + $scope.number2 = [{label: 1}, {label: 2}, {label: 3}, {label: 4}, {label: 5}, {label: 6}, {label: 7}, {label: 8}]; + $scope.number3 = [{label: 1}, {label: 2}, {label: 3}, {label: 4}, {label: 5}, {label: 6}, {label: 7}, {label: 8}]; + $scope.number4 = [{label: 225}, {label: 125}, {label: 200}, {label: 175}, {label: 150}, {label: 180}, {label: 300}, {label: 400}]; + + $scope.slideAdd = function (object) { + $scope[object].push({label: Math.floor((Math.random() * 10) + 100)}); + }; + + $scope.slickConfig = { + dots: true, + autoplay: false, + infinite: true, + autoplaySpeed: 3000, + method: {}, + event: { + beforeChange: function (event, slick, currentSlide, nextSlide) { + console.log('before change'); + }, + afterChange: function (event, slick, currentSlide, nextSlide) { + + }, + breakpoint: function (event, slick, breakpoint) { + console.log('breakpoint'); + }, + destroy: function (event, slick) { + console.log('destroy'); + }, + edge: function (event, slick, direction) { + console.log('edge'); + }, + reInit: function (event, slick) { + console.log('re-init'); + }, + init: function (event, slick) { + console.log('init'); + }, + setPosition: function (evnet, slick) { + console.log('setPosition'); + }, + swipe: function (event, slick, direction) { + console.log('swipe'); + } + } + }; + + $scope.slickConfig2 = { + method: {}, + slidesToShow: 3, + slidesToScroll: 3 + }; + + $scope.slickConfig3 = { + method: {}, + dots: true, + infinite: false, + speed: 300, + slidesToShow: 4, + slidesToScroll: 4, + responsive: [ + { + breakpoint: 1024, + settings: { + slidesToShow: 3, + slidesToScroll: 3, + infinite: true, + dots: true + } + }, + { + breakpoint: 600, + settings: { + slidesToShow: 2, + slidesToScroll: 2 + } + }, + { + breakpoint: 480, + settings: { + slidesToShow: 1, + slidesToScroll: 1 + } + } + ] + }; + + $scope.slickConfig4 = { + method: {}, + dots: true, + infinite: true, + speed: 300, + slidesToShow: 1, + centerMode: true, + variableWidth: true + }; + + }); + diff --git a/karma.conf.js b/karma.conf.js deleted file mode 100644 index 7746515..0000000 --- a/karma.conf.js +++ /dev/null @@ -1,48 +0,0 @@ -module.exports = function (config) { - config.set({ - - // Base path, that will be used to resolve files and exclude - basePath: '', - - // Frameworks to use - frameworks: ['jasmine'], - - // List of files / patterns to load in the browser - files: [ - 'bower_components/jquery/dist/jquery.js', - 'bower_components/angular/angular.js', - 'bower_components/angular-mocks/angular-mocks.js', - - 'bower_components/slick-carousel/slick/slick.js', - 'dist/angular-slick.js', - 'test/**/*.spec.js' - ], - - // List of files to exclude - exclude: [], - - // Web server port - port: 9876, - - // Level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // Enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera - // - Safari (only Mac) - // - PhantomJS - // - IE (only Windows) - browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'], - - // Continuous Integration mode - // if true, it capture browsers, run tests and exit - singleRun: false - }); -}; diff --git a/package.json b/package.json deleted file mode 100644 index ec7c13e..0000000 --- a/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "angular-slick-carousel", - "version": "3.1.7", - "main": "dist/angular-slick.js", - "repository": { - "type": "git", - "url": "https://github.com/devmark/angular-slick-carousel.git" - }, - "author": "DevMark", - "license": "MIT", - "dependencies": { - }, - "devDependencies": { - "gulp": "~3.9.0", - "grunt": "*", - "load-grunt-tasks": "^3.5.0", - "time-grunt": "^1.3.0", - "grunt-contrib-sass": "*", - "grunt-contrib-connect": "^1.0.2", - "grunt-contrib-watch": "*", - "gulp-autoprefixer": "~2.3.1", - "gulp-angular-templatecache": "~1.6.0", - "del": "~1.2.0", - "lodash": "~3.10.1", - "gulp-csso": "~1.0.0", - "gulp-filter": "~2.0.2", - "gulp-flatten": "~0.0.4", - "gulp-jshint": "~1.11.0", - "gulp-load-plugins": "~0.10.0", - "gulp-size": "~1.2.1", - "gulp-uglify": "~1.2.0", - "gulp-useref": "~1.2.0", - "gulp-util": "~3.0.5", - "gulp-ng-annotate": "~1.0.0", - "gulp-replace": "~0.5.3", - "gulp-rename": "~1.2.2", - "gulp-rev": "~5.0.0", - "gulp-rev-replace": "~0.4.2", - "gulp-minify-html": "~1.0.3", - "gulp-inject": "~1.3.1", - "gulp-protractor": "~1.0.0", - "gulp-sourcemaps": "~1.5.2", - "gulp-less": "~3.0.3", - "gulp-angular-filesort": "~1.1.1", - "main-bower-files": "~2.9.0", - "merge-stream": "~0.1.7", - "jshint-stylish": "~2.0.0", - "wiredep": "~2.2.2", - "karma": "~0.13.10", - "karma-jasmine": "~0.3.5", - "karma-chrome-launcher": "^0.2.0", - "karma-phantomjs-launcher": "~0.2.0", - "karma-ng-html2js-preprocessor": "~0.1.2", - "concat-stream": "~1.5.0", - "require-dir": "~0.3.0", - "wrench": "~1.5.8", - "event-stream": "^3.3.1", - "gulp-concat": "^2.6.0", - "gulp-footer": "^1.0.5", - "gulp-header": "^1.2.2", - "gulp-minify-css": "^1.2.0", - "gulp-plumber": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } -} diff --git a/protractor.conf.js b/protractor.conf.js deleted file mode 100644 index f2a84a5..0000000 --- a/protractor.conf.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var paths = require('./.yo-rc.json')['generator-gulp-angular'].props.paths; - -// An example configuration file. -exports.config = { - // The address of a running selenium server. - //seleniumAddress: 'http://localhost:4444/wd/hub', - //seleniumServerJar: deprecated, this should be set on node_modules/protractor/config.json - - // Capabilities to be passed to the webdriver instance. - capabilities: { - 'browserName': 'chrome' - }, - - baseUrl: 'http://localhost:3000/', - - // Spec patterns are relative to the current working directly when - // protractor is called. - specs: [paths.e2e + '/**/*.js'], - - // Options to be passed to Jasmine-node. - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000 - } -}; diff --git a/scss/_app.scss b/scss/_app.scss deleted file mode 100644 index a5a9c1d..0000000 --- a/scss/_app.scss +++ /dev/null @@ -1,83 +0,0 @@ -// ********************************************************************* -// =app -// -// Author : @douglasdeodato -// Project: angular-slick-carousel -// Date : 24/08/2016 -// Version: package.json -// ********************************************************************* - - -@font-face { - font-family: 'Pacifico'; - src: url('#{$slick-font-path}pacifico.eot'); - src: url('#{$slick-font-path}pacifico.eot?#iefix') format('embedded-opentype'), - url('#{$slick-font-path}pacifico.woff') format('woff'), - url('#{$slick-font-path}pacifico.ttf') format('truetype'), - url('#{$slick-font-path}pacifico.svg#Pacifico') format('svg'); -} - -.header { - padding: 20px 0px; - & .title { - color: palette(blue); - font-size: 48px; - line-height: 100px; - font-family: 'Pacifico'; - } - & .sub-title { - color: $grey; - font-size: 12px; - font-style: italic; - font-weight: 400; - margin: 10px auto; - text-align: center; - } -} - - -.blue { - background: palette(blue); - color: $white; - h3 { - background: $white; - color: palette(blue); - font-size: 36px; - line-height: 100px; - margin: 10px; - padding: 2%; - position: relative; - text-align: center; -} -} - - - -.content { - & .content-title { - text-align: center; - line-height: 100px; - font-family: 'Pacifico'; - } -} - - -.footer { - padding: 20px 0px; - .title { - color: palette(blue); - font-size: 48px; - line-height: 100px; - font-family: 'Pacifico'; -} -.sub-title { - color: $grey; - font-size: 12px; - font-style: italic; - font-weight: 400; - margin: 10px auto; - text-align: center; -} -} - - diff --git a/scss/_config.scss b/scss/_config.scss deleted file mode 100644 index a02dd9b..0000000 --- a/scss/_config.scss +++ /dev/null @@ -1,28 +0,0 @@ -// ********************************************************************* -// =main config -// -// Author : @douglasdeodato -// Project: angular-slick-carousel -// Date : 24/08/2016 -// Version: package.json -// ********************************************************************* - -$slick-font-path: "/examples/fonts/" !default; - - -// Color Palette Modifiers - -$blue:#3498db; -$white:#fff; -$grey: #555; - -$color-palettes: ( - blue: ( - x-light : #4b8cff, - light : #9cc0ff, - base : $blue, - light-dark : #146aff, - dark : #0355C6, - x-dark : #2271fd, - ), -); \ No newline at end of file diff --git a/scss/_functions.scss b/scss/_functions.scss deleted file mode 100644 index afed03f..0000000 --- a/scss/_functions.scss +++ /dev/null @@ -1,14 +0,0 @@ -// ********************************************************************* -// =Helpers Functions -// -// Author : @douglasdeodato -// Project: angular-slick-carousel -// Date : 24/08/2016 -// Version: package.json -// ********************************************************************* - - -// Call the color palette modifiers in color values -@function palette($palette, $shade: 'base') { - @return map-get(map-get($color-palettes, $palette), $shade); -} diff --git a/scss/main.scss b/scss/main.scss deleted file mode 100644 index 3d50250..0000000 --- a/scss/main.scss +++ /dev/null @@ -1,14 +0,0 @@ -// ********************************************************************* -// =Main Import -// -// Author : @douglasdeodato -// Project: angular-slick-carousel -// Date : 24/08/2016 -// Version: package.json -// ********************************************************************* - -@import "http://github.com/functions"; -@import "http://github.com/config"; -@import "http://github.com/app"; - - diff --git a/src/slick.js b/src/slick.js deleted file mode 100644 index e0f8419..0000000 --- a/src/slick.js +++ /dev/null @@ -1,292 +0,0 @@ -'use strict'; - -angular - .module('slickCarousel', []) - //global config - .constant('slickCarouselConfig', { - method: {}, - event: {} - }) - .directive('slick', [ - '$timeout', 'slickCarouselConfig', function ($timeout, slickCarouselConfig) { - var slickMethodList, slickEventList; - slickMethodList = ['slickGoTo', 'slickNext', 'slickPrev', 'slickPause', 'slickPlay', 'slickAdd', 'slickRemove', 'slickFilter', 'slickUnfilter', 'unslick']; - slickEventList = ['afterChange', 'beforeChange', 'breakpoint', 'destroy', 'edge', 'init', 'reInit', 'setPosition', 'swipe', 'lazyLoaded', 'lazyLoadError']; - - return { - scope: { - settings: '=', - enabled: '@', - accessibility: '@', - adaptiveHeight: '@', - autoplay: '@', - autoplaySpeed: '@', - arrows: '@', - asNavFor: '@', - appendArrows: '@', - prevArrow: '@', - nextArrow: '@', - centerMode: '@', - centerPadding: '@', - cssEase: '@', - customPaging: '&', - dots: '@', - draggable: '@', - fade: '@', - focusOnSelect: '@', - easing: '@', - edgeFriction: '@', - infinite: '@', - initialSlide: '@', - lazyLoad: '@', - mobileFirst: '@', - pauseOnHover: '@', - pauseOnDotsHover: '@', - respondTo: '@', - responsive: '=?', - rows: '@', - slide: '@', - slidesPerRow: '@', - slidesToShow: '@', - slidesToScroll: '@', - speed: '@', - swipe: '@', - swipeToSlide: '@', - touchMove: '@', - touchThreshold: '@', - useCSS: '@', - variableWidth: '@', - vertical: '@', - verticalSwiping: '@', - rtl: '@' - }, - restrict: 'AE', - link: function (scope, element, attr) { - //hide slider - angular.element(element).css('display', 'none'); - - var options, initOptions, destroy, init, destroyAndInit, currentIndex; - - initOptions = function () { - options = angular.extend(angular.copy(slickCarouselConfig), { - enabled: scope.enabled !== 'false', - accessibility: scope.accessibility !== 'false', - adaptiveHeight: scope.adaptiveHeight === 'true', - autoplay: scope.autoplay === 'true', - autoplaySpeed: scope.autoplaySpeed != null ? parseInt(scope.autoplaySpeed, 10) : 3000, - arrows: scope.arrows !== 'false', - asNavFor: scope.asNavFor ? scope.asNavFor : void 0, - appendArrows: scope.appendArrows ? angular.element(scope.appendArrows) : angular.element(element), - prevArrow: scope.prevArrow ? angular.element(scope.prevArrow) : void 0, - nextArrow: scope.nextArrow ? angular.element(scope.nextArrow) : void 0, - centerMode: scope.centerMode === 'true', - centerPadding: scope.centerPadding || '50px', - cssEase: scope.cssEase || 'ease', - customPaging: attr.customPaging ? function (slick, index) { - return scope.customPaging({slick: slick, index: index}); - } : void 0, - dots: scope.dots === 'true', - draggable: scope.draggable !== 'false', - fade: scope.fade === 'true', - focusOnSelect: scope.focusOnSelect === 'true', - easing: scope.easing || 'linear', - edgeFriction: scope.edgeFriction || 0.15, - infinite: scope.infinite !== 'false', - initialSlide: parseInt(scope.initialSlide) || 0, - lazyLoad: scope.lazyLoad || 'ondemand', - mobileFirst: scope.mobileFirst === 'true', - pauseOnHover: scope.pauseOnHover !== 'false', - pauseOnDotsHover: scope.pauseOnDotsHover === "true", - respondTo: scope.respondTo != null ? scope.respondTo : 'window', - responsive: scope.responsive || void 0, - rows: scope.rows != null ? parseInt(scope.rows, 10) : 1, - slide: scope.slide || '', - slidesPerRow: scope.slidesPerRow != null ? parseInt(scope.slidesPerRow, 10) : 1, - slidesToShow: scope.slidesToShow != null ? parseInt(scope.slidesToShow, 10) : 1, - slidesToScroll: scope.slidesToScroll != null ? parseInt(scope.slidesToScroll, 10) : 1, - speed: scope.speed != null ? parseInt(scope.speed, 10) : 300, - swipe: scope.swipe !== 'false', - swipeToSlide: scope.swipeToSlide === 'true', - touchMove: scope.touchMove !== 'false', - touchThreshold: scope.touchThreshold ? parseInt(scope.touchThreshold, 10) : 5, - useCSS: scope.useCSS !== 'false', - variableWidth: scope.variableWidth === 'true', - vertical: scope.vertical === 'true', - verticalSwiping: scope.verticalSwiping === 'true', - rtl: scope.rtl === 'true' - }, scope.settings); - - }; - - destroy = function () { - var slickness = angular.element(element); - if (slickness.hasClass('slick-initialized')) { - slickness.remove('slick-list'); - slickness.slick('unslick'); - } - - return slickness; - }; - - init = function () { - initOptions(); - - var slickness = angular.element(element); - - if (angular.element(element).hasClass('slick-initialized')) { - if (options.enabled) { - return slickness.slick('getSlick'); - } else { - destroy(); - } - } else { - if (!options.enabled) { - return; - } - // Event - slickness.on('init', function (event, slick) { - if (typeof options.event.init !== 'undefined') { - options.event.init(event, slick); - } - if (typeof currentIndex !== 'undefined') { - return slick.slideHandler(currentIndex); - } - }); - - $timeout(function () { - angular.element(element).css('display', 'block'); - slickness.not('.slick-initialized').slick(options); - }); - } - - scope.internalControl = options.method || {}; - - // Method - slickMethodList.forEach(function (value) { - scope.internalControl[value] = function () { - var args; - args = Array.prototype.slice.call(arguments); - args.unshift(value); - slickness.slick.apply(element, args); - }; - }); - - // Event - slickness.on('afterChange', function (event, slick, currentSlide) { - currentIndex = currentSlide; - if (typeof options.event.afterChange !== 'undefined') { - $timeout(function () { - scope.$apply(function () { - options.event.afterChange(event, slick, currentSlide); - }); - }); - } - }); - - slickness.on('beforeChange', function (event, slick, currentSlide, nextSlide) { - if (typeof options.event.beforeChange !== 'undefined') { - $timeout(function () { - $timeout(function () { - scope.$apply(function () { - options.event.beforeChange(event, slick, currentSlide, nextSlide); - }); - }); - }); - } - }); - - slickness.on('reInit', function (event, slick) { - if (typeof options.event.reInit !== 'undefined') { - $timeout(function () { - scope.$apply(function () { - options.event.reInit(event, slick); - }); - }); - } - }); - - if (typeof options.event.breakpoint !== 'undefined') { - slickness.on('breakpoint', function (event, slick, breakpoint) { - $timeout(function () { - scope.$apply(function () { - options.event.breakpoint(event, slick, breakpoint); - }); - }); - }); - } - if (typeof options.event.destroy !== 'undefined') { - slickness.on('destroy', function (event, slick) { - $timeout(function () { - scope.$apply(function () { - options.event.destroy(event, slick); - }); - }); - }); - } - if (typeof options.event.edge !== 'undefined') { - slickness.on('edge', function (event, slick, direction) { - $timeout(function () { - scope.$apply(function () { - options.event.edge(event, slick, direction); - }); - }); - }); - } - - if (typeof options.event.setPosition !== 'undefined') { - slickness.on('setPosition', function (event, slick) { - $timeout(function () { - scope.$apply(function () { - options.event.setPosition(event, slick); - }); - }); - }); - } - if (typeof options.event.swipe !== 'undefined') { - slickness.on('swipe', function (event, slick, direction) { - $timeout(function () { - scope.$apply(function () { - options.event.swipe(event, slick, direction); - }); - }); - }); - } - if (typeof options.event.lazyLoaded !== 'undefined') { - slickness.on('lazyLoaded', function (event, slick, image, imageSource) { - $timeout(function () { - scope.$apply(function () { - options.event.lazyLoaded(event, slick, image, imageSource); - }); - }); - }); - } - if (typeof options.event.lazyLoadError !== 'undefined') { - slickness.on('lazyLoadError', function (event, slick, image, imageSource) { - $timeout(function () { - scope.$apply(function () { - options.event.lazyLoadError(event, slick, image, imageSource); - }); - }); - }); - } - }; - - destroyAndInit = function () { - destroy(); - init(); - }; - - element.one('$destroy', function () { - destroy(); - }); - - return scope.$watch('settings', function (newVal, oldVal) { - if (newVal !== null) { - return destroyAndInit(); - } - }, true); - - } - }; - } - ]); diff --git a/test/.jshintrc b/test/.jshintrc deleted file mode 100644 index 5540069..0000000 --- a/test/.jshintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../.jshintrc", - "globals": { - "browser": false, - "element": false, - "by": false, - "$": false, - "$$": false - } -} diff --git a/test/main.spec.js b/test/main.spec.js deleted file mode 100644 index d9edfc6..0000000 --- a/test/main.spec.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -describe('angular slick testing', function () { - var scope, $rootScope, $compile, $timeout, $injector; - - beforeEach(module('slickCarousel')); - - beforeEach(inject(function (_$rootScope_, _$compile_, _$timeout_, _$injector_) { - $rootScope = _$rootScope_; - scope = $rootScope.$new(); - $compile = _$compile_; - $timeout = _$timeout_; - $injector = _$injector_; - - scope.date = [ - {id: 1, name: 'Mark', email: 'adam@email.com'}, - {id: 2, name: 'Ken', email: 'adam@email.com'}, - {id: 3, name: 'Oren', email: 'adam@email.com'}, - {id: 4, name: 'Kenny', email: 'adam@email.com'} - ]; - })); - - // DSL (domain-specific language) - function compileTemplate(template) { - var el = $compile(angular.element(template))(scope); - scope.$digest(); - $timeout.flush(); - return el; - } - - it('should init', function () { - var element = compileTemplate('\ - \ -
1
\ -
2
\ -
'); - scope.$digest(); - expect(element.hasClass('slick-initialized')).toBe(true); - }); - - it('should init if ng-if is true', function () { - scope.slickConfigLoaded = true; - var element = compileTemplate('\ - \ -
1
\ -
2
\ -
'); - scope.$digest(); - expect(element.next().hasClass('slick-initialized')).toBe(true); - }); - - it('should re-init if change ng-if', function () { - scope.slickConfigLoaded = true; - var element = compileTemplate('\ - \ -
\ -
i
\ - '); - scope.$digest(); - expect(element.next().hasClass('slick-initialized')).toBe(true); - }); - - it('should re-init if config change', function () { - scope.isDestroy = false; - scope.slickConfig = { - autoplay: true, - event: { - destroy: function (event, slick) { - scope.isDestroy = true; - } - } - }; - var element = compileTemplate('\ - \ -
\ -
i
\ - '); - scope.$digest(); - expect(element.hasClass('slick-initialized')).toBe(true); - - $timeout(function () { - scope.slickConfig.autoplay = false; - scope.$digest(); - $timeout.flush(); - expect(scope.isDestroy).toBe(true); - expect(element.hasClass('slick-initialized')).toBe(true); - }); - }); - -}); diff --git a/vendor/slick/ajax-loader.gif b/vendor/slick/ajax-loader.gif new file mode 100644 index 0000000..e0e6e97 Binary files /dev/null and b/vendor/slick/ajax-loader.gif differ diff --git a/vendor/slick/fonts/slick.eot b/vendor/slick/fonts/slick.eot new file mode 100644 index 0000000..2cbab9c Binary files /dev/null and b/vendor/slick/fonts/slick.eot differ diff --git a/vendor/slick/fonts/slick.svg b/vendor/slick/fonts/slick.svg new file mode 100644 index 0000000..b36a66a --- /dev/null +++ b/vendor/slick/fonts/slick.svg @@ -0,0 +1,14 @@ + + + +Generated by Fontastic.me + + + + + + + + + + diff --git a/vendor/slick/fonts/slick.ttf b/vendor/slick/fonts/slick.ttf new file mode 100644 index 0000000..9d03461 Binary files /dev/null and b/vendor/slick/fonts/slick.ttf differ diff --git a/vendor/slick/fonts/slick.woff b/vendor/slick/fonts/slick.woff new file mode 100644 index 0000000..8ee9972 Binary files /dev/null and b/vendor/slick/fonts/slick.woff differ diff --git a/vendor/slick/slick-theme.css b/vendor/slick/slick-theme.css new file mode 100644 index 0000000..a53cd69 --- /dev/null +++ b/vendor/slick/slick-theme.css @@ -0,0 +1,201 @@ +@charset 'UTF-8'; +/* Slider */ +.slick-loading .slick-list +{ + background: #fff url('http://github.com/ajax-loader.gif') center center no-repeat; +} + +/* Icons */ +@font-face +{ + font-family: 'slick'; + font-weight: normal; + font-style: normal; + + src: url('http://github.com/fonts/slick.eot'); + src: url('http://github.com/fonts/slick.eot?#iefix') format('embedded-opentype'), url('http://github.com/fonts/slick.woff') format('woff'), url('http://github.com/fonts/slick.ttf') format('truetype'), url('http://github.com/fonts/slick.svg#slick') format('svg'); +} +/* Arrows */ +.slick-prev, +.slick-next +{ + font-size: 0; + line-height: 0; + + position: absolute; + top: 50%; + + display: block; + + width: 20px; + height: 20px; + margin-top: -10px; + padding: 0; + + cursor: pointer; + + color: transparent; + border: none; + outline: none; + background: transparent; +} +.slick-prev:hover, +.slick-prev:focus, +.slick-next:hover, +.slick-next:focus +{ + color: transparent; + outline: none; + background: transparent; +} +.slick-prev:hover:before, +.slick-prev:focus:before, +.slick-next:hover:before, +.slick-next:focus:before +{ + opacity: 1; +} +.slick-prev.slick-disabled:before, +.slick-next.slick-disabled:before +{ + opacity: .25; +} + +.slick-prev:before, +.slick-next:before +{ + font-family: 'slick'; + font-size: 20px; + line-height: 1; + + opacity: .75; + color: white; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.slick-prev +{ + left: -25px; +} +[dir='rtl'] .slick-prev +{ + right: -25px; + left: auto; +} +.slick-prev:before +{ + content: '←'; +} +[dir='rtl'] .slick-prev:before +{ + content: '→'; +} + +.slick-next +{ + right: -25px; +} +[dir='rtl'] .slick-next +{ + right: auto; + left: -25px; +} +.slick-next:before +{ + content: '→'; +} +[dir='rtl'] .slick-next:before +{ + content: '←'; +} + +/* Dots */ +.slick-slider +{ + margin-bottom: 30px; +} + +.slick-dots +{ + position: absolute; + bottom: -45px; + + display: block; + + width: 100%; + padding: 0; + + list-style: none; + + text-align: center; +} +.slick-dots li +{ + position: relative; + + display: inline-block; + + width: 20px; + height: 20px; + margin: 0 5px; + padding: 0; + + cursor: pointer; +} +.slick-dots li button +{ + font-size: 0; + line-height: 0; + + display: block; + + width: 20px; + height: 20px; + padding: 5px; + + cursor: pointer; + + color: transparent; + border: 0; + outline: none; + background: transparent; +} +.slick-dots li button:hover, +.slick-dots li button:focus +{ + outline: none; +} +.slick-dots li button:hover:before, +.slick-dots li button:focus:before +{ + opacity: 1; +} +.slick-dots li button:before +{ + font-family: 'slick'; + font-size: 6px; + line-height: 20px; + + position: absolute; + top: 0; + left: 0; + + width: 20px; + height: 20px; + + content: '•'; + text-align: center; + + opacity: .25; + color: black; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.slick-dots li.slick-active button:before +{ + opacity: .75; + color: black; +} diff --git a/vendor/slick/slick.css b/vendor/slick/slick.css new file mode 100644 index 0000000..e7f5607 --- /dev/null +++ b/vendor/slick/slick.css @@ -0,0 +1,119 @@ +/* Slider */ +.slick-slider +{ + position: relative; + + display: block; + + -moz-box-sizing: border-box; + box-sizing: border-box; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + -webkit-touch-callout: none; + -khtml-user-select: none; + -ms-touch-action: pan-y; + touch-action: pan-y; + -webkit-tap-highlight-color: transparent; +} + +.slick-list +{ + position: relative; + + display: block; + overflow: hidden; + + margin: 0; + padding: 0; +} +.slick-list:focus +{ + outline: none; +} +.slick-list.dragging +{ + cursor: pointer; + cursor: hand; +} + +.slick-slider .slick-track, +.slick-slider .slick-list +{ + -webkit-transform: translate3d(0, 0, 0); + -moz-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} + +.slick-track +{ + position: relative; + top: 0; + left: 0; + + display: block; +} +.slick-track:before, +.slick-track:after +{ + display: table; + + content: ''; +} +.slick-track:after +{ + clear: both; +} +.slick-loading .slick-track +{ + visibility: hidden; +} + +.slick-slide +{ + display: none; + float: left; + + height: 100%; + min-height: 1px; +} +[dir='rtl'] .slick-slide +{ + float: right; +} +.slick-slide img +{ + display: block; +} +.slick-slide.slick-loading img +{ + display: none; +} +.slick-slide.dragging img +{ + pointer-events: none; +} +.slick-initialized .slick-slide +{ + display: block; +} +.slick-loading .slick-slide +{ + visibility: hidden; +} +.slick-vertical .slick-slide +{ + display: block; + + height: auto; + + border: 1px solid transparent; +} +.slick-arrow.slick-hidden { + display: none; +} \ No newline at end of file diff --git a/vendor/slick/slick.min.js b/vendor/slick/slick.min.js new file mode 100644 index 0000000..76118d9 --- /dev/null +++ b/vendor/slick/slick.min.js @@ -0,0 +1,18 @@ +/* + _ _ _ _ + ___| (_) ___| | __ (_)___ +/ __| | |/ __| |/ / | / __| +\__ \ | | (__| < _ | \__ \ +|___/_|_|\___|_|\_(_)/ |___/ + |__/ + + Version: 1.5.6 + Author: Ken Wheeler + Website: http://kenwheeler.github.io + Docs: http://kenwheeler.github.io/slick + Repo: http://github.com/kenwheeler/slick + Issues: http://github.com/kenwheeler/slick/issues + + */ +!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),d[e.animType]=e.options.vertical===!1?"translate3d("+b+"px, 0px, 0px)":"translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=c.options.asNavFor;d&&null!==d&&(d=a(d).not(c.$slider)),null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};c[b.transitionType]=b.options.fade===!1?b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:"opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(0===a.currentSlide-1&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='
    ',c=0;c<=b.getDotCount();c+=1)d+="
  • "+b.options.customPaging.call(this,b,c)+"
  • ";d+="
",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slidesCache=b.$slides,b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('
').appendTo(b.$slider):b.$slides.wrapAll('
').parent(),b.$list=b.$slideTrack.wrap('
').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;cd.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=0!==d.slideCount%d.options.slidesToScroll,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(ab.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;bb.options.slidesToShow&&(b.slideOffset=-1*b.slideWidth*b.options.slidesToShow,e=-1*d*b.options.slidesToShow),0!==b.slideCount%b.options.slidesToScroll&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=-1*(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth,e=-1*(b.options.slidesToShow-(a-b.slideCount))*d):(b.slideOffset=-1*b.slideCount%b.options.slidesToScroll*b.slideWidth,e=-1*b.slideCount%b.options.slidesToScroll*d))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?-1*a*b.slideWidth+b.slideOffset:-1*a*d+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.setPaused,b,!0)).on("mouseleave.slick",a.proxy(b.setPaused,b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.$list.on("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}}))},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:0},100,function(){b.attr("src",c).animate({opacity:1},200,function(){b.removeAttr("data-lazy").removeClass("slick-loading")})})},d.src=c})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay(),b.options.accessibility===!0&&b.initADA()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(b){var c=this,d=c.currentSlide;c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b]),b.options.autoplay===!0&&b.focusHandler()},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,d.reinit(),void 0)},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=-1*b.slideWidth*d,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(b,c,d){var f,g,e=this;if("responsive"===b&&"array"===a.type(c))for(g in c)if("array"!==a.type(e.options.responsive))e.options.responsive=[c[g]];else{for(f=e.options.responsive.length-1;f>=0;)e.options.responsive[f].breakpoint===c[g].breakpoint&&e.options.responsive.splice(f,1),f--;e.options.responsive.push(c[g])}else e.options[b]=c;d===!0&&(e.unload(),e.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-ab.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,a?b.autoPlayClear():b.autoPlay())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),c.asNavFor(e),void 0):(c.slideHandler(e),void 0)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?0!==i.slideCount%i.options.slidesToScroll?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?0!==i.slideCount%i.options.slidesToScroll?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e) +})):i.postSlide(e),i.animateHeight(),void 0):(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e),void 0)))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.swipeLeft=b.options.vertical===!1?d+f*g:d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):(b.setCSS(b.swipeLeft),void 0)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,b.dragging=!0,void 0)},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):a.options.autoplay===!0&&(a.paused=!1,a.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.activateADA=function(){var a=this,b=a.$slider.find("*").is(":focus");a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false",tabindex:"0"}).find("a, input, button, select").attr({tabindex:"0"}),b&&a.$slideTrack.find(".slick-active").focus()},b.prototype.focusHandler=function(){var b=this;b.$slider.on("focus.slick blur.slick","*",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.isPlay&&(d.is(":focus")?(b.autoPlayClear(),b.paused=!0):(b.paused=!1,b.autoPlay()))},0)})},a.fn.slick=function(){var g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length,f=0;for(f;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}}); \ No newline at end of file diff --git a/examples/views/home.html b/views/home.html similarity index 74% rename from examples/views/home.html rename to views/home.html index 84613ef..5970a11 100644 --- a/examples/views/home.html +++ b/views/home.html @@ -8,13 +8,9 @@

Single Item

{{ i.label }}

- - - -
-
+ +
+
@@ -24,21 +20,21 @@

{{ i }}

- +

Multiple Items

- -
+ +

Responsive Display

- +
@@ -47,7 +43,7 @@

Responsive Display

Variable Width

- +
@@ -57,7 +53,7 @@

Variable Width

- +