mirror of
https://github.com/documize/community.git
synced 2025-08-08 06:55:28 +02:00
Merge branch 'master' into enes-tweaks
This commit is contained in:
commit
43166b9b9c
2 changed files with 7 additions and 40 deletions
|
@ -36,10 +36,12 @@ module.exports = function(environment) {
|
|||
};
|
||||
|
||||
process.argv.forEach(function(element){
|
||||
if (element !== 'undefined') {
|
||||
if (element.startsWith("intercom=")) {
|
||||
element = element.replace("intercom=", "");
|
||||
ENV.APP.intercomKey = element;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (environment === 'development') {
|
||||
|
|
|
@ -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