Making id uniq
This commit is contained in:
parent
8cff207c2b
commit
521b2280ee
|
|
@ -203,7 +203,7 @@ var tarteaucitron = {
|
||||||
},
|
},
|
||||||
"respond": function (el, status) {
|
"respond": function (el, status) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var key = el.id.replace(new RegExp("(Allow|Deni)ed", "g"), '');
|
var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
|
||||||
|
|
||||||
// return if same state
|
// return if same state
|
||||||
if (tarteaucitron.state[key] === status) {
|
if (tarteaucitron.state[key] === status) {
|
||||||
|
|
@ -382,14 +382,15 @@ var tarteaucitron = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"engage": function (id, r) {
|
"engage": function (id) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var html = '';
|
var html = '',
|
||||||
|
r = Math.floor(Math.random() * 100000);
|
||||||
|
|
||||||
html += '<div class="tac_activate">';
|
html += '<div class="tac_activate">';
|
||||||
html += ' <div class="tac_float">';
|
html += ' <div class="tac_float">';
|
||||||
html += ' <b>' + id + '</b> ' + tarteaucitron.lang.fallback + '<br/>';
|
html += ' <b>' + id + '</b> ' + tarteaucitron.lang.fallback + '<br/>';
|
||||||
html += ' <div class="tarteaucitronAllow" id="tacEngage' + id + r + '">';
|
html += ' <div class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">';
|
||||||
html += ' ' + tarteaucitron.lang.allow;
|
html += ' ' + tarteaucitron.lang.allow;
|
||||||
html += ' </div>';
|
html += ' </div>';
|
||||||
html += ' </div>';
|
html += ' </div>';
|
||||||
|
|
|
||||||
|
|
@ -54,13 +54,9 @@ tarteaucitron.services.disqus = {
|
||||||
},
|
},
|
||||||
"fallback": function () {
|
"fallback": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var id = 'disqus',
|
var id = 'disqus';
|
||||||
r = Math.floor(Math.random() * 100000);
|
|
||||||
|
|
||||||
document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id, r);
|
document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
|
||||||
document.getElementById('tacEngage' + id + r).onclick = function () {
|
|
||||||
tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -87,15 +83,10 @@ tarteaucitron.services.sharethis = {
|
||||||
"fallback": function () {
|
"fallback": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var cookies = ['__unam'],
|
var cookies = ['__unam'],
|
||||||
id = 'sharethis',
|
id = 'sharethis';
|
||||||
r = Math.floor(Math.random() * 100000);
|
|
||||||
|
|
||||||
tarteaucitron.cookie.purge(cookies);
|
tarteaucitron.cookie.purge(cookies);
|
||||||
|
tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id));
|
||||||
tarteaucitron.fallback(['tacSharethis'], tarteaucitron.engage(id, r));
|
|
||||||
document.getElementById('tacEngage' + id + r).onclick = function () {
|
|
||||||
tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -122,15 +113,10 @@ tarteaucitron.services.shareaholic = {
|
||||||
"fallback": function () {
|
"fallback": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var cookies = ['__utma', '__utmb', '__utmc', '__utmz'],
|
var cookies = ['__utma', '__utmb', '__utmc', '__utmz'],
|
||||||
id = 'shareaholic',
|
id = 'shareaholic';
|
||||||
r = Math.floor(Math.random() * 100000);
|
|
||||||
|
|
||||||
tarteaucitron.cookie.purge(cookies);
|
tarteaucitron.cookie.purge(cookies);
|
||||||
|
tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id));
|
||||||
tarteaucitron.fallback(['shareaholic-canvas'], tarteaucitron.engage(id, r));
|
|
||||||
document.getElementById('tacEngage' + id + r).onclick = function () {
|
|
||||||
tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -152,15 +138,10 @@ tarteaucitron.services.addthis = {
|
||||||
"fallback": function () {
|
"fallback": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var cookies = ['__atuvc'],
|
var cookies = ['__atuvc'],
|
||||||
id = 'addthis',
|
id = 'addthis';
|
||||||
r = Math.floor(Math.random() * 100000);
|
|
||||||
|
|
||||||
tarteaucitron.cookie.purge(cookies);
|
tarteaucitron.cookie.purge(cookies);
|
||||||
|
tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id));
|
||||||
tarteaucitron.fallback(['addthis_sharing_toolbox'], tarteaucitron.engage(id, r));
|
|
||||||
document.getElementById('tacEngage' + id + r).onclick = function () {
|
|
||||||
tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -212,13 +193,9 @@ tarteaucitron.services.adsense = {
|
||||||
},
|
},
|
||||||
"fallback": function () {
|
"fallback": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var id = 'adsense',
|
var id = 'adsense';
|
||||||
r = Math.floor(Math.random() * 100000);
|
|
||||||
|
|
||||||
tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id, r));
|
tarteaucitron.fallback(['adsbygoogle'], tarteaucitron.engage(id));
|
||||||
document.getElementById('tacEngage' + id + r).onclick = function () {
|
|
||||||
tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue