1
0
Fork 0
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:
Elliott Stoneham 2016-06-16 17:05:35 +01:00
commit c45eb09436
2 changed files with 7 additions and 40 deletions

View file

@ -36,10 +36,12 @@ module.exports = function(environment) {
}; };
process.argv.forEach(function(element){ process.argv.forEach(function(element){
if (element !== 'undefined') {
if (element.startsWith("intercom=")) { if (element.startsWith("intercom=")) {
element = element.replace("intercom=", ""); element = element.replace("intercom=", "");
ENV.APP.intercomKey = element; ENV.APP.intercomKey = element;
} }
}
}); });
if (environment === 'development') { if (environment === 'development') {

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>
`;
} }
}, },