Skip to content

Commit c4714cf

Browse files
committed
chore(bower): change path to bower_components
2 parents 3e652d0 + 7c56fe1 commit c4714cf

30 files changed

+1128
-2422
lines changed

.bowerrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"directory": "components",
2+
"directory": "bower_components",
33
"json": "bower.json"
44
}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.DS_Store
22
node_modules
3-
components
3+
bower_components
4+
coverage

Gruntfile.js

+45-54
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
/* global require, module, process */
1+
/* global require, module, process, __dirname */
22

33
'use strict';
44

5+
var path = require('path');
6+
57
module.exports = function(grunt) {
68

79
// Project configuration.
@@ -21,31 +23,39 @@ module.exports = function(grunt) {
2123
options: {
2224
port: 9999,
2325
hostname: '0.0.0.0',
24-
base: '.',
25-
keepalive: true
26+
base: '.'
2627
}
2728
}
2829
},
2930
dirs: {
31+
src: 'src',
3032
dest: 'dist'
3133
},
34+
copy: {
35+
36+
},
37+
autoprefixer: {
38+
source: {
39+
options: {
40+
//browsers: ['last 2 version', '> 1%', 'android', 'chrome', 'firefox']
41+
},
42+
src: '<%= dirs.src %>/css/<%= pkg.name %>.css',
43+
dest: '<%= dirs.dest %>/<%= pkg.name %>.css'
44+
}
45+
},
3246
concat: {
3347
options: {
3448
banner: '<%= meta.banner %>'
3549
},
3650
dist: {
37-
src: ['src/*.js', 'src/**/*.js'],
51+
src: ['<%= dirs.src %>/*.js', '<%= dirs.src %>/**/*.js'],
3852
dest: '<%= dirs.dest %>/<%= pkg.name %>.js'
39-
},
40-
ngMobile: {
41-
src: ['lib/angular-mobile.js'],
42-
dest: '<%= dirs.dest %>/angular-mobile.js'
4353
}
4454
},
4555
cssmin: {
4656
combine: {
4757
files: {
48-
'<%= dirs.dest %>/<%= pkg.name %>.min.css': ['src/css/*.css']
58+
'<%= dirs.dest %>/<%= pkg.name %>.min.css': ['<%= dirs.dest %>/<%= pkg.name %>.css']
4959
}
5060
}
5161
},
@@ -59,7 +69,7 @@ module.exports = function(grunt) {
5969
}
6070
},
6171
jshint: {
62-
files: ['Gruntfile.js', 'src/*.js', 'test/unit/*.js'],
72+
files: ['Gruntfile.js', '<%= dirs.src %>/*.js', 'test/unit/*.js'],
6373
options: {
6474
curly: false,
6575
browser: true,
@@ -81,69 +91,50 @@ module.exports = function(grunt) {
8191
}
8292
}
8393
},
84-
// watch: {
85-
// files: '<config:jshint.files>',
86-
// tasks: 'default'
87-
// },
8894
karma: {
89-
test: {
90-
options: {
91-
reporters: ['dots'],
92-
singleRun: true
93-
}
95+
options: {
96+
// needed to use absolute path for some reason
97+
configFile: path.join(__dirname, 'test', 'karma.conf.js')
9498
},
95-
server: {
96-
options: {
97-
singleRun: false
98-
}
99+
unit: {
100+
port: 7101,
101+
background: true
99102
},
100-
options: {
101-
configFile: 'test/karma.conf.js'
103+
continuous: {
104+
singleRun: true
102105
}
103106
},
104107
watch: {
105-
files: ['src/**'],
106-
tasks: ['quickbuild']
108+
dev: {
109+
files: ['<%= dirs.src %>/**'],
110+
tasks: ['build']
111+
},
112+
test: {
113+
files: ['test/unit/**'],
114+
tasks: ['karma:unit:run']
115+
}
116+
107117
}
108118
});
109119

110-
// Load the plugin that provides the "jshint" task.
120+
grunt.loadNpmTasks('grunt-autoprefixer');
121+
grunt.loadNpmTasks('grunt-contrib-copy');
111122
grunt.loadNpmTasks('grunt-contrib-jshint');
112-
113-
// Load the plugin that provides the "concat" task.
114123
grunt.loadNpmTasks('grunt-contrib-concat');
115-
116-
// Load the plugin that provides the "uglify" task.
117124
grunt.loadNpmTasks('grunt-contrib-uglify');
118-
119125
grunt.loadNpmTasks('grunt-contrib-cssmin');
120-
121126
grunt.loadNpmTasks('grunt-contrib-connect');
122-
123-
// Load the plugin that provides the "watch" task.
124127
grunt.loadNpmTasks('grunt-contrib-watch');
125-
126-
127-
// Default task.
128-
grunt.registerTask('default', ['test']);
128+
grunt.loadNpmTasks('grunt-karma');
129129

130130
// Test tasks.
131-
grunt.registerTask('test', ['jshint', 'karma:test']);
132-
grunt.registerTask('test-server', ['karma:server']);
131+
grunt.registerTask('test', ['jshint', 'karma:unit']);
133132

134133
// Build task.
135-
grunt.registerTask('build', ['concat', 'uglify', 'cssmin', 'test']);
136-
grunt.registerTask('quickbuild', ['jshint', 'concat', 'uglify', 'cssmin']);
134+
grunt.registerTask('quickbuild', ['jshint', 'concat', 'uglify', 'autoprefixer', 'cssmin']);
135+
grunt.registerTask('build', ['quickbuild', 'test']);
137136

138-
// run devserver
139-
grunt.registerTask('webserver', ['connect:devserver']);
140-
141-
// Provides the "karma" task.
142-
grunt.registerMultiTask('karma', 'Starts up a karma server.', function() {
143-
var done = this.async();
144-
require('karma').server.start(this.options(), function(code) {
145-
done(code === 0);
146-
});
147-
});
137+
// Default task.
138+
grunt.registerTask('default', ['build', 'connect', 'watch']);
148139

149140
};

