init
This commit is contained in:
.gitignoreCHANGELOG.txtLICENSE-GPLLICENSE-MITREADME.mdgrunt.jsjquery.ui.datepicker-ru.jsmakezippackage.json
libs
bootstrap204
css
img
js
bootstrap211
css
img
js
bootstrap221
css
img
js
jquery-ui-1.9.1.custom
css
redmond
images
ui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_55_fbec88_40x100.pngui-bg_glass_75_d0e5f5_1x400.pngui-bg_glass_85_dfeffc_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_gloss-wave_55_5c9ccc_500x100.pngui-bg_inset-hard_100_f5f8f9_1x100.pngui-bg_inset-hard_100_fcfdfd_1x100.pngui-icons_217bc0_256x240.pngui-icons_2e83ff_256x240.pngui-icons_469bdd_256x240.pngui-icons_6da8d5_256x240.pngui-icons_cd0a0a_256x240.pngui-icons_d8e7f3_256x240.pngui-icons_f9bd01_256x240.png
jquery-ui-1.9.1.custom.cssjquery-ui-1.9.1.custom.min.csssmoothness
images
ui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_75_ffffff_40x100.pngui-bg_glass_55_fbf9ee_1x400.pngui-bg_glass_65_ffffff_1x400.pngui-bg_glass_75_dadada_1x400.pngui-bg_glass_75_e6e6e6_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_highlight-soft_75_cccccc_1x100.pngui-icons_222222_256x240.pngui-icons_2e83ff_256x240.pngui-icons_454545_256x240.pngui-icons_888888_256x240.pngui-icons_cd0a0a_256x240.png
jquery-ui-1.9.1.custom.cssjquery-ui-1.9.1.custom.min.cssjs
jquery-ui-datepicker
jquery
mockjax
poshytip
jquery.poshytip.jsjquery.poshytip.min.jsjquery.poshytip_corrected.js
tip-darkgray
tip-green
tip-skyblue
tip-twitter
tip-violet
tip-yellow
tip-yellowsimple
qunit
src
containers
editable-container.csseditable-container.jseditable-inline.jseditable-popover.jseditable-poshytip.jseditable-tooltip.js
editable-form
editable-form-bootstrap.jseditable-form-jqueryui.jseditable-form-utils.jseditable-form.csseditable-form.js
img
element
inputs
abstract.js
date
bootstrap-datepicker.jsdate.jsdatepicker.css
dateui.jsselect.jstext.jstextarea.jslocales
bootstrap-datepicker.bg.jsbootstrap-datepicker.br.jsbootstrap-datepicker.cs.jsbootstrap-datepicker.da.jsbootstrap-datepicker.de.jsbootstrap-datepicker.es.jsbootstrap-datepicker.fi.jsbootstrap-datepicker.fr.jsbootstrap-datepicker.id.jsbootstrap-datepicker.is.jsbootstrap-datepicker.it.jsbootstrap-datepicker.ja.jsbootstrap-datepicker.kr.jsbootstrap-datepicker.lt.jsbootstrap-datepicker.lv.jsbootstrap-datepicker.ms.jsbootstrap-datepicker.nb.jsbootstrap-datepicker.nl.jsbootstrap-datepicker.pl.jsbootstrap-datepicker.pt-BR.jsbootstrap-datepicker.pt.jsbootstrap-datepicker.ru.jsbootstrap-datepicker.sl.jsbootstrap-datepicker.sv.jsbootstrap-datepicker.th.jsbootstrap-datepicker.tr.jsbootstrap-datepicker.zh-CN.jsbootstrap-datepicker.zh-TW.js
test
228
grunt.js
Normal file
228
grunt.js
Normal file
@ -0,0 +1,228 @@
|
||||
/*global module:false*/
|
||||
module.exports = function(grunt) {
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib');
|
||||
|
||||
//grunt.loadTasks('tasks/');
|
||||
|
||||
//directories
|
||||
var
|
||||
lib = 'src/',
|
||||
forms = lib+'editable-form/',
|
||||
inputs = lib+'inputs/',
|
||||
containers = lib+'containers/';
|
||||
|
||||
//config for different cores of lib
|
||||
var config = {
|
||||
bootstrap: {
|
||||
form: [forms+'editable-form-bootstrap.js'],
|
||||
container: [containers+'editable-popover.js'],
|
||||
inputs: [inputs+'date/date.js', inputs+'date/bootstrap-datepicker.js'],
|
||||
css: [inputs+'date/datepicker.css']
|
||||
},
|
||||
jqueryui: {
|
||||
form: [forms+'editable-form-jqueryui.js'],
|
||||
container: [containers+'editable-tooltip.js'],
|
||||
inputs: [inputs+'dateui.js'],
|
||||
css: []
|
||||
},
|
||||
jquery: {
|
||||
form: [],
|
||||
container: [containers+'editable-poshytip.js'],
|
||||
inputs: [inputs+'dateui.js'],
|
||||
css: []
|
||||
}
|
||||
};
|
||||
|
||||
var inline = [containers+'editable-inline.js'];
|
||||
|
||||
//common js files
|
||||
var js = [
|
||||
'<banner:meta.banner>',
|
||||
forms+'editable-form.js',
|
||||
forms+'editable-form-utils.js',
|
||||
containers+'editable-container.js',
|
||||
lib+'element/editable-element.js',
|
||||
inputs+'abstract.js',
|
||||
inputs+'text.js',
|
||||
inputs+'textarea.js',
|
||||
inputs+'select.js'
|
||||
];
|
||||
|
||||
//common css files
|
||||
var css = [
|
||||
'<banner:meta.banner>',
|
||||
forms+'editable-form.css',
|
||||
containers+'editable-container.css',
|
||||
lib+'element/editable-element.css'
|
||||
];
|
||||
|
||||
//create grunt concat task
|
||||
var task, folder, dest, concat_files = {}, min_files = {};
|
||||
for(var k in config) {
|
||||
folder = '<%= dist %>/'+k+'-editable/';
|
||||
|
||||
//popup
|
||||
task = k+'_popup_js';
|
||||
dest = folder+'js/'+k+'-editable'+ (k === 'jquery' ? '-poshytip' : '');
|
||||
concat_files[task] = {
|
||||
src: js.concat(config[k].form).concat(config[k].container).concat(config[k].inputs),
|
||||
dest: dest+'.js'
|
||||
};
|
||||
min_files[task] = {
|
||||
src: ['<banner:meta.banner>', '<config:concat.'+task+'.dest>'],
|
||||
dest: dest + '.min.js'
|
||||
};
|
||||
|
||||
//inline
|
||||
task = k+'_inline_js';
|
||||
dest = folder+'js/'+k+'-editable-inline';
|
||||
concat_files[task] = {
|
||||
src: js.concat(config[k].form).concat(inline).concat(config[k].inputs),
|
||||
dest: dest+'.js'
|
||||
};
|
||||
min_files[task] = {
|
||||
src: ['<banner:meta.banner>', '<config:concat.'+task+'.dest>'],
|
||||
dest: dest + '.min.js'
|
||||
};
|
||||
|
||||
//css
|
||||
concat_files[k+'_css'] = {
|
||||
src: css.concat(config[k].css),
|
||||
dest: folder+'css/'+k+'-editable.css'
|
||||
};
|
||||
}
|
||||
|
||||
var module = '';
|
||||
//module = '&module=textarea';
|
||||
//module = '&module=select';
|
||||
//module = '&module=text';
|
||||
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: '<json:package.json>',
|
||||
dist: 'dist',
|
||||
meta: {
|
||||
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> \n' +
|
||||
'* <%= pkg.description %>\n' +
|
||||
'* <%= pkg.homepage %>\n' +
|
||||
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
|
||||
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
|
||||
},
|
||||
clean: ['<config:dist>'],
|
||||
concat: concat_files,
|
||||
min: min_files,
|
||||
qunit: {
|
||||
bootstrap: [
|
||||
'http://localhost:8000/test/index.html?f=bootstrap&c=popup'+module,
|
||||
'http://localhost:8000/test/index.html?f=bootstrap&c=inline'+module
|
||||
],
|
||||
jqueryui: [
|
||||
'http://localhost:8000/test/index.html?f=jqueryui&c=popup'+module,
|
||||
'http://localhost:8000/test/index.html?f=jqueryui&c=inline'+module
|
||||
],
|
||||
plain: [
|
||||
'http://localhost:8000/test/index.html?f=plain&c=popup'+module,
|
||||
'http://localhost:8000/test/index.html?f=plain&c=inline'+module
|
||||
]
|
||||
// files: ['test/index.html']
|
||||
},
|
||||
server: {
|
||||
port: 8000,
|
||||
base: '.'
|
||||
},
|
||||
|
||||
lint: {
|
||||
//TODO: lint tests files
|
||||
//files: ['grunt.js', 'src/js/*.js', 'test/**/*.js']
|
||||
files: ['grunt.js',
|
||||
'src/editable-form/*.js',
|
||||
'src/containers/*.js',
|
||||
'src/inputs/*.js',
|
||||
'src/element/*.js',
|
||||
'src/inputs/*.js',
|
||||
'src/inputs/date/date.js'
|
||||
//do not check bootstrap-datepicker
|
||||
]
|
||||
},
|
||||
/*
|
||||
watch: {
|
||||
files: '<config:lint.files>',
|
||||
tasks: 'lint qunit'
|
||||
},
|
||||
*/
|
||||
jshint: {
|
||||
options: {
|
||||
curly: true,
|
||||
eqeqeq: true,
|
||||
immed: true,
|
||||
latedef: true,
|
||||
newcap: true,
|
||||
noarg: true,
|
||||
sub: true,
|
||||
undef: true,
|
||||
boss: true,
|
||||
eqnull: true,
|
||||
browser: true,
|
||||
evil: false
|
||||
},
|
||||
globals: {
|
||||
jQuery: true
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
dist: {
|
||||
files: {
|
||||
'<%= dist %>/bootstrap-editable/css/img' : 'src/editable-form/img/*',
|
||||
'<%= dist %>/jqueryui-editable/css/img' : 'src/editable-form/img/*',
|
||||
'<%= dist %>/jquery-editable/css/img' : 'src/editable-form/img/*',
|
||||
'<%= dist %>/bootstrap-editable/js/locales' : 'src/inputs/date/locales/*',
|
||||
'<%= dist %>': ['LICENSE-GPL', 'LICENSE-MIT', 'README.md', 'CHANGELOG.txt']
|
||||
},
|
||||
options: {
|
||||
flatten: true
|
||||
}
|
||||
}
|
||||
},
|
||||
//compress does not work properly for MAC OS (see https://github.com/vitalets/bootstrap-editable/issues/19)
|
||||
//zip will be created manually
|
||||
/*
|
||||
compress: {
|
||||
zip: {
|
||||
options: {
|
||||
mode: "zip",
|
||||
//TODO: unfortunatly here <%= dist_source %> and <config:dist_source> does not work
|
||||
basePath: "dist"
|
||||
},
|
||||
files: {
|
||||
"<%= dist %>/bootstrap-editable-v<%= pkg.version %>.zip": ["<%= dist_source %>/ **", "<%= dist %>/libs/ **"]
|
||||
}
|
||||
},
|
||||
tgz: {
|
||||
options: {
|
||||
mode: "tgz",
|
||||
basePath: "dist"
|
||||
},
|
||||
files: {
|
||||
"<%= dist %>/bootstrap-editable-v<%= pkg.version %>.tar.gz": ["<%= dist_source %>/ **", "<%= dist %>/libs/ **"]
|
||||
}
|
||||
}
|
||||
},
|
||||
*/
|
||||
uglify: {}
|
||||
});
|
||||
|
||||
//test task
|
||||
grunt.registerTask('test', 'server qunit:bootstrap');
|
||||
grunt.registerTask('testall', 'server qunit');
|
||||
|
||||
// Default task.
|
||||
// grunt.registerTask('default', 'lint qunit');
|
||||
grunt.registerTask('default', 'clean concat min copy');
|
||||
|
||||
// build
|
||||
grunt.registerTask('build', 'clean lint concat min copy');
|
||||
|
||||
//to run particular task use ":", e.g. copy:libs
|
||||
};
|
Reference in New Issue
Block a user