From 5971a53686b10af9ffa36073cd46811ca726a28c Mon Sep 17 00:00:00 2001 From: vsn4ik Date: Sat, 5 Dec 2015 22:34:46 +0300 Subject: [PATCH] Update version --- .gitignore | 4 ++++ Gruntfile.js | 32 +++++++++++++++++++++++++++++--- bower.json | 1 - dist/js/jquery.spinner.js | 2 +- dist/js/jquery.spinner.min.js | 2 +- js/jquery.spinner.js | 2 +- less/bootstrap-spinner.less | 32 ++++++++++++++++---------------- package.json | 1 + spinner.jquery.json | 2 +- 9 files changed, 54 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 2ccbe46..855a92e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ +# Files to ignore +*-dist.zip + +# Folders to ignore /node_modules/ diff --git a/Gruntfile.js b/Gruntfile.js index 399d7c0..56ebf37 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,7 +11,10 @@ module.exports = function(grunt) { ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n', // Task configuration. clean: { - files: ['dist'] + dist: [ + 'dist', + '*-dist.zip' + ] }, concat: { options: { @@ -60,17 +63,40 @@ module.exports = function(grunt) { src: 'less/bootstrap-spinner.less', dest: 'dist/css/bootstrap-spinner.css' } + }, + compress: { + dist: { + options: { + archive: '<%= compress.dist.dest %>.zip' + }, + expand: true, + cwd: 'dist', + src: '**', + dest: '<%= pkg.name %>-<%= pkg.version %>-dist' + } } }); // These plugins provide necessary tasks. grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-compress'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-less'); - // Default task. - grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify', 'less']); + grunt.registerTask('default', [ + 'jshint', + 'qunit', + 'clean', + 'concat', + 'uglify', + 'less' + ]); + + grunt.registerTask('prep-release', [ + 'default', + 'compress' + ]); }; diff --git a/bower.json b/bower.json index fe67d26..8eacf05 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,5 @@ { "name": "jquery-spinner", - "version": "0.1.6", "description": "A Number-Spinner based-on jQuery, Support keyboard operations and continuous changing", "keywords": [ "spinner", diff --git a/dist/js/jquery.spinner.js b/dist/js/jquery.spinner.js index e174ce0..2512fba 100644 --- a/dist/js/jquery.spinner.js +++ b/dist/js/jquery.spinner.js @@ -1,4 +1,4 @@ -/*! jQuery spinner - v0.1.6 - 2015-11-29 +/*! jQuery spinner - v0.2.0 - 2015-12-05 * https://github.com/xixilive/jquery-spinner * Copyright (c) 2015 xixilive; Licensed MIT */ ;(function($){ diff --git a/dist/js/jquery.spinner.min.js b/dist/js/jquery.spinner.min.js index 048e628..c77b2c4 100644 --- a/dist/js/jquery.spinner.min.js +++ b/dist/js/jquery.spinner.min.js @@ -1,4 +1,4 @@ -/*! jQuery spinner - v0.1.6 - 2015-11-29 +/*! jQuery spinner - v0.2.0 - 2015-12-05 * https://github.com/xixilive/jquery-spinner * Copyright (c) 2015 xixilive; Licensed MIT */ !function(a){"use strict";var b,c=function(b,d){return d=a.extend({},d),this.$el=b,this.options=a.extend({},c.rules.defaults,c.rules[d.rule]||{},d),this.min=parseFloat(this.options.min)||0,this.max=parseFloat(this.options.max)||0,this.$el.on({"focus.spinner":a.proxy(function(b){b.preventDefault(),a(document).trigger("mouseup.spinner"),this.oldValue=this.value()},this),"change.spinner":a.proxy(function(a){a.preventDefault(),this.value(this.$el.val())},this),"keydown.spinner":a.proxy(function(a){var b={38:"up",40:"down"}[a.which];b&&(a.preventDefault(),this.spin(b))},this)}),this.oldValue=this.value(),this.value(this.$el.val()),this};c.rules={defaults:{min:null,max:null,step:1,precision:0},currency:{min:0,max:null,step:.01,precision:2},quantity:{min:1,max:999,step:1,precision:0},percent:{min:1,max:100,step:1,precision:0},month:{min:1,max:12,step:1,precision:0},day:{min:1,max:31,step:1,precision:0},hour:{min:0,max:23,step:1,precision:0},minute:{min:1,max:59,step:1,precision:0},second:{min:1,max:59,step:1,precision:0}},c.prototype={spin:function(b){if(!this.$el.prop("disabled")){this.oldValue=this.value();var c=a.isFunction(this.options.step)?this.options.step.call(this,b):this.options.step,d="up"===b?1:-1;this.value(this.oldValue+Number(c,10)*d)}},value:function(c){if(null===c||void 0===c)return this.numeric(this.$el.val());c=this.numeric(c);var e=this.validate(c);0!==e&&(c=-1===e?this.min:this.max),this.$el.val(c.toFixed(this.options.precision)),this.oldValue!==this.value()&&(this.$el.trigger("changing.spinner",[this.value(),this.oldValue]),clearTimeout(b),b=setTimeout(a.proxy(function(){this.$el.trigger("changed.spinner",[this.value(),this.oldValue])},this),d.delay))},numeric:function(a){return a=this.options.precision>0?parseFloat(a,10):parseInt(a,10),!isNaN(parseFloat(a))&&isFinite(a)?a:a||this.options.min||0},validate:function(a){return null!==this.options.min&&athis.max?1:0}};var d=function(b,d){d=a.extend({},d),this.$el=b,this.$spinning=a("[data-spin='spinner']",this.$el),0===this.$spinning.length&&(this.$spinning=a(":input[type='text']",this.$el)),this.spinning=new c(this.$spinning,a.extend(this.$spinning.data(),d)),this.$el.on("click.spinner","[data-spin='up'],[data-spin='down']",a.proxy(this,"spin")).on("mousedown.spinner","[data-spin='up'],[data-spin='down']",a.proxy(this,"spin")),a(document).on("mouseup.spinner",a.proxy(function(){clearTimeout(this.spinTimeout),clearInterval(this.spinInterval)},this)),d.delay&&this.delay(d.delay),d.changed&&this.changed(d.changed),d.changing&&this.changing(d.changing)};d.delay=500,d.prototype={constructor:d,spin:function(b){var c=a(b.currentTarget).data("spin");switch(b.type){case"click":b.preventDefault(),this.spinning.spin(c);break;case"mousedown":1===b.which&&(this.spinTimeout=setTimeout(a.proxy(this,"beginSpin",c),300))}},delay:function(a){var b=parseInt(a,10);b>=0&&(this.constructor.delay=b+100)},value:function(){return this.spinning.value()},changed:function(a){this.bindHandler("changed.spinner",a)},changing:function(a){this.bindHandler("changing.spinner",a)},bindHandler:function(b,c){a.isFunction(c)?this.$spinning.on(b,c):this.$spinning.off(b)},beginSpin:function(b){this.spinInterval=setInterval(a.proxy(this.spinning,"spin",b),100)}},a.fn.spinner=function(b,c){return this.each(function(){var e=a(this),f=e.data("spinner");f||e.data("spinner",f=new d(e,a.extend({},e.data(),b))),("delay"===b||"changed"===b||"changing"===b)&&f[b](c),"step"===b&&c&&(f.spinning.step=c),"spin"===b&&c&&f.spinning.spin(c)})},a(function(){a('[data-trigger="spinner"]').spinner()})}(jQuery); \ No newline at end of file diff --git a/js/jquery.spinner.js b/js/jquery.spinner.js index 55cd278..40b3161 100644 --- a/js/jquery.spinner.js +++ b/js/jquery.spinner.js @@ -1,6 +1,6 @@ /* * spinner - * https://github.com/xixilive/jquery-spinner + * https://github.com/vsn4ik/jquery-spinner * * Copyright (c) 2013 xixilive * Licensed under the MIT license. diff --git a/less/bootstrap-spinner.less b/less/bootstrap-spinner.less index 963902b..53260f7 100644 --- a/less/bootstrap-spinner.less +++ b/less/bootstrap-spinner.less @@ -1,7 +1,7 @@ -.spinner.input-group{ - .input-group-addon{ +.spinner.input-group { + .input-group-addon { .spin-up, - .spin-down{ + .spin-down { height: 10px; width: 10px; overflow: hidden; @@ -9,61 +9,61 @@ text-align: center; color: #999; - &:hover{ + &:hover { color: #555; } - .fa{ + .fa { margin-top: -8px; vertical-align: middle; } - .glyphicon{ + .glyphicon { font-size: 10px; top: -2px; } } a.spin-up, - a.spin-down{ + a.spin-down { text-decoration: none; } button.spin-up, - button.spin-down{ + button.spin-down { background: none; border: none; padding: 0; } } - &.input-group-sm .input-group-addon{ + &.input-group-sm .input-group-addon { .spin-up, - .spin-down{ + .spin-down { height: 8px; - .fa{ + .fa { margin-top: -12px; } - .glyphicon{ + .glyphicon { font-size: 8px; top: -5px; } } } - &.input-group-lg .input-group-addon{ + &.input-group-lg .input-group-addon { .spin-up, - .spin-down{ + .spin-down { height: 12px; width: 12px; - .fa{ + .fa { margin-top: -16px; } - .glyphicon{ + .glyphicon { font-size: 12px; top: -6px; } diff --git a/package.json b/package.json index f1ef023..d96ab37 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-clean": "~0.7.0", + "grunt-contrib-compress": "~0.14.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-jshint": "~0.6.0", "grunt-contrib-less": "~0.5.0", diff --git a/spinner.jquery.json b/spinner.jquery.json index f273817..32f455b 100644 --- a/spinner.jquery.json +++ b/spinner.jquery.json @@ -2,7 +2,7 @@ "name": "spinner", "title": "jQuery spinner", "description": "A Number-Spinner based-on jQuery, Support Keyboard operations and continuous changing", - "version": "0.1.6", + "version": "0.2.0", "homepage": "https://github.com/xixilive/jquery-spinner", "demo": "http://xixilive.github.io/jquery-spinner", "author": {