From c186089797608589ccd542d022bdc576d0615e96 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Fri, 12 Dec 2014 16:52:45 +0100 Subject: [PATCH] Simplify Xiti --- tarteaucitron.services.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 93ea8bf..84e16a2 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -343,28 +343,31 @@ tarteaucitron.services.xiti = { "needConsent": true, "js": function () { "use strict"; - if (tarteaucitron.user.xitiId === undefined || document.getElementById('xitiTac') === undefined) { + if (tarteaucitron.user.xitiId === undefined) { return; } var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=', Xt_r, Xt_h, Xt_i, - Xt_s; + Xt_s, + div = document.createElement('div'); try { Xt_r = top.document.referrer; } catch (e) { Xt_r = document.referrer; } Xt_h = new Date(); - Xt_i = '= 4) { Xt_s = screen; Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth; } - document.getElementById('xitiTac').innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">'; + + div.innerHTML = Xt_i + '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$') + '" title="Internet Audience">'; + document.getElementsByTagName('body')[0].appendChild(div.firstChild); if (typeof tarteaucitron.user.xitiMore === 'function') { tarteaucitron.user.xitiMore();