Skip to content

Commit a27af74

Browse files
author
Karan Batra-Daitch
committed
Add uglifyJS for minification
1 parent b1dc213 commit a27af74

File tree

18 files changed

+246
-366
lines changed

18 files changed

+246
-366
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea
22
.DS_Store
3+
node_modules
4+
bower_components

Gruntfile.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,31 @@ module.exports = function(grunt) {
55
require('time-grunt')(grunt);
66

77
grunt.initConfig({
8+
uglify: {
9+
dist: {
10+
options: {
11+
sourceMap: true,
12+
sourceMapIncludeSources: true
13+
},
14+
files: {
15+
'dist/slick.min.js': ['dist/slick.js'],
16+
'example/angular-slick-carousel/slick.min.js': ['example/angular-slick-carousel/slick.js']
17+
}
18+
}
19+
},
820
src: {
921
js: ['js/*.js']
1022
},
1123

24+
coffee: {
25+
dist: {
26+
files: {
27+
'dist/slick.js': 'src/slick.coffee',
28+
'example/angular-slick-carousel/slick.js': 'src/slick.coffee'
29+
}
30+
}
31+
},
32+
1233
test: {
1334
karmaConfig: 'test/unit/config/karma.conf.js',
1435
unit: ['test/unit/spec/**/*Spec.js']
@@ -21,4 +42,7 @@ module.exports = function(grunt) {
2142
});
2243

2344
grunt.loadNpmTasks('grunt-karma');
45+
grunt.loadNpmTasks('grunt-contrib-coffee');
46+
grunt.loadNpmTasks('grunt-contrib-uglify');
47+
grunt.registerTask('dist', ['coffee', 'uglify']);
2448
};

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ Release: 2.0
99
was working but arbitrary. We now register a simple `onFinishRender` directive which
1010
allows us to postpone slickification until `ng-repeat` has finished execution.
1111
2. **[BC-BREAK]** The directive is no longer based on a transclude functionality. You can either use the 2.0
12-
directive with the provided template or use your own (with [slick-no-tpls.js](dist/slick-no-tpls.js)). When using
13-
the latter option, refer to [slick.coffee](https://github.com/kbdaitch/angular-slick-carousel/blob/master/src/slick.coffee#L12-L18) and ensure your template uses `on-finish-render=init()` in its `ng-repeat` element.
14-
3. The two functions `isImage` and `isVideo` on the directive's scope are provided for use in the template,
15-
and are overridable.
16-
4. **[BC-BREAK]** The directive no longer supports statically provided image assets out-of-the-box.
12+
directive with the provided template or use your own (when using the `src` attribute).
13+
3. **[BC-BREAK]** The directive no longer supports statically provided image assets out-of-the-box.
1714
The dynamic usecase is what it tries to solve optimally.
18-
5. You should now use JS to specify a variety of sources in the `media` array. See [example](https://github.com/kbdaitch/angular-slick-carousel/blob/master/example/index.html).
19-
6. The use of `on-directive-init` attribute introduced earlier is now in the demo. Use this to use the handle object to do something on directive init. This is different from the underlying `slick.js` `onInit` in that the handle object is now ready to use
20-
(with all the setup to call underlying `slick.js` calls).
15+
4. You should now use JS to specify a variety of sources in the `media` array. See [example](https://github.com/kbdaitch/angular-slick-carousel/blob/master/example/index.html).
2116

2217
Usage
2318
-----
@@ -30,12 +25,22 @@ as either a `<div>` attribute or a `<slick>` element.
3025
<slick settings="scoped-settings"
3126
control="scoped-control-handle"
3227
media="media"
28+
src="optionalCustomTemplate.html"
3329
on-directive-init="onDirectiveInit()"
3430
is-image="isImage(media)"
3531
is-video="isVideo(media)>
3632
</slick>
3733
```
3834
35+
### Attributes ###
36+
1. `settings`: optional `Object` containing any of the slick options. Consult [here](http://kenwheeler.github.io/slick/#settings).
37+
2. `control`: optional `Object` discussed [#control](below) in detail
38+
3. `media`: mandatory `Array` of images and/or video
39+
4. `src`: optional `String` the url for the custom template, if desired
40+
4. `on-directive-init`: optional `Function` the directive's handle object is ready to use in this function. This is different from `slick`'s `onInit` handler.
41+
5. `is-image`: optional `Function` that takes a metadata object and returns a `Boolean`
42+
6. `is-video`: optional `Function` that takes a metadata object and returns a `Boolean`
43+
3944
### Steps ###
4045
1. Include the `slick.js` at the base of this repo, or install through `bower`:
4146

dist/slick-no-tpls.js

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

dist/slick.js

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

dist/slick.map

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

dist/slick.min.js

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

0 commit comments

Comments
 (0)