README.md

+7-26
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Proudly brought to you by the [@revolunet](http://twitter.com/revolunet) team.
1010

1111
## Usage :
1212

13-
1. Add `angular-carousel.css`, `angular-carousel.js` and `angular-mobile.js` (from this repo) to your code:
13+
1. If you use bower, just `bower install angular-carousel`.
14+
2. If not, add `angular-carousel.css`, `angular-carousel.js` to your code:
1415
```html
1516
<link href="lib/angular-carousel.css" rel="stylesheet" type="text/css" />
1617
<script src="lib/angular.js"></script>
@@ -39,46 +40,26 @@ angular.module('MyApp', ['angular-carousel']);
3940
<li>slide #3</li>
4041
</ul>
4142
```
42-
5. Alternatively, for an infinite carousel, use the `rn-carousel-prev` and `rn-carousel-next` callbacks :
43-
```html
44-
<div rn-carousel-infinite rn-carousel-next="next(item)" rn-carousel-prev="prev(item)" rn-carousel-current="product">
45-
<h1> #{{ product.id }} </h1>
46-
{{ product.description }}
47-
</div>
48-
```
49-
50-
The `prev()` and `next()` function return promises containing the prev and next slide.
5143

5244
## Features :
5345
- Mobile friendly, tested on webkit+firefox
5446
- CSS 3D transformations with GPU accel
47+
- DOM buffering
48+
- index data-binding
5549

5650
### Regular carousel :
5751
- `rn-carousel-index` two way binding to control the carousel position.
5852
- `rn-carousel-indicator` to turn on the indicator, see demo page.
5953
- `rn-carousel-buffered` to buffer the carousel, good to minimize the DOM.
60-
- ~~`rn-carousel-cycle` to have an forever-cycling carousel.~~ (BROKEN)
61-
- `rn-carousel-watch` force deep watch of the ngRepeat collection (listen to add/remove items).
62-
63-
64-
### Infinite carousel :
65-
66-
You can setup a dynamic, infinite carousel that will load slides on demand using a promise.
67-
- `rn-carousel-infinite` : use this to setup an infinite carousel without the initial ul/li structure.
68-
- `rn-carousel-next="getNextSlide(item)"` : callback called when carousel reach the last slide, that should return a single slide. great for generating slides on-demand.
69-
- `rn-carousel-prev="getPrevSlide(item)"` : callback called when carousel reach the first slide, that should return a single slide. great for generating slides on-demand.
70-
- `rn-carousel-current` : data-binding to the current carousel item. will be sent as first argument to the prev/next callbacks.
7154

7255
## Todo :
73-
- memory profiling
74-
- optional auto-slide
75-
- buffering : allow buffer size tuning (default=3 slides)
76-
- buffering : add intelligent indicators
56+
- see the [TODO file](./TODO)
7757

7858
## Inspirations
7959
- https://github.com/ajoslin/angular-mobile-nav
8060
- http://mobile.smashingmagazine.com/2012/06/21/play-with-hardware-accelerated-css/
81-
- Thanks @ganarajpr @bennadel and angular folks for all the tips :)
61+
- http://ariya.ofilabs.com/2013/08/javascript-kinetic-scrolling-part-1.html
62+
- Thanks to all angular folks for all the tips :)
8263

