1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-07 22:45:24 +02:00

Merge branch 'master' into mirage-upgrade

This commit is contained in:
Harvey Kandola 2016-06-17 09:32:13 -07:00
commit 5758813ef7
3 changed files with 15 additions and 45 deletions

View file

@ -24,7 +24,7 @@ export default Ember.Service.extend({
}, },
record(id) { record(id) {
if (!this.get('enabled')) { if (!this.get('enabled') || is.empty(this.get('appId'))) {
return; return;
} }

View file

@ -35,13 +35,6 @@ module.exports = function(environment) {
} }
}; };
process.argv.forEach(function(element){
if (element.startsWith("intercom=")) {
element = element.replace("intercom=", "");
ENV.APP.intercomKey = element;
}
});
if (environment === 'development') { if (environment === 'development') {
ENV.APP.LOG_TRANSITIONS = true; ENV.APP.LOG_TRANSITIONS = true;
ENV.APP.LOG_TRANSITIONS_INTERNAL = true; ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
@ -50,7 +43,6 @@ module.exports = function(environment) {
}; };
ENV.apiHost = "https://localhost:5001"; ENV.apiHost = "https://localhost:5001";
ENV.apiHost = "https://demo1.dev:5001";
} }
if (environment === 'test') { if (environment === 'test') {
@ -81,6 +73,19 @@ module.exports = function(environment) {
ENV.apiHost = ""; ENV.apiHost = "";
} }
process.argv.forEach(function(element) {
if (element !== undefined) {
if (element.startsWith("intercom=")) {
element = element.replace("intercom=", "");
ENV.APP.intercomKey = element;
}
if (element.startsWith("apiHost=")) {
element = element.replace("apiHost=", "");
ENV.apiHost = element;
}
}
});
ENV.apiNamespace = "api"; ENV.apiNamespace = "api";
ENV.contentSecurityPolicy = null; ENV.contentSecurityPolicy = null;

View file

@ -11,42 +11,7 @@ module.exports = {
var appId = config.APP.intercomKey; var appId = config.APP.intercomKey;
if ('head-footer' === type && appId.length > 0) { if ('head-footer' === type && appId.length > 0) {
return ` return "<script type='text/javascript'> (function() { var w = window; var ic = w.Intercom; if (typeof ic === 'function') { ic('reattach_activator'); ic('update', intercomSettings); } else { var d = document; var i = function() { i.c(arguments) }; i.q = []; i.c = function(args) { i.q.push(args) }; w.Intercom = i; function l() { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/${appId}'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })() </script>";
<script type="text/javascript">
(function() {
var w = window;
var ic = w.Intercom;
if (typeof ic === "function") {
ic('reattach_activator');
ic('update', intercomSettings);
} else {
var d = document;
var i = function() {
i.c(arguments)
};
i.q = [];
i.c = function(args) {
i.q.push(args)
};
w.Intercom = i;
function l() {
var s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://widget.intercom.io/widget/${appId}';
var x = d.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
if (w.attachEvent) {
w.attachEvent('onload', l);
} else {
w.addEventListener('load', l, false);
}
}
})()
</script>
`;
} }
}, },