Skip to content
Browse files

added in grunt plugins for jasmine and csslint cssmin for fun

  • Loading branch information...
1 parent 9085b63 commit 2b8ead6d9cc29adce250782a83f72f1dbbf26e5d @acconrad committed Apr 28, 2012
Showing with 50 additions and 3 deletions.
  1. +1 −1 dist/jquery.expander.js
  2. +1 −1 dist/jquery.expander.min.js
  3. +48 −1 grunt.js
View
2 dist/jquery.expander.js
@@ -1,4 +1,4 @@
-/*! jQuery Expander - v0.2.5 - 2012-04-27
+/*! jQuery Expander - v0.2.5 - 2012-04-28
* https://github.com/acconrad/jquery-expander
* Copyright (c) 2012 Adam Conrad; Licensed MIT, GPL */
View
2 dist/jquery.expander.min.js
@@ -1,4 +1,4 @@
-/*! jQuery Expander - v0.2.5 - 2012-04-27
+/*! jQuery Expander - v0.2.5 - 2012-04-28
* https://github.com/acconrad/jquery-expander
* Copyright (c) 2012 Adam Conrad; Licensed MIT, GPL */
(function(a){"use strict",a.fn.expander=function(b){var c=a.extend({},a.fn.expander.options,b),d=c.filter===""?c.filter:"."+c.filter,e=10;return this.each(function(b){var f=a(this),g=f.next(),h=f.is("table"),i=h?f.children("tbody").children(d).length:f.children(d).length,j,k;e<i?(h?f.children("tbody").children(d+":gt("+(e-1)+")").addClass("hidden"):f.children(d+":gt("+(e-1)+")").addClass("hidden"),k=i-e,j=k<e?k:e,g.hasClass("expander-more")?g.html("Show "+j+" More").removeClass("hidden").attr("name",c.filter):f.after('<a href="#" name="'+c.filter+'" class="expander-more">Show '+j+" More</a>")):e>=i&&g.hasClass("expander-more")&&g.addClass("hidden")})},a.fn.expander.options={filter:""},a(document).on("click",".expander-more",function(b){b.preventDefault();var c=a(b.target),d=c.prev(),e=typeof c.attr("name")=="undefined"?"":"."+c.attr("name"),f=d.is("table"),g=f?d.children("tbody").children(e).length:d.children(e).length,h=f?g-d.children("tbody").children(".hidden").length:g-d.children(".hidden").length,i,j,k,l,m;h<g&&(j=10,m=g-h,l=m<j?m:j,i=f?d.children("tbody").children(e+":lt("+(h+l)+")").removeClass("hidden"):d.children(e+":lt("+(h+l)+")").removeClass("hidden"),k=i.length,k===g?c.remove():(m=g-k,l=m<j?m:j,c.html("Show "+l+" More")))})})(jQuery);
View
49 grunt.js
@@ -23,12 +23,57 @@ module.exports = function(grunt) {
dest: 'dist/<%= pkg.name %>.min.js'
}
},
+ cssmin: {
+ dist: {
+ src: ['src/**/*.css', 'test/**/*.css'],
+ dest: 'dist/<%= pkg.name %>.min.css'
+ }
+ },
qunit: {
files: ['test/**/*.html']
},
+ jasmine: {
+ all: ['specs/specrunner.html']
+ },
lint: {
files: ['grunt.js', 'src/**/*.js', 'test/**/*.js']
},
+ csslint: {
+ base_theme: {
+ src: ['src/**/*.css', 'test/**/*.css'],
+ rules: {
+ "adjoining-classes": false,
+ "box-model": true,
+ "box-sizing": "warning",
+ "compatible-vendor-prefixes": "warning",
+ "display-property-grouping": true,
+ "duplicate-background-images": "warning",
+ "duplicate-properties": true,
+ "empty-rules": true,
+ "errors": true,
+ "fallback-colors": "warning",
+ "floats": "warning",
+ "font-faces": "warning",
+ "font-sizes": "warning",
+ "gradients": "warning",
+ "ids": "warning",
+ "import": "warning",
+ "important": "warning",
+ "known-properties": true,
+ "outline-none": "warning",
+ "overqualified-elements": "warning",
+ "qualified-headings": "warning",
+ "regex-selectors": "warning",
+ "rules-count": "warning",
+ "shorthand": "warning",
+ "text-indent": "warning",
+ "unique-headings": "warning",
+ "universal-selector": "warning",
+ "vendor-prefix": true,
+ "zero-units": "warning"
+ }
+ }
+ },
watch: {
files: '<config:lint.files>',
tasks: 'lint qunit'
@@ -57,6 +102,8 @@ module.exports = function(grunt) {
});
// Default task.
- grunt.registerTask('default', 'lint qunit concat min');
+ grunt.loadNpmTasks('grunt-css');
+ grunt.loadNpmTasks('grunt-jasmine-task');
+ grunt.registerTask('default', 'lint qunit concat min cssmin csslint');
};

0 comments on commit 2b8ead6

Please sign in to comment.
Something went wrong with that request. Please try again.