Updated Dist and Gruntfile

This commit is contained in:
Dustin Moore
2013-05-15 09:28:48 -07:00
parent 361c751e6e
commit c2fcff7276
8 changed files with 124 additions and 45 deletions
+23 -19
View File
@@ -3,7 +3,7 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
@@ -13,12 +13,12 @@ module.exports = function(grunt) {
},
concat: {
dist_js: {
src: ['<banner:meta.banner>', '<file_strip_banner:src/jquery.coords.js>', '<file_strip_banner:src/jquery.collision.js>', 'src/utils.js', '<file_strip_banner:src/jquery.draggable.js>', '<file_strip_banner:src/<%= pkg.name %>.js>'],
src: ['<banner:meta.banner>', 'src/jquery.coords.js', 'src/jquery.collision.js', 'src/utils.js', 'src/jquery.draggable.js', 'src/<%= pkg.name %>.js'],
dest: 'dist/<%= pkg.name %>.js'
},
dist_extras_js: {
src: ['<banner:meta.banner>', '<file_strip_banner:src/jquery.coords.js>', '<file_strip_banner:src/jquery.collision.js>', 'src/utils.js', '<file_strip_banner:src/jquery.draggable.js>', '<file_strip_banner:src/<%= pkg.name %>.js>', '<file_strip_banner:src/<%= pkg.name %>.extras.js>'],
src: ['<banner:meta.banner>', 'src/jquery.coords.js', 'src/jquery.collision.js', 'src/utils.js', 'src/jquery.draggable.js', 'src/<%= pkg.name %>.js', 'src/<%= pkg.name %>.extras.js'],
dest: 'dist/<%= pkg.name %>.with-extras.js'
},
@@ -28,12 +28,12 @@ module.exports = function(grunt) {
},
dist_demo_js: {
src: ['<banner:meta.banner>', '<file_strip_banner:src/jquery.coords.js>', '<file_strip_banner:src/jquery.collision.js>', 'src/utils.js', '<file_strip_banner:src/jquery.draggable.js>', '<file_strip_banner:src/<%= pkg.name %>.js>'],
src: ['<banner:meta.banner>', 'src/jquery.coords.js', 'src/jquery.collision.js', 'src/utils.js', 'src/jquery.draggable.js', 'src/<%= pkg.name %>.js'],
dest: 'gh-pages/dist/<%= pkg.name %>.js'
},
dist_extras_demo_js: {
src: ['<banner:meta.banner>', '<file_strip_banner:src/jquery.coords.js>', '<file_strip_banner:src/jquery.collision.js>', 'src/utils.js', '<file_strip_banner:src/jquery.draggable.js>', '<file_strip_banner:src/<%= pkg.name %>.js>', '<file_strip_banner:src/<%= pkg.name %>.extras.js>'],
src: ['<banner:meta.banner>', 'src/jquery.coords.js', 'src/jquery.collision.js', 'src/utils.js', 'src/jquery.draggable.js>', 'src/<%= pkg.name %>.js', 'src/<%= pkg.name %>.extras.js'],
dest: 'gh-pages/dist/<%= pkg.name %>.with-extras.js'
},
@@ -42,28 +42,32 @@ module.exports = function(grunt) {
dest: 'gh-pages/dist/<%= pkg.name %>.css'
}
},
min: {
uglify: {
dist: {
src: ['<banner:meta.banner>', '<config:concat.dist_js.dest>'],
dest: 'dist/<%= pkg.name %>.min.js'
files: {
'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
}
},
dist_extras: {
src: ['<banner:meta.banner>', '<config:concat.dist_extras_js.dest>'],
dest: 'dist/<%= pkg.name %>.with-extras.min.js'
files: {
'dist/<%= pkg.name %>.with-extras.min.js': ['dist/<%= pkg.name %>.with-extras.js']
}
},
dist_demo: {
src: ['<banner:meta.banner>', '<config:concat.dist_js.dest>'],
dest: 'gh-pages/dist/<%= pkg.name %>.min.js'
files: {
'gh-pages/dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
}
},
dist_extras_demo: {
src: ['<banner:meta.banner>', '<config:concat.dist_extras_js.dest>'],
dest: 'gh-pages/dist/<%= pkg.name %>.with-extras.min.js'
files: {
'gh-pages/dist/<%= pkg.name %>.with-extras.min.js': ['dist/<%= pkg.name %>.with-extras.js']
}
}
},
mincss: {
cssmin: {
compress: {
files: {
"dist/<%= pkg.name %>.min.css": ["dist/<%= pkg.name %>.css"],
@@ -74,7 +78,7 @@ module.exports = function(grunt) {
qunit: {
files: ['test/**/*.html']
},
lint: {
jslint: {
files: ['grunt.js', 'src/**/*.js', 'test/**/*.js']
},
watch: {
@@ -99,7 +103,6 @@ module.exports = function(grunt) {
jQuery: true
}
},
uglify: {},
yuidoc: {
compile: {
"name": 'gridster.js',
@@ -116,8 +119,9 @@ module.exports = function(grunt) {
});
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-jslint');
// Default task.
grunt.registerTask('default', 'lint qunit concat min mincss yuidoc');
grunt.registerTask('default', ['jslint', 'qunit', 'concat', 'uglify', 'cssmin', 'yuidoc']);
};
};
-4
View File
@@ -1,7 +1,3 @@
/*! gridster.js - v0.1.0 - 2013-04-09
* http://gridster.net/
* Copyright (c) 2013 ducksboard; Licensed MIT */
.gridster {
position:relative;
}
+46 -5
View File
@@ -1,6 +1,10 @@
/*! gridster.js - v0.1.0 - 2013-04-09
* http://gridster.net/
* Copyright (c) 2013 ducksboard; Licensed MIT */
/*
* jquery.coords
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined){
/**
@@ -103,6 +107,14 @@
}(jQuery, window, document));
/*
* jquery.collision
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined){
var defaults = {
@@ -358,6 +370,14 @@
})(window);
/*
* jquery.draggable
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined){
var defaults = {
@@ -712,6 +732,13 @@
}(jQuery, window, document));
/*
* jquery.gridster
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined) {
var defaults = {
@@ -722,6 +749,7 @@
extra_rows: 0,
extra_cols: 0,
min_cols: 1,
max_cols: -1,
min_rows: 15,
max_size_x: 6,
autogenerate_stylesheet: true,
@@ -764,6 +792,8 @@
* @param {Number} [options.extra_rows] Add more rows in addition to
* those that have been calculated.
* @param {Number} [options.min_cols] The minimum required columns.
* @param {Number} [options.max_cols] The maximum columns possible (set to -1
* for no maximum).
* @param {Number} [options.min_rows] The minimum required rows.
* @param {Number} [options.max_size_x] The maximum number of columns
* that a widget can span.
@@ -895,7 +925,7 @@
/**
/**
* Change the size of a widget.
*
* @method resize_widget
@@ -903,9 +933,10 @@
* representing the widget.
* @param {Number} size_x The number of columns that will occupy the widget.
* @param {Number} size_y The number of rows that will occupy the widget.
* @param {Function} callback Function executed when the widget is removed.
* @return {HTMLElement} Returns $widget.
*/
fn.resize_widget = function($widget, size_x, size_y) {
fn.resize_widget = function($widget, size_x, size_y, callback) {
var wgd = $widget.coords().grid;
size_x || (size_x = wgd.size_x);
size_y || (size_y = wgd.size_y);
@@ -1024,6 +1055,10 @@
this.remove_empty_cells.apply(this, rows_to_remove_holes);
}
if (callback) {
callback.call(this, size_x, size_y);
}
return $widget;
};
@@ -3221,6 +3256,12 @@
});
this.cols = Math.max(min_cols, cols, this.options.min_cols);
var max_cols = this.options.max_cols;
if (max_cols >= -1 && max_cols >= min_cols) {
if (max_cols < this.cols) {
this.cols = max_cols;
}
}
this.rows = Math.max(max_rows, this.options.min_rows);
this.baseX = ($(window).width() - aw) / 2;
+1 -3
View File
@@ -1,3 +1 @@
/*! gridster.js - v0.1.0 - 2012-10-20
* http://gridster.net/
* Copyright (c) 2012 ducksboard; Licensed MIT */.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s;-moz-transition:height .4s;-o-transition:height .4s;-ms-transition:height .4s;transition:height .4s}.gridster .gs_w{z-index:2;position:absolute}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s;-moz-transition:opacity .3s,left .3s,top .3s;-o-transition:opacity .3s,left .3s,top .3s;transition:opacity .3s,left .3s,top .3s}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important}
.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s;-moz-transition:height .4s;-o-transition:height .4s;-ms-transition:height .4s;transition:height .4s}.gridster .gs_w{z-index:2;position:absolute}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s;-moz-transition:opacity .3s,left .3s,top .3s;-o-transition:opacity .3s,left .3s,top .3s;transition:opacity .3s,left .3s,top .3s}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important}
+2 -4
View File
File diff suppressed because one or more lines are too long
+46 -5
View File
@@ -1,6 +1,10 @@
/*! gridster.js - v0.1.0 - 2013-04-09
* http://gridster.net/
* Copyright (c) 2013 ducksboard; Licensed MIT */
/*
* jquery.coords
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined){
/**
@@ -103,6 +107,14 @@
}(jQuery, window, document));
/*
* jquery.collision
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined){
var defaults = {
@@ -358,6 +370,14 @@
})(window);
/*
* jquery.draggable
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined){
var defaults = {
@@ -712,6 +732,13 @@
}(jQuery, window, document));
/*
* jquery.gridster
* https://github.com/ducksboard/gridster.js
*
* Copyright (c) 2012 ducksboard
* Licensed under the MIT licenses.
*/
;(function($, window, document, undefined) {
var defaults = {
@@ -722,6 +749,7 @@
extra_rows: 0,
extra_cols: 0,
min_cols: 1,
max_cols: -1,
min_rows: 15,
max_size_x: 6,
autogenerate_stylesheet: true,
@@ -764,6 +792,8 @@
* @param {Number} [options.extra_rows] Add more rows in addition to
* those that have been calculated.
* @param {Number} [options.min_cols] The minimum required columns.
* @param {Number} [options.max_cols] The maximum columns possible (set to -1
* for no maximum).
* @param {Number} [options.min_rows] The minimum required rows.
* @param {Number} [options.max_size_x] The maximum number of columns
* that a widget can span.
@@ -895,7 +925,7 @@
/**
/**
* Change the size of a widget.
*
* @method resize_widget
@@ -903,9 +933,10 @@
* representing the widget.
* @param {Number} size_x The number of columns that will occupy the widget.
* @param {Number} size_y The number of rows that will occupy the widget.
* @param {Function} callback Function executed when the widget is removed.
* @return {HTMLElement} Returns $widget.
*/
fn.resize_widget = function($widget, size_x, size_y) {
fn.resize_widget = function($widget, size_x, size_y, callback) {
var wgd = $widget.coords().grid;
size_x || (size_x = wgd.size_x);
size_y || (size_y = wgd.size_y);
@@ -1024,6 +1055,10 @@
this.remove_empty_cells.apply(this, rows_to_remove_holes);
}
if (callback) {
callback.call(this, size_x, size_y);
}
return $widget;
};
@@ -3221,6 +3256,12 @@
});
this.cols = Math.max(min_cols, cols, this.options.min_cols);
var max_cols = this.options.max_cols;
if (max_cols >= -1 && max_cols >= min_cols) {
if (max_cols < this.cols) {
this.cols = max_cols;
}
}
this.rows = Math.max(max_rows, this.options.min_rows);
this.baseX = ($(window).width() - aw) / 2;
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -24,5 +24,8 @@
"dependencies": {
"jquery": "~1.5"
},
"keywords": []
"keywords": [],
"devDependencies": {
"grunt-contrib": "~0.6.1"
}
}