va_common 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -4
- data/app/assets/js/va_common_main.js +16 -1
- data/lib/va_common/version.rb +1 -1
- data/lib/va_common.rb +4 -0
- data/va_common.gemspec +15 -0
- metadata +200 -177
- data/app/assets/js/foundation/foundation.abide.js +0 -408
- data/app/assets/js/foundation/foundation.accordion.js +0 -88
- data/app/assets/js/foundation/foundation.alert.js +0 -43
- data/app/assets/js/foundation/foundation.clearing.js +0 -586
- data/app/assets/js/foundation/foundation.dropdown.js +0 -463
- data/app/assets/js/foundation/foundation.equalizer.js +0 -104
- data/app/assets/js/foundation/foundation.interchange.js +0 -359
- data/app/assets/js/foundation/foundation.joyride.js +0 -932
- data/app/assets/js/foundation/foundation.js +0 -725
- data/app/assets/js/foundation/foundation.magellan.js +0 -215
- data/app/assets/js/foundation/foundation.offcanvas.js +0 -152
- data/app/assets/js/foundation/foundation.orbit.js +0 -476
- data/app/assets/js/foundation/foundation.reveal.js +0 -498
- data/app/assets/js/foundation/foundation.slider.js +0 -281
- data/app/assets/js/foundation/foundation.tab.js +0 -249
- data/app/assets/js/foundation/foundation.tooltip.js +0 -339
- data/app/assets/js/foundation/foundation.topbar.js +0 -458
- data/app/assets/js/foundation.min.js +0 -6376
- data/app/assets/js/vendor/html5shiv.js +0 -8
- data/app/assets/js/vendor/jquery-1.11.0.min.js +0 -4
- data/app/assets/js/vendor/jquery.js +0 -9789
- data/app/assets/js/vendor/jquery.smooth-scroll.js +0 -255
- data/app/assets/js/vendor/jquery.stellar.js +0 -651
- data/app/assets/js/vendor/jquery.tipsy.js +0 -258
- data/app/assets/js/vendor/menu.js +0 -40
- data/app/assets/js/vendor/modernizr.custom.js +0 -4
- data/app/assets/js/vendor/respond.min.js +0 -6
- data/app/assets/js/vendor/selectivizr-1.0.3b.js +0 -560
- data/app/assets/js/vendor/tota11y.min.js +0 -28
- data/app/assets/js/vendor/wow.min.js +0 -2
- data/app/assets/stylesheets/foundation/_functions.scss +0 -146
- data/app/assets/stylesheets/foundation/_settings.scss +0 -1467
- data/app/assets/stylesheets/foundation/_variables.scss +0 -1286
- data/app/assets/stylesheets/foundation/components/_accordion.scss +0 -157
- data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +0 -128
- data/app/assets/stylesheets/foundation/components/_block-grid.scss +0 -132
- data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
- data/app/assets/stylesheets/foundation/components/_button-groups.scss +0 -200
- data/app/assets/stylesheets/foundation/components/_buttons.scss +0 -259
- data/app/assets/stylesheets/foundation/components/_clearing.scss +0 -256
- data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -131
- data/app/assets/stylesheets/foundation/components/_dropdown.scss +0 -262
- data/app/assets/stylesheets/foundation/components/_flex-video.scss +0 -51
- data/app/assets/stylesheets/foundation/components/_forms.scss +0 -570
- data/app/assets/stylesheets/foundation/components/_global.scss +0 -481
- data/app/assets/stylesheets/foundation/components/_grid.scss +0 -289
- data/app/assets/stylesheets/foundation/components/_icon-bar.scss +0 -358
- data/app/assets/stylesheets/foundation/components/_inline-lists.scss +0 -57
- data/app/assets/stylesheets/foundation/components/_joyride.scss +0 -222
- data/app/assets/stylesheets/foundation/components/_keystrokes.scss +0 -61
- data/app/assets/stylesheets/foundation/components/_labels.scss +0 -106
- data/app/assets/stylesheets/foundation/components/_magellan.scss +0 -34
- data/app/assets/stylesheets/foundation/components/_offcanvas.scss +0 -515
- data/app/assets/stylesheets/foundation/components/_orbit.scss +0 -368
- data/app/assets/stylesheets/foundation/components/_pagination.scss +0 -162
- data/app/assets/stylesheets/foundation/components/_panels.scss +0 -101
- data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -150
- data/app/assets/stylesheets/foundation/components/_progress-bars.scss +0 -79
- data/app/assets/stylesheets/foundation/components/_range-slider.scss +0 -169
- data/app/assets/stylesheets/foundation/components/_reveal.scss +0 -202
- data/app/assets/stylesheets/foundation/components/_side-nav.scss +0 -116
- data/app/assets/stylesheets/foundation/components/_split-buttons.scss +0 -199
- data/app/assets/stylesheets/foundation/components/_sub-nav.scss +0 -123
- data/app/assets/stylesheets/foundation/components/_switches.scss +0 -238
- data/app/assets/stylesheets/foundation/components/_tables.scss +0 -135
- data/app/assets/stylesheets/foundation/components/_tabs.scss +0 -123
- data/app/assets/stylesheets/foundation/components/_thumbs.scss +0 -66
- data/app/assets/stylesheets/foundation/components/_toolbar.scss +0 -70
- data/app/assets/stylesheets/foundation/components/_tooltips.scss +0 -142
- data/app/assets/stylesheets/foundation/components/_top-bar.scss +0 -691
- data/app/assets/stylesheets/foundation/components/_type.scss +0 -525
- data/app/assets/stylesheets/foundation/components/_visibility.scss +0 -408
- data/app/assets/stylesheets/lib/_normalize.scss +0 -427
- data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +0 -411
- data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +0 -87
- data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +0 -48
- data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +0 -64
- data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +0 -30
- data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +0 -31
- data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +0 -27
- data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +0 -48
- data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +0 -66
- data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +0 -51
- data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +0 -112
- data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +0 -34
- data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +0 -63
- data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +0 -29
- data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +0 -43
- data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +0 -3
- data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +0 -3
- data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +0 -42
- data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +0 -55
- data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +0 -59
- data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +0 -47
- data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +0 -287
- data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +0 -24
- data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +0 -10
- data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +0 -4
- data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +0 -14
- data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +0 -36
- data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +0 -38
- data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +0 -8
- data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +0 -8
- data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +0 -39
- data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +0 -42
- data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +0 -19
- data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +0 -15
- data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +0 -71
- data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +0 -3
- data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +0 -11
- data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +0 -20
- data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +0 -11
- data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +0 -21
- data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +0 -11
- data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +0 -13
- data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +0 -69
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +0 -13
- data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +0 -15
- data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +0 -24
- data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +0 -17
- data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +0 -24
- data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +0 -22
- data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +0 -27
- data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +0 -21
- data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +0 -96
- data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +0 -43
- data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +0 -13
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +0 -25
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +0 -41
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +0 -61
- data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +0 -31
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +0 -69
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +0 -50
- data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +0 -18
- data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +0 -26
- data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +0 -10
- data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +0 -50
- data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +0 -7
- data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +0 -9
- data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +0 -1
- data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +0 -8
- data/app/assets/stylesheets/lib/neat/_neat.scss +0 -23
- data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +0 -49
- data/app/assets/stylesheets/lib/neat/functions/_private.scss +0 -114
- data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +0 -15
- data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +0 -33
- data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +0 -28
- data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +0 -22
- data/app/assets/stylesheets/lib/neat/grid/_media.scss +0 -92
- data/app/assets/stylesheets/lib/neat/grid/_omega.scss +0 -87
- data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +0 -38
- data/app/assets/stylesheets/lib/neat/grid/_pad.scss +0 -25
- data/app/assets/stylesheets/lib/neat/grid/_private.scss +0 -35
- data/app/assets/stylesheets/lib/neat/grid/_row.scss +0 -52
- data/app/assets/stylesheets/lib/neat/grid/_shift.scss +0 -50
- data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +0 -94
- data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +0 -97
- data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +0 -42
- data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +0 -13
- data/app/assets/stylesheets/lib/neat/settings/_grid.scss +0 -51
- data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +0 -27
- data/app/assets/stylesheets/va_common_main.css.scss +0 -18
- /data/app/assets/js/{vendor/scroll-settings.js → scroll-settings.js} +0 -0
- /data/app/assets/js/{vendor/stellar-settings.js → stellar-settings.js} +0 -0
@@ -1,476 +0,0 @@
|
|
1
|
-
;(function ($, window, document, undefined) {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
var noop = function () {};
|
5
|
-
|
6
|
-
var Orbit = function (el, settings) {
|
7
|
-
// Don't reinitialize plugin
|
8
|
-
if (el.hasClass(settings.slides_container_class)) {
|
9
|
-
return this;
|
10
|
-
}
|
11
|
-
|
12
|
-
var self = this,
|
13
|
-
container,
|
14
|
-
slides_container = el,
|
15
|
-
number_container,
|
16
|
-
bullets_container,
|
17
|
-
timer_container,
|
18
|
-
idx = 0,
|
19
|
-
animate,
|
20
|
-
timer,
|
21
|
-
locked = false,
|
22
|
-
adjust_height_after = false;
|
23
|
-
|
24
|
-
self.slides = function () {
|
25
|
-
return slides_container.children(settings.slide_selector);
|
26
|
-
};
|
27
|
-
|
28
|
-
self.slides().first().addClass(settings.active_slide_class);
|
29
|
-
|
30
|
-
self.update_slide_number = function (index) {
|
31
|
-
if (settings.slide_number) {
|
32
|
-
number_container.find('span:first').text(parseInt(index) + 1);
|
33
|
-
number_container.find('span:last').text(self.slides().length);
|
34
|
-
}
|
35
|
-
if (settings.bullets) {
|
36
|
-
bullets_container.children().removeClass(settings.bullets_active_class);
|
37
|
-
$(bullets_container.children().get(index)).addClass(settings.bullets_active_class);
|
38
|
-
}
|
39
|
-
};
|
40
|
-
|
41
|
-
self.update_active_link = function (index) {
|
42
|
-
var link = $('[data-orbit-link="' + self.slides().eq(index).attr('data-orbit-slide') + '"]');
|
43
|
-
link.siblings().removeClass(settings.bullets_active_class);
|
44
|
-
link.addClass(settings.bullets_active_class);
|
45
|
-
};
|
46
|
-
|
47
|
-
self.build_markup = function () {
|
48
|
-
slides_container.wrap('<div class="' + settings.container_class + '"></div>');
|
49
|
-
container = slides_container.parent();
|
50
|
-
slides_container.addClass(settings.slides_container_class);
|
51
|
-
|
52
|
-
if (settings.stack_on_small) {
|
53
|
-
container.addClass(settings.stack_on_small_class);
|
54
|
-
}
|
55
|
-
|
56
|
-
if (settings.navigation_arrows) {
|
57
|
-
container.append($('<a href="#"><span></span></a>').addClass(settings.prev_class));
|
58
|
-
container.append($('<a href="#"><span></span></a>').addClass(settings.next_class));
|
59
|
-
}
|
60
|
-
|
61
|
-
if (settings.timer) {
|
62
|
-
timer_container = $('<div>').addClass(settings.timer_container_class);
|
63
|
-
timer_container.append('<span>');
|
64
|
-
timer_container.append($('<div>').addClass(settings.timer_progress_class));
|
65
|
-
timer_container.addClass(settings.timer_paused_class);
|
66
|
-
container.append(timer_container);
|
67
|
-
}
|
68
|
-
|
69
|
-
if (settings.slide_number) {
|
70
|
-
number_container = $('<div>').addClass(settings.slide_number_class);
|
71
|
-
number_container.append('<span></span> ' + settings.slide_number_text + ' <span></span>');
|
72
|
-
container.append(number_container);
|
73
|
-
}
|
74
|
-
|
75
|
-
if (settings.bullets) {
|
76
|
-
bullets_container = $('<ol>').addClass(settings.bullets_container_class);
|
77
|
-
container.append(bullets_container);
|
78
|
-
bullets_container.wrap('<div class="orbit-bullets-container"></div>');
|
79
|
-
self.slides().each(function (idx, el) {
|
80
|
-
var bullet = $('<li>').attr('data-orbit-slide', idx).on('click', self.link_bullet);;
|
81
|
-
bullets_container.append(bullet);
|
82
|
-
});
|
83
|
-
}
|
84
|
-
|
85
|
-
};
|
86
|
-
|
87
|
-
self._goto = function (next_idx, start_timer) {
|
88
|
-
// if (locked) {return false;}
|
89
|
-
if (next_idx === idx) {return false;}
|
90
|
-
if (typeof timer === 'object') {timer.restart();}
|
91
|
-
var slides = self.slides();
|
92
|
-
|
93
|
-
var dir = 'next';
|
94
|
-
locked = true;
|
95
|
-
if (next_idx < idx) {dir = 'prev';}
|
96
|
-
if (next_idx >= slides.length) {
|
97
|
-
if (!settings.circular) {
|
98
|
-
return false;
|
99
|
-
}
|
100
|
-
next_idx = 0;
|
101
|
-
} else if (next_idx < 0) {
|
102
|
-
if (!settings.circular) {
|
103
|
-
return false;
|
104
|
-
}
|
105
|
-
next_idx = slides.length - 1;
|
106
|
-
}
|
107
|
-
|
108
|
-
var current = $(slides.get(idx));
|
109
|
-
var next = $(slides.get(next_idx));
|
110
|
-
|
111
|
-
current.css('zIndex', 2);
|
112
|
-
current.removeClass(settings.active_slide_class);
|
113
|
-
next.css('zIndex', 4).addClass(settings.active_slide_class);
|
114
|
-
|
115
|
-
slides_container.trigger('before-slide-change.fndtn.orbit');
|
116
|
-
settings.before_slide_change();
|
117
|
-
self.update_active_link(next_idx);
|
118
|
-
|
119
|
-
var callback = function () {
|
120
|
-
var unlock = function () {
|
121
|
-
idx = next_idx;
|
122
|
-
locked = false;
|
123
|
-
if (start_timer === true) {timer = self.create_timer(); timer.start();}
|
124
|
-
self.update_slide_number(idx);
|
125
|
-
slides_container.trigger('after-slide-change.fndtn.orbit', [{slide_number : idx, total_slides : slides.length}]);
|
126
|
-
settings.after_slide_change(idx, slides.length);
|
127
|
-
};
|
128
|
-
if (slides_container.outerHeight() != next.outerHeight() && settings.variable_height) {
|
129
|
-
slides_container.animate({'height': next.outerHeight()}, 250, 'linear', unlock);
|
130
|
-
} else {
|
131
|
-
unlock();
|
132
|
-
}
|
133
|
-
};
|
134
|
-
|
135
|
-
if (slides.length === 1) {callback(); return false;}
|
136
|
-
|
137
|
-
var start_animation = function () {
|
138
|
-
if (dir === 'next') {animate.next(current, next, callback);}
|
139
|
-
if (dir === 'prev') {animate.prev(current, next, callback);}
|
140
|
-
};
|
141
|
-
|
142
|
-
if (next.outerHeight() > slides_container.outerHeight() && settings.variable_height) {
|
143
|
-
slides_container.animate({'height': next.outerHeight()}, 250, 'linear', start_animation);
|
144
|
-
} else {
|
145
|
-
start_animation();
|
146
|
-
}
|
147
|
-
};
|
148
|
-
|
149
|
-
self.next = function (e) {
|
150
|
-
e.stopImmediatePropagation();
|
151
|
-
e.preventDefault();
|
152
|
-
self._goto(idx + 1);
|
153
|
-
};
|
154
|
-
|
155
|
-
self.prev = function (e) {
|
156
|
-
e.stopImmediatePropagation();
|
157
|
-
e.preventDefault();
|
158
|
-
self._goto(idx - 1);
|
159
|
-
};
|
160
|
-
|
161
|
-
self.link_custom = function (e) {
|
162
|
-
e.preventDefault();
|
163
|
-
var link = $(this).attr('data-orbit-link');
|
164
|
-
if ((typeof link === 'string') && (link = $.trim(link)) != '') {
|
165
|
-
var slide = container.find('[data-orbit-slide=' + link + ']');
|
166
|
-
if (slide.index() != -1) {self._goto(slide.index());}
|
167
|
-
}
|
168
|
-
};
|
169
|
-
|
170
|
-
self.link_bullet = function (e) {
|
171
|
-
var index = $(this).attr('data-orbit-slide');
|
172
|
-
if ((typeof index === 'string') && (index = $.trim(index)) != '') {
|
173
|
-
if (isNaN(parseInt(index))) {
|
174
|
-
var slide = container.find('[data-orbit-slide=' + index + ']');
|
175
|
-
if (slide.index() != -1) {self._goto(slide.index() + 1);}
|
176
|
-
} else {
|
177
|
-
self._goto(parseInt(index));
|
178
|
-
}
|
179
|
-
}
|
180
|
-
|
181
|
-
}
|
182
|
-
|
183
|
-
self.timer_callback = function () {
|
184
|
-
self._goto(idx + 1, true);
|
185
|
-
}
|
186
|
-
|
187
|
-
self.compute_dimensions = function () {
|
188
|
-
var current = $(self.slides().get(idx));
|
189
|
-
var h = current.outerHeight();
|
190
|
-
if (!settings.variable_height) {
|
191
|
-
self.slides().each(function(){
|
192
|
-
if ($(this).outerHeight() > h) { h = $(this).outerHeight(); }
|
193
|
-
});
|
194
|
-
}
|
195
|
-
slides_container.height(h);
|
196
|
-
};
|
197
|
-
|
198
|
-
self.create_timer = function () {
|
199
|
-
var t = new Timer(
|
200
|
-
container.find('.' + settings.timer_container_class),
|
201
|
-
settings,
|
202
|
-
self.timer_callback
|
203
|
-
);
|
204
|
-
return t;
|
205
|
-
};
|
206
|
-
|
207
|
-
self.stop_timer = function () {
|
208
|
-
if (typeof timer === 'object') {
|
209
|
-
timer.stop();
|
210
|
-
}
|
211
|
-
};
|
212
|
-
|
213
|
-
self.toggle_timer = function () {
|
214
|
-
var t = container.find('.' + settings.timer_container_class);
|
215
|
-
if (t.hasClass(settings.timer_paused_class)) {
|
216
|
-
if (typeof timer === 'undefined') {timer = self.create_timer();}
|
217
|
-
timer.start();
|
218
|
-
} else {
|
219
|
-
if (typeof timer === 'object') {timer.stop();}
|
220
|
-
}
|
221
|
-
};
|
222
|
-
|
223
|
-
self.init = function () {
|
224
|
-
self.build_markup();
|
225
|
-
if (settings.timer) {
|
226
|
-
timer = self.create_timer();
|
227
|
-
Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
|
228
|
-
}
|
229
|
-
animate = new FadeAnimation(settings, slides_container);
|
230
|
-
if (settings.animation === 'slide') {
|
231
|
-
animate = new SlideAnimation(settings, slides_container);
|
232
|
-
}
|
233
|
-
|
234
|
-
container.on('click', '.' + settings.next_class, self.next);
|
235
|
-
container.on('click', '.' + settings.prev_class, self.prev);
|
236
|
-
|
237
|
-
if (settings.next_on_click) {
|
238
|
-
container.on('click', '.' + settings.slides_container_class + ' [data-orbit-slide]', self.link_bullet);
|
239
|
-
}
|
240
|
-
|
241
|
-
container.on('click', self.toggle_timer);
|
242
|
-
if (settings.swipe) {
|
243
|
-
container.on('touchstart.fndtn.orbit', function (e) {
|
244
|
-
if (!e.touches) {e = e.originalEvent;}
|
245
|
-
var data = {
|
246
|
-
start_page_x : e.touches[0].pageX,
|
247
|
-
start_page_y : e.touches[0].pageY,
|
248
|
-
start_time : (new Date()).getTime(),
|
249
|
-
delta_x : 0,
|
250
|
-
is_scrolling : undefined
|
251
|
-
};
|
252
|
-
container.data('swipe-transition', data);
|
253
|
-
e.stopPropagation();
|
254
|
-
})
|
255
|
-
.on('touchmove.fndtn.orbit', function (e) {
|
256
|
-
if (!e.touches) {
|
257
|
-
e = e.originalEvent;
|
258
|
-
}
|
259
|
-
// Ignore pinch/zoom events
|
260
|
-
if (e.touches.length > 1 || e.scale && e.scale !== 1) {
|
261
|
-
return;
|
262
|
-
}
|
263
|
-
|
264
|
-
var data = container.data('swipe-transition');
|
265
|
-
if (typeof data === 'undefined') {data = {};}
|
266
|
-
|
267
|
-
data.delta_x = e.touches[0].pageX - data.start_page_x;
|
268
|
-
|
269
|
-
if ( typeof data.is_scrolling === 'undefined') {
|
270
|
-
data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );
|
271
|
-
}
|
272
|
-
|
273
|
-
if (!data.is_scrolling && !data.active) {
|
274
|
-
e.preventDefault();
|
275
|
-
var direction = (data.delta_x < 0) ? (idx + 1) : (idx - 1);
|
276
|
-
data.active = true;
|
277
|
-
self._goto(direction);
|
278
|
-
}
|
279
|
-
})
|
280
|
-
.on('touchend.fndtn.orbit', function (e) {
|
281
|
-
container.data('swipe-transition', {});
|
282
|
-
e.stopPropagation();
|
283
|
-
})
|
284
|
-
}
|
285
|
-
container.on('mouseenter.fndtn.orbit', function (e) {
|
286
|
-
if (settings.timer && settings.pause_on_hover) {
|
287
|
-
self.stop_timer();
|
288
|
-
}
|
289
|
-
})
|
290
|
-
.on('mouseleave.fndtn.orbit', function (e) {
|
291
|
-
if (settings.timer && settings.resume_on_mouseout) {
|
292
|
-
timer.start();
|
293
|
-
}
|
294
|
-
});
|
295
|
-
|
296
|
-
$(document).on('click', '[data-orbit-link]', self.link_custom);
|
297
|
-
$(window).on('load resize', self.compute_dimensions);
|
298
|
-
Foundation.utils.image_loaded(this.slides().children('img'), self.compute_dimensions);
|
299
|
-
Foundation.utils.image_loaded(this.slides().children('img'), function () {
|
300
|
-
container.prev('.' + settings.preloader_class).css('display', 'none');
|
301
|
-
self.update_slide_number(0);
|
302
|
-
self.update_active_link(0);
|
303
|
-
slides_container.trigger('ready.fndtn.orbit');
|
304
|
-
});
|
305
|
-
};
|
306
|
-
|
307
|
-
self.init();
|
308
|
-
};
|
309
|
-
|
310
|
-
var Timer = function (el, settings, callback) {
|
311
|
-
var self = this,
|
312
|
-
duration = settings.timer_speed,
|
313
|
-
progress = el.find('.' + settings.timer_progress_class),
|
314
|
-
start,
|
315
|
-
timeout,
|
316
|
-
left = -1;
|
317
|
-
|
318
|
-
this.update_progress = function (w) {
|
319
|
-
var new_progress = progress.clone();
|
320
|
-
new_progress.attr('style', '');
|
321
|
-
new_progress.css('width', w + '%');
|
322
|
-
progress.replaceWith(new_progress);
|
323
|
-
progress = new_progress;
|
324
|
-
};
|
325
|
-
|
326
|
-
this.restart = function () {
|
327
|
-
clearTimeout(timeout);
|
328
|
-
el.addClass(settings.timer_paused_class);
|
329
|
-
left = -1;
|
330
|
-
self.update_progress(0);
|
331
|
-
};
|
332
|
-
|
333
|
-
this.start = function () {
|
334
|
-
if (!el.hasClass(settings.timer_paused_class)) {return true;}
|
335
|
-
left = (left === -1) ? duration : left;
|
336
|
-
el.removeClass(settings.timer_paused_class);
|
337
|
-
start = new Date().getTime();
|
338
|
-
progress.animate({'width' : '100%'}, left, 'linear');
|
339
|
-
timeout = setTimeout(function () {
|
340
|
-
self.restart();
|
341
|
-
callback();
|
342
|
-
}, left);
|
343
|
-
el.trigger('timer-started.fndtn.orbit')
|
344
|
-
};
|
345
|
-
|
346
|
-
this.stop = function () {
|
347
|
-
if (el.hasClass(settings.timer_paused_class)) {return true;}
|
348
|
-
clearTimeout(timeout);
|
349
|
-
el.addClass(settings.timer_paused_class);
|
350
|
-
var end = new Date().getTime();
|
351
|
-
left = left - (end - start);
|
352
|
-
var w = 100 - ((left / duration) * 100);
|
353
|
-
self.update_progress(w);
|
354
|
-
el.trigger('timer-stopped.fndtn.orbit');
|
355
|
-
};
|
356
|
-
};
|
357
|
-
|
358
|
-
var SlideAnimation = function (settings, container) {
|
359
|
-
var duration = settings.animation_speed;
|
360
|
-
var is_rtl = ($('html[dir=rtl]').length === 1);
|
361
|
-
var margin = is_rtl ? 'marginRight' : 'marginLeft';
|
362
|
-
var animMargin = {};
|
363
|
-
animMargin[margin] = '0%';
|
364
|
-
|
365
|
-
this.next = function (current, next, callback) {
|
366
|
-
current.animate({marginLeft : '-100%'}, duration);
|
367
|
-
next.animate(animMargin, duration, function () {
|
368
|
-
current.css(margin, '100%');
|
369
|
-
callback();
|
370
|
-
});
|
371
|
-
};
|
372
|
-
|
373
|
-
this.prev = function (current, prev, callback) {
|
374
|
-
current.animate({marginLeft : '100%'}, duration);
|
375
|
-
prev.css(margin, '-100%');
|
376
|
-
prev.animate(animMargin, duration, function () {
|
377
|
-
current.css(margin, '100%');
|
378
|
-
callback();
|
379
|
-
});
|
380
|
-
};
|
381
|
-
};
|
382
|
-
|
383
|
-
var FadeAnimation = function (settings, container) {
|
384
|
-
var duration = settings.animation_speed;
|
385
|
-
var is_rtl = ($('html[dir=rtl]').length === 1);
|
386
|
-
var margin = is_rtl ? 'marginRight' : 'marginLeft';
|
387
|
-
|
388
|
-
this.next = function (current, next, callback) {
|
389
|
-
next.css({'margin' : '0%', 'opacity' : '0.01'});
|
390
|
-
next.animate({'opacity' :'1'}, duration, 'linear', function () {
|
391
|
-
current.css('margin', '100%');
|
392
|
-
callback();
|
393
|
-
});
|
394
|
-
};
|
395
|
-
|
396
|
-
this.prev = function (current, prev, callback) {
|
397
|
-
prev.css({'margin' : '0%', 'opacity' : '0.01'});
|
398
|
-
prev.animate({'opacity' : '1'}, duration, 'linear', function () {
|
399
|
-
current.css('margin', '100%');
|
400
|
-
callback();
|
401
|
-
});
|
402
|
-
};
|
403
|
-
};
|
404
|
-
|
405
|
-
Foundation.libs = Foundation.libs || {};
|
406
|
-
|
407
|
-
Foundation.libs.orbit = {
|
408
|
-
name : 'orbit',
|
409
|
-
|
410
|
-
version : '5.5.2',
|
411
|
-
|
412
|
-
settings : {
|
413
|
-
animation : 'slide',
|
414
|
-
timer_speed : 10000,
|
415
|
-
pause_on_hover : true,
|
416
|
-
resume_on_mouseout : false,
|
417
|
-
next_on_click : true,
|
418
|
-
animation_speed : 500,
|
419
|
-
stack_on_small : false,
|
420
|
-
navigation_arrows : true,
|
421
|
-
slide_number : true,
|
422
|
-
slide_number_text : 'of',
|
423
|
-
container_class : 'orbit-container',
|
424
|
-
stack_on_small_class : 'orbit-stack-on-small',
|
425
|
-
next_class : 'orbit-next',
|
426
|
-
prev_class : 'orbit-prev',
|
427
|
-
timer_container_class : 'orbit-timer',
|
428
|
-
timer_paused_class : 'paused',
|
429
|
-
timer_progress_class : 'orbit-progress',
|
430
|
-
slides_container_class : 'orbit-slides-container',
|
431
|
-
preloader_class : 'preloader',
|
432
|
-
slide_selector : '*',
|
433
|
-
bullets_container_class : 'orbit-bullets',
|
434
|
-
bullets_active_class : 'active',
|
435
|
-
slide_number_class : 'orbit-slide-number',
|
436
|
-
caption_class : 'orbit-caption',
|
437
|
-
active_slide_class : 'active',
|
438
|
-
orbit_transition_class : 'orbit-transitioning',
|
439
|
-
bullets : true,
|
440
|
-
circular : true,
|
441
|
-
timer : true,
|
442
|
-
variable_height : false,
|
443
|
-
swipe : true,
|
444
|
-
before_slide_change : noop,
|
445
|
-
after_slide_change : noop
|
446
|
-
},
|
447
|
-
|
448
|
-
init : function (scope, method, options) {
|
449
|
-
var self = this;
|
450
|
-
this.bindings(method, options);
|
451
|
-
},
|
452
|
-
|
453
|
-
events : function (instance) {
|
454
|
-
var orbit_instance = new Orbit(this.S(instance), this.S(instance).data('orbit-init'));
|
455
|
-
this.S(instance).data(this.name + '-instance', orbit_instance);
|
456
|
-
},
|
457
|
-
|
458
|
-
reflow : function () {
|
459
|
-
var self = this;
|
460
|
-
|
461
|
-
if (self.S(self.scope).is('[data-orbit]')) {
|
462
|
-
var $el = self.S(self.scope);
|
463
|
-
var instance = $el.data(self.name + '-instance');
|
464
|
-
instance.compute_dimensions();
|
465
|
-
} else {
|
466
|
-
self.S('[data-orbit]', self.scope).each(function (idx, el) {
|
467
|
-
var $el = self.S(el);
|
468
|
-
var opts = self.data_options($el);
|
469
|
-
var instance = $el.data(self.name + '-instance');
|
470
|
-
instance.compute_dimensions();
|
471
|
-
});
|
472
|
-
}
|
473
|
-
}
|
474
|
-
};
|
475
|
-
|
476
|
-
}(jQuery, window, window.document));
|