zurb-foundation 0.0.5
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.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/README.markdown +14 -0
- data/Rakefile +1 -0
- data/app/assets/images/foundation/misc/button-gloss.png +0 -0
- data/app/assets/images/foundation/misc/button-overlay.png +0 -0
- data/app/assets/images/foundation/misc/custom-form-sprites.png +0 -0
- data/app/assets/images/foundation/misc/input-bg.png +0 -0
- data/app/assets/images/foundation/misc/modal-gloss.png +0 -0
- data/app/assets/images/foundation/misc/table-sorter.png +0 -0
- data/app/assets/images/foundation/orbit/bullets.jpg +0 -0
- data/app/assets/images/foundation/orbit/left-arrow.png +0 -0
- data/app/assets/images/foundation/orbit/loading.gif +0 -0
- data/app/assets/images/foundation/orbit/mask-black.png +0 -0
- data/app/assets/images/foundation/orbit/pause-black.png +0 -0
- data/app/assets/images/foundation/orbit/right-arrow.png +0 -0
- data/app/assets/images/foundation/orbit/rotator-black.png +0 -0
- data/app/assets/images/foundation/orbit/timer-black.png +0 -0
- data/app/assets/javascripts/foundation/app.js +63 -0
- data/app/assets/javascripts/foundation/forms.jquery.js +58 -0
- data/app/assets/javascripts/foundation/index.js +6 -0
- data/app/assets/javascripts/foundation/jquery.customforms.js +162 -0
- data/app/assets/javascripts/foundation/jquery.orbit-1.2.3.js +401 -0
- data/app/assets/javascripts/foundation/jquery.reveal.js +150 -0
- data/app/assets/stylesheets/foundation/fonts/league/League_Gothic-webfont.eot +0 -0
- data/app/assets/stylesheets/foundation/fonts/league/League_Gothic-webfont.svg +223 -0
- data/app/assets/stylesheets/foundation/fonts/league/League_Gothic-webfont.ttf +0 -0
- data/app/assets/stylesheets/foundation/fonts/league/League_Gothic-webfont.woff +0 -0
- data/app/assets/stylesheets/foundation/fonts/league/SIL Open Font License 1.1.txt +91 -0
- data/app/assets/stylesheets/foundation/fonts/league/font.css.erb +18 -0
- data/app/assets/stylesheets/foundation/forms.css.scss.erb +83 -0
- data/app/assets/stylesheets/foundation/globals.css.scss.erb +279 -0
- data/app/assets/stylesheets/foundation/index.css +10 -0
- data/app/assets/stylesheets/foundation/mobile.css.scss.erb +112 -0
- data/app/assets/stylesheets/foundation/orbit-1.2.3.css.scss.erb +201 -0
- data/app/assets/stylesheets/foundation/reveal.css.scss.erb +91 -0
- data/app/assets/stylesheets/foundation/ui.css.scss.erb +212 -0
- data/foundation.gemspec +25 -0
- data/lib/foundation/engine.rb +5 -0
- data/lib/foundation/generators/USAGE +15 -0
- data/lib/foundation/generators/install_generator.rb +14 -0
- data/lib/foundation/generators/layout_generator.rb +19 -0
- data/lib/foundation/generators/templates/application.css +5 -0
- data/lib/foundation/generators/templates/application.html.erb +31 -0
- data/lib/foundation/generators/templates/application.js +4 -0
- data/lib/foundation/version.rb +3 -0
- data/lib/zurb-foundation.rb +7 -0
- metadata +112 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
USAGE
|
2
|
+
=====
|
3
|
+
1. Inside your Gemfile add the following:
|
4
|
+
|
5
|
+
`gem "zurb-foundation"`
|
6
|
+
|
7
|
+
1. Run `bundle install`
|
8
|
+
1. Run `rails g foundation:install`
|
9
|
+
1. If you want to replace your application layout, run `rails g foundation:layout`
|
10
|
+
1. Eat a cookie.
|
11
|
+
|
12
|
+
DEPENDENCIES
|
13
|
+
============
|
14
|
+
* Rails 3.1
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,63 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
|
3
|
+
/* Use this js doc for all application specific JS */
|
4
|
+
|
5
|
+
/* TABS --------------------------------- */
|
6
|
+
/* Remove if you don't need :) */
|
7
|
+
|
8
|
+
var tabs = $('dl.tabs');
|
9
|
+
tabsContent = $('ul.tabs-content')
|
10
|
+
|
11
|
+
tabs.each(function(i) {
|
12
|
+
//Get all tabs
|
13
|
+
var tab = $(this).children('dd').children('a');
|
14
|
+
tab.click(function(e) {
|
15
|
+
|
16
|
+
//Get Location of tab's content
|
17
|
+
var contentLocation = $(this).attr("href")
|
18
|
+
contentLocation = contentLocation + "Tab";
|
19
|
+
|
20
|
+
//Let go if not a hashed one
|
21
|
+
if(contentLocation.charAt(0)=="#") {
|
22
|
+
|
23
|
+
e.preventDefault();
|
24
|
+
|
25
|
+
//Make Tab Active
|
26
|
+
tab.removeClass('active');
|
27
|
+
$(this).addClass('active');
|
28
|
+
|
29
|
+
//Show Tab Content
|
30
|
+
$(contentLocation).parent('.tabs-content').children('li').css({"display":"none"});
|
31
|
+
$(contentLocation).css({"display":"block"});
|
32
|
+
|
33
|
+
}
|
34
|
+
});
|
35
|
+
});
|
36
|
+
|
37
|
+
|
38
|
+
/* PLACEHOLDER FOR FORMS ------------- */
|
39
|
+
/* Remove if you don't need :) */
|
40
|
+
|
41
|
+
$('[placeholder]').focus(function() {
|
42
|
+
var input = $(this);
|
43
|
+
if (input.val() == input.attr('placeholder')) {
|
44
|
+
input.val('');
|
45
|
+
input.removeClass('placeholder');
|
46
|
+
}
|
47
|
+
}).blur(function() {
|
48
|
+
var input = $(this);
|
49
|
+
if (input.val() == '' || input.val() == input.attr('placeholder')) {
|
50
|
+
input.addClass('placeholder');
|
51
|
+
input.val(input.attr('placeholder'));
|
52
|
+
}
|
53
|
+
}).blur();
|
54
|
+
$('[placeholder]').parents('form').submit(function() {
|
55
|
+
$(this).find('[placeholder]').each(function() {
|
56
|
+
var input = $(this);
|
57
|
+
if (input.val() == input.attr('placeholder')) {
|
58
|
+
input.val('');
|
59
|
+
}
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
});
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/**
|
2
|
+
* jQuery.placeholder - Placeholder plugin for input fields
|
3
|
+
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
|
4
|
+
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
|
5
|
+
* Date: 2008/10/14
|
6
|
+
*
|
7
|
+
* @author Blair Mitchelmore
|
8
|
+
* @version 1.0.1
|
9
|
+
*
|
10
|
+
**/
|
11
|
+
new function($) {
|
12
|
+
$.fn.placeholder = function(settings) {
|
13
|
+
settings = settings || {};
|
14
|
+
var key = settings.dataKey || "placeholderValue";
|
15
|
+
var attr = settings.attr || "placeholder";
|
16
|
+
var className = settings.className || "placeholder";
|
17
|
+
var values = settings.values || [];
|
18
|
+
var block = settings.blockSubmit || false;
|
19
|
+
var blank = settings.blankSubmit || false;
|
20
|
+
var submit = settings.onSubmit || false;
|
21
|
+
var value = settings.value || "";
|
22
|
+
var position = settings.cursor_position || 0;
|
23
|
+
|
24
|
+
|
25
|
+
return this.filter(":input").each(function(index) {
|
26
|
+
$.data(this, key, values[index] || $(this).attr(attr));
|
27
|
+
}).each(function() {
|
28
|
+
if ($.trim($(this).val()) === "")
|
29
|
+
$(this).addClass(className).val($.data(this, key));
|
30
|
+
}).focus(function() {
|
31
|
+
if ($.trim($(this).val()) === $.data(this, key))
|
32
|
+
$(this).removeClass(className).val(value)
|
33
|
+
if ($.fn.setCursorPosition) {
|
34
|
+
$(this).setCursorPosition(position);
|
35
|
+
}
|
36
|
+
}).blur(function() {
|
37
|
+
if ($.trim($(this).val()) === value)
|
38
|
+
$(this).addClass(className).val($.data(this, key));
|
39
|
+
}).each(function(index, elem) {
|
40
|
+
if (block)
|
41
|
+
new function(e) {
|
42
|
+
$(e.form).submit(function() {
|
43
|
+
return $.trim($(e).val()) != $.data(e, key)
|
44
|
+
});
|
45
|
+
}(elem);
|
46
|
+
else if (blank)
|
47
|
+
new function(e) {
|
48
|
+
$(e.form).submit(function() {
|
49
|
+
if ($.trim($(e).val()) == $.data(e, key))
|
50
|
+
$(e).removeClass(className).val("");
|
51
|
+
return true;
|
52
|
+
});
|
53
|
+
}(elem);
|
54
|
+
else if (submit)
|
55
|
+
new function(e) { $(e.form).submit(submit); }(elem);
|
56
|
+
});
|
57
|
+
};
|
58
|
+
}(jQuery);
|
@@ -0,0 +1,162 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Custom Forms Plugin 1.0
|
3
|
+
* www.ZURB.com
|
4
|
+
* Copyright 2010, ZURB
|
5
|
+
* Free to use under the MIT license.
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
*/
|
8
|
+
|
9
|
+
jQuery(document).ready(function ($) {
|
10
|
+
|
11
|
+
function appendCustomMarkup(type) {
|
12
|
+
$('form.custom input:' + type).each(function () {
|
13
|
+
var $span = $('<span class="custom ' + type + '"></span>');
|
14
|
+
if ($(this).next('span.custom.' + type).length === 0) {
|
15
|
+
if (this.checked) {
|
16
|
+
$span.addClass('checked');
|
17
|
+
}
|
18
|
+
$(this)
|
19
|
+
.hide()
|
20
|
+
.after($span);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
}
|
24
|
+
appendCustomMarkup('checkbox');
|
25
|
+
appendCustomMarkup('radio');
|
26
|
+
|
27
|
+
$('form.custom select').each(function () {
|
28
|
+
var $this = $(this),
|
29
|
+
$customSelect = $this.next('div.custom.dropdown'),
|
30
|
+
$options = $this.find('option'),
|
31
|
+
maxWidth = 0,
|
32
|
+
$li;
|
33
|
+
|
34
|
+
if ($customSelect.length === 0) {
|
35
|
+
$customSelect = $('<div class="custom dropdown"><a href="#" class="selector"></a><ul></ul></div>"');
|
36
|
+
$options.each(function () {
|
37
|
+
$li = $('<li>' + $(this).html() + '</li>');
|
38
|
+
$customSelect.find('ul').append($li);
|
39
|
+
});
|
40
|
+
$customSelect.prepend('<a href="#" class="current">' + $options.first().html() + '</a>');
|
41
|
+
|
42
|
+
$this.after($customSelect);
|
43
|
+
$this.hide();
|
44
|
+
}
|
45
|
+
|
46
|
+
$options.each(function (index) {
|
47
|
+
if (this.selected) {
|
48
|
+
$customSelect.find('li').eq(index).addClass('selected');
|
49
|
+
$customSelect.find('.current').html($(this).html());
|
50
|
+
}
|
51
|
+
});
|
52
|
+
|
53
|
+
$customSelect.find('li').each(function () {
|
54
|
+
$customSelect.addClass('open');
|
55
|
+
if ($(this).outerWidth() > maxWidth) {
|
56
|
+
maxWidth = $(this).outerWidth();
|
57
|
+
}
|
58
|
+
$customSelect.removeClass('open');
|
59
|
+
});
|
60
|
+
$customSelect.css('width', maxWidth + 18 + 'px');
|
61
|
+
$customSelect.find('ul').css('width', maxWidth + 16 + 'px');
|
62
|
+
});
|
63
|
+
});
|
64
|
+
|
65
|
+
(function ($) {
|
66
|
+
|
67
|
+
function toggleCheckbox($element) {
|
68
|
+
var $input = $element.prev(),
|
69
|
+
input = $input[0];
|
70
|
+
|
71
|
+
input.checked = ((input.checked) ? false : true);
|
72
|
+
$element.toggleClass('checked');
|
73
|
+
}
|
74
|
+
|
75
|
+
function toggleRadio($element) {
|
76
|
+
var $input = $element.prev(),
|
77
|
+
input = $input[0];
|
78
|
+
|
79
|
+
$('input:radio[name=' + $input.attr('name') + ']').each(function () {
|
80
|
+
$(this).next().removeClass('checked');
|
81
|
+
});
|
82
|
+
input.checked = ((input.checked) ? false : true);
|
83
|
+
$element.toggleClass('checked');
|
84
|
+
}
|
85
|
+
|
86
|
+
$('form.custom span.custom.checkbox').live('click', function (event) {
|
87
|
+
event.preventDefault();
|
88
|
+
event.stopPropagation();
|
89
|
+
|
90
|
+
toggleCheckbox($(this));
|
91
|
+
});
|
92
|
+
|
93
|
+
$('form.custom span.custom.radio').live('click', function (event) {
|
94
|
+
event.preventDefault();
|
95
|
+
event.stopPropagation();
|
96
|
+
|
97
|
+
toggleRadio($(this));
|
98
|
+
});
|
99
|
+
|
100
|
+
$('form.custom label').live('click', function (event) {
|
101
|
+
var $associatedElement = $('#' + $(this).attr('for')),
|
102
|
+
$customCheckbox,
|
103
|
+
$customRadio;
|
104
|
+
if ($associatedElement.length !== 0) {
|
105
|
+
if ($associatedElement.attr('type') === 'checkbox') {
|
106
|
+
event.preventDefault();
|
107
|
+
$customCheckbox = $(this).find('span.custom.checkbox');
|
108
|
+
toggleCheckbox($customCheckbox);
|
109
|
+
} else if ($associatedElement.attr('type') === 'radio') {
|
110
|
+
event.preventDefault();
|
111
|
+
$customRadio = $(this).find('span.custom.radio');
|
112
|
+
toggleRadio($customRadio);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
});
|
116
|
+
|
117
|
+
$('form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector').live('click', function (event) {
|
118
|
+
var $this = $(this),
|
119
|
+
$dropdown = $this.closest('div.custom.dropdown');
|
120
|
+
|
121
|
+
event.preventDefault();
|
122
|
+
$dropdown.toggleClass('open');
|
123
|
+
|
124
|
+
if ($dropdown.hasClass('open')) {
|
125
|
+
$(document).bind('click.customdropdown', function (event) {
|
126
|
+
$dropdown.removeClass('open');
|
127
|
+
$(document).unbind('.customdropdown');
|
128
|
+
});
|
129
|
+
} else {
|
130
|
+
$(document).unbind('.customdropdown');
|
131
|
+
}
|
132
|
+
});
|
133
|
+
|
134
|
+
$('form.custom div.custom.dropdown li').live('click', function (event) {
|
135
|
+
var $this = $(this),
|
136
|
+
$customDropdown = $this.closest('div.custom.dropdown'),
|
137
|
+
$select = $customDropdown.prev(),
|
138
|
+
selectedIndex = 0;
|
139
|
+
|
140
|
+
event.preventDefault();
|
141
|
+
event.stopPropagation();
|
142
|
+
|
143
|
+
$this
|
144
|
+
.closest('ul')
|
145
|
+
.find('li')
|
146
|
+
.removeClass('selected');
|
147
|
+
$this.addClass('selected');
|
148
|
+
|
149
|
+
$customDropdown
|
150
|
+
.removeClass('open')
|
151
|
+
.find('a.current')
|
152
|
+
.html($this.html());
|
153
|
+
|
154
|
+
$this.closest('ul').find('li').each(function (index) {
|
155
|
+
if ($this[0] == this) {
|
156
|
+
selectedIndex = index;
|
157
|
+
}
|
158
|
+
|
159
|
+
});
|
160
|
+
$select[0].selectedIndex = selectedIndex;
|
161
|
+
});
|
162
|
+
})(jQuery);
|
@@ -0,0 +1,401 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Orbit Plugin 1.2.3
|
3
|
+
* www.ZURB.com/playground
|
4
|
+
* Copyright 2010, ZURB
|
5
|
+
* Free to use under the MIT license.
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
*/
|
8
|
+
|
9
|
+
|
10
|
+
(function($) {
|
11
|
+
|
12
|
+
$.fn.orbit = function(options) {
|
13
|
+
|
14
|
+
//Defaults to extend options
|
15
|
+
var defaults = {
|
16
|
+
animation: 'horizontal-push', // fade, horizontal-slide, vertical-slide, horizontal-push
|
17
|
+
animationSpeed: 600, // how fast animtions are
|
18
|
+
timer: true, // true or false to have the timer
|
19
|
+
advanceSpeed: 4000, // if timer is enabled, time between transitions
|
20
|
+
pauseOnHover: false, // if you hover pauses the slider
|
21
|
+
startClockOnMouseOut: false, // if clock should start on MouseOut
|
22
|
+
startClockOnMouseOutAfter: 1000, // how long after MouseOut should the timer start again
|
23
|
+
directionalNav: true, // manual advancing directional navs
|
24
|
+
captions: true, // do you want captions?
|
25
|
+
captionAnimation: 'fade', // fade, slideOpen, none
|
26
|
+
captionAnimationSpeed: 600, // if so how quickly should they animate in
|
27
|
+
bullets: false, // true or false to activate the bullet navigation
|
28
|
+
bulletThumbs: false, // thumbnails for the bullets
|
29
|
+
bulletThumbLocation: '', // location from this file where thumbs will be
|
30
|
+
afterSlideChange: function(){} // empty function
|
31
|
+
};
|
32
|
+
|
33
|
+
//Extend those options
|
34
|
+
var options = $.extend(defaults, options);
|
35
|
+
|
36
|
+
return this.each(function() {
|
37
|
+
|
38
|
+
// ==============
|
39
|
+
// ! SETUP
|
40
|
+
// ==============
|
41
|
+
|
42
|
+
//Global Variables
|
43
|
+
var activeSlide = 0,
|
44
|
+
numberSlides = 0,
|
45
|
+
orbitWidth,
|
46
|
+
orbitHeight,
|
47
|
+
locked;
|
48
|
+
|
49
|
+
//Initialize
|
50
|
+
var orbit = $(this).addClass('orbit'),
|
51
|
+
orbitWrapper = orbit.wrap('<div class="orbit-wrapper" />').parent();
|
52
|
+
//orbit.add(orbitWidth).width('1px').height('1px');
|
53
|
+
|
54
|
+
//Collect all slides and set slider size of largest image
|
55
|
+
var slides = orbit.children('img, a, div');
|
56
|
+
slides.each(function() {
|
57
|
+
var _slide = $(this),
|
58
|
+
_slideWidth = _slide.width(),
|
59
|
+
_slideHeight = _slide.height();
|
60
|
+
if(_slideWidth > orbit.width()) {
|
61
|
+
orbit.add(orbitWrapper).width(_slideWidth);
|
62
|
+
orbitWidth = orbit.width();
|
63
|
+
}
|
64
|
+
if(_slideHeight > orbit.height()) {
|
65
|
+
orbit.add(orbitWrapper).height(_slideHeight);
|
66
|
+
orbitHeight = orbit.height();
|
67
|
+
}
|
68
|
+
numberSlides++;
|
69
|
+
});
|
70
|
+
|
71
|
+
//Animation locking functions
|
72
|
+
function unlock() {
|
73
|
+
locked = false;
|
74
|
+
}
|
75
|
+
function lock() {
|
76
|
+
locked = true;
|
77
|
+
}
|
78
|
+
|
79
|
+
//If there is only a single slide remove nav, timer and bullets
|
80
|
+
if(slides.length == 1) {
|
81
|
+
options.directionalNav = false;
|
82
|
+
options.timer = false;
|
83
|
+
options.bullets = false;
|
84
|
+
}
|
85
|
+
|
86
|
+
//Set initial front photo z-index and fades it in
|
87
|
+
slides.eq(activeSlide)
|
88
|
+
.css({"z-index" : 3})
|
89
|
+
.fadeIn(function() {
|
90
|
+
//brings in all other slides IF css declares a display: none
|
91
|
+
slides.css({"display":"block"})
|
92
|
+
});
|
93
|
+
|
94
|
+
// ==============
|
95
|
+
// ! TIMER
|
96
|
+
// ==============
|
97
|
+
|
98
|
+
//Timer Execution
|
99
|
+
function startClock() {
|
100
|
+
if(!options.timer || options.timer == 'false') {
|
101
|
+
return false;
|
102
|
+
//if timer is hidden, don't need to do crazy calculations
|
103
|
+
} else if(timer.is(':hidden')) {
|
104
|
+
clock = setInterval(function(e){
|
105
|
+
shift("next");
|
106
|
+
}, options.advanceSpeed);
|
107
|
+
//if timer is visible and working, let's do some math
|
108
|
+
} else {
|
109
|
+
timerRunning = true;
|
110
|
+
pause.removeClass('active')
|
111
|
+
clock = setInterval(function(e){
|
112
|
+
var degreeCSS = "rotate("+degrees+"deg)"
|
113
|
+
degrees += 2
|
114
|
+
rotator.css({
|
115
|
+
"-webkit-transform": degreeCSS,
|
116
|
+
"-moz-transform": degreeCSS,
|
117
|
+
"-o-transform": degreeCSS
|
118
|
+
});
|
119
|
+
if(degrees > 180) {
|
120
|
+
rotator.addClass('move');
|
121
|
+
mask.addClass('move');
|
122
|
+
}
|
123
|
+
if(degrees > 360) {
|
124
|
+
rotator.removeClass('move');
|
125
|
+
mask.removeClass('move');
|
126
|
+
degrees = 0;
|
127
|
+
shift("next");
|
128
|
+
}
|
129
|
+
}, options.advanceSpeed/180);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
function stopClock() {
|
133
|
+
if(!options.timer || options.timer == 'false') { return false; } else {
|
134
|
+
timerRunning = false;
|
135
|
+
clearInterval(clock);
|
136
|
+
pause.addClass('active');
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
//Timer Setup
|
141
|
+
if(options.timer) {
|
142
|
+
var timerHTML = '<div class="timer"><span class="mask"><span class="rotator"></span></span><span class="pause"></span></div>'
|
143
|
+
orbitWrapper.append(timerHTML);
|
144
|
+
var timer = $('div.timer'),
|
145
|
+
timerRunning;
|
146
|
+
if(timer.length != 0) {
|
147
|
+
var rotator = $('div.timer span.rotator'),
|
148
|
+
mask = $('div.timer span.mask'),
|
149
|
+
pause = $('div.timer span.pause'),
|
150
|
+
degrees = 0,
|
151
|
+
clock;
|
152
|
+
startClock();
|
153
|
+
timer.click(function() {
|
154
|
+
if(!timerRunning) {
|
155
|
+
startClock();
|
156
|
+
} else {
|
157
|
+
stopClock();
|
158
|
+
}
|
159
|
+
});
|
160
|
+
if(options.startClockOnMouseOut){
|
161
|
+
var outTimer;
|
162
|
+
orbitWrapper.mouseleave(function() {
|
163
|
+
outTimer = setTimeout(function() {
|
164
|
+
if(!timerRunning){
|
165
|
+
startClock();
|
166
|
+
}
|
167
|
+
}, options.startClockOnMouseOutAfter)
|
168
|
+
})
|
169
|
+
orbitWrapper.mouseenter(function() {
|
170
|
+
clearTimeout(outTimer);
|
171
|
+
})
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
//Pause Timer on hover
|
177
|
+
if(options.pauseOnHover) {
|
178
|
+
orbitWrapper.mouseenter(function() {
|
179
|
+
stopClock();
|
180
|
+
});
|
181
|
+
}
|
182
|
+
|
183
|
+
// ==============
|
184
|
+
// ! CAPTIONS
|
185
|
+
// ==============
|
186
|
+
|
187
|
+
//Caption Setup
|
188
|
+
if(options.captions) {
|
189
|
+
var captionHTML = '<div class="orbit-caption"></div>';
|
190
|
+
orbitWrapper.append(captionHTML);
|
191
|
+
var caption = orbitWrapper.children('.orbit-caption');
|
192
|
+
setCaption();
|
193
|
+
}
|
194
|
+
|
195
|
+
//Caption Execution
|
196
|
+
function setCaption() {
|
197
|
+
if(!options.captions || options.captions =="false") {
|
198
|
+
return false;
|
199
|
+
} else {
|
200
|
+
var _captionLocation = slides.eq(activeSlide).data('caption'); //get ID from rel tag on image
|
201
|
+
_captionHTML = $(_captionLocation).html(); //get HTML from the matching HTML entity
|
202
|
+
//Set HTML for the caption if it exists
|
203
|
+
if(_captionHTML) {
|
204
|
+
caption
|
205
|
+
.attr('id',_captionLocation) // Add ID caption
|
206
|
+
.html(_captionHTML); // Change HTML in Caption
|
207
|
+
//Animations for Caption entrances
|
208
|
+
if(options.captionAnimation == 'none') {
|
209
|
+
caption.show();
|
210
|
+
}
|
211
|
+
if(options.captionAnimation == 'fade') {
|
212
|
+
caption.fadeIn(options.captionAnimationSpeed);
|
213
|
+
}
|
214
|
+
if(options.captionAnimation == 'slideOpen') {
|
215
|
+
caption.slideDown(options.captionAnimationSpeed);
|
216
|
+
}
|
217
|
+
} else {
|
218
|
+
//Animations for Caption exits
|
219
|
+
if(options.captionAnimation == 'none') {
|
220
|
+
caption.hide();
|
221
|
+
}
|
222
|
+
if(options.captionAnimation == 'fade') {
|
223
|
+
caption.fadeOut(options.captionAnimationSpeed);
|
224
|
+
}
|
225
|
+
if(options.captionAnimation == 'slideOpen') {
|
226
|
+
caption.slideUp(options.captionAnimationSpeed);
|
227
|
+
}
|
228
|
+
}
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
232
|
+
// ==================
|
233
|
+
// ! DIRECTIONAL NAV
|
234
|
+
// ==================
|
235
|
+
|
236
|
+
//DirectionalNav { rightButton --> shift("next"), leftButton --> shift("prev");
|
237
|
+
if(options.directionalNav) {
|
238
|
+
if(options.directionalNav == "false") { return false; }
|
239
|
+
var directionalNavHTML = '<div class="slider-nav"><span class="right">Right</span><span class="left">Left</span></div>';
|
240
|
+
orbitWrapper.append(directionalNavHTML);
|
241
|
+
var leftBtn = orbitWrapper.children('div.slider-nav').children('span.left'),
|
242
|
+
rightBtn = orbitWrapper.children('div.slider-nav').children('span.right');
|
243
|
+
leftBtn.click(function() {
|
244
|
+
stopClock();
|
245
|
+
shift("prev");
|
246
|
+
});
|
247
|
+
rightBtn.click(function() {
|
248
|
+
stopClock();
|
249
|
+
shift("next")
|
250
|
+
});
|
251
|
+
}
|
252
|
+
|
253
|
+
// ==================
|
254
|
+
// ! BULLET NAV
|
255
|
+
// ==================
|
256
|
+
|
257
|
+
//Bullet Nav Setup
|
258
|
+
if(options.bullets) {
|
259
|
+
var bulletHTML = '<ul class="orbit-bullets"></ul>';
|
260
|
+
orbitWrapper.append(bulletHTML);
|
261
|
+
var bullets = $('ul.orbit-bullets');
|
262
|
+
for(i=0; i<numberSlides; i++) {
|
263
|
+
var liMarkup = $('<li>'+(i+1)+'</li>');
|
264
|
+
if(options.bulletThumbs) {
|
265
|
+
var thumbName = slides.eq(i).data('thumb');
|
266
|
+
if(thumbName) {
|
267
|
+
var liMarkup = $('<li class="has-thumb">'+i+'</li>')
|
268
|
+
liMarkup.css({"background" : "url("+options.bulletThumbLocation+thumbName+") no-repeat"});
|
269
|
+
}
|
270
|
+
}
|
271
|
+
$('ul.orbit-bullets').append(liMarkup);
|
272
|
+
liMarkup.data('index',i);
|
273
|
+
liMarkup.click(function() {
|
274
|
+
stopClock();
|
275
|
+
shift($(this).data('index'));
|
276
|
+
});
|
277
|
+
}
|
278
|
+
setActiveBullet();
|
279
|
+
}
|
280
|
+
|
281
|
+
//Bullet Nav Execution
|
282
|
+
function setActiveBullet() {
|
283
|
+
if(!options.bullets) { return false; } else {
|
284
|
+
bullets.children('li').removeClass('active').eq(activeSlide).addClass('active');
|
285
|
+
}
|
286
|
+
}
|
287
|
+
|
288
|
+
// ====================
|
289
|
+
// ! SHIFT ANIMATIONS
|
290
|
+
// ====================
|
291
|
+
|
292
|
+
//Animating the shift!
|
293
|
+
function shift(direction) {
|
294
|
+
//remember previous activeSlide
|
295
|
+
var prevActiveSlide = activeSlide,
|
296
|
+
slideDirection = direction;
|
297
|
+
//exit function if bullet clicked is same as the current image
|
298
|
+
if(prevActiveSlide == slideDirection) { return false; }
|
299
|
+
//reset Z & Unlock
|
300
|
+
function resetAndUnlock() {
|
301
|
+
slides
|
302
|
+
.eq(prevActiveSlide)
|
303
|
+
.css({"z-index" : 1});
|
304
|
+
unlock();
|
305
|
+
options.afterSlideChange.call(this);
|
306
|
+
}
|
307
|
+
if(slides.length == "1") { return false; }
|
308
|
+
if(!locked) {
|
309
|
+
lock();
|
310
|
+
//deduce the proper activeImage
|
311
|
+
if(direction == "next") {
|
312
|
+
activeSlide++
|
313
|
+
if(activeSlide == numberSlides) {
|
314
|
+
activeSlide = 0;
|
315
|
+
}
|
316
|
+
} else if(direction == "prev") {
|
317
|
+
activeSlide--
|
318
|
+
if(activeSlide < 0) {
|
319
|
+
activeSlide = numberSlides-1;
|
320
|
+
}
|
321
|
+
} else {
|
322
|
+
activeSlide = direction;
|
323
|
+
if (prevActiveSlide < activeSlide) {
|
324
|
+
slideDirection = "next";
|
325
|
+
} else if (prevActiveSlide > activeSlide) {
|
326
|
+
slideDirection = "prev"
|
327
|
+
}
|
328
|
+
}
|
329
|
+
//set to correct bullet
|
330
|
+
setActiveBullet();
|
331
|
+
|
332
|
+
//set previous slide z-index to one below what new activeSlide will be
|
333
|
+
slides
|
334
|
+
.eq(prevActiveSlide)
|
335
|
+
.css({"z-index" : 2});
|
336
|
+
|
337
|
+
//fade
|
338
|
+
if(options.animation == "fade") {
|
339
|
+
slides
|
340
|
+
.eq(activeSlide)
|
341
|
+
.css({"opacity" : 0, "z-index" : 3})
|
342
|
+
.animate({"opacity" : 1}, options.animationSpeed, resetAndUnlock);
|
343
|
+
}
|
344
|
+
//horizontal-slide
|
345
|
+
if(options.animation == "horizontal-slide") {
|
346
|
+
if(slideDirection == "next") {
|
347
|
+
slides
|
348
|
+
.eq(activeSlide)
|
349
|
+
.css({"left": orbitWidth, "z-index" : 3})
|
350
|
+
.animate({"left" : 0}, options.animationSpeed, resetAndUnlock);
|
351
|
+
}
|
352
|
+
if(slideDirection == "prev") {
|
353
|
+
slides
|
354
|
+
.eq(activeSlide)
|
355
|
+
.css({"left": -orbitWidth, "z-index" : 3})
|
356
|
+
.animate({"left" : 0}, options.animationSpeed, resetAndUnlock);
|
357
|
+
}
|
358
|
+
}
|
359
|
+
//vertical-slide
|
360
|
+
if(options.animation == "vertical-slide") {
|
361
|
+
if(slideDirection == "prev") {
|
362
|
+
slides
|
363
|
+
.eq(activeSlide)
|
364
|
+
.css({"top": orbitHeight, "z-index" : 3})
|
365
|
+
.animate({"top" : 0}, options.animationSpeed, resetAndUnlock);
|
366
|
+
}
|
367
|
+
if(slideDirection == "next") {
|
368
|
+
slides
|
369
|
+
.eq(activeSlide)
|
370
|
+
.css({"top": -orbitHeight, "z-index" : 3})
|
371
|
+
.animate({"top" : 0}, options.animationSpeed, resetAndUnlock);
|
372
|
+
}
|
373
|
+
}
|
374
|
+
//push-over
|
375
|
+
if(options.animation == "horizontal-push") {
|
376
|
+
if(slideDirection == "next") {
|
377
|
+
slides
|
378
|
+
.eq(activeSlide)
|
379
|
+
.css({"left": orbitWidth, "z-index" : 3})
|
380
|
+
.animate({"left" : 0}, options.animationSpeed, resetAndUnlock);
|
381
|
+
slides
|
382
|
+
.eq(prevActiveSlide)
|
383
|
+
.animate({"left" : -orbitWidth}, options.animationSpeed);
|
384
|
+
}
|
385
|
+
if(slideDirection == "prev") {
|
386
|
+
slides
|
387
|
+
.eq(activeSlide)
|
388
|
+
.css({"left": -orbitWidth, "z-index" : 3})
|
389
|
+
.animate({"left" : 0}, options.animationSpeed, resetAndUnlock);
|
390
|
+
slides
|
391
|
+
.eq(prevActiveSlide)
|
392
|
+
.animate({"left" : orbitWidth}, options.animationSpeed);
|
393
|
+
}
|
394
|
+
}
|
395
|
+
setCaption();
|
396
|
+
} //lock
|
397
|
+
}//orbit function
|
398
|
+
});//each call
|
399
|
+
}//orbit plugin call
|
400
|
+
})(jQuery);
|
401
|
+
|