forked from Semantic-Org/Semantic-UI-Ember
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
54 lines (44 loc) · 1.57 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
42
43
44
45
46
47
48
49
50
51
52
53
54
/* jshint node: true */
'use strict';
var defaults = {
css: true,
javascript: true,
fonts: true,
images: true
};
var getWithDefault = function(property, default_property) {
if (property === null || property === undefined) {
return default_property;
}
return property;
}
module.exports = {
name: 'semantic-ui-ember',
included: function (app) {
var options = (app && app.options['SemanticUI']) || {};
if (getWithDefault(options['css'], defaults['css'])) {
app.import({
development: 'bower_components/semantic-ui/dist/semantic.css',
production: 'bower_components/semantic-ui/dist/semantic.min.css'
});
}
if (getWithDefault(options['javascript'], defaults['javascript'])) {
app.import({
development: 'bower_components/semantic-ui/dist/semantic.js',
production: 'bower_components/semantic-ui/dist/semantic.min.js'
});
} else {
}
if (getWithDefault(options['images'], defaults['images'])) {
var imageOptions = { destDir: 'assets/themes/default/assets/images' };
app.import('bower_components/semantic-ui/dist/themes/default/assets/images/flags.png', imageOptions);
}
if (getWithDefault(options['fonts'], defaults['fonts'])) {
var fontExtensions = ['.eot','.otf','.svg','.ttf','.woff','.woff2'];
var fontOptions = { destDir: 'assets/themes/default/assets/fonts' };
for (var i = fontExtensions.length - 1; i >= 0; i--) {
app.import('bower_components/semantic-ui/dist/themes/default/assets/fonts/icons'+fontExtensions[i], fontOptions);
};
}
}
};