From 5bc3ff3767e356f78efe8b127d0e72a85e7d5a19 Mon Sep 17 00:00:00 2001 From: "Emanuele \"ToX\" Toscano" Date: Sun, 20 Dec 2015 13:42:11 +0100 Subject: [PATCH] Added dutch translation --- cookiebar-latest.js | 5 +++-- cookiebar-latest.min.js | 2 +- lang/nl.html | 48 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 lang/nl.html diff --git a/cookiebar-latest.js b/cookiebar-latest.js index 5a11cb7..0291910 100644 --- a/cookiebar-latest.js +++ b/cookiebar-latest.js @@ -3,7 +3,7 @@ Plugin URL: http://cookie-bar.eu/ @author: Emanuele "ToX" Toscano @description: Cookie Bar is a free & simple solution to the EU cookie law. - @version: 1.5.7 + @version: 1.5.8 */ /* @@ -14,7 +14,8 @@ var CookieLanguages = [ 'it', 'fr', 'hu', - 'de' + 'de', + 'nl' ]; var cookieLawStates = [ diff --git a/cookiebar-latest.min.js b/cookiebar-latest.min.js index 93ef8a2..eb3648f 100644 --- a/cookiebar-latest.min.js +++ b/cookiebar-latest.min.js @@ -1 +1 @@ -function setupCookieBar(){function a(){if(w.abort(),console.log("cookieBAR - Timeout for ip geolocation"),document.cookie.length>0||window.localStorage.length>0){var a=e();void 0===a&&b()}}function b(){var a=d(),b="";l("theme")&&(b="-"+l("theme"));var c=v.replace(/[^\/]*$/,""),e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",c+"cookiebar"+b+".css"),document.head.appendChild(e);var f=new XMLHttpRequest;f.open("GET",c+"/lang/"+a+".html",!0),f.onreadystatechange=function(){if(4===f.readyState&&200===f.status){var a=document.createElement("div");if(a.innerHTML=f.responseText,document.getElementsByTagName("body")[0].appendChild(a),n=document.getElementById("cookie-bar"),o=document.getElementById("cookie-bar-button"),p=document.getElementById("cookie-bar-button-no"),q=document.getElementById("cookie-bar-prompt"),r=document.getElementById("cookie-bar-prompt-button"),s=document.getElementById("cookie-bar-prompt-close"),t=document.getElementById("cookie-bar-prompt-content"),u=document.getElementById("cookie-bar-no-consent"),thirdparty=document.getElementById("cookie-bar-thirdparty"),tracking=document.getElementById("cookie-bar-tracking"),privacyPage=document.getElementById("cookie-bar-privacy-page"),privacyLink=document.getElementById("cookie-bar-privacy-link"),l("showNoConsent")||(u.style.display="none",p.style.display="none"),l("blocking")&&(h(q,500),s.style.display="none"),l("thirdparty")&&(thirdparty.style.display="block"),l("tracking")&&(tracking.style.display="block"),l("top")?(n.style.top=0,j("top")):(n.style.bottom=0,j("bottom")),l("privacyPage")){var b=decodeURIComponent(l("privacyPage"));privacyLink.href=b,privacyPage.style.display="inline-block"}m(),h(n,250),j()}},f.send()}function c(){for(var a=document.getElementsByTagName("script"),b=0;b-1)return c}}function d(){var a=l("forceLang");return a===!1&&(a=navigator.language||navigator.userLanguage),a=a.substr(0,2),CookieLanguages.indexOf(a)<0&&(a="en"),a}function e(){var a=document.cookie.match(/(;)?cookiebar=([^;]*);?/);return null==a?void 0:decodeURI(a)[2]}function f(a,b){var c=30;l("remember")&&(c=l("remember"));var d=new Date;d.setDate(d.getDate()+parseInt(c));var e=encodeURI(b)+(null===c?"":"; expires="+d.toUTCString()+";path=/");document.cookie=a+"="+e}function g(){document.cookie.split(";").forEach(function(a){document.cookie=a.replace(/^ +/,"").replace(/=.*/,"=;expires="+(new Date).toUTCString()+";path=/")}),localStorage.clear()}function h(a,b){var c=a.style;c.opacity=0,c.display="block",function d(){(c.opacity-=-.1)>.9?null:setTimeout(d,b/10)}()}function i(a,b){var c=a.style;c.opacity=1,function d(){(c.opacity-=.1)<.1?c.display="none":setTimeout(d,b/10)}()}function j(a){setTimeout(function(){var b=document.getElementById("cookie-bar").clientHeight;switch(a){case"top":document.getElementsByTagName("body")[0].style.marginTop=b+"px";break;case"bottom":document.getElementsByTagName("body")[0].style.marginBottom=b+"px"}},300)}function k(){var a=document.getElementById("cookie-bar").clientHeight;if(l("top")){var b=parseInt(document.getElementsByTagName("body")[0].style.marginTop);document.getElementsByTagName("body")[0].style.marginTop=b-a+"px"}else{var c=parseInt(document.getElementsByTagName("body")[0].style.marginBottom);document.getElementsByTagName("body")[0].style.marginBottom=c-a+"px"}}function l(a){var b=v.split(a+"=");return b[1]?b[1].split(/[&?]+/)[0]:!1}function m(){o.addEventListener("click",function(){f("cookiebar","CookieAllowed"),k(),i(q,250),i(n,250)}),p.addEventListener("click",function(){var a=u.textContent.trim(),b=window.confirm(a);b===!0&&(g(),f("cookiebar","CookieDisallowed"),k(),i(q,250),i(n,250))}),r.addEventListener("click",function(){h(q,250)}),s.addEventListener("click",function(){i(q,250)})}var n,o,p,q,r,s,t,u,v=c();"CookieDisallowed"==e()&&(g(),f("cookiebar","CookieDisallowed"));var w=new XMLHttpRequest;w.open("GET","//freegeoip.net/json/",!0),w.onreadystatechange=function(){if(4===w.readyState&&200===w.status){clearTimeout(x);var a=JSON.parse(w.responseText).country_code;if(cookieLawStates.indexOf(a)>-1){if(l("always")){var c=e();void 0===c&&b()}else if(document.cookie.length>0||window.localStorage.length>0){var c=e();void 0===c&&b()}}else console.log("cookieBAR - Not an EU user, no cookieBAR.")}},w.send();var x=setTimeout(a,1500)}var CookieLanguages=["en","it","fr","hu","de"],cookieLawStates=["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","GB"];document.addEventListener("DOMContentLoaded",function(){setupCookieBar()}); \ No newline at end of file +function setupCookieBar(){function a(){if(w.abort(),console.log("cookieBAR - Timeout for ip geolocation"),document.cookie.length>0||window.localStorage.length>0){var a=e();void 0===a&&b()}}function b(){var a=d(),b="";l("theme")&&(b="-"+l("theme"));var c=v.replace(/[^\/]*$/,""),e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",c+"cookiebar"+b+".css"),document.head.appendChild(e);var f=new XMLHttpRequest;f.open("GET",c+"/lang/"+a+".html",!0),f.onreadystatechange=function(){if(4===f.readyState&&200===f.status){var a=document.createElement("div");if(a.innerHTML=f.responseText,document.getElementsByTagName("body")[0].appendChild(a),n=document.getElementById("cookie-bar"),o=document.getElementById("cookie-bar-button"),p=document.getElementById("cookie-bar-button-no"),q=document.getElementById("cookie-bar-prompt"),r=document.getElementById("cookie-bar-prompt-button"),s=document.getElementById("cookie-bar-prompt-close"),t=document.getElementById("cookie-bar-prompt-content"),u=document.getElementById("cookie-bar-no-consent"),thirdparty=document.getElementById("cookie-bar-thirdparty"),tracking=document.getElementById("cookie-bar-tracking"),privacyPage=document.getElementById("cookie-bar-privacy-page"),privacyLink=document.getElementById("cookie-bar-privacy-link"),l("showNoConsent")||(u.style.display="none",p.style.display="none"),l("blocking")&&(h(q,500),s.style.display="none"),l("thirdparty")&&(thirdparty.style.display="block"),l("tracking")&&(tracking.style.display="block"),l("top")?(n.style.top=0,j("top")):(n.style.bottom=0,j("bottom")),l("privacyPage")){var b=decodeURIComponent(l("privacyPage"));privacyLink.href=b,privacyPage.style.display="inline-block"}m(),h(n,250),j()}},f.send()}function c(){for(var a=document.getElementsByTagName("script"),b=0;b-1)return c}}function d(){var a=l("forceLang");return a===!1&&(a=navigator.language||navigator.userLanguage),a=a.substr(0,2),CookieLanguages.indexOf(a)<0&&(a="en"),a}function e(){var a=document.cookie.match(/(;)?cookiebar=([^;]*);?/);return null==a?void 0:decodeURI(a)[2]}function f(a,b){var c=30;l("remember")&&(c=l("remember"));var d=new Date;d.setDate(d.getDate()+parseInt(c));var e=encodeURI(b)+(null===c?"":"; expires="+d.toUTCString()+";path=/");document.cookie=a+"="+e}function g(){document.cookie.split(";").forEach(function(a){document.cookie=a.replace(/^ +/,"").replace(/=.*/,"=;expires="+(new Date).toUTCString()+";path=/")}),localStorage.clear()}function h(a,b){var c=a.style;c.opacity=0,c.display="block",function d(){(c.opacity-=-.1)>.9?null:setTimeout(d,b/10)}()}function i(a,b){var c=a.style;c.opacity=1,function d(){(c.opacity-=.1)<.1?c.display="none":setTimeout(d,b/10)}()}function j(a){setTimeout(function(){var b=document.getElementById("cookie-bar").clientHeight;switch(a){case"top":document.getElementsByTagName("body")[0].style.marginTop=b+"px";break;case"bottom":document.getElementsByTagName("body")[0].style.marginBottom=b+"px"}},300)}function k(){var a=document.getElementById("cookie-bar").clientHeight;if(l("top")){var b=parseInt(document.getElementsByTagName("body")[0].style.marginTop);document.getElementsByTagName("body")[0].style.marginTop=b-a+"px"}else{var c=parseInt(document.getElementsByTagName("body")[0].style.marginBottom);document.getElementsByTagName("body")[0].style.marginBottom=c-a+"px"}}function l(a){var b=v.split(a+"=");return b[1]?b[1].split(/[&?]+/)[0]:!1}function m(){o.addEventListener("click",function(){f("cookiebar","CookieAllowed"),k(),i(q,250),i(n,250)}),p.addEventListener("click",function(){var a=u.textContent.trim(),b=window.confirm(a);b===!0&&(g(),f("cookiebar","CookieDisallowed"),k(),i(q,250),i(n,250))}),r.addEventListener("click",function(){h(q,250)}),s.addEventListener("click",function(){i(q,250)})}var n,o,p,q,r,s,t,u,v=c();"CookieDisallowed"==e()&&(g(),f("cookiebar","CookieDisallowed"));var w=new XMLHttpRequest;w.open("GET","//freegeoip.net/json/",!0),w.onreadystatechange=function(){if(4===w.readyState&&200===w.status){clearTimeout(x);var a=JSON.parse(w.responseText).country_code;if(cookieLawStates.indexOf(a)>-1){if(l("always")){var c=e();void 0===c&&b()}else if(document.cookie.length>0||window.localStorage.length>0){var c=e();void 0===c&&b()}}else console.log("cookieBAR - Not an EU user, no cookieBAR.")}},w.send();var x=setTimeout(a,1500)}var CookieLanguages=["en","it","fr","hu","de","nl"],cookieLawStates=["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","GB"];document.addEventListener("DOMContentLoaded",function(){setupCookieBar()}); \ No newline at end of file diff --git a/lang/nl.html b/lang/nl.html new file mode 100644 index 0000000..9bef941 --- /dev/null +++ b/lang/nl.html @@ -0,0 +1,48 @@ + + +