Skip to content

Commit b8590a2

Browse files
committed
update
1 parent c7e66d7 commit b8590a2

23 files changed

+458
-12469
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/node_modules/
2+
/bower_components/

.jshintrc

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
{
2-
"curly": true,
2+
"curly" : true,
33
"eqeqeq": true,
4-
"immed": true,
5-
"latedef": true,
64
"newcap": true,
7-
"noarg": true,
8-
"sub": true,
9-
"undef": true,
10-
"unused": true,
11-
"boss": true,
12-
"eqnull": true,
13-
"node": true,
14-
"es5": true
15-
}
5+
"noarg" : true,
6+
"node" : true,
7+
"nonbsp": true,
8+
"strict": true,
9+
"undef" : true,
10+
"unused": true
11+
}

Gruntfile.js

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,23 @@ module.exports = function(grunt) {
1111
clean: {
1212
files: ['dist']
1313
},
14+
copy: {
15+
js: {
16+
files: [{
17+
"expand": true,
18+
"cwd": "bower_components/jquery-mousewheel/",
19+
"src": ["*.js"],
20+
"dest": "demo/js/"
21+
}]
22+
}
23+
},
1424
concat: {
1525
options: {
1626
banner: '<%= banner %>',
1727
stripBanners: true
1828
},
1929
dist: {
20-
src: ['src/<%= pkg.name %>.js', 'src/jquery-asSpinner-mousewheel.js'],
30+
src: ['src/<%= pkg.name %>.js'],
2131
dest: 'dist/<%= pkg.name %>.js'
2232
},
2333
},
@@ -30,7 +40,6 @@ module.exports = function(grunt) {
3040
dest: 'dist/<%= pkg.name %>.min.js'
3141
},
3242
},
33-
3443
jshint: {
3544
gruntfile: {
3645
options: {
@@ -43,13 +52,7 @@ module.exports = function(grunt) {
4352
jshintrc: 'src/.jshintrc'
4453
},
4554
src: ['src/**/*.js']
46-
},
47-
test: {
48-
options: {
49-
jshintrc: 'test/.jshintrc'
50-
},
51-
src: ['test/**/*.js']
52-
},
55+
}
5356
},
5457
watch: {
5558
gruntfile: {
@@ -58,12 +61,8 @@ module.exports = function(grunt) {
5861
},
5962
src: {
6063
files: '<%= jshint.src.src %>',
61-
tasks: ['jshint:src', 'qunit']
62-
},
63-
test: {
64-
files: '<%= jshint.test.src %>',
65-
tasks: ['jshint:test', 'qunit']
66-
},
64+
tasks: ['jshint:src']
65+
}
6766
},
6867

6968
jsbeautifier: {
@@ -114,16 +113,10 @@ module.exports = function(grunt) {
114113
}
115114
});
116115

117-
// These plugins provide necessary tasks.
118-
grunt.loadNpmTasks('grunt-contrib-clean');
119-
grunt.loadNpmTasks('grunt-contrib-concat');
120-
grunt.loadNpmTasks('grunt-contrib-uglify');
121-
grunt.loadNpmTasks('grunt-contrib-jshint');
122-
grunt.loadNpmTasks('grunt-contrib-watch');
123-
124-
grunt.loadNpmTasks('grunt-jsbeautifier');
125-
grunt.loadNpmTasks('grunt-recess');
126-
grunt.loadNpmTasks('grunt-text-replace');
116+
// Load npm plugins to provide necessary tasks.
117+
require('load-grunt-tasks')(grunt, {
118+
pattern: ['grunt-*']
119+
});
127120

