Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Commit 752b836

Browse files
author
Marlow Payne
committed
pew pew Zepto; pew pew Bower
1 parent 5e4c586 commit 752b836

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+81
-14771
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
2-
bower_components/
32
.DS_Store
43
/.sass-cache/

README.md

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
A mobile-first accordion UI module for progressive disclosure on the web.
44

5-
[![Bower version](https://badge.fury.io/bo/bellows.svg)](http://badge.fury.io/bo/bellows)
65
[![Dependency Status](https://www.versioneye.com/user/projects/53ff9b7deab62a5003000009/badge.svg?style=flat)](https://www.versioneye.com/user/projects/53ff9b7deab62a5003000009)
76
[![Build Status](https://circleci.com/gh/mobify/bellows/tree/master.svg?style=shield&circle-token=8c096b513a1f04ef1b977178c4f3358c2a42a132)](https://circleci.com/gh/mobify/bellows)
87

@@ -14,37 +13,33 @@ You can find a simple demo on [the Documentation page](http://mobify.github.io/b
1413

1514
## Requirements
1615

17-
* [Zepto](http://zeptojs.com/)
18-
* [Velocity.js](http://velocityjs.org)
16+
* [jQuery](http://jquery.com/)
17+
* [Velocity.js](http://julian.com/research/velocity/)
1918

20-
### Velocity
19+
### Zepto Support
2120

22-
If you are using Zepto, you need to load `bower_components/velocity/velocity.js` (this file comes with a jQuery shim bundled directly in it). If you are using jQuery, you need to load `bower_components/velocity/jquery.velocity.js`.
23-
24-
### jQuery Support
25-
26-
Bellows supports jQuery but is not actively developed for it. You should be able to use Bellows directly with jQuery 2.0. While we don't actively support jQuery for Bellows, we welcome any and all issues and PRs to help us make it work.
21+
Bellows supports Zepto up until v5.1.2 but is not actively developed for it. You should be able to use Bellows directly with Zepto. While we don't actively support Zepto for Bellows, we welcome any and all issues and PRs to help us make it work.
2722

2823

2924
## Installation
3025

31-
Bellows can be installed using bower:
26+
Bellows can be installed using NPM:
3227

3328
```
34-
bower install bellows
29+
npm install bellows
3530
```
3631

3732
## Usage with Require.js
3833

39-
To use with require.js, after installing through bower you merely have to reference bellows in your require config file:
34+
To use with require.js, after installing through NPM you merely have to reference bellows in your require config file:
4035

4136
```config.js
4237

4338
{
4439
'paths': {
45-
'plugin': 'bower_components/plugin/dist/plugin.min',
46-
'bellows': 'bower_components/bellows/dist/bellows.min',
47-
'velocity': 'bower_components/mobify-velocity/velocity'
40+
'plugin': 'node_modules/plugin/dist/plugin.min',
41+
'bellows': 'node_modules/bellows/dist/bellows.min',
42+
'velocity': 'node_modules/velocity-animate/velocity'
4843
}
4944
}
5045

@@ -54,7 +49,7 @@ And then require bellows in as needed:
5449

5550
```
5651
define(
57-
['zepto', 'bellows'],
52+
['$', 'bellows'],
5853
function($) {
5954
$('.bellows').bellows();
6055
}
@@ -104,9 +99,9 @@ At a bare minimum, your markup structure should follow the above structure. You
10499
</div>
105100

106101
<!-- Include dependencies -->
107-
<script src="zepto.min.js"></script>
108-
<script src="bower_components/mobify-velocity/dist/velocity.min.js"></script>
109-
<script src="bower_components/plugin/dist/plugin.min.js"></script>
102+
<script src="jqueryin.js"></script>
103+
<script src="node_modules/velocity-animate/velocity.min.js"></script>
104+
<script src="node_modules/plugin/dist/plugin.min.js"></script>
110105

111106
<!-- Include bellows.js -->
112107
<script src="bellows.min.js"></script>
@@ -173,10 +168,10 @@ default: `swing`
173168

174169
Sets the easing for the animation. Bellows takes all of the same easing properties that [Velocity.js](http://julian.com/research/velocity) accepts.
175170

176-
> * [jQuery UI's easings](http://easings.net/) and CSS3's easings ("ease", "ease-in", "ease-out", and "ease-in-out"), which are pre-packaged into Velocity. A bonus "spring" easing (sampled in the CSS Support pane) is also included.
177-
* CSS3's bezier curves: Pass in a four-item array of bezier points. (Refer to [Cubic-Bezier.com](http://cubic-bezier.com/) for crafing custom bezier curves.)
178-
* Spring physics: Pass a two-item array in the form of [ tension, friction ]. A higher tension (default: 600) increases total speed and bounciness. A lower friction (default: 20) increases ending vibration speed.
179-
* Step easing: Pass a one-item array in the form of [ steps ]. The animation will jump toward its end values using the specified number of steps.
171+
> * [jQuery UI's easings](http://easings.net/) and CSS3's easings ("ease", "ease-in", "ease-out", and "ease-in-out"), which are pre-packaged into Velocity. A bonus "spring" easing (sampled in the CSS Support pane) is also included.
172+
* CSS3's bezier curves: Pass in a four-item array of bezier points. (Refer to [Cubic-Bezier.com](http://cubic-bezier.com/) for crafing custom bezier curves.)
173+
* Spring physics: Pass a two-item array in the form of [ tension, friction ]. A higher tension (default: 600) increases total speed and bounciness. A lower friction (default: 20) increases ending vibration speed.
174+
* Step easing: Pass a one-item array in the form of [ steps ]. The animation will jump toward its end values using the specified number of steps.
180175

181176
For more information, check out [Velocity's docs on easing](http://julian.com/research/velocity/#easing).
182177

@@ -197,11 +192,11 @@ Triggered every time the selected bellows item is starting to open.
197192
| Parameter name | Description |
198193
|----------------|-------------|
199194
| **e** | An Event object passed to the callback |
200-
| **ui** | An object containing any associated data for use inside the callback |
195+
| **ui** | An object containing any associated data for use inside the callback |
201196

202197
```js
203198
$('.bellows').bellows({
204-
open: function(e, ui) {
199+
open: function(e, ui) {
205200
// ui.item contains the item opening
206201
}
207202
});
@@ -218,11 +213,11 @@ Triggered every time the selected bellows item has finished opening.
218213
| Parameter name | Description |
219214
|----------------|-------------|
220215
| **e** | An Event object passed to the callback |
221-
| **ui** | An object containing any associated data for use inside the callback |
216+
| **ui** | An object containing any associated data for use inside the callback |
222217

223218
```js
224219
$('.bellows').bellows({
225-
opened: function(e, ui) {
220+
opened: function(e, ui) {
226221
// ui.item contains the item that opened
227222
}
228223
});
@@ -237,11 +232,11 @@ Triggered every time an bellows item is starting to close.
237232
| Parameter name | Description |
238233
|----------------|-------------|
239234
| **e** | An Event object passed to the callback |
240-
| **ui** | An object containing any associated data for use inside the callback |
235+
| **ui** | An object containing any associated data for use inside the callback |
241236

242237
```js
243238
$('.bellows').bellows({
244-
close: function(e, ui) {
239+
close: function(e, ui) {
245240
// ui.item contains the item closing
246241
}
247242
});
@@ -256,11 +251,11 @@ Triggered every time an bellows item is finished closing.
256251
| Parameter name | Description |
257252
|----------------|-------------|
258253
| **e** | An Event object passed to the callback |
259-
| **ui** | An object containing any associated data for use inside the callback |
254+
| **ui** | An object containing any associated data for use inside the callback |
260255

261256
```js
262257
$('.bellows').bellows({
263-
closed: function(e, ui) {
258+
closed: function(e, ui) {
264259
// ui.item contains the item that closed
265260
}
266261
});
@@ -291,7 +286,7 @@ $bellows.bellows('openAll');
291286
```
292287

293288
### close
294-
289+
295290
Close the selected bellows item by element reference
296291

297292
```js
@@ -313,7 +308,7 @@ $bellows.bellows('closeAll');
313308
```
314309

315310
### toggle
316-
311+
317312
Toggle the selected bellows item by element reference
318313

319314
```js
@@ -363,7 +358,7 @@ $('.bellows').bellows({
363358
});
364359
```
365360

366-
This will scroll the viewport to the opened bellows item, restoring its position in the viewport.
361+
This will scroll the viewport to the opened bellows item, restoring its position in the viewport.
367362

368363
## Browser Compatibility
369364

@@ -382,12 +377,9 @@ This will scroll the viewport to the opened bellows item, restoring its position
382377
* [node.js 0.10.x/npm](http://nodejs.org/download/)
383378
* [Grunt](http://gruntjs.com/)
384379
* Install with `npm install -g grunt-cli`
385-
* [Bower](http://bower.io/)
386-
* Install with `npm install -g bower`
387380

388381
### Steps
389382
1. `npm install`
390-
1. `bower install`
391383
1. `grunt build`
392384

393385
The `dist` directory will be populated with minified versions of the css and javascript files for distribution and use with whatever build system you might use. The `src` directory has our raw unminified Sass and Javascript files if you prefer to work with those.

bower.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

dist/bellows.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'plugin'
77
], factory);
88
} else {
9-
var framework = window.Zepto || window.jQuery;
9+
var framework = window.jQuery;
1010
factory(framework, framework.Velocity, window.Plugin);
1111
}
1212
}(function($, Velocity, Plugin) {
@@ -66,7 +66,7 @@
6666

6767
/**
6868
* Ghetto Event Delegation™
69-
69+
TODO: Re-evalute this for new default of jQuery
7070
Zepto doesn't support descendant selectors in event delegation,
7171
so we compare against the closest bellows to ensure we are invoking
7272
the event from a direct child, not a bellows child from a nested bellows.

dist/bellows.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/animation.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1>Bellows Examples</h1>
1616

1717
<h2>Different Animation Timings</h2>
1818

19-
<p>You can pass Bellows alternate animation <code>duration</code> and <code>easing</code> when you initialize it. The different easings available are described in the readme</p>
19+
<p>You can pass Bellows alternate animation <code>duration</code> and <code>easing</code> when you initialize it. The different easings available are described in the readme</p>
2020

2121
<div class="bellows animation">
2222
<div class="bellows__item bellows--is-open">
@@ -53,7 +53,6 @@ <h3>Header</h3>
5353
</div>
5454
</div>
5555

56-
<script data-main="assets/js/main" src="../bower_components/requirejs/require.js"></script>
56+
<script data-main="assets/js/main" src="../node_modules/requirejs/require.js"></script>
5757
</body>
5858
</html>
59-

examples/assets/js/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ require.config({
22
baseUrl: '../',
33
almond: true,
44
paths: {
5-
'text': 'bower_components/requirejs-text/text',
6-
'$': 'lib/zeptojs/dist/zepto',
7-
'velocity': 'bower_components/mobify-velocity/velocity',
8-
'plugin': 'bower_components/plugin/dist/plugin.min',
5+
'text': 'node_modules/text/text',
6+
'$': 'node_modules/jquery/dist/jquery',
7+
'velocity': 'node_modules/velocity-animate/velocity',
8+
'plugin': 'node_modules/plugin/dist/plugin.min',
99
'bellows': 'dist/bellows',
1010
'setup-bellows': 'examples/assets/js/setup-bellows'
1111
},

examples/assets/js/setup-bellows.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
define(['bellows'], factory);
55
} else {
66
// Browser globals
7-
root.setupBellows = factory(window.Zepto || window.jQuery);
7+
root.setupBellows = factory(window.jQuery);
88
}
99
}(this, function ($) {
1010

examples/dataattr.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ <h3>Header</h3>
5353
</div>
5454
</div>
5555

56-
<script data-main="assets/js/main" src="../bower_components/requirejs/require.js"></script>
56+
<script data-main="assets/js/main" src="../node_modules/requirejs/require.js"></script>
5757
</body>
5858
</html>
59-

examples/default.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ <h3>Header</h3>
5555

5656
<p>Lorem honeyed locusts sit amet, none so wise, sed do eiusmod never resting ut labore et dolore magna aliqua. Manhood death before disgrace warrior, feed it to the goats spare me your false courtesy commodo consequat. Mace aute irure dolor in reprehenderit poison is a woman's weapon lord of light tower dwarf. The last of the dragons royal, godswood garron sister betrothed officia deserunt mollit anim id est snow.</p>
5757

58-
<script data-main="assets/js/main" src="../bower_components/requirejs/require.js"></script>
58+
<script data-main="assets/js/main" src="../node_modules/requirejs/require.js"></script>
5959
</body>
6060
</html>
61-

0 commit comments

Comments
 (0)