Simplify Xiti

This commit is contained in:
Amauri CHAMPEAUX 2014-12-12 16:52:45 +01:00
parent b0172df38e
commit c186089797
1 changed files with 7 additions and 4 deletions

View File

@ -343,28 +343,31 @@ tarteaucitron.services.xiti = {
"needConsent": true, "needConsent": true,
"js": function () { "js": function () {
"use strict"; "use strict";
if (tarteaucitron.user.xitiId === undefined || document.getElementById('xitiTac') === undefined) { if (tarteaucitron.user.xitiId === undefined) {
return; return;
} }
var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=', var Xt_param = 's=' + tarteaucitron.user.xitiId + '&p=',
Xt_r, Xt_r,
Xt_h, Xt_h,
Xt_i, Xt_i,
Xt_s; Xt_s,
div = document.createElement('div');
try { try {
Xt_r = top.document.referrer; Xt_r = top.document.referrer;
} catch (e) { } catch (e) {
Xt_r = document.referrer; Xt_r = document.referrer;
} }
Xt_h = new Date(); Xt_h = new Date();
Xt_i = '<img width="39" height="25" border="0" alt="" '; Xt_i = '<img style="display:none" border="0" alt="" ';
Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param; Xt_i += 'src="http://logv3.xiti.com/hit.xiti?' + Xt_param;
Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds(); Xt_i += '&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
if (parseFloat(navigator.appVersion) >= 4) { if (parseFloat(navigator.appVersion) >= 4) {
Xt_s = screen; Xt_s = screen;
Xt_i += '&r=' + Xt_s.width + 'x' + Xt_s.height + 'x' + Xt_s.pixelDepth + 'x' + Xt_s.colorDepth; 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') { if (typeof tarteaucitron.user.xitiMore === 'function') {
tarteaucitron.user.xitiMore(); tarteaucitron.user.xitiMore();