2013-04-21 02:48:29 +03:00
|
|
|
module.exports = function (grunt) {
|
2013-03-23 02:39:08 +03:00
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
2013-04-18 21:01:21 +03:00
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
curl: {
|
2013-05-15 08:49:31 +03:00
|
|
|
'UI/JsLibraries/backbone.js' : 'http://documentcloud.github.io/backbone/backbone.js',
|
|
|
|
'UI/JsLibraries/backbone.marionette.js' : 'http://marionettejs.com/downloads/backbone.marionette.js',
|
|
|
|
'UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
|
|
|
|
'UI/JsLibraries/backbone.mutators.js' : 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js',
|
|
|
|
'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
|
2013-06-08 22:47:34 +03:00
|
|
|
|
2013-05-15 08:49:31 +03:00
|
|
|
'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
|
|
|
|
'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
|
|
|
|
'UI/JsLibraries/backbone.backgrid.paginator.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/paginator/backgrid-paginator.js',
|
|
|
|
'UI/JsLibraries/backbone.backgrid.filter.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/filter/backgrid-filter.js',
|
|
|
|
|
|
|
|
'UI/JsLibraries/handlebars.runtime.js' : 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js',
|
2013-06-27 03:33:54 +03:00
|
|
|
'UI/JsLibraries/handlebars.helpers.js' : 'http://raw.github.com/danharper/Handlebars-Helpers/master/helpers.js',
|
2013-05-15 08:49:31 +03:00
|
|
|
|
|
|
|
'UI/JsLibraries/jquery.js' : 'http://code.jquery.com/jquery.js',
|
|
|
|
'UI/JsLibraries/jquery.backstretch.js' : 'http://raw.github.com/srobbin/jquery-backstretch/master/jquery.backstretch.js',
|
2013-06-26 08:44:36 +03:00
|
|
|
'UI/JsLibraries/jquery.signalR.js' : 'http://raw.github.com/SignalR/SignalR/master/samples/Microsoft.AspNet.SignalR.Hosting.AspNet.Samples/Scripts/jquery.signalR.js',
|
|
|
|
'UI/JsLibraries/jquery.knob.js' : 'http://raw.github.com/aterrien/jQuery-Knob/master/js/jquery.knob.js',
|
2013-05-15 08:49:31 +03:00
|
|
|
|
|
|
|
'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
|
|
|
|
'UI/JsLibraries/sugar.js' : 'http://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js',
|
|
|
|
'UI/JsLibraries/underscore.js' : 'http://underscorejs.org/underscore.js',
|
2013-06-25 02:41:59 +03:00
|
|
|
'UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
|
2013-05-15 08:49:31 +03:00
|
|
|
'UI/JsLibraries/lunr.js' : 'http://raw.github.com/olivernn/lunr.js/master/lunr.js',
|
|
|
|
|
|
|
|
'UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
|
|
|
|
'UI/Content/Messenger/messenger.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger.css',
|
|
|
|
'UI/Content/Messenger/messenger.future.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger-theme-future.css',
|
|
|
|
|
2013-06-26 08:42:44 +03:00
|
|
|
'UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
|
|
|
|
'UI/Content/prefixer.less' : 'http://raw.github.com/JoelSutherland/LESS-Prefixer/master/prefixer.less'
|
2013-04-21 02:48:29 +03:00
|
|
|
},
|
2013-04-18 21:01:21 +03:00
|
|
|
|
2013-05-01 10:01:17 +03:00
|
|
|
clean: {
|
|
|
|
folder: "_output/UI/"
|
2013-04-21 02:48:29 +03:00
|
|
|
},
|
2013-05-01 10:01:17 +03:00
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
less : {
|
2013-06-26 08:42:44 +03:00
|
|
|
|
|
|
|
options:{
|
|
|
|
dumpLineNumbers : 'false',
|
|
|
|
compress : false,
|
|
|
|
yuicompress : false,
|
|
|
|
ieCompat : false
|
|
|
|
},
|
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
bootstrap: {
|
|
|
|
src : "UI/Content/bootstrap/bootstrap.less",
|
|
|
|
dest: "_output/UI/Content/bootstrap.css"
|
|
|
|
},
|
|
|
|
general : {
|
|
|
|
files: [
|
|
|
|
{
|
|
|
|
expand: true,
|
2013-06-26 03:33:17 +03:00
|
|
|
src : [
|
|
|
|
'UI/Content/base.less',
|
2013-06-28 20:49:13 +03:00
|
|
|
'UI/Content/Overrides.less',
|
2013-06-26 03:33:17 +03:00
|
|
|
'UI/Series/Series.less',
|
|
|
|
'UI/AddSeries/addSeries.less',
|
|
|
|
'UI/Calendar/calendar.less',
|
|
|
|
'UI/Cells/cells.less',
|
|
|
|
'UI/Settings/settings.less',
|
|
|
|
],
|
2013-04-21 02:48:29 +03:00
|
|
|
dest : '_output/',
|
|
|
|
ext : '.css'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2013-03-24 02:24:27 +03:00
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
handlebars: {
|
|
|
|
options: {
|
2013-06-15 08:28:35 +03:00
|
|
|
namespace : "T",
|
2013-06-08 22:39:53 +03:00
|
|
|
partialRegex: /Partial.html/,
|
2013-06-15 02:36:59 +03:00
|
|
|
wrapped : true,
|
|
|
|
amd : true,
|
2013-04-21 02:48:29 +03:00
|
|
|
processName: function (fileName) {
|
|
|
|
return fileName
|
|
|
|
.replace('UI/', '')
|
|
|
|
.replace('.html', '')
|
|
|
|
.toLowerCase();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
files : {
|
2013-06-08 22:39:53 +03:00
|
|
|
src : ['UI/**/*emplate.html','UI/**/*Partial.html'],
|
2013-04-21 02:48:29 +03:00
|
|
|
dest: '_output/UI/templates.js'
|
|
|
|
}
|
|
|
|
},
|
2013-03-24 02:24:27 +03:00
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
copy: {
|
|
|
|
index : {
|
2013-06-08 22:47:51 +03:00
|
|
|
src : 'UI/*ndex.html',
|
2013-05-21 03:17:33 +03:00
|
|
|
dest: '_output/'
|
2013-04-21 02:48:29 +03:00
|
|
|
},
|
|
|
|
scripts: {
|
|
|
|
src : 'UI/**/*.js',
|
|
|
|
dest: '_output/'
|
|
|
|
},
|
|
|
|
styles : {
|
|
|
|
src : 'UI/**/*.css',
|
|
|
|
dest: '_output/'
|
|
|
|
},
|
|
|
|
images : {
|
|
|
|
src : 'UI/**/*.png',
|
|
|
|
dest: '_output/'
|
|
|
|
},
|
2013-06-07 06:52:46 +03:00
|
|
|
jpg : {
|
|
|
|
src : 'UI/**/*.jpg',
|
|
|
|
dest: '_output/'
|
|
|
|
},
|
2013-06-15 03:29:38 +03:00
|
|
|
fontAwesome : {
|
2013-05-14 07:18:27 +03:00
|
|
|
src : 'UI/**/FontAwesome/*.*',
|
2013-04-21 02:48:29 +03:00
|
|
|
dest: '_output/'
|
2013-06-15 03:29:38 +03:00
|
|
|
},
|
|
|
|
fonts : {
|
|
|
|
src : 'UI/**/fonts/*.*',
|
|
|
|
dest: '_output/'
|
2013-04-21 02:48:29 +03:00
|
|
|
}
|
|
|
|
},
|
2013-03-29 04:49:14 +03:00
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
watch: {
|
2013-06-25 02:41:59 +03:00
|
|
|
options: {
|
|
|
|
nospawn: false,
|
|
|
|
},
|
2013-04-21 02:48:29 +03:00
|
|
|
bootstrap : {
|
2013-05-21 03:17:33 +03:00
|
|
|
files: ['UI/**/Bootstrap/**', 'UI/**/FontAwesome/**'],
|
2013-06-26 03:34:50 +03:00
|
|
|
tasks: ['less:bootstrap','less:general']
|
2013-04-21 02:48:29 +03:00
|
|
|
},
|
|
|
|
generalLess: {
|
2013-05-14 07:18:27 +03:00
|
|
|
files: ['UI/**/*.less', '!**/Bootstrap/**', '!**/FontAwesome/**'],
|
2013-04-21 02:48:29 +03:00
|
|
|
tasks: ['less:general']
|
|
|
|
},
|
|
|
|
handlebars : {
|
|
|
|
files: '<%= handlebars.files.src %>',
|
|
|
|
tasks: ['handlebars']
|
|
|
|
},
|
|
|
|
copyIndex : {
|
|
|
|
files: '<%= copy.index.src %>',
|
|
|
|
tasks: ['copy:index']
|
|
|
|
},
|
|
|
|
copyScripts: {
|
|
|
|
files: '<%= copy.scripts.src %>',
|
|
|
|
tasks: ['copy:scripts']
|
|
|
|
},
|
|
|
|
copyStyles : {
|
|
|
|
files: '<%= copy.styles.src %>',
|
|
|
|
tasks: ['copy:styles']
|
|
|
|
},
|
|
|
|
copyImages : {
|
|
|
|
files: '<%= copy.images.src %>',
|
|
|
|
tasks: ['copy:images']
|
|
|
|
},
|
2013-06-08 22:39:53 +03:00
|
|
|
copyJpg : {
|
2013-06-07 06:52:46 +03:00
|
|
|
files: '<%= copy.jpg.src %>',
|
|
|
|
tasks: ['copy:jpg']
|
|
|
|
},
|
2013-06-15 03:29:38 +03:00
|
|
|
copyFontAwesome : {
|
|
|
|
files: '<%= copy.fontAwesome.src %>',
|
|
|
|
tasks: ['copy:fontAwesome']
|
|
|
|
},
|
2013-04-21 02:48:29 +03:00
|
|
|
copyFonts : {
|
|
|
|
files: '<%= copy.fonts.src %>',
|
|
|
|
tasks: ['copy:fonts']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2013-03-23 02:39:08 +03:00
|
|
|
|
2013-04-21 02:48:29 +03:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-handlebars');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
|
|
grunt.loadNpmTasks('grunt-notify');
|
|
|
|
grunt.loadNpmTasks('grunt-curl');
|
2013-05-01 10:01:17 +03:00
|
|
|
grunt.loadNpmTasks('grunt-clean');
|
2013-04-21 02:48:29 +03:00
|
|
|
// Default task(s).
|
2013-05-01 10:01:17 +03:00
|
|
|
grunt.registerTask('package', ['clean', 'copy', 'less', 'handlebars']);
|
|
|
|
grunt.registerTask('default', ['package', 'watch']);
|
2013-04-21 02:48:29 +03:00
|
|
|
grunt.registerTask('update', ['curl']);
|
2013-03-23 02:39:08 +03:00
|
|
|
|
2013-06-08 22:47:34 +03:00
|
|
|
};
|