128121
// Default task.
129122
grunt.registerTask('default', ['jshint', 'clean', 'concat', 'uglify']);
@@ -137,4 +130,4 @@ module.exports = function(grunt) {
137130
'replace:bower',
138131
'replace:jquery'
139132
]);
140-
};
133+
};

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $('.custom').asSpinner({
4848
});
4949
```
5050

51-
51+
Mouse Whell function depends on https://github.com/brandonaaron/jquery-mousewheel
5252

5353
## Settings
5454

@@ -60,9 +60,6 @@ $('.custom').asSpinner({
6060
//Optional property, set transition effect, it works after you load specified skin file
6161
skin: 'simple',
6262

63-
//Optional property,set the asSpinner's start value when asSpinner initilize
64-
value: 0,
65-
6663
//Optional property, set the minimum value of asSpinner
6764
min: 0,
6865

@@ -91,11 +88,11 @@ $('.custom').asSpinner("set");
9188
// get element's value
9289
$('.custom').asSpinner("get");
9390

94-
// element's value become prevous
95-
$('.custom').asSpinner("prev");
91+
// element's value become spinDownous
92+
$('.custom').asSpinner("spinDown");
9693

97-
// element's value become next
98-
$('.custom').asSpinner("next");
94+
// element's value become spinUp
95+
$('.custom').asSpinner("spinUp");
9996

10097
// judge value whether a number
10198
$('.custom').asSpinner("isNumber");

bower.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "jquery-asSpinner",
3-
"version": "0.1.1",
4-
"main": "dist/jquery-asSpinner.js",
5-
"ignore": [
6-
"**/.*",
7-
"node_modules",
8-
"bower_components",
9-
"test",
10-
"tests"
11-
],
12-
"dependencies": {
13-
"jquery": ">=1.8.3"
14-
}
15-
}
2+
"name": "jquery-asSpinner",
3+
"version": "0.2.0",
4+
"main": "dist/jquery-asSpinner.js",
5+
"ignore": [
6+
"**/.*",
7+
"node_modules",
8+
"bower_components",
9+
"test",
10+
"tests"
11+
],
12+
"dependencies": {
13+
"jquery": ">=1.8.3"
14+
}
15+
}

demo/css/asSpinner.css

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
1-
.asSpinner-wrap {
1+
.asSpinner {
22
position: relative;
33
display: inline-block;
44
-webkit-user-select: none;
5-
/* Chrome all / Safari all */
6-
75
-moz-user-select: none;
8-
/* Firefox all */
9-
106
-ms-user-select: none;
11-
/* IE 10+ */
12-
137
}
148

15-
.asSpinner-wrap .asSpinner {
9+
.asSpinner input {
1610
width: 100px;
1711
height: 20px;
1812
background-color: #fff;
1913
}
2014

21-
.asSpinner-wrap .asSpinner-control .asSpinner-prev {
15+
.asSpinner-down, .asSpinner-up {
2216
position: absolute;
2317
top: 0;
24-
left: -20px;
18+
2519
width: 20px;
2620
height: 20px;
2721
background-color: red;
2822
}
2923

30-
.asSpinner-wrap .asSpinner-control .asSpinner-next {
31-
position: absolute;
32-
top: 0;
24+
.asSpinner-down {
25+
left: -20px;
26+
}
27+
28+
.asSpinner-up {
3329
right: -20px;
34-
width: 20px;
35-
height: 20px;
36-
background-color: red;
3730
}

demo/css/spinner.css

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

demo/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
<script src="js/vendor/jquery.toc.js"></script>
2222
<script src="js/vendor/prism.js"></script>
2323
<script src="js/vendor/bootstrap.js"></script>
24-
<script src="../dist/jquery-asSpinner.js"></script>
24+
25+
<script src="js/jquery.mousewheel.js"></script>
26+
<script src="../src/jquery-asSpinner.js"></script>
2527
<style type="text/css">
2628
#paginator-content {
2729
height: 100px;
@@ -74,7 +76,7 @@ <h4>Default</h4>
7476
$(".custom").asSpinner();
7577
</code></pre>
7678
<div class="example">
77-
<input type="text" class="custom" value="0"/>
79+
<input type="text" class="custom" value="0" disabled />
7880
<script>
7981
$(document).ready(function() {
8082
$('.custom').asSpinner();

0 commit comments

Comments
 (0)