zurb-foundation-5 5.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.bowerrc +3 -0
- data/.editorconfig +9 -0
- data/.gitignore +46 -0
- data/.travis.yml +34 -0
- data/CONTRIBUTING.md +55 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +16 -0
- data/Gruntfile.js +222 -0
- data/LICENSE +22 -0
- data/README.md +44 -0
- data/bower.json +20 -0
- data/composer.json +9 -0
- data/foundation.gemspec +21 -0
- data/humans.txt +8 -0
- data/js/foundation/foundation.abide.js +299 -0
- data/js/foundation/foundation.accordion.js +54 -0
- data/js/foundation/foundation.alert.js +43 -0
- data/js/foundation/foundation.clearing.js +531 -0
- data/js/foundation/foundation.dropdown.js +306 -0
- data/js/foundation/foundation.equalizer.js +68 -0
- data/js/foundation/foundation.interchange.js +331 -0
- data/js/foundation/foundation.joyride.js +849 -0
- data/js/foundation/foundation.js +609 -0
- data/js/foundation/foundation.magellan.js +173 -0
- data/js/foundation/foundation.offcanvas.js +50 -0
- data/js/foundation/foundation.orbit.js +606 -0
- data/js/foundation/foundation.reveal.js +427 -0
- data/js/foundation/foundation.slider.js +200 -0
- data/js/foundation/foundation.tab.js +168 -0
- data/js/foundation/foundation.tooltip.js +272 -0
- data/js/foundation/foundation.topbar.js +422 -0
- data/karma.conf.js +114 -0
- data/lib/foundation/engine.rb +20 -0
- data/lib/foundation/generators/USAGE +15 -0
- data/lib/foundation/generators/install_generator.rb +54 -0
- data/lib/foundation/generators/templates/application.html.erb +47 -0
- data/lib/foundation/generators/templates/application.html.haml +31 -0
- data/lib/foundation/generators/templates/application.html.slim +35 -0
- data/lib/foundation/sprockets.rb +4 -0
- data/lib/foundation/version.rb +3 -0
- data/lib/scss.js +114 -0
- data/lib/zurb-foundation.rb +33 -0
- data/package.json +48 -0
- data/robots.txt +4 -0
- data/run-tests.sh +83 -0
- data/sache.json +5 -0
- data/scss/foundation.scss +45 -0
- data/scss/foundation/_functions.scss +101 -0
- data/scss/foundation/_settings.scss +1279 -0
- data/scss/foundation/components/_accordion.scss +52 -0
- data/scss/foundation/components/_alert-boxes.scss +126 -0
- data/scss/foundation/components/_block-grid.scss +132 -0
- data/scss/foundation/components/_breadcrumbs.scss +127 -0
- data/scss/foundation/components/_button-groups.scss +108 -0
- data/scss/foundation/components/_buttons.scss +222 -0
- data/scss/foundation/components/_clearing.scss +247 -0
- data/scss/foundation/components/_dropdown-buttons.scss +129 -0
- data/scss/foundation/components/_dropdown.scss +248 -0
- data/scss/foundation/components/_flex-video.scss +51 -0
- data/scss/foundation/components/_forms.scss +496 -0
- data/scss/foundation/components/_global.scss +365 -0
- data/scss/foundation/components/_grid.scss +261 -0
- data/scss/foundation/components/_inline-lists.scss +56 -0
- data/scss/foundation/components/_joyride.scss +220 -0
- data/scss/foundation/components/_keystrokes.scss +61 -0
- data/scss/foundation/components/_labels.scss +104 -0
- data/scss/foundation/components/_magellan.scss +34 -0
- data/scss/foundation/components/_offcanvas.scss +381 -0
- data/scss/foundation/components/_orbit.scss +415 -0
- data/scss/foundation/components/_pagination.scss +150 -0
- data/scss/foundation/components/_panels.scss +91 -0
- data/scss/foundation/components/_pricing-tables.scss +150 -0
- data/scss/foundation/components/_progress-bars.scss +79 -0
- data/scss/foundation/components/_range-slider.scss +148 -0
- data/scss/foundation/components/_reveal-new.scss +0 -0
- data/scss/foundation/components/_reveal.scss +216 -0
- data/scss/foundation/components/_side-nav.scss +93 -0
- data/scss/foundation/components/_split-buttons.scss +191 -0
- data/scss/foundation/components/_sub-nav.scss +125 -0
- data/scss/foundation/components/_switch.scss +294 -0
- data/scss/foundation/components/_tables.scss +97 -0
- data/scss/foundation/components/_tabs.scss +105 -0
- data/scss/foundation/components/_thumbs.scss +68 -0
- data/scss/foundation/components/_tooltips.scss +140 -0
- data/scss/foundation/components/_top-bar.scss +640 -0
- data/scss/foundation/components/_type.scss +493 -0
- data/scss/foundation/components/_visibility.scss +345 -0
- data/scss/foundation/test.html +0 -0
- data/scss/normalize.scss +423 -0
- data/spec/abide/abide.js +173 -0
- data/spec/abide/advanced.html +22 -0
- data/spec/abide/basic.html +13 -0
- data/spec/accordion/accordion.js +94 -0
- data/spec/accordion/basic.html +39 -0
- data/spec/accordion/grid.html +44 -0
- data/spec/accordion/multiexpand.html +20 -0
- data/spec/alert/alert.js +35 -0
- data/spec/alert/basic.html +4 -0
- data/spec/clearing/222.gif +0 -0
- data/spec/clearing/777.gif +0 -0
- data/spec/clearing/basic.html +5 -0
- data/spec/clearing/ccc.gif +0 -0
- data/spec/clearing/clearing.js +55 -0
- data/spec/dropdown/basic.html +10 -0
- data/spec/dropdown/dropdown.js +65 -0
- data/spec/equalizer/basic.html +24 -0
- data/spec/equalizer/equalizer.js +30 -0
- data/spec/framework/framework.js +14 -0
- data/spec/helpers.js +37 -0
- data/spec/interchange/basic.html +3 -0
- data/spec/interchange/interchange.js +60 -0
- data/spec/joyride/joyride.js +14 -0
- data/spec/magellan/magellan.js +14 -0
- data/spec/offcanvas/offcanvas.js +14 -0
- data/spec/orbit/orbit.js +14 -0
- data/spec/reveal/reveal.js +14 -0
- data/spec/tab/tab.js +14 -0
- data/spec/tooltip/tooltip.js +14 -0
- data/spec/topbar/multidropdown.html +60 -0
- data/spec/topbar/sticky.html +31 -0
- data/spec/topbar/topbar.js +96 -0
- metadata +238 -0
data/spec/abide/abide.js
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
describe('abide:', function() {
|
2
|
+
beforeEach(function() {
|
3
|
+
this.addMatchers({
|
4
|
+
// Place abide-specific matchers here...
|
5
|
+
});
|
6
|
+
|
7
|
+
var origFunc = $.fn.foundation;
|
8
|
+
spyOn($.fn, 'foundation').andCallFake(function() {
|
9
|
+
var result = origFunc.apply(this, arguments);
|
10
|
+
jasmine.Clock.tick(1000); // Let things settle...
|
11
|
+
return result;
|
12
|
+
});
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('basic validation', function() {
|
16
|
+
beforeEach(function() {
|
17
|
+
document.body.innerHTML = __html__['spec/abide/basic.html'];
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should not mark fields as invalid on load', function() {
|
21
|
+
$(document).foundation();
|
22
|
+
|
23
|
+
expect($('input[name="user_name"]')).not.toHaveData('invalid');
|
24
|
+
expect($('input[name="user_email"]')).not.toHaveData('invalid');
|
25
|
+
});
|
26
|
+
|
27
|
+
it('should trigger correct events for all required fields', function() {
|
28
|
+
$(document).foundation();
|
29
|
+
|
30
|
+
var settings = Foundation.libs.abide.settings;
|
31
|
+
|
32
|
+
spyOnEvent('form', 'invalid');
|
33
|
+
spyOnEvent('form', 'valid');
|
34
|
+
|
35
|
+
spyOnEvent('input[name="user_name"]', 'invalid');
|
36
|
+
spyOnEvent('input[name="user_name"]', 'valid');
|
37
|
+
|
38
|
+
spyOnEvent('input[name="user_email"]', 'invalid');
|
39
|
+
spyOnEvent('input[name="user_email"]', 'valid');
|
40
|
+
|
41
|
+
$('form').submit();
|
42
|
+
|
43
|
+
expect('valid').not.toHaveBeenTriggeredOn('form');
|
44
|
+
expect('valid').not.toHaveBeenTriggeredOn('input[name="user_name"]');
|
45
|
+
expect('valid').not.toHaveBeenTriggeredOn('input[name="user_email"]');
|
46
|
+
|
47
|
+
expect('invalid').toHaveBeenTriggeredOn('form');
|
48
|
+
expect('invalid').toHaveBeenTriggeredOn('input[name="user_name"]');
|
49
|
+
expect('invalid').toHaveBeenTriggeredOn('input[name="user_email"]');
|
50
|
+
});
|
51
|
+
|
52
|
+
it('should mark missing required fields as invalid', function() {
|
53
|
+
$(document).foundation();
|
54
|
+
|
55
|
+
expect($('input[name="user_name"]')).not.toHaveData('invalid');
|
56
|
+
expect($('input[name="user_email"]')).not.toHaveData('invalid');
|
57
|
+
|
58
|
+
$('form').submit();
|
59
|
+
|
60
|
+
var invalid_fields = $('form').find('[data-invalid]');
|
61
|
+
expect(invalid_fields.length).toBe(2);
|
62
|
+
|
63
|
+
expect($('input[name="user_name"]')).toHaveData('invalid');
|
64
|
+
expect($('input[name="user_email"]')).toHaveData('invalid');
|
65
|
+
});
|
66
|
+
|
67
|
+
it('should pass validation when all fields are filled out correctly', function() {
|
68
|
+
$(document).foundation();
|
69
|
+
|
70
|
+
spyOnEvent('form', 'invalid');
|
71
|
+
spyOnEvent('form', 'valid');
|
72
|
+
|
73
|
+
spyOnEvent('input[name="user_name"]', 'invalid');
|
74
|
+
spyOnEvent('input[name="user_name"]', 'valid');
|
75
|
+
|
76
|
+
spyOnEvent('input[name="user_email"]', 'invalid');
|
77
|
+
spyOnEvent('input[name="user_email"]', 'valid');
|
78
|
+
|
79
|
+
$('input[name="user_name"]').val('John');
|
80
|
+
$('input[name="user_email"]').val('foo@bar.com');
|
81
|
+
|
82
|
+
$('form').submit();
|
83
|
+
|
84
|
+
expect('valid').toHaveBeenTriggeredOn('form');
|
85
|
+
expect('valid').toHaveBeenTriggeredOn('input[name="user_name"]');
|
86
|
+
expect('valid').toHaveBeenTriggeredOn('input[name="user_email"]');
|
87
|
+
|
88
|
+
expect('invalid').not.toHaveBeenTriggeredOn('form');
|
89
|
+
expect('invalid').not.toHaveBeenTriggeredOn('input[name="user_name"]');
|
90
|
+
expect('invalid').not.toHaveBeenTriggeredOn('input[name="user_email"]');
|
91
|
+
});
|
92
|
+
});
|
93
|
+
|
94
|
+
describe('advanced validation', function() {
|
95
|
+
beforeEach(function() {
|
96
|
+
document.body.innerHTML = __html__['spec/abide/advanced.html'];
|
97
|
+
});
|
98
|
+
|
99
|
+
it('should support builtin equalTo validator', function() {
|
100
|
+
$(document).foundation({
|
101
|
+
abide: {
|
102
|
+
validators: {
|
103
|
+
range: function(){ return true; }
|
104
|
+
}
|
105
|
+
}
|
106
|
+
});
|
107
|
+
|
108
|
+
|
109
|
+
expect($('input[name="user_password"]')).not.toHaveAttr('data-invalid');
|
110
|
+
expect($('input[name="user_password_confirmation"]')).not.toHaveAttr('data-invalid');
|
111
|
+
|
112
|
+
$('input[name="user_password"]').val("foobarbaz");
|
113
|
+
// now they're not equal
|
114
|
+
$('form').submit();
|
115
|
+
|
116
|
+
var invalid_fields = $('form').find('[data-invalid]');
|
117
|
+
expect(invalid_fields.length).toBe(1);
|
118
|
+
expect($('input[name="user_password_confirmation"]')).toHaveAttr('data-invalid');
|
119
|
+
|
120
|
+
$('input[name="user_password_confirmation"]').val("foobarbaz");
|
121
|
+
// now they're equal
|
122
|
+
spyOnEvent('form', 'invalid');
|
123
|
+
spyOnEvent('form', 'valid');
|
124
|
+
|
125
|
+
$('form').submit();
|
126
|
+
|
127
|
+
expect('valid').toHaveBeenTriggeredOn('form');
|
128
|
+
expect($('input[name="user_password"]')).not.toHaveAttr('data-invalid');
|
129
|
+
expect($('input[name="user_password_confirmation"]')).not.toHaveAttr('data-invalid');
|
130
|
+
});
|
131
|
+
|
132
|
+
it('should support custom validators', function() {
|
133
|
+
$(document).foundation({
|
134
|
+
abide: {
|
135
|
+
validators: {
|
136
|
+
range: function(el, required, parent) {
|
137
|
+
var start = parseInt(this.S("[name='user_start_num']").val()),
|
138
|
+
end = parseInt(el.value);
|
139
|
+
|
140
|
+
return start < end;
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
});
|
145
|
+
|
146
|
+
expect($('input[name="user_start_num"]')).not.toHaveData('invalid');
|
147
|
+
expect($('input[name="user_end_num"]')).not.toHaveData('invalid');
|
148
|
+
|
149
|
+
// invalid
|
150
|
+
$('input[name="user_start_num"]').val("10");
|
151
|
+
$('input[name="user_end_num"]').val("2");
|
152
|
+
|
153
|
+
$('form').submit();
|
154
|
+
|
155
|
+
var invalid_fields = $('form').find('[data-invalid]');
|
156
|
+
expect(invalid_fields.length).toBe(1);
|
157
|
+
|
158
|
+
expect($('input[name="user_start_num"]')).not.toHaveAttr('data-invalid');
|
159
|
+
expect($('input[name="user_end_num"]')).toHaveAttr('data-invalid');
|
160
|
+
|
161
|
+
// valid now
|
162
|
+
$('input[name="user_end_num"]').val("12");
|
163
|
+
spyOnEvent('form', 'invalid');
|
164
|
+
spyOnEvent('form', 'valid');
|
165
|
+
|
166
|
+
$('form').submit();
|
167
|
+
|
168
|
+
expect('valid').toHaveBeenTriggeredOn('form');
|
169
|
+
expect($('input[name="user_start_num"]')).not.toHaveAttr('data-invalid');
|
170
|
+
expect($('input[name="user_end_num"]')).not.toHaveAttr('data-invalid');
|
171
|
+
});
|
172
|
+
});
|
173
|
+
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<form data-abide="ajax">
|
2
|
+
<div class="range-start-field">
|
3
|
+
<label>Starting number <small>required</small></label>
|
4
|
+
<input name="user_start_num" type="text">
|
5
|
+
<small class="error">Starting number must be before the end date</small>
|
6
|
+
</div>
|
7
|
+
<div class="range-end-field">
|
8
|
+
<label>Ending number <small>required</small></label>
|
9
|
+
<input name="user_end_num" type="text" data-abide-validator="range">
|
10
|
+
<small class="error">Ending number must be before the end date</small>
|
11
|
+
</div>
|
12
|
+
<div class="password-field">
|
13
|
+
<label>Password <small>required</small></label>
|
14
|
+
<input id="user_password" name="user_password" type="password">
|
15
|
+
</div>
|
16
|
+
<div class="password-confirmation-field">
|
17
|
+
<label>Password confirmation<small>required</small></label>
|
18
|
+
<input name="user_password_confirmation" type="password" data-abide-validator="equalTo" data-equalto="user_password">
|
19
|
+
<small class="error">Password and password confirmation must match.</small>
|
20
|
+
</div>
|
21
|
+
<button type="submit">Submit</button>
|
22
|
+
</form>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<form data-abide="ajax">
|
2
|
+
<div class="name-field">
|
3
|
+
<label>Your name <small>required</small></label>
|
4
|
+
<input name="user_name" type="text" required pattern="[a-zA-Z]+">
|
5
|
+
<small class="error">Name is required and must be a string.</small>
|
6
|
+
</div>
|
7
|
+
<div class="email-field">
|
8
|
+
<label>Email <small>required</small></label>
|
9
|
+
<input name="user_email" type="email" required>
|
10
|
+
<small class="error">An email address is required.</small>
|
11
|
+
</div>
|
12
|
+
<button type="submit">Submit</button>
|
13
|
+
</form>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
describe('accordion:', function() {
|
2
|
+
beforeEach(function() {
|
3
|
+
this.addMatchers({
|
4
|
+
// Place accordion-specific matchers here...
|
5
|
+
});
|
6
|
+
|
7
|
+
var origFunc = $.fn.foundation;
|
8
|
+
spyOn($.fn, 'foundation').andCallFake(function() {
|
9
|
+
var result = origFunc.apply(this, arguments);
|
10
|
+
jasmine.Clock.tick(1000); // Let things settle...
|
11
|
+
return result;
|
12
|
+
});
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('basic accordion with tab child', function() {
|
16
|
+
beforeEach(function() {
|
17
|
+
document.body.innerHTML = __html__['spec/accordion/basic.html'];
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should default to the active tab', function() {
|
21
|
+
$(document).foundation();
|
22
|
+
|
23
|
+
expect($('#panel1')).toBeVisible();
|
24
|
+
expect($('#panel2-1')).toBeVisible();
|
25
|
+
expect($('#panel2-2')).toBeHidden();
|
26
|
+
expect($('#panel2')).toBeHidden();
|
27
|
+
expect($('#panel3')).toBeHidden();
|
28
|
+
});
|
29
|
+
|
30
|
+
it('should switch to the clicked section', function() {
|
31
|
+
$(document).foundation();
|
32
|
+
|
33
|
+
$('#panel2').prev().click();
|
34
|
+
|
35
|
+
expect($('#panel1')).toBeHidden();
|
36
|
+
expect($('#panel2-1')).toBeHidden();
|
37
|
+
expect($('#panel2-2')).toBeHidden();
|
38
|
+
expect($('#panel2')).toBeVisible();
|
39
|
+
expect($('#panel3')).toBeHidden();
|
40
|
+
});
|
41
|
+
});
|
42
|
+
|
43
|
+
describe('embedded grid accordion', function() {
|
44
|
+
beforeEach(function() {
|
45
|
+
document.body.innerHTML = __html__['spec/accordion/grid.html'];
|
46
|
+
});
|
47
|
+
|
48
|
+
it('should switch to the clicked section', function() {
|
49
|
+
$(document).foundation();
|
50
|
+
|
51
|
+
$('#panel1c').prev().click();
|
52
|
+
|
53
|
+
expect($('#panel1c')).toBeVisible();
|
54
|
+
expect($('#panel2c')).toBeHidden();
|
55
|
+
expect($('#panel3c')).toBeHidden();
|
56
|
+
expect($('#panel4c')).toBeHidden();
|
57
|
+
expect($('#panel5c')).toBeHidden();
|
58
|
+
expect($('#panel6c')).toBeHidden();
|
59
|
+
|
60
|
+
$('#panel4c').prev().click();
|
61
|
+
|
62
|
+
expect($('#panel1c')).toBeHidden();
|
63
|
+
expect($('#panel2c')).toBeHidden();
|
64
|
+
expect($('#panel3c')).toBeHidden();
|
65
|
+
expect($('#panel4c')).toBeVisible();
|
66
|
+
expect($('#panel5c')).toBeHidden();
|
67
|
+
expect($('#panel6c')).toBeHidden();
|
68
|
+
});
|
69
|
+
});
|
70
|
+
|
71
|
+
describe('multi-expand accordion', function() {
|
72
|
+
beforeEach(function() {
|
73
|
+
document.body.innerHTML = __html__['spec/accordion/multiexpand.html'];
|
74
|
+
});
|
75
|
+
|
76
|
+
it('should default to the active panel', function() {
|
77
|
+
$(document).foundation('accordion', { multi_expand: true });
|
78
|
+
|
79
|
+
expect($('#panel1')).toBeHidden();
|
80
|
+
expect($('#panel2')).toBeVisible();
|
81
|
+
expect($('#panel3')).toBeHidden();
|
82
|
+
});
|
83
|
+
|
84
|
+
it('should open the clicked section, leaving previous active panels open', function() {
|
85
|
+
$(document).foundation('accordion', { multi_expand: true });
|
86
|
+
|
87
|
+
$('#panel3').prev().click();
|
88
|
+
|
89
|
+
expect($('#panel1')).toBeHidden();
|
90
|
+
expect($('#panel2')).toBeVisible();
|
91
|
+
expect($('#panel3')).toBeVisible();
|
92
|
+
});
|
93
|
+
});
|
94
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<dl class="accordion" data-accordion>
|
2
|
+
<dd>
|
3
|
+
<a href="#panel1">Accordion 1</a>
|
4
|
+
<div id="panel1" class="content active">
|
5
|
+
<dl class="tabs" data-tab>
|
6
|
+
<dd class="active"><a href="#panel2-1">Tab 1</a></dd>
|
7
|
+
<dd><a href="#panel2-2">Tab 2</a></dd>
|
8
|
+
<dd><a href="#panel2-3">Tab 3</a></dd>
|
9
|
+
<dd><a href="#panel2-4">Tab 4</a></dd>
|
10
|
+
</dl>
|
11
|
+
<div class="tabs-content">
|
12
|
+
<div class="content active" id="panel2-1">
|
13
|
+
<p>First panel content goes here...</p>
|
14
|
+
</div>
|
15
|
+
<div class="content" id="panel2-2">
|
16
|
+
<p>Second panel content goes here...</p>
|
17
|
+
</div>
|
18
|
+
<div class="content" id="panel2-3">
|
19
|
+
<p>Third panel content goes here...</p>
|
20
|
+
</div>
|
21
|
+
<div class="content" id="panel2-4">
|
22
|
+
<p>Fourth panel content goes here...</p>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</dd>
|
27
|
+
<dd>
|
28
|
+
<a href="#panel2">Accordion 2</a>
|
29
|
+
<div id="panel2" class="content">
|
30
|
+
Panel 2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
31
|
+
</div>
|
32
|
+
</dd>
|
33
|
+
<dd>
|
34
|
+
<a href="#panel3">Accordion 3</a>
|
35
|
+
<div id="panel3" class="content">
|
36
|
+
Panel 3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
37
|
+
</div>
|
38
|
+
</dd>
|
39
|
+
</dl>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<dl class="accordion" data-accordion>
|
2
|
+
<ul class="small-block-grid-1 medium-block-grid-3">
|
3
|
+
<li>
|
4
|
+
<dd>
|
5
|
+
<a href="#panel1c">Accordion 1</a>
|
6
|
+
<div id="panel1c" class="content">
|
7
|
+
Panel 1. Lorem ipsum dolor
|
8
|
+
</div>
|
9
|
+
</dd>
|
10
|
+
<dd>
|
11
|
+
<a href="#panel2c">Accordion 2</a>
|
12
|
+
<div id="panel2c" class="content">
|
13
|
+
Panel 2. Lorem ipsum dolor
|
14
|
+
</div>
|
15
|
+
</dd>
|
16
|
+
<dd>
|
17
|
+
<a href="#panel3c">Accordion 3</a>
|
18
|
+
<div id="panel3c" class="content">
|
19
|
+
Panel 3. Lorem ipsum dolor
|
20
|
+
</div>
|
21
|
+
</dd>
|
22
|
+
</li>
|
23
|
+
<li>
|
24
|
+
<dd>
|
25
|
+
<a href="#panel4c">Accordion 4</a>
|
26
|
+
<div id="panel4c" class="content">
|
27
|
+
Panel 4. Lorem ipsum dolor
|
28
|
+
</div>
|
29
|
+
</dd>
|
30
|
+
<dd>
|
31
|
+
<a href="#panel5c">Accordion 5</a>
|
32
|
+
<div id="panel5c" class="content">
|
33
|
+
Panel 5. Lorem ipsum dolor
|
34
|
+
</div>
|
35
|
+
</dd>
|
36
|
+
<dd>
|
37
|
+
<a href="#panel6c">Accordion 6</a>
|
38
|
+
<div id="panel6c" class="content">
|
39
|
+
Panel 6. Lorem ipsum dolor
|
40
|
+
</div>
|
41
|
+
</dd>
|
42
|
+
</li>
|
43
|
+
</ul>
|
44
|
+
</dl>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<dl class="accordion" data-accordion>
|
2
|
+
<dd>
|
3
|
+
<a href="#panel1">Accordion 1</a>
|
4
|
+
<div id="panel1" class="content">
|
5
|
+
Panel 1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
6
|
+
</div>
|
7
|
+
</dd>
|
8
|
+
<dd>
|
9
|
+
<a href="#panel2">Accordion 2</a>
|
10
|
+
<div id="panel2" class="content active">
|
11
|
+
Panel 2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
12
|
+
</div>
|
13
|
+
</dd>
|
14
|
+
<dd>
|
15
|
+
<a href="#panel3">Accordion 3</a>
|
16
|
+
<div id="panel3" class="content">
|
17
|
+
Panel 3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
18
|
+
</div>
|
19
|
+
</dd>
|
20
|
+
</dl>
|
data/spec/alert/alert.js
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
describe('alert:', function() {
|
2
|
+
beforeEach(function() {
|
3
|
+
this.addMatchers({
|
4
|
+
// Place alert-specific matchers here...
|
5
|
+
});
|
6
|
+
|
7
|
+
var origFunc = $.fn.foundation;
|
8
|
+
spyOn($.fn, 'foundation').andCallFake(function() {
|
9
|
+
var result = origFunc.apply(this, arguments);
|
10
|
+
jasmine.Clock.tick(1000); // Let things settle...
|
11
|
+
return result;
|
12
|
+
});
|
13
|
+
});
|
14
|
+
|
15
|
+
describe('basic alert', function() {
|
16
|
+
beforeEach(function() {
|
17
|
+
document.body.innerHTML = __html__['spec/alert/basic.html'];
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should be visible by default', function() {
|
21
|
+
$(document).foundation();
|
22
|
+
|
23
|
+
expect($('#myAlert')).toBeVisible();
|
24
|
+
});
|
25
|
+
|
26
|
+
it('should be hidden when close is clicked', function() {
|
27
|
+
$(document).foundation();
|
28
|
+
|
29
|
+
// TODO: Figure out how to get this working... more difficult than it seems. :)
|
30
|
+
// $('a.close').click();
|
31
|
+
// jasmine.Clock.tick(1000);
|
32
|
+
//expect($('#alertClose')).not.toBeVisible();
|
33
|
+
});
|
34
|
+
});
|
35
|
+
});
|