Prevent script to be loaded
This commit is contained in:
parent
447b5e0b3b
commit
bb4f67329e
|
|
@ -10,7 +10,7 @@ var scripts = document.getElementsByTagName('script'),
|
||||||
tarteaucitronNoAdBlocker = false;
|
tarteaucitronNoAdBlocker = false;
|
||||||
|
|
||||||
var tarteaucitron = {
|
var tarteaucitron = {
|
||||||
"version": 156,
|
"version": 156.2,
|
||||||
"cdn": cdn,
|
"cdn": cdn,
|
||||||
"user": {},
|
"user": {},
|
||||||
"lang": {},
|
"lang": {},
|
||||||
|
|
@ -226,7 +226,12 @@ var tarteaucitron = {
|
||||||
html += ' --><div id="tarteaucitronCookiesNumber" onclick="tarteaucitron.userInterface.toggleCookiesList();">';
|
html += ' --><div id="tarteaucitronCookiesNumber" onclick="tarteaucitron.userInterface.toggleCookiesList();">';
|
||||||
html += ' 0';
|
html += ' 0';
|
||||||
html += ' </div>';
|
html += ' </div>';
|
||||||
html += ' <div id="tarteaucitronCookiesListContainer"><div id="tarteaucitronCookiesList"></div></div>';
|
html += ' <div id="tarteaucitronCookiesListContainer">';
|
||||||
|
html += ' <div id="tarteaucitronClosePanelCookie" onclick="tarteaucitron.userInterface.closePanel();">';
|
||||||
|
html += ' ' + tarteaucitron.lang.close;
|
||||||
|
html += ' </div>';
|
||||||
|
html += ' <div id="tarteaucitronCookiesList"></div>';
|
||||||
|
html += ' </div>';
|
||||||
} else {
|
} else {
|
||||||
html += ' </div>';
|
html += ' </div>';
|
||||||
}
|
}
|
||||||
|
|
@ -796,29 +801,30 @@ var tarteaucitron = {
|
||||||
},
|
},
|
||||||
"addScript": function (url, id, callback, execute) {
|
"addScript": function (url, id, callback, execute) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var script = document.createElement('script'),
|
var script,
|
||||||
done = false;
|
done = false;
|
||||||
|
|
||||||
script.type = 'text/javascript';
|
|
||||||
script.id = (id !== undefined) ? id : '';
|
|
||||||
script.async = true;
|
|
||||||
script.src = url;
|
|
||||||
|
|
||||||
if (typeof callback === 'function') {
|
|
||||||
script.onreadystatechange = script.onload = function () {
|
|
||||||
var state = script.readyState;
|
|
||||||
if (!done && (!state || /loaded|complete/.test(state))) {
|
|
||||||
done = true;
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (execute === false) {
|
if (execute === false) {
|
||||||
if (typeof callback === 'function') {
|
if (typeof callback === 'function') {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
script = document.createElement('script');
|
||||||
|
script.type = 'text/javascript';
|
||||||
|
script.id = (id !== undefined) ? id : '';
|
||||||
|
script.async = true;
|
||||||
|
script.src = url;
|
||||||
|
|
||||||
|
if (typeof callback === 'function') {
|
||||||
|
script.onreadystatechange = script.onload = function () {
|
||||||
|
var state = script.readyState;
|
||||||
|
if (!done && (!state || /loaded|complete/.test(state))) {
|
||||||
|
done = true;
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(script);
|
document.getElementsByTagName('head')[0].appendChild(script);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue