-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
41 lines (31 loc) · 1.08 KB
/
index.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
/* jshint node: true */
'use strict';
var fs = require('fs');
var path = require('path');
module.exports = {
name: 'ember-cli-jquery-ui',
blueprintsPath: function() {
return path.join(__dirname, 'blueprints');
},
included: function(app) {
this._super.included(app);
var options = app.options['ember-cli-jquery-ui'] || {};
var theme = options.theme || "base";
app.import(path.join(app.bowerDirectory, 'jquery-ui', 'jquery-ui.js'));
if (theme != 'none') {
var cssFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme);
var cssFiles = fs.readdirSync(cssFileDir);
cssFiles.forEach(function(file) {
if (/^.*\.css$/.test(file) && !/^.*\.min\.css$/.test(file))
app.import(path.join(cssFileDir, file));
});
var imgFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme, 'images');
var imgFiles = fs.readdirSync(imgFileDir);
imgFiles.forEach(function(file) {
app.import(path.join(imgFileDir, file), {
destDir: "/assets/images"
});
});
}
}
};