jekyll-theme-artsy 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/css/bootstrap.min.css +8143 -0
- data/css/galleries.css +150 -0
- data/css/home.css +151 -0
- data/css/journal.css +235 -0
- data/css/magnificpopup.css +352 -0
- data/css/main.css +856 -0
- data/css/selena.css +50 -0
- data/css/super-search.css +110 -0
- data/css/tags-wrap.css +35 -0
- data/img/404.jpg +0 -0
- data/img/about-bg.jpg +0 -0
- data/img/add-to-cart.png +0 -0
- data/img/archive-bg.jpg +0 -0
- data/img/avatar.png +0 -0
- data/img/bookbutton.png +0 -0
- data/img/cart-empty.png +0 -0
- data/img/cart-full.png +0 -0
- data/img/donate.png +0 -0
- data/img/gallery-bg.jpg +0 -0
- data/img/journal/post01.jpg +0 -0
- data/img/journal/post02.jpg +0 -0
- data/img/journal/post03.jpg +0 -0
- data/img/left-arrow.svg +36 -0
- data/img/lightbox/close.png +0 -0
- data/img/lightbox/loading.gif +0 -0
- data/img/lightbox/next.png +0 -0
- data/img/lightbox/prev.png +0 -0
- data/img/loading.gif +0 -0
- data/img/logo.png +0 -0
- data/img/misc-bg.jpg +0 -0
- data/img/postcover/pc001.jpg +0 -0
- data/img/postcover/pc002.jpg +0 -0
- data/img/postcover/pc003.jpg +0 -0
- data/img/postcover/pc004.jpg +0 -0
- data/img/postcover/pc005.jpg +0 -0
- data/img/postcover/pc006.jpg +0 -0
- data/img/postcover/pc007.jpg +0 -0
- data/img/postcover/pc008.jpg +0 -0
- data/img/right-arrow.svg +36 -0
- data/img/siteicon.png +0 -0
- data/img/watermark-1900x1900-alt.png +0 -0
- data/img/watermark-1900x1900.png +0 -0
- data/img/watermark-800x800.png +0 -0
- data/img/writing-bg.jpg +0 -0
- data/js/dripload.js +37 -0
- data/js/fullcart.js +22 -0
- data/js/isotope.pkgd.min.js +8 -0
- data/js/jquery.cycle.min.js +1 -0
- data/js/jquery.isotope.min.js +13 -0
- data/js/jquery.lazylinepainter.min.js +17 -0
- data/js/jquery.magnific-popup.js +1861 -0
- data/js/jquery.mousewheel.min.js +8 -0
- data/js/jquery.tinycarousel.min.js +7 -0
- data/js/kenburns.min.js +6 -0
- data/js/main.min.js +588 -0
- data/js/modernizr.js +2 -0
- data/js/owlcarousel/.gitattributes +5 -0
- data/js/owlcarousel/.gitignore +18 -0
- data/js/owlcarousel/.travis.yml +14 -0
- data/js/owlcarousel/CONTRIBUTING.md +88 -0
- data/js/owlcarousel/Gruntfile.js +320 -0
- data/js/owlcarousel/ISSUE_TEMPLATE.md +14 -0
- data/js/owlcarousel/LICENSE +23 -0
- data/js/owlcarousel/README.md +122 -0
- data/js/owlcarousel/ROADMAP.md +57 -0
- data/js/owlcarousel/_config.json +30 -0
- data/js/owlcarousel/bower.json +13 -0
- data/js/owlcarousel/dist/LICENSE +23 -0
- data/js/owlcarousel/dist/README.md +122 -0
- data/js/owlcarousel/dist/assets/ajax-loader.gif +0 -0
- data/js/owlcarousel/dist/assets/owl.carousel.css +186 -0
- data/js/owlcarousel/dist/assets/owl.carousel.min.css +6 -0
- data/js/owlcarousel/dist/assets/owl.theme.default.css +50 -0
- data/js/owlcarousel/dist/assets/owl.theme.default.min.css +6 -0
- data/js/owlcarousel/dist/assets/owl.theme.green.css +50 -0
- data/js/owlcarousel/dist/assets/owl.theme.green.min.css +6 -0
- data/js/owlcarousel/dist/assets/owl.video.play.png +0 -0
- data/js/owlcarousel/dist/owl.carousel.js +3448 -0
- data/js/owlcarousel/dist/owl.carousel.min.js +7 -0
- data/js/owlcarousel/docs/assets/css/animate.css +3303 -0
- data/js/owlcarousel/docs/assets/css/docs.theme.min.css +1 -0
- data/js/owlcarousel/docs/assets/img/bird_blue_32.png +0 -0
- data/js/owlcarousel/docs/assets/img/download.png +0 -0
- data/js/owlcarousel/docs/assets/img/feature-drag.png +0 -0
- data/js/owlcarousel/docs/assets/img/feature-modern.png +0 -0
- data/js/owlcarousel/docs/assets/img/feature-module.png +0 -0
- data/js/owlcarousel/docs/assets/img/feature-options.png +0 -0
- data/js/owlcarousel/docs/assets/img/feature-responsive.png +0 -0
- data/js/owlcarousel/docs/assets/img/feature-zombie.png +0 -0
- data/js/owlcarousel/docs/assets/img/owl-logo.png +0 -0
- data/js/owlcarousel/docs/assets/img/twitter_25.png +0 -0
- data/js/owlcarousel/docs/assets/js/app.js +32 -0
- data/js/owlcarousel/docs/assets/js/foundation.min.js +3 -0
- data/js/owlcarousel/docs/assets/owlcarousel/README.md +122 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/ajax-loader.gif +0 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/owl.carousel.css +186 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/owl.carousel.min.css +6 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/owl.theme.default.css +50 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/owl.theme.default.min.css +6 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/owl.theme.green.css +50 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/owl.theme.green.min.css +6 -0
- data/js/owlcarousel/docs/assets/owlcarousel/assets/owl.video.play.png +0 -0
- data/js/owlcarousel/docs/assets/owlcarousel/owl.carousel.js +3448 -0
- data/js/owlcarousel/docs/assets/owlcarousel/owl.carousel.min.js +7 -0
- data/js/owlcarousel/docs/assets/vendors/foundation.min.js +3 -0
- data/js/owlcarousel/docs/assets/vendors/highlight.js +1 -0
- data/js/owlcarousel/docs/assets/vendors/jquery.min.js +2 -0
- data/js/owlcarousel/docs/assets/vendors/jquery.min.map +1 -0
- data/js/owlcarousel/docs/assets/vendors/jquery.mousewheel.min.js +8 -0
- data/js/owlcarousel/docs/demos/animate.html +272 -0
- data/js/owlcarousel/docs/demos/autoheight.html +165 -0
- data/js/owlcarousel/docs/demos/autoplay.html +186 -0
- data/js/owlcarousel/docs/demos/autowidth.html +185 -0
- data/js/owlcarousel/docs/demos/basic.html +199 -0
- data/js/owlcarousel/docs/demos/center.html +239 -0
- data/js/owlcarousel/docs/demos/demos.html +198 -0
- data/js/owlcarousel/docs/demos/events.html +207 -0
- data/js/owlcarousel/docs/demos/lazyLoad.html +165 -0
- data/js/owlcarousel/docs/demos/merge.html +202 -0
- data/js/owlcarousel/docs/demos/mousewheel.html +209 -0
- data/js/owlcarousel/docs/demos/responsive.html +297 -0
- data/js/owlcarousel/docs/demos/rtl.html +202 -0
- data/js/owlcarousel/docs/demos/stagepadding.html +202 -0
- data/js/owlcarousel/docs/demos/test.html +144 -0
- data/js/owlcarousel/docs/demos/urlhashnav.html +190 -0
- data/js/owlcarousel/docs/demos/video.html +189 -0
- data/js/owlcarousel/docs/docs/api-classes.html +227 -0
- data/js/owlcarousel/docs/docs/api-events.html +358 -0
- data/js/owlcarousel/docs/docs/api-options.html +395 -0
- data/js/owlcarousel/docs/docs/dev-buildin-plugins.html +157 -0
- data/js/owlcarousel/docs/docs/dev-external.html +151 -0
- data/js/owlcarousel/docs/docs/dev-plugin-api.html +160 -0
- data/js/owlcarousel/docs/docs/dev-styles.html +171 -0
- data/js/owlcarousel/docs/docs/started-faq.html +162 -0
- data/js/owlcarousel/docs/docs/started-installation.html +173 -0
- data/js/owlcarousel/docs/docs/started-welcome.html +196 -0
- data/js/owlcarousel/docs/docs/support-changelog.html +169 -0
- data/js/owlcarousel/docs/docs/support-contact.html +140 -0
- data/js/owlcarousel/docs/docs/support-contributing.html +162 -0
- data/js/owlcarousel/docs/index.html +239 -0
- data/js/owlcarousel/package-lock.json +6169 -0
- data/js/owlcarousel/package.json +57 -0
- data/js/owlcarousel/src/img/ajax-loader.gif +0 -0
- data/js/owlcarousel/src/img/owl.video.play.png +0 -0
- data/js/owlcarousel/src/js/.jscsrc +47 -0
- data/js/owlcarousel/src/js/.jshintrc +13 -0
- data/js/owlcarousel/src/js/owl.animate.js +121 -0
- data/js/owlcarousel/src/js/owl.autoheight.js +132 -0
- data/js/owlcarousel/src/js/owl.autoplay.js +233 -0
- data/js/owlcarousel/src/js/owl.autorefresh.js +111 -0
- data/js/owlcarousel/src/js/owl.carousel.js +1750 -0
- data/js/owlcarousel/src/js/owl.hash.js +122 -0
- data/js/owlcarousel/src/js/owl.lazyload.js +149 -0
- data/js/owlcarousel/src/js/owl.navigation.js +406 -0
- data/js/owlcarousel/src/js/owl.support.js +83 -0
- data/js/owlcarousel/src/js/owl.support.modernizr.js +66 -0
- data/js/owlcarousel/src/js/owl.video.js +327 -0
- data/js/owlcarousel/src/scss/_animate.scss +28 -0
- data/js/owlcarousel/src/scss/_autoheight.scss +7 -0
- data/js/owlcarousel/src/scss/_core.scss +126 -0
- data/js/owlcarousel/src/scss/_lazyload.scss +25 -0
- data/js/owlcarousel/src/scss/_theme.default.scss +30 -0
- data/js/owlcarousel/src/scss/_theme.green.scss +30 -0
- data/js/owlcarousel/src/scss/_theme.scss +64 -0
- data/js/owlcarousel/src/scss/_video.scss +53 -0
- data/js/owlcarousel/src/scss/owl.carousel.scss +5 -0
- data/js/owlcarousel/src/scss/owl.theme.default.scss +1 -0
- data/js/owlcarousel/src/scss/owl.theme.green.scss +1 -0
- data/js/owlcarousel/test/index.html +32 -0
- data/js/owlcarousel/test/unit/autoplay.js +86 -0
- data/js/owlcarousel/test/unit/core.js +140 -0
- data/js/retina.min.js +10 -0
- data/js/scripts.js +204 -0
- data/js/super-search.js +136 -0
- data/js/zepto.min.js +2 -0
- metadata +176 -1
@@ -0,0 +1,122 @@
|
|
1
|
+
/**
|
2
|
+
* Hash Plugin
|
3
|
+
* @version 2.3.4
|
4
|
+
* @author Artus Kolanowski
|
5
|
+
* @author David Deutsch
|
6
|
+
* @license The MIT License (MIT)
|
7
|
+
*/
|
8
|
+
;(function($, window, document, undefined) {
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Creates the hash plugin.
|
13
|
+
* @class The Hash Plugin
|
14
|
+
* @param {Owl} carousel - The Owl Carousel
|
15
|
+
*/
|
16
|
+
var Hash = function(carousel) {
|
17
|
+
/**
|
18
|
+
* Reference to the core.
|
19
|
+
* @protected
|
20
|
+
* @type {Owl}
|
21
|
+
*/
|
22
|
+
this._core = carousel;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Hash index for the items.
|
26
|
+
* @protected
|
27
|
+
* @type {Object}
|
28
|
+
*/
|
29
|
+
this._hashes = {};
|
30
|
+
|
31
|
+
/**
|
32
|
+
* The carousel element.
|
33
|
+
* @type {jQuery}
|
34
|
+
*/
|
35
|
+
this.$element = this._core.$element;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* All event handlers.
|
39
|
+
* @protected
|
40
|
+
* @type {Object}
|
41
|
+
*/
|
42
|
+
this._handlers = {
|
43
|
+
'initialized.owl.carousel': $.proxy(function(e) {
|
44
|
+
if (e.namespace && this._core.settings.startPosition === 'URLHash') {
|
45
|
+
$(window).trigger('hashchange.owl.navigation');
|
46
|
+
}
|
47
|
+
}, this),
|
48
|
+
'prepared.owl.carousel': $.proxy(function(e) {
|
49
|
+
if (e.namespace) {
|
50
|
+
var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
|
51
|
+
|
52
|
+
if (!hash) {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
|
56
|
+
this._hashes[hash] = e.content;
|
57
|
+
}
|
58
|
+
}, this),
|
59
|
+
'changed.owl.carousel': $.proxy(function(e) {
|
60
|
+
if (e.namespace && e.property.name === 'position') {
|
61
|
+
var current = this._core.items(this._core.relative(this._core.current())),
|
62
|
+
hash = $.map(this._hashes, function(item, hash) {
|
63
|
+
return item === current ? hash : null;
|
64
|
+
}).join();
|
65
|
+
|
66
|
+
if (!hash || window.location.hash.slice(1) === hash) {
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
|
70
|
+
window.location.hash = hash;
|
71
|
+
}
|
72
|
+
}, this)
|
73
|
+
};
|
74
|
+
|
75
|
+
// set default options
|
76
|
+
this._core.options = $.extend({}, Hash.Defaults, this._core.options);
|
77
|
+
|
78
|
+
// register the event handlers
|
79
|
+
this.$element.on(this._handlers);
|
80
|
+
|
81
|
+
// register event listener for hash navigation
|
82
|
+
$(window).on('hashchange.owl.navigation', $.proxy(function(e) {
|
83
|
+
var hash = window.location.hash.substring(1),
|
84
|
+
items = this._core.$stage.children(),
|
85
|
+
position = this._hashes[hash] && items.index(this._hashes[hash]);
|
86
|
+
|
87
|
+
if (position === undefined || position === this._core.current()) {
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
|
91
|
+
this._core.to(this._core.relative(position), false, true);
|
92
|
+
}, this));
|
93
|
+
};
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Default options.
|
97
|
+
* @public
|
98
|
+
*/
|
99
|
+
Hash.Defaults = {
|
100
|
+
URLhashListener: false
|
101
|
+
};
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Destroys the plugin.
|
105
|
+
* @public
|
106
|
+
*/
|
107
|
+
Hash.prototype.destroy = function() {
|
108
|
+
var handler, property;
|
109
|
+
|
110
|
+
$(window).off('hashchange.owl.navigation');
|
111
|
+
|
112
|
+
for (handler in this._handlers) {
|
113
|
+
this._core.$element.off(handler, this._handlers[handler]);
|
114
|
+
}
|
115
|
+
for (property in Object.getOwnPropertyNames(this)) {
|
116
|
+
typeof this[property] != 'function' && (this[property] = null);
|
117
|
+
}
|
118
|
+
};
|
119
|
+
|
120
|
+
$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
|
121
|
+
|
122
|
+
})(window.Zepto || window.jQuery, window, document);
|
@@ -0,0 +1,149 @@
|
|
1
|
+
/**
|
2
|
+
* Lazy Plugin
|
3
|
+
* @version 2.3.4
|
4
|
+
* @author Bartosz Wojciechowski
|
5
|
+
* @author David Deutsch
|
6
|
+
* @license The MIT License (MIT)
|
7
|
+
*/
|
8
|
+
;(function($, window, document, undefined) {
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Creates the lazy plugin.
|
12
|
+
* @class The Lazy Plugin
|
13
|
+
* @param {Owl} carousel - The Owl Carousel
|
14
|
+
*/
|
15
|
+
var Lazy = function(carousel) {
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Reference to the core.
|
19
|
+
* @protected
|
20
|
+
* @type {Owl}
|
21
|
+
*/
|
22
|
+
this._core = carousel;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Already loaded items.
|
26
|
+
* @protected
|
27
|
+
* @type {Array.<jQuery>}
|
28
|
+
*/
|
29
|
+
this._loaded = [];
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Event handlers.
|
33
|
+
* @protected
|
34
|
+
* @type {Object}
|
35
|
+
*/
|
36
|
+
this._handlers = {
|
37
|
+
'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
|
38
|
+
if (!e.namespace) {
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
|
42
|
+
if (!this._core.settings || !this._core.settings.lazyLoad) {
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
|
46
|
+
if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
|
47
|
+
var settings = this._core.settings,
|
48
|
+
n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
|
49
|
+
i = ((settings.center && n * -1) || 0),
|
50
|
+
position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
|
51
|
+
clones = this._core.clones().length,
|
52
|
+
load = $.proxy(function(i, v) { this.load(v) }, this);
|
53
|
+
//TODO: Need documentation for this new option
|
54
|
+
if (settings.lazyLoadEager > 0) {
|
55
|
+
n += settings.lazyLoadEager;
|
56
|
+
// If the carousel is looping also preload images that are to the "left"
|
57
|
+
if (settings.loop) {
|
58
|
+
position -= settings.lazyLoadEager;
|
59
|
+
n++;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
while (i++ < n) {
|
64
|
+
this.load(clones / 2 + this._core.relative(position));
|
65
|
+
clones && $.each(this._core.clones(this._core.relative(position)), load);
|
66
|
+
position++;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}, this)
|
70
|
+
};
|
71
|
+
|
72
|
+
// set the default options
|
73
|
+
this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
|
74
|
+
|
75
|
+
// register event handler
|
76
|
+
this._core.$element.on(this._handlers);
|
77
|
+
};
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Default options.
|
81
|
+
* @public
|
82
|
+
*/
|
83
|
+
Lazy.Defaults = {
|
84
|
+
lazyLoad: false,
|
85
|
+
lazyLoadEager: 0
|
86
|
+
};
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Loads all resources of an item at the specified position.
|
90
|
+
* @param {Number} position - The absolute position of the item.
|
91
|
+
* @protected
|
92
|
+
*/
|
93
|
+
Lazy.prototype.load = function(position) {
|
94
|
+
var $item = this._core.$stage.children().eq(position),
|
95
|
+
$elements = $item && $item.find('.owl-lazy');
|
96
|
+
|
97
|
+
if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
|
98
|
+
return;
|
99
|
+
}
|
100
|
+
|
101
|
+
$elements.each($.proxy(function(index, element) {
|
102
|
+
var $element = $(element), image,
|
103
|
+
url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
|
104
|
+
|
105
|
+
this._core.trigger('load', { element: $element, url: url }, 'lazy');
|
106
|
+
|
107
|
+
if ($element.is('img')) {
|
108
|
+
$element.one('load.owl.lazy', $.proxy(function() {
|
109
|
+
$element.css('opacity', 1);
|
110
|
+
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
111
|
+
}, this)).attr('src', url);
|
112
|
+
} else if ($element.is('source')) {
|
113
|
+
$element.one('load.owl.lazy', $.proxy(function() {
|
114
|
+
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
115
|
+
}, this)).attr('srcset', url);
|
116
|
+
} else {
|
117
|
+
image = new Image();
|
118
|
+
image.onload = $.proxy(function() {
|
119
|
+
$element.css({
|
120
|
+
'background-image': 'url("' + url + '")',
|
121
|
+
'opacity': '1'
|
122
|
+
});
|
123
|
+
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
124
|
+
}, this);
|
125
|
+
image.src = url;
|
126
|
+
}
|
127
|
+
}, this));
|
128
|
+
|
129
|
+
this._loaded.push($item.get(0));
|
130
|
+
};
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Destroys the plugin.
|
134
|
+
* @public
|
135
|
+
*/
|
136
|
+
Lazy.prototype.destroy = function() {
|
137
|
+
var handler, property;
|
138
|
+
|
139
|
+
for (handler in this.handlers) {
|
140
|
+
this._core.$element.off(handler, this.handlers[handler]);
|
141
|
+
}
|
142
|
+
for (property in Object.getOwnPropertyNames(this)) {
|
143
|
+
typeof this[property] != 'function' && (this[property] = null);
|
144
|
+
}
|
145
|
+
};
|
146
|
+
|
147
|
+
$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
|
148
|
+
|
149
|
+
})(window.Zepto || window.jQuery, window, document);
|
@@ -0,0 +1,406 @@
|
|
1
|
+
/**
|
2
|
+
* Navigation Plugin
|
3
|
+
* @version 2.3.4
|
4
|
+
* @author Artus Kolanowski
|
5
|
+
* @author David Deutsch
|
6
|
+
* @license The MIT License (MIT)
|
7
|
+
*/
|
8
|
+
;(function($, window, document, undefined) {
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Creates the navigation plugin.
|
13
|
+
* @class The Navigation Plugin
|
14
|
+
* @param {Owl} carousel - The Owl Carousel.
|
15
|
+
*/
|
16
|
+
var Navigation = function(carousel) {
|
17
|
+
/**
|
18
|
+
* Reference to the core.
|
19
|
+
* @protected
|
20
|
+
* @type {Owl}
|
21
|
+
*/
|
22
|
+
this._core = carousel;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Indicates whether the plugin is initialized or not.
|
26
|
+
* @protected
|
27
|
+
* @type {Boolean}
|
28
|
+
*/
|
29
|
+
this._initialized = false;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* The current paging indexes.
|
33
|
+
* @protected
|
34
|
+
* @type {Array}
|
35
|
+
*/
|
36
|
+
this._pages = [];
|
37
|
+
|
38
|
+
/**
|
39
|
+
* All DOM elements of the user interface.
|
40
|
+
* @protected
|
41
|
+
* @type {Object}
|
42
|
+
*/
|
43
|
+
this._controls = {};
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Markup for an indicator.
|
47
|
+
* @protected
|
48
|
+
* @type {Array.<String>}
|
49
|
+
*/
|
50
|
+
this._templates = [];
|
51
|
+
|
52
|
+
/**
|
53
|
+
* The carousel element.
|
54
|
+
* @type {jQuery}
|
55
|
+
*/
|
56
|
+
this.$element = this._core.$element;
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Overridden methods of the carousel.
|
60
|
+
* @protected
|
61
|
+
* @type {Object}
|
62
|
+
*/
|
63
|
+
this._overrides = {
|
64
|
+
next: this._core.next,
|
65
|
+
prev: this._core.prev,
|
66
|
+
to: this._core.to
|
67
|
+
};
|
68
|
+
|
69
|
+
/**
|
70
|
+
* All event handlers.
|
71
|
+
* @protected
|
72
|
+
* @type {Object}
|
73
|
+
*/
|
74
|
+
this._handlers = {
|
75
|
+
'prepared.owl.carousel': $.proxy(function(e) {
|
76
|
+
if (e.namespace && this._core.settings.dotsData) {
|
77
|
+
this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
|
78
|
+
$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
|
79
|
+
}
|
80
|
+
}, this),
|
81
|
+
'added.owl.carousel': $.proxy(function(e) {
|
82
|
+
if (e.namespace && this._core.settings.dotsData) {
|
83
|
+
this._templates.splice(e.position, 0, this._templates.pop());
|
84
|
+
}
|
85
|
+
}, this),
|
86
|
+
'remove.owl.carousel': $.proxy(function(e) {
|
87
|
+
if (e.namespace && this._core.settings.dotsData) {
|
88
|
+
this._templates.splice(e.position, 1);
|
89
|
+
}
|
90
|
+
}, this),
|
91
|
+
'changed.owl.carousel': $.proxy(function(e) {
|
92
|
+
if (e.namespace && e.property.name == 'position') {
|
93
|
+
this.draw();
|
94
|
+
}
|
95
|
+
}, this),
|
96
|
+
'initialized.owl.carousel': $.proxy(function(e) {
|
97
|
+
if (e.namespace && !this._initialized) {
|
98
|
+
this._core.trigger('initialize', null, 'navigation');
|
99
|
+
this.initialize();
|
100
|
+
this.update();
|
101
|
+
this.draw();
|
102
|
+
this._initialized = true;
|
103
|
+
this._core.trigger('initialized', null, 'navigation');
|
104
|
+
}
|
105
|
+
}, this),
|
106
|
+
'refreshed.owl.carousel': $.proxy(function(e) {
|
107
|
+
if (e.namespace && this._initialized) {
|
108
|
+
this._core.trigger('refresh', null, 'navigation');
|
109
|
+
this.update();
|
110
|
+
this.draw();
|
111
|
+
this._core.trigger('refreshed', null, 'navigation');
|
112
|
+
}
|
113
|
+
}, this)
|
114
|
+
};
|
115
|
+
|
116
|
+
// set default options
|
117
|
+
this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
|
118
|
+
|
119
|
+
// register event handlers
|
120
|
+
this.$element.on(this._handlers);
|
121
|
+
};
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Default options.
|
125
|
+
* @public
|
126
|
+
* @todo Rename `slideBy` to `navBy`
|
127
|
+
*/
|
128
|
+
Navigation.Defaults = {
|
129
|
+
nav: false,
|
130
|
+
navText: [
|
131
|
+
'<span aria-label="' + 'Previous' + '">‹</span>',
|
132
|
+
'<span aria-label="' + 'Next' + '">›</span>'
|
133
|
+
],
|
134
|
+
navSpeed: false,
|
135
|
+
navElement: 'button type="button" role="presentation"',
|
136
|
+
navContainer: false,
|
137
|
+
navContainerClass: 'owl-nav',
|
138
|
+
navClass: [
|
139
|
+
'owl-prev',
|
140
|
+
'owl-next'
|
141
|
+
],
|
142
|
+
slideBy: 1,
|
143
|
+
dotClass: 'owl-dot',
|
144
|
+
dotsClass: 'owl-dots',
|
145
|
+
dots: true,
|
146
|
+
dotsEach: false,
|
147
|
+
dotsData: false,
|
148
|
+
dotsSpeed: false,
|
149
|
+
dotsContainer: false
|
150
|
+
};
|
151
|
+
|
152
|
+
/**
|
153
|
+
* Initializes the layout of the plugin and extends the carousel.
|
154
|
+
* @protected
|
155
|
+
*/
|
156
|
+
Navigation.prototype.initialize = function() {
|
157
|
+
var override,
|
158
|
+
settings = this._core.settings;
|
159
|
+
|
160
|
+
// create DOM structure for relative navigation
|
161
|
+
this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
|
162
|
+
: $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
|
163
|
+
|
164
|
+
this._controls.$previous = $('<' + settings.navElement + '>')
|
165
|
+
.addClass(settings.navClass[0])
|
166
|
+
.html(settings.navText[0])
|
167
|
+
.prependTo(this._controls.$relative)
|
168
|
+
.on('click', $.proxy(function(e) {
|
169
|
+
this.prev(settings.navSpeed);
|
170
|
+
}, this));
|
171
|
+
this._controls.$next = $('<' + settings.navElement + '>')
|
172
|
+
.addClass(settings.navClass[1])
|
173
|
+
.html(settings.navText[1])
|
174
|
+
.appendTo(this._controls.$relative)
|
175
|
+
.on('click', $.proxy(function(e) {
|
176
|
+
this.next(settings.navSpeed);
|
177
|
+
}, this));
|
178
|
+
|
179
|
+
// create DOM structure for absolute navigation
|
180
|
+
if (!settings.dotsData) {
|
181
|
+
this._templates = [ $('<button role="button">')
|
182
|
+
.addClass(settings.dotClass)
|
183
|
+
.append($('<span>'))
|
184
|
+
.prop('outerHTML') ];
|
185
|
+
}
|
186
|
+
|
187
|
+
this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
|
188
|
+
: $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
|
189
|
+
|
190
|
+
this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
|
191
|
+
var index = $(e.target).parent().is(this._controls.$absolute)
|
192
|
+
? $(e.target).index() : $(e.target).parent().index();
|
193
|
+
|
194
|
+
e.preventDefault();
|
195
|
+
|
196
|
+
this.to(index, settings.dotsSpeed);
|
197
|
+
}, this));
|
198
|
+
|
199
|
+
/*$el.on('focusin', function() {
|
200
|
+
$(document).off(".carousel");
|
201
|
+
|
202
|
+
$(document).on('keydown.carousel', function(e) {
|
203
|
+
if(e.keyCode == 37) {
|
204
|
+
$el.trigger('prev.owl')
|
205
|
+
}
|
206
|
+
if(e.keyCode == 39) {
|
207
|
+
$el.trigger('next.owl')
|
208
|
+
}
|
209
|
+
});
|
210
|
+
});*/
|
211
|
+
|
212
|
+
// override public methods of the carousel
|
213
|
+
for (override in this._overrides) {
|
214
|
+
this._core[override] = $.proxy(this[override], this);
|
215
|
+
}
|
216
|
+
};
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Destroys the plugin.
|
220
|
+
* @protected
|
221
|
+
*/
|
222
|
+
Navigation.prototype.destroy = function() {
|
223
|
+
var handler, control, property, override, settings;
|
224
|
+
settings = this._core.settings;
|
225
|
+
|
226
|
+
for (handler in this._handlers) {
|
227
|
+
this.$element.off(handler, this._handlers[handler]);
|
228
|
+
}
|
229
|
+
for (control in this._controls) {
|
230
|
+
if (control === '$relative' && settings.navContainer) {
|
231
|
+
this._controls[control].html('');
|
232
|
+
} else {
|
233
|
+
this._controls[control].remove();
|
234
|
+
}
|
235
|
+
}
|
236
|
+
for (override in this.overides) {
|
237
|
+
this._core[override] = this._overrides[override];
|
238
|
+
}
|
239
|
+
for (property in Object.getOwnPropertyNames(this)) {
|
240
|
+
typeof this[property] != 'function' && (this[property] = null);
|
241
|
+
}
|
242
|
+
};
|
243
|
+
|
244
|
+
/**
|
245
|
+
* Updates the internal state.
|
246
|
+
* @protected
|
247
|
+
*/
|
248
|
+
Navigation.prototype.update = function() {
|
249
|
+
var i, j, k,
|
250
|
+
lower = this._core.clones().length / 2,
|
251
|
+
upper = lower + this._core.items().length,
|
252
|
+
maximum = this._core.maximum(true),
|
253
|
+
settings = this._core.settings,
|
254
|
+
size = settings.center || settings.autoWidth || settings.dotsData
|
255
|
+
? 1 : settings.dotsEach || settings.items;
|
256
|
+
|
257
|
+
if (settings.slideBy !== 'page') {
|
258
|
+
settings.slideBy = Math.min(settings.slideBy, settings.items);
|
259
|
+
}
|
260
|
+
|
261
|
+
if (settings.dots || settings.slideBy == 'page') {
|
262
|
+
this._pages = [];
|
263
|
+
|
264
|
+
for (i = lower, j = 0, k = 0; i < upper; i++) {
|
265
|
+
if (j >= size || j === 0) {
|
266
|
+
this._pages.push({
|
267
|
+
start: Math.min(maximum, i - lower),
|
268
|
+
end: i - lower + size - 1
|
269
|
+
});
|
270
|
+
if (Math.min(maximum, i - lower) === maximum) {
|
271
|
+
break;
|
272
|
+
}
|
273
|
+
j = 0, ++k;
|
274
|
+
}
|
275
|
+
j += this._core.mergers(this._core.relative(i));
|
276
|
+
}
|
277
|
+
}
|
278
|
+
};
|
279
|
+
|
280
|
+
/**
|
281
|
+
* Draws the user interface.
|
282
|
+
* @todo The option `dotsData` wont work.
|
283
|
+
* @protected
|
284
|
+
*/
|
285
|
+
Navigation.prototype.draw = function() {
|
286
|
+
var difference,
|
287
|
+
settings = this._core.settings,
|
288
|
+
disabled = this._core.items().length <= settings.items,
|
289
|
+
index = this._core.relative(this._core.current()),
|
290
|
+
loop = settings.loop || settings.rewind;
|
291
|
+
|
292
|
+
this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
|
293
|
+
|
294
|
+
if (settings.nav) {
|
295
|
+
this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
|
296
|
+
this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
|
297
|
+
}
|
298
|
+
|
299
|
+
this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
|
300
|
+
|
301
|
+
if (settings.dots) {
|
302
|
+
difference = this._pages.length - this._controls.$absolute.children().length;
|
303
|
+
|
304
|
+
if (settings.dotsData && difference !== 0) {
|
305
|
+
this._controls.$absolute.html(this._templates.join(''));
|
306
|
+
} else if (difference > 0) {
|
307
|
+
this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
|
308
|
+
} else if (difference < 0) {
|
309
|
+
this._controls.$absolute.children().slice(difference).remove();
|
310
|
+
}
|
311
|
+
|
312
|
+
this._controls.$absolute.find('.active').removeClass('active');
|
313
|
+
this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
|
314
|
+
}
|
315
|
+
};
|
316
|
+
|
317
|
+
/**
|
318
|
+
* Extends event data.
|
319
|
+
* @protected
|
320
|
+
* @param {Event} event - The event object which gets thrown.
|
321
|
+
*/
|
322
|
+
Navigation.prototype.onTrigger = function(event) {
|
323
|
+
var settings = this._core.settings;
|
324
|
+
|
325
|
+
event.page = {
|
326
|
+
index: $.inArray(this.current(), this._pages),
|
327
|
+
count: this._pages.length,
|
328
|
+
size: settings && (settings.center || settings.autoWidth || settings.dotsData
|
329
|
+
? 1 : settings.dotsEach || settings.items)
|
330
|
+
};
|
331
|
+
};
|
332
|
+
|
333
|
+
/**
|
334
|
+
* Gets the current page position of the carousel.
|
335
|
+
* @protected
|
336
|
+
* @returns {Number}
|
337
|
+
*/
|
338
|
+
Navigation.prototype.current = function() {
|
339
|
+
var current = this._core.relative(this._core.current());
|
340
|
+
return $.grep(this._pages, $.proxy(function(page, index) {
|
341
|
+
return page.start <= current && page.end >= current;
|
342
|
+
}, this)).pop();
|
343
|
+
};
|
344
|
+
|
345
|
+
/**
|
346
|
+
* Gets the current succesor/predecessor position.
|
347
|
+
* @protected
|
348
|
+
* @returns {Number}
|
349
|
+
*/
|
350
|
+
Navigation.prototype.getPosition = function(successor) {
|
351
|
+
var position, length,
|
352
|
+
settings = this._core.settings;
|
353
|
+
|
354
|
+
if (settings.slideBy == 'page') {
|
355
|
+
position = $.inArray(this.current(), this._pages);
|
356
|
+
length = this._pages.length;
|
357
|
+
successor ? ++position : --position;
|
358
|
+
position = this._pages[((position % length) + length) % length].start;
|
359
|
+
} else {
|
360
|
+
position = this._core.relative(this._core.current());
|
361
|
+
length = this._core.items().length;
|
362
|
+
successor ? position += settings.slideBy : position -= settings.slideBy;
|
363
|
+
}
|
364
|
+
|
365
|
+
return position;
|
366
|
+
};
|
367
|
+
|
368
|
+
/**
|
369
|
+
* Slides to the next item or page.
|
370
|
+
* @public
|
371
|
+
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
372
|
+
*/
|
373
|
+
Navigation.prototype.next = function(speed) {
|
374
|
+
$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
|
375
|
+
};
|
376
|
+
|
377
|
+
/**
|
378
|
+
* Slides to the previous item or page.
|
379
|
+
* @public
|
380
|
+
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
381
|
+
*/
|
382
|
+
Navigation.prototype.prev = function(speed) {
|
383
|
+
$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
|
384
|
+
};
|
385
|
+
|
386
|
+
/**
|
387
|
+
* Slides to the specified item or page.
|
388
|
+
* @public
|
389
|
+
* @param {Number} position - The position of the item or page.
|
390
|
+
* @param {Number} [speed] - The time in milliseconds for the transition.
|
391
|
+
* @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
|
392
|
+
*/
|
393
|
+
Navigation.prototype.to = function(position, speed, standard) {
|
394
|
+
var length;
|
395
|
+
|
396
|
+
if (!standard && this._pages.length) {
|
397
|
+
length = this._pages.length;
|
398
|
+
$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
|
399
|
+
} else {
|
400
|
+
$.proxy(this._overrides.to, this._core)(position, speed);
|
401
|
+
}
|
402
|
+
};
|
403
|
+
|
404
|
+
$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
|
405
|
+
|
406
|
+
})(window.Zepto || window.jQuery, window, document);
|