Skip to content

Commit

Permalink
First commit!
Browse files Browse the repository at this point in the history
This is the first commit, everyone.
  • Loading branch information
bluefirex committed Apr 3, 2016
0 parents commit 8745794
Show file tree
Hide file tree
Showing 44 changed files with 4,108 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dist/*
node_modules
.sass-cache
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
examples
.sass-cache
10 changes: 10 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*!
* SweetModal: Sweet, easy and powerful modals and dialogs
* v<%= pkg.version %>, <%= grunt.template.today("yyyy-mm-dd") %>
* http://github.com/adeptoas/sweet-modal
*
* Copyright (c) 2016 Adepto.as AS · Oslo, Norway
* Dual licensed under the MIT and GPL licenses.
*
* See LICENSE-MIT.txt and LICENSE-GPL.txt
*/
170 changes: 170 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copyrightBanner: grunt.file.read('COPYRIGHT'),

opts: {
scss: 'src/scss',
js: 'src/js',
images: 'src/images',
examples: 'examples',

dist: {
parent: 'dist',
min: 'dist/min',
dev: 'dist/dev',
images: 'dist/images'
},

archive: {
zip: 'jquery.sweet-modal-<%= pkg.version %>.zip'
}
},

clean: {
dist: ['<%= opts.dist.parent %>/*'],
examples: [
'<%= opts.examples %>/css',
'<%= opts.examples %>/js',
'<%= opts.examples %>/images'
]
},

copy: {
images: {
expand: true,
cwd: '<%= opts.images %>',
src: '**',
dest: '<%= opts.dist.images %>'
},

'examples-deps-js': {
expand: true,
flatten: true,
src: ['node_modules/jquery/dist/jquery.min.js', '<%= opts.dist.min %>/jquery.sweet-modal.min.js'],
dest: '<%= opts.examples %>/js/'
},

'examples-deps-css': {
expand: true,
flatten: true,
src: ['<%= opts.dist.min %>/jquery.sweet-modal.min.css'],
dest: '<%= opts.examples %>/css/'
},

'examples-deps-images': {
expand: true,
cwd: '<%= opts.images %>',
src: '**',
dest: '<%= opts.examples %>/images/'
},
},

sass: {
options: {
trace: true,
sourcemap: 'none',
style: 'compressed'
},

'sweet-modal': {
options: {
style: 'nested',
sourcemap: 'auto'
},

files: {
'<%= opts.dist.dev %>/jquery.sweet-modal.css': ['<%= opts.scss %>/sweet-modal.scss']
}
},

'sweet-modal-min': {
files: {
'<%= opts.dist.min %>/jquery.sweet-modal.min.css': ['<%= opts.scss %>/sweet-modal.scss']
}
},

examples: {
files: {
'<%= opts.examples %>/css/examples.css': ['<%= opts.scss %>/examples.scss']
}
}
},

browserify: {
'sweet-modal': {
options: {
transform: ['coffeeify'],
banner: '<%= copyrightBanner %>'
},

files: {
'<%= opts.dist.dev %>/jquery.sweet-modal.js': ['<%= opts.js %>/sweet-modal.coffee']
}
}
},

uglify: {
options: {
screwIE8: true,
mangle: {
except: ['jQuery', '$', 'module']
},
banner: '<%= copyrightBanner %>',
mangle: false,
sourceMap: false
},

'sweet-modal-min': {
files: {
'<%= opts.dist.min %>/jquery.sweet-modal.min.js': ['<%= opts.dist.dev %>/jquery.sweet-modal.js']
}
}
},

watch: {
scss: {
files: ['<%= opts.scss %>/**/*.scss'],
tasks: ['compile:scss', 'copy:examples-deps-css']
},

js: {
files: ['<%= opts.js %>/**/*.coffee'],
tasks: ['compile:js', 'copy:examples-deps-js']
}
},

compress: {
'sweet-modal': {
options: {
archive: '<%= opts.dist.parent %>/<%= opts.archive.zip %>'
},

files: [
{
expand: true,
cwd: '<%= opts.dist.parent %>',
src: ['*', '**/*', '!*.zip', '../LICENSE-GPL', '../LICENSE-MIT', '../README.md'],
dest: '/'
}
]
}
}
});

grunt.registerTask('copy:examples-deps', ['copy:examples-deps-js', 'copy:examples-deps-css', 'copy:examples-deps-images']);

grunt.registerTask('compile:js', ['browserify:sweet-modal', 'uglify:sweet-modal-min']);

grunt.registerTask('compile:scss', ['sass']);
grunt.registerTask('compile:scss:sweet-modal', ['sass:sweet-modal', 'sass:sweet-modal-min']);
grunt.registerTask('compile:scss:examples', ['sass:examples']);

grunt.registerTask('compile:examples', ['clean:examples', 'compile:scss:examples', 'copy:examples-deps']);

grunt.registerTask('compile', ['clean', 'compile:js', 'compile:scss:sweet-modal', 'copy:images', 'compile:examples']);

grunt.registerTask('default', ['compile']);
};
Loading

0 comments on commit 8745794

Please sign in to comment.