-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
29 lines (24 loc) · 1.16 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
module.exports = {
name: 'ember-cli-map',
included: function(app) {
this.app = app;
app.import('vendor/map.css');
},
contentFor: function(type, config) {
if (type === 'body-footer' && config.environment !== 'test') {
var libs = '<script src="https://api-maps.yandex.ru/2.0/?load=package.standard&lang=ru-Ru"></script>';
if (config['ember-cli-map'] && config['ember-cli-map'].googleApiKey) {
var key = config['ember-cli-map'].googleApiKey;
libs = libs + '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&key=' + key + '&libraries=places"></script>';
} else {
libs = libs + '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>';
}
return libs;
}
if (type === 'test-body-footer' && config.environment === 'test') {
var libs = '<script src="http://api-maps.yandex.ru/2.0/?load=package.standard&lang=ru-Ru"></script>';
libs = libs + '<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>';
return libs;
}
}
};