Commit 1a2437e4 authored by rg's avatar rg

Modification des comportements par defaut.

parent d86a9261
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* - fixed: boolean (default true). If false, css position = "relative". If true css position = "absolute" * - fixed: boolean (default true). If false, css position = "relative". If true css position = "absolute"
* - validateFollow: true/false -> is equal to a click on "ok" on first document click (default true). A false value specifies a click to button "ok" as mandatory * - validateFollow: true/false -> is equal to a click on "ok" on first document click (default true). A false value specifies a click to button "ok" as mandatory
* - consent: array of specifics cookies (optional) * - consent: array of specifics cookies (optional)
* - buttons : default="ok|notOk|choice" -> displayed buttons * - default: default value at first display => 'accept' (default) or 'deny'
* - locale: json to change default text * - locale: json to change default text
* ex: var locale={ * ex: var locale={
* 'ok': 'Ok', * 'ok': 'Ok',
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
'denyAll': 'Interdire tous les cookies', 'denyAll': 'Interdire tous les cookies',
'accept': 'Autoriser', 'accept': 'Autoriser',
'deny': 'Interdire', 'deny': 'Interdire',
'close': 'X' 'close': 'Fermer'
}; };
if(typeof options!=="undefined") { if(typeof options!=="undefined") {
if(typeof options.buttons!=="undefined") buttons=options.buttons; if(typeof options.buttons!=="undefined") buttons=options.buttons;
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
list.push({"key": e.key,"value": e.value}); list.push({"key": e.key,"value": e.value});
}); });
autoSelectButtons(consentOptions); autoSelectButtons(consentOptions);
saveCookieConsent(cookieName,consentOptions); //saveCookieConsent(cookieName,consentOptions);
} }
var runCallback=function(e) { var runCallback=function(e) {
...@@ -249,16 +249,16 @@ ...@@ -249,16 +249,16 @@
case "ok": case "ok":
$('<button>'+locale.ok+'</button>').appendTo(txt).click(function() { $('<button>'+locale.ok+'</button>').appendTo(txt).click(function() {
div.slideUp(); div.slideUp();
consentOptions.forEach(function(e) { //consentOptions.forEach(function(e) {
e.value=true; // e.value=true;
}); //});
saveCookieConsent(cookieName,consentOptions); saveCookieConsent(cookieName,consentOptions);
runCallbacks(consentOptions); runCallbacks(consentOptions);
}); });
break; break;
case "notOk": case "notOk":
$('<button>'+locale.notOk+'</button>').appendTo(txt).click(function() { $('<button>'+locale.notOk+'</button>').appendTo(txt).click(function() {
txt.slideUp(); div.slideUp();
consentOptions.forEach(function(e) { consentOptions.forEach(function(e) {
e.value=false; e.value=false;
}); });
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
break; break;
case "choice": case "choice":
$('<button>'+locale.choice+'</button>').appendTo(txt).click(function() { $('<button>'+locale.choice+'</button>').appendTo(txt).click(function() {
txt.slideUp();