8364
## Licence
8465
As AngularJS itself, this module is released under the permissive [MIT license](http://revolunet.mit-license.org). Your contributions are always welcome.

TODO

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
3+
Carousel v2:
4+
Base features:
5+
✔ basic ngRepeat @done (14-01-04 20:22)
6+
✔ ngRepeat with filter @done (14-01-04 20:54)
7+
✔ ngRepeat with filter and track by @done (14-01-04 20:59)
8+
✔ template based only @done (14-01-04 20:22)
9+
Bindings:
10+
✔ should have a carousel-index binding @done (14-01-04 20:22)
11+
Buffering:
12+
✔ should optionnaly buffer the carousel DOM @done (14-01-04 20:22)
13+
Indicators:
14+
☐ should have optional indicators
15+
☐ indicators should be clickable
16+
☐ indicators should be customisable
17+
Animations:
18+
☐ should have some builtin animations
19+
☐ should be able to customise animations
20+
Bugs:
21+
☐ bug when rn-carousel-index change while animation from outside
22+
☐ handle touch cancel
23+
Advanced:
24+
☐ optional cycle
25+
☐ infinite carousels with slide generators
26+
☐ optional auto-slide
27+
Tests:
28+
✔ setup karma @done (14-01-05 00:15)
29+
Tooling:
30+
✔ update grunt @done (14-01-04 22:09)
31+
✔ add autoprefixer @done (14-01-04 22:09)
32+
☐ template with code samples for the demo page
33+
Docs:
34+
☐ README update

bower.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@
22
"author": "revolunet",
33
"name": "angular-carousel",
44
"description": "Mobile friendly AngularJS carousel",
5-
"version": "0.0.8",
5+
"version": "0.1.0",
66
"homepage": "https://github.com/revolunet/angular-carousel",
77
"repository": {
88
"type": "git",
99
"url": "git://github.com/revolunet/angular-carousel.git"
1010
},
11-
"main": "./dist/angular-carousel.js",
11+
"main": [
12+
"./dist/angular-carousel.js",
13+
"./dist/angular-carousel.css"
14+
],
1215
"dependencies": {
13-
"angular": "PatternConsulting/bower-angular",
14-
"jquery": "1.9.1"
16+
"angular": "1.2.7",
17+
"angular-touch": "1.2.7"
18+
},
19+
"devDependencies": {
20+
"angular": "1.2.7",
21+
"angular-touch": "1.2.7",
22+
"angular-mocks": "1.2.7"
1523
}
1624
}

component.json

-18
This file was deleted.

0 commit comments

Comments
 (0)