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:
commit
5758813ef7
3 changed files with 15 additions and 45 deletions
|
@ -24,7 +24,7 @@ export default Ember.Service.extend({
|
|||
},
|
||||
|
||||
record(id) {
|
||||
if (!this.get('enabled')) {
|
||||
if (!this.get('enabled') || is.empty(this.get('appId'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -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') {
|
||||
ENV.APP.LOG_TRANSITIONS = true;
|
||||
ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
||||
|
@ -50,7 +43,6 @@ module.exports = function(environment) {
|
|||
};
|
||||
|
||||
ENV.apiHost = "https://localhost:5001";
|
||||
ENV.apiHost = "https://demo1.dev:5001";
|
||||
}
|
||||
|
||||
if (environment === 'test') {
|
||||
|
@ -81,6 +73,19 @@ module.exports = function(environment) {
|
|||
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.contentSecurityPolicy = null;
|
||||
|
||||
|
|
|
@ -11,42 +11,7 @@ module.exports = {
|
|||
var appId = config.APP.intercomKey;
|
||||
|
||||
if ('head-footer' === type && appId.length > 0) {
|
||||
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>
|
||||
`;
|
||||
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>";
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue