zurb-foundation 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +51 -13
- data/lib/foundation/generators/layout_generator.rb +10 -1
- data/lib/foundation/generators/templates/application.html.erb +1 -1
- data/lib/foundation/generators/templates/application.html.haml +30 -0
- data/lib/foundation/generators/templates/application.html.slim +30 -0
- data/lib/foundation/version.rb +1 -1
- data/{app → vendor}/assets/images/foundation/misc/button-gloss.png +0 -0
- data/{app → vendor}/assets/images/foundation/misc/button-overlay.png +0 -0
- data/{app → vendor}/assets/images/foundation/misc/custom-form-sprites.png +0 -0
- data/{app → vendor}/assets/images/foundation/misc/input-bg.png +0 -0
- data/{app → vendor}/assets/images/foundation/misc/modal-gloss.png +0 -0
- data/{app → vendor}/assets/images/foundation/misc/table-sorter.png +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/bullets.jpg +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/left-arrow.png +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/loading.gif +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/mask-black.png +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/pause-black.png +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/right-arrow.png +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/rotator-black.png +0 -0
- data/{app → vendor}/assets/images/foundation/orbit/timer-black.png +0 -0
- data/{app/assets/javascripts/foundation/jquery.orbit-1.3.0.js → vendor/assets/javascripts/foundation.js} +354 -1
- data/vendor/assets/stylesheets/foundation.scss +1072 -0
- metadata +26 -36
- data/app/assets/javascripts/foundation/app.js +0 -43
- data/app/assets/javascripts/foundation/forms.jquery.js +0 -58
- data/app/assets/javascripts/foundation/index.js +0 -6
- data/app/assets/javascripts/foundation/jquery.customforms.js +0 -162
- data/app/assets/javascripts/foundation/jquery.placeholder.min.js.erb +0 -2
- data/app/assets/javascripts/foundation/jquery.reveal.js +0 -150
- data/app/assets/stylesheets/foundation/forms.css.scss.erb +0 -83
- data/app/assets/stylesheets/foundation/globals.css.scss.erb +0 -301
- data/app/assets/stylesheets/foundation/index.css +0 -8
- data/app/assets/stylesheets/foundation/mobile.css.scss.erb +0 -112
- data/app/assets/stylesheets/foundation/orbit.css.scss.erb +0 -210
- data/app/assets/stylesheets/foundation/reveal.css.scss.erb +0 -91
- data/app/assets/stylesheets/foundation/ui.css.scss.erb +0 -212
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zurb-foundation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-28 00:00:00.000000000 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2156667340 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.1.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2156667340
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: jquery-rails
|
28
|
-
requirement: &
|
28
|
+
requirement: &2156663800 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2156663800
|
37
37
|
description: An easy to use, powerful, and flexible framework for building prototypes
|
38
38
|
and production code on any kind of device.
|
39
39
|
email:
|
@@ -46,34 +46,6 @@ files:
|
|
46
46
|
- Gemfile
|
47
47
|
- README.markdown
|
48
48
|
- Rakefile
|
49
|
-
- app/assets/images/foundation/misc/button-gloss.png
|
50
|
-
- app/assets/images/foundation/misc/button-overlay.png
|
51
|
-
- app/assets/images/foundation/misc/custom-form-sprites.png
|
52
|
-
- app/assets/images/foundation/misc/input-bg.png
|
53
|
-
- app/assets/images/foundation/misc/modal-gloss.png
|
54
|
-
- app/assets/images/foundation/misc/table-sorter.png
|
55
|
-
- app/assets/images/foundation/orbit/bullets.jpg
|
56
|
-
- app/assets/images/foundation/orbit/left-arrow.png
|
57
|
-
- app/assets/images/foundation/orbit/loading.gif
|
58
|
-
- app/assets/images/foundation/orbit/mask-black.png
|
59
|
-
- app/assets/images/foundation/orbit/pause-black.png
|
60
|
-
- app/assets/images/foundation/orbit/right-arrow.png
|
61
|
-
- app/assets/images/foundation/orbit/rotator-black.png
|
62
|
-
- app/assets/images/foundation/orbit/timer-black.png
|
63
|
-
- app/assets/javascripts/foundation/app.js
|
64
|
-
- app/assets/javascripts/foundation/forms.jquery.js
|
65
|
-
- app/assets/javascripts/foundation/index.js
|
66
|
-
- app/assets/javascripts/foundation/jquery.customforms.js
|
67
|
-
- app/assets/javascripts/foundation/jquery.orbit-1.3.0.js
|
68
|
-
- app/assets/javascripts/foundation/jquery.placeholder.min.js.erb
|
69
|
-
- app/assets/javascripts/foundation/jquery.reveal.js
|
70
|
-
- app/assets/stylesheets/foundation/forms.css.scss.erb
|
71
|
-
- app/assets/stylesheets/foundation/globals.css.scss.erb
|
72
|
-
- app/assets/stylesheets/foundation/index.css
|
73
|
-
- app/assets/stylesheets/foundation/mobile.css.scss.erb
|
74
|
-
- app/assets/stylesheets/foundation/orbit.css.scss.erb
|
75
|
-
- app/assets/stylesheets/foundation/reveal.css.scss.erb
|
76
|
-
- app/assets/stylesheets/foundation/ui.css.scss.erb
|
77
49
|
- foundation.gemspec
|
78
50
|
- lib/foundation/engine.rb
|
79
51
|
- lib/foundation/generators/USAGE
|
@@ -81,9 +53,27 @@ files:
|
|
81
53
|
- lib/foundation/generators/layout_generator.rb
|
82
54
|
- lib/foundation/generators/templates/application.css
|
83
55
|
- lib/foundation/generators/templates/application.html.erb
|
56
|
+
- lib/foundation/generators/templates/application.html.haml
|
57
|
+
- lib/foundation/generators/templates/application.html.slim
|
84
58
|
- lib/foundation/generators/templates/application.js
|
85
59
|
- lib/foundation/version.rb
|
86
60
|
- lib/zurb-foundation.rb
|
61
|
+
- vendor/assets/images/foundation/misc/button-gloss.png
|
62
|
+
- vendor/assets/images/foundation/misc/button-overlay.png
|
63
|
+
- vendor/assets/images/foundation/misc/custom-form-sprites.png
|
64
|
+
- vendor/assets/images/foundation/misc/input-bg.png
|
65
|
+
- vendor/assets/images/foundation/misc/modal-gloss.png
|
66
|
+
- vendor/assets/images/foundation/misc/table-sorter.png
|
67
|
+
- vendor/assets/images/foundation/orbit/bullets.jpg
|
68
|
+
- vendor/assets/images/foundation/orbit/left-arrow.png
|
69
|
+
- vendor/assets/images/foundation/orbit/loading.gif
|
70
|
+
- vendor/assets/images/foundation/orbit/mask-black.png
|
71
|
+
- vendor/assets/images/foundation/orbit/pause-black.png
|
72
|
+
- vendor/assets/images/foundation/orbit/right-arrow.png
|
73
|
+
- vendor/assets/images/foundation/orbit/rotator-black.png
|
74
|
+
- vendor/assets/images/foundation/orbit/timer-black.png
|
75
|
+
- vendor/assets/javascripts/foundation.js
|
76
|
+
- vendor/assets/stylesheets/foundation.scss
|
87
77
|
has_rdoc: true
|
88
78
|
homepage: http://foundation.zurb.com
|
89
79
|
licenses: []
|
@@ -99,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
89
|
version: '0'
|
100
90
|
segments:
|
101
91
|
- 0
|
102
|
-
hash:
|
92
|
+
hash: 3327952097264640656
|
103
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
94
|
none: false
|
105
95
|
requirements:
|
@@ -108,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
98
|
version: '0'
|
109
99
|
segments:
|
110
100
|
- 0
|
111
|
-
hash:
|
101
|
+
hash: 3327952097264640656
|
112
102
|
requirements: []
|
113
103
|
rubyforge_project: foundation
|
114
104
|
rubygems_version: 1.6.2
|
@@ -1,43 +0,0 @@
|
|
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 this and jquery.placeholder.min.js if you don't need :) */
|
40
|
-
|
41
|
-
$('input, textarea').placeholder();
|
42
|
-
|
43
|
-
});
|
@@ -1,58 +0,0 @@
|
|
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);
|
@@ -1,162 +0,0 @@
|
|
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);
|
@@ -1,2 +0,0 @@
|
|
1
|
-
/*! http://mths.be/placeholder v1.8.5 by @mathias */
|
2
|
-
(function(g,a,$){var f='placeholder' in a.createElement('input'),b='placeholder' in a.createElement('textarea');if(f&&b){$.fn.placeholder=function(){return this};$.fn.placeholder.input=$.fn.placeholder.textarea=true}else{$.fn.placeholder=function(){return this.filter((f?'textarea':':input')+'[placeholder]').bind('focus.placeholder',c).bind('blur.placeholder',e).trigger('blur.placeholder').end()};$.fn.placeholder.input=f;$.fn.placeholder.textarea=b;$(function(){$('form').bind('submit.placeholder',function(){var h=$('.placeholder',this).each(c);setTimeout(function(){h.each(e)},10)})});$(g).bind('unload.placeholder',function(){$('.placeholder').val('')})}function d(i){var h={},j=/^jQuery\d+$/;$.each(i.attributes,function(l,k){if(k.specified&&!j.test(k.name)){h[k.name]=k.value}});return h}function c(){var h=$(this);if(h.val()===h.attr('placeholder')&&h.hasClass('placeholder')){if(h.data('placeholder-password')){h.hide().next().show().focus().attr('id',h.removeAttr('id').data('placeholder-id'))}else{h.val('').removeClass('placeholder')}}}function e(){var l,k=$(this),h=k,j=this.id;if(k.val()===''){if(k.is(':password')){if(!k.data('placeholder-textinput')){try{l=k.clone().attr({type:'text'})}catch(i){l=$('<input>').attr($.extend(d(this),{type:'text'}))}l.removeAttr('name').data('placeholder-password',true).data('placeholder-id',j).bind('focus.placeholder',c);k.data('placeholder-textinput',l).data('placeholder-id',j).before(l)}k=k.removeAttr('id').hide().prev().attr('id',j).show()}k.addClass('placeholder').val(k.attr('placeholder'))}else{k.removeClass('placeholder')}}}(this,document,jQuery));
|
@@ -1,150 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery Reveal 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
|
-
|
10
|
-
(function($) {
|
11
|
-
|
12
|
-
/*---------------------------
|
13
|
-
Defaults for Reveal
|
14
|
-
----------------------------*/
|
15
|
-
|
16
|
-
/*---------------------------
|
17
|
-
Listener for data-reveal-id attributes
|
18
|
-
----------------------------*/
|
19
|
-
|
20
|
-
$('a[data-reveal-id]').live('click', function(e) {
|
21
|
-
e.preventDefault();
|
22
|
-
var modalLocation = $(this).attr('data-reveal-id');
|
23
|
-
$('#'+modalLocation).reveal($(this).data());
|
24
|
-
});
|
25
|
-
|
26
|
-
/*---------------------------
|
27
|
-
Extend and Execute
|
28
|
-
----------------------------*/
|
29
|
-
|
30
|
-
$.fn.reveal = function(options) {
|
31
|
-
|
32
|
-
|
33
|
-
var defaults = {
|
34
|
-
animation: 'fadeAndPop', //fade, fadeAndPop, none
|
35
|
-
animationspeed: 300, //how fast animtions are
|
36
|
-
closeonbackgroundclick: true, //if you click background will modal close?
|
37
|
-
dismissmodalclass: 'close-reveal-modal' //the class of a button or element that will close an open modal
|
38
|
-
};
|
39
|
-
|
40
|
-
//Extend dem' options
|
41
|
-
var options = $.extend({}, defaults, options);
|
42
|
-
|
43
|
-
return this.each(function() {
|
44
|
-
|
45
|
-
/*---------------------------
|
46
|
-
Global Variables
|
47
|
-
----------------------------*/
|
48
|
-
var modal = $(this),
|
49
|
-
topMeasure = parseInt(modal.css('top')),
|
50
|
-
topOffset = modal.height() + topMeasure,
|
51
|
-
locked = false,
|
52
|
-
modalBG = $('.reveal-modal-bg');
|
53
|
-
|
54
|
-
/*---------------------------
|
55
|
-
Create Modal BG
|
56
|
-
----------------------------*/
|
57
|
-
if(modalBG.length == 0) {
|
58
|
-
modalBG = $('<div class="reveal-modal-bg" />').insertAfter(modal);
|
59
|
-
}
|
60
|
-
|
61
|
-
/*---------------------------
|
62
|
-
Open and add Closing Listeners
|
63
|
-
----------------------------*/
|
64
|
-
//Open Modal Immediately
|
65
|
-
openModal();
|
66
|
-
|
67
|
-
//Close Modal Listeners
|
68
|
-
var closeButton = $('.' + options.dismissmodalclass).bind('click.modalEvent',closeModal)
|
69
|
-
if(options.closeonbackgroundclick) {
|
70
|
-
modalBG.css({"cursor":"pointer"})
|
71
|
-
modalBG.bind('click.modalEvent',closeModal)
|
72
|
-
}
|
73
|
-
|
74
|
-
|
75
|
-
/*---------------------------
|
76
|
-
Open & Close Animations
|
77
|
-
----------------------------*/
|
78
|
-
//Entrance Animations
|
79
|
-
function openModal() {
|
80
|
-
modalBG.unbind('click.modalEvent');
|
81
|
-
$('.' + options.dismissmodalclass).unbind('click.modalEvent');
|
82
|
-
if(!locked) {
|
83
|
-
lockModal();
|
84
|
-
if(options.animation == "fadeAndPop") {
|
85
|
-
modal.css({'top': $(document).scrollTop()-topOffset, 'opacity' : 0, 'visibility' : 'visible'});
|
86
|
-
modalBG.fadeIn(options.animationspeed/2);
|
87
|
-
modal.delay(options.animationspeed/2).animate({
|
88
|
-
"top": $(document).scrollTop()+topMeasure,
|
89
|
-
"opacity" : 1
|
90
|
-
}, options.animationspeed,unlockModal());
|
91
|
-
}
|
92
|
-
if(options.animation == "fade") {
|
93
|
-
modal.css({'opacity' : 0, 'visibility' : 'visible', 'top': $(document).scrollTop()+topMeasure});
|
94
|
-
modalBG.fadeIn(options.animationspeed/2);
|
95
|
-
modal.delay(options.animationspeed/2).animate({
|
96
|
-
"opacity" : 1
|
97
|
-
}, options.animationspeed,unlockModal());
|
98
|
-
}
|
99
|
-
if(options.animation == "none") {
|
100
|
-
modal.css({'visibility' : 'visible', 'top':$(document).scrollTop()+topMeasure});
|
101
|
-
modalBG.css({"display":"block"});
|
102
|
-
unlockModal()
|
103
|
-
}
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
//Closing Animation
|
108
|
-
function closeModal() {
|
109
|
-
if(!locked) {
|
110
|
-
lockModal();
|
111
|
-
if(options.animation == "fadeAndPop") {
|
112
|
-
modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);
|
113
|
-
modal.animate({
|
114
|
-
"top": $(document).scrollTop()-topOffset,
|
115
|
-
"opacity" : 0
|
116
|
-
}, options.animationspeed/2, function() {
|
117
|
-
modal.css({'top':topMeasure, 'opacity' : 1, 'visibility' : 'hidden'});
|
118
|
-
unlockModal();
|
119
|
-
});
|
120
|
-
}
|
121
|
-
if(options.animation == "fade") {
|
122
|
-
modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);
|
123
|
-
modal.animate({
|
124
|
-
"opacity" : 0
|
125
|
-
}, options.animationspeed, function() {
|
126
|
-
modal.css({'opacity' : 1, 'visibility' : 'hidden', 'top' : topMeasure});
|
127
|
-
unlockModal();
|
128
|
-
});
|
129
|
-
}
|
130
|
-
if(options.animation == "none") {
|
131
|
-
modal.css({'visibility' : 'hidden', 'top' : topMeasure});
|
132
|
-
modalBG.css({'display' : 'none'});
|
133
|
-
}
|
134
|
-
}
|
135
|
-
}
|
136
|
-
|
137
|
-
/*---------------------------
|
138
|
-
Animations Locks
|
139
|
-
----------------------------*/
|
140
|
-
function unlockModal() {
|
141
|
-
locked = false;
|
142
|
-
}
|
143
|
-
function lockModal() {
|
144
|
-
locked = true;
|
145
|
-
}
|
146
|
-
|
147
|
-
});//each call
|
148
|
-
}//orbit plugin call
|
149
|
-
})(jQuery);
|
150
|
-
|