From 04b0682cd6c32bc92111aef28c0d8526e8d72739 Mon Sep 17 00:00:00 2001 From: Craig R Morton Date: Tue, 26 Jun 2018 15:06:01 +0800 Subject: [PATCH 1/3] Converting the jQuery EU Cookie Law Popup JS to LESS --- less/eupopup.less | 115 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 less/eupopup.less diff --git a/less/eupopup.less b/less/eupopup.less new file mode 100644 index 0000000..776e1cb --- /dev/null +++ b/less/eupopup.less @@ -0,0 +1,115 @@ +body { + .eupopup-color-inverse { + color: #000; + background-color: rgba(255, 255, 255, 0.9); + .eupopup-head { + color: #000; + } + } + .eupopup-style-compact { + text-align: left; + padding: 8px 30px 7px 20px; + line-height: 15px; + .eupopup-head, .eupopup-body, .eupopup-buttons { + display: inline; + padding: 0; + margin: 0; + } + .eupopup-button { + margin: 0 5px; + } + } +} + +.clearfix { + clear: both; +} + +.eupopup-container { + background-color: rgba(25, 25, 25, 0.9); + color: #efefef; + padding: 5px 20px; + font-size: 12px; + line-height: 1.2em; + text-align: center; + display: none; + z-index: 9999999; + .eupopup-head { + font-size: 1.2em; + font-weight: bold; + padding: 7px; + color: #fff; + } + + .eupopup-body { + color: #a2a2a2; + } + + .eupopup-buttons { + padding: 7px 0 5px 0; + } + + .eupopup-button_1 { + color: #f6a21d; + font-weight: bold; + font-size: 14px; + } + + .eupopup-button_2 { + color: #f6a21d; + font-weight: normal; + font-size: 12px; + } + + .eupopup-button { + margin: 0 10px; + &:hover, &:focus { + text-decoration: underline; + color: #f6a21d; + } + } + .eupopup-closebutton { + font-size: 16px; + font-weight: 100; + line-height: 1; + color: #a2a2a2; + filter: alpha(opacity=20); + position: absolute; + font-family: helvetica, arial, verdana, sans-serif; + top: 0; right: 0; + padding: 5px 10px; + &:hover, &:active { + color: #fff; + text-decoration: none; + } + } +} + +.eupopup-container-top, +.eupopup-container-fixedtop { + position: absolute; + top: 0; left: 0; right: 0; +} + +.eupopup-container-fixedtop { + position: fixed; +} + +.eupopup-container-bottom { + position: fixed; + bottom: 0; left: 0; right: 0; +} + +.eupopup-container-bottomleft { + position: fixed; + bottom: 10px; + left: 10px; + width: 300px; +} + +.eupopup-container-bottomright { + position: fixed; + bottom: 10px; + right: 10px; + width: 300px; +} From 0769a1bfa6151411812537eea5861f2dfd1b1512 Mon Sep 17 00:00:00 2001 From: Craig R Morton Date: Tue, 3 Jul 2018 14:58:57 +0800 Subject: [PATCH 2/3] Fixing a jslint issue when using == to check the returning value of indexOf --- js/jquery-eu-cookie-law-popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery-eu-cookie-law-popup.js b/js/jquery-eu-cookie-law-popup.js index ceca18b..4402fac 100644 --- a/js/jquery-eu-cookie-law-popup.js +++ b/js/jquery-eu-cookie-law-popup.js @@ -172,7 +172,7 @@ $.fn.euCookieLawPopup = (function() { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var c = cookies[i].trim(); - if (c.indexOf(_self.vars.COOKIE_NAME) == 0) { + if (c.indexOf(_self.vars.COOKIE_NAME) === 0) { userAcceptedCookies = c.substring(_self.vars.COOKIE_NAME.length + 1, c.length); } } From a0509a029d7a6c40155d8d3fa6eb3c49369ac1d0 Mon Sep 17 00:00:00 2001 From: Craig R Morton Date: Thu, 19 Sep 2019 16:59:40 +0800 Subject: [PATCH 3/3] Changing the comparison operator from == to !== to resolve issues with jshint runners complaining --- js/jquery-eu-cookie-law-popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery-eu-cookie-law-popup.js b/js/jquery-eu-cookie-law-popup.js index 1bdfbe2..f4d54ef 100644 --- a/js/jquery-eu-cookie-law-popup.js +++ b/js/jquery-eu-cookie-law-popup.js @@ -172,7 +172,7 @@ $.fn.euCookieLawPopup = (function() { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) { var c = cookies[i].trim(); - if (c.indexOf(_self.vars.COOKIE_NAME) === 0) { + if (c.indexOf(_self.vars.COOKIE_NAME) !== -1) { userAcceptedCookies = c.substring(_self.vars.COOKIE_NAME.length + 1, c.length); } }