forked from huafu/ember-data-sails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
26 lines (24 loc) · 746 Bytes
/
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
/* jshint node: true */
'use strict';
module.exports = {
name: 'ember-data-sails',
contentFor: function (what, config) {
var options;
if (what === 'body') {
if (config.APP && config.APP.emberDataSails) {
options = config.APP.emberDataSails;
}
else {
options = {};
}
if (!options.host) {
options.host = '';
}
if (!options.scriptPath) {
options.scriptPath = '/js/dependencies/sails.io.js';
}
return '<script type="text/javascript" id="eds-sails-io-script" src="' + options.host + options.scriptPath + '"></script>' +
'<script type="text/javascript">io.sails.autoConnect = false; io.sails.emberDataSailsReady = true;</script>';
}
}
};