Merge pull request #401 from nstCactus/patch-3
✨ Dispatch an event when a service is added.
This commit is contained in:
commit
4d870d731d
|
|
@ -226,11 +226,11 @@ var tarteaucitron = {
|
|||
},
|
||||
params = tarteaucitron.parameters;
|
||||
|
||||
// Step -1
|
||||
if (typeof tarteaucitronCustomPremium !== 'undefined') {
|
||||
tarteaucitronCustomPremium();
|
||||
// Step -1
|
||||
if (typeof tarteaucitronCustomPremium !== 'undefined') {
|
||||
tarteaucitronCustomPremium();
|
||||
}
|
||||
|
||||
|
||||
// Step 0: get params
|
||||
if (params !== undefined) {
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ var tarteaucitron = {
|
|||
html += ' ' + tarteaucitron.lang.privacyUrl;
|
||||
html += ' </button>';
|
||||
}
|
||||
|
||||
|
||||
//html += ' </span>';
|
||||
//html += '</div>';
|
||||
html += '</div>';
|
||||
|
|
@ -384,15 +384,15 @@ var tarteaucitron = {
|
|||
html += ' <button type="button" id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.respondAll(true);">';
|
||||
html += ' ✓ ' + tarteaucitron.lang.acceptAll;
|
||||
html += ' </button>';
|
||||
|
||||
|
||||
|
||||
|
||||
if (tarteaucitron.parameters.orientation === 'middle') {
|
||||
html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" onclick="tarteaucitron.userInterface.respondAll(false);">';
|
||||
html += ' ✗ ' + tarteaucitron.lang.denyAll;
|
||||
html += ' </button>';
|
||||
html += ' <br/><br/>';
|
||||
}
|
||||
|
||||
|
||||
html += ' <button type="button" id="tarteaucitronCloseAlert" onclick="tarteaucitron.userInterface.openPanel();">';
|
||||
html += ' ' + tarteaucitron.lang.personalize;
|
||||
html += ' </button>';
|
||||
|
|
@ -454,7 +454,7 @@ var tarteaucitron = {
|
|||
div.id = 'tarteaucitronRoot';
|
||||
body.appendChild(div, body);
|
||||
div.innerHTML = html;
|
||||
|
||||
|
||||
//ie compatibility
|
||||
var tacRootAvailableEvent;
|
||||
if(typeof(Event) === 'function') {
|
||||
|
|
@ -464,7 +464,7 @@ var tarteaucitron = {
|
|||
tacRootAvailableEvent.initEvent("tac.root_available", true, true);
|
||||
}
|
||||
//end ie compatibility
|
||||
|
||||
|
||||
window.dispatchEvent(tacRootAvailableEvent);
|
||||
|
||||
if (tarteaucitron.job !== undefined) {
|
||||
|
|
@ -641,6 +641,7 @@ var tarteaucitron = {
|
|||
}
|
||||
|
||||
tarteaucitron.cookie.checkCount(service.key);
|
||||
tarteaucitron.sendEvent(service.key + '_added')
|
||||
},
|
||||
"sendEvent" : function(event_key) {
|
||||
if(event_key !== undefined) {
|
||||
|
|
@ -839,7 +840,7 @@ var tarteaucitron = {
|
|||
document.getElementsByTagName('body')[0].classList.add('modal-open');
|
||||
tarteaucitron.userInterface.focusTrap();
|
||||
tarteaucitron.userInterface.jsSizing('main');
|
||||
|
||||
|
||||
//ie compatibility
|
||||
var tacOpenPanelEvent;
|
||||
if(typeof(Event) === 'function') {
|
||||
|
|
@ -849,7 +850,7 @@ var tarteaucitron = {
|
|||
tacOpenPanelEvent.initEvent("tac.open_panel", true, true);
|
||||
}
|
||||
//end ie compatibility
|
||||
|
||||
|
||||
window.dispatchEvent(tacOpenPanelEvent);
|
||||
},
|
||||
"closePanel": function () {
|
||||
|
|
@ -878,7 +879,7 @@ var tarteaucitron = {
|
|||
document.getElementById('tarteaucitronCloseAlert').focus();
|
||||
}
|
||||
document.getElementsByTagName('body')[0].classList.remove('modal-open');
|
||||
|
||||
|
||||
//ie compatibility
|
||||
var tacClosePanelEvent;
|
||||
if(typeof(Event) === 'function') {
|
||||
|
|
@ -888,7 +889,7 @@ var tarteaucitron = {
|
|||
tacClosePanelEvent.initEvent("tac.close_panel", true, true);
|
||||
}
|
||||
//end ie compatibility
|
||||
|
||||
|
||||
window.dispatchEvent(tacClosePanelEvent);
|
||||
},
|
||||
"focusTrap": function() {
|
||||
|
|
@ -948,7 +949,7 @@ var tarteaucitron = {
|
|||
tacOpenAlertEvent.initEvent("tac.open_alert", true, true);
|
||||
}
|
||||
//end ie compatibility
|
||||
|
||||
|
||||
window.dispatchEvent(tacOpenAlertEvent);
|
||||
},
|
||||
"closeAlert": function () {
|
||||
|
|
@ -959,7 +960,7 @@ var tarteaucitron = {
|
|||
tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none');
|
||||
tarteaucitron.userInterface.removeClass(c + 'Root', 'tarteaucitronBeforeVisible');
|
||||
tarteaucitron.userInterface.jsSizing('box');
|
||||
|
||||
|
||||
//ie compatibility
|
||||
var tacCloseAlertEvent;
|
||||
if(typeof(Event) === 'function') {
|
||||
|
|
@ -969,7 +970,7 @@ var tarteaucitron = {
|
|||
tacCloseAlertEvent.initEvent("tac.close_alert", true, true);
|
||||
}
|
||||
//end ie compatibility
|
||||
|
||||
|
||||
window.dispatchEvent(tacCloseAlertEvent);
|
||||
},
|
||||
"toggleCookiesList": function () {
|
||||
|
|
@ -1362,15 +1363,15 @@ var tarteaucitron = {
|
|||
|
||||
var availableLanguages = 'cs,de,en,es,fr,it,nl,pl,pt,ru,el,ro,bg,ja,cn',
|
||||
defaultLanguage = 'en';
|
||||
|
||||
|
||||
if (tarteaucitronForceLanguage !== '') {
|
||||
if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
|
||||
return tarteaucitronForceLanguage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!navigator) { return 'en'; }
|
||||
|
||||
|
||||
var lang = navigator.language || navigator.browserLanguage ||
|
||||
navigator.systemLanguage || navigator.userLang || null,
|
||||
userLanguage = lang ? lang.substr(0, 2) : null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue