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