-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
137 lines (123 loc) · 4.11 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
module.exports = function(grunt) {
var defaultTasks = [
'npmcopy',
'concat',
'clean'
];
var banner = '/*! <%= pkg.name %> <%= pkg.version %> */\n';
var contribFiles = [
// external libraries
'vendor/js/jquery.js',
'vendor/js/bootstrap.js',
'vendor/js/bootstrap-fileinput.js',
'vendor/js/x-editable.js',
'vendor/js/wysihtml5.js',
'vendor/js/x-editable-wysihtml5.js',
'vendor/js/x-editable-bootstrap-wysihtml5.js'
];
var srcFiles = [
'assets/js/imageTools.js'
];
var allFiles = contribFiles.concat(srcFiles);
var cssFiles = [
'vendor/css/bootstrap.css',
'vendor/css/bootstrap-fileinput.css',
'vendor/css/x-editable.css',
'vendor/css/x-editable-bootstrap-wysihtml5.css',
'assets/css/visorxml.css'
];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
npmcopy: {
js: {
options: {
destPrefix: 'vendor/js'
},
files: {
'jquery.js': 'jquery/dist/jquery.js',
'bootstrap.js': 'bootstrap/dist/js/bootstrap.js',
'bootstrap-fileinput.js': 'bootstrap-fileinput/js/fileinput.js',
'x-editable.js': 'x-editable/dist/bootstrap3-editable/js/bootstrap-editable.js',
'wysihtml5.js': 'x-editable/dist/inputs-ext/wysihtml5/wysihtml5.js',
/*'x-editable-wysihtml5.js': 'x-editable/dist/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/wysihtml5-0.3.0.js',
This script has been replaced by other with support for base64 images into <img> src attribute.
*/
'x-editable-wysihtml5.js': '../assets/js/wysihtml5-base64.js',
/* 'x-editable-bootstrap-wysihtml5.js': 'x-editable/dist/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5-0.0.2.js'
This script has been replaces by other with "scroll bug" fixed.
*/
'x-editable-bootstrap-wysihtml5.js': '../assets/js/bootstrap-wysihtml5-base64.js'
}
},
css: {
options: {
destPrefix: 'vendor/css'
},
files: {
'bootstrap.css': 'bootstrap/dist/css/bootstrap.css',
'bootstrap-fileinput.css': 'bootstrap-fileinput/css/fileinput.css',
'x-editable.css': 'x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css',
'x-editable-bootstrap-wysihtml5.css': 'x-editable/dist/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5-0.0.2.css'
}
},
fonts: {
options: {
destPrefix: 'visorxml/static/fonts'
},
files: {
'glyphicons-halflings-regular.eot': 'bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
'glyphicons-halflings-regular.svg': 'bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
'glyphicons-halflings-regular.ttf': 'bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
'glyphicons-halflings-regular.woff': 'bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
'glyphicons-halflings-regular.woff2': 'bootstrap/dist/fonts/glyphicons-halflings-regular.woff2'
}
},
imgs: {
options: {
destPrefix: 'visorxml/static/img'
},
files: {
'loading.gif': 'x-editable/dist/bootstrap3-editable/img/loading.gif',
'clear.png': 'x-editable/dist/bootstrap3-editable/img/clear.png'
}
}
},
watch: {
js: {
files: [
'Gruntfile.js',
'app/**/*.js',
'po/**/*.po'
],
tasks: defaultTasks
},
scss: {
files: [
'assets/**/*.css'
],
tasks: defaultTasks
}
},
concat: {
options: {
banner: banner
},
js: {
src: allFiles,
dest: 'visorxml/static/js/<%= pkg.name %>.js'
},
css: {
src: cssFiles,
dest: 'visorxml/static/css/style.css'
}
},
clean: [
'vendor'
]
});
grunt.loadNpmTasks('grunt-npmcopy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', defaultTasks);
};