Changeset 1525243
- Timestamp:
- 10/31/2016 11:49:06 AM (9 years ago)
- Location:
- custom-cookie-message
- Files:
-
- 4 edited
- 7 copied
-
tags/1.1 (copied) (copied from custom-cookie-message/trunk)
-
tags/1.1/README.txt (modified) (1 diff)
-
tags/1.1/css/cookies.css (copied) (copied from custom-cookie-message/trunk/css/cookies.css)
-
tags/1.1/custom-cookie-message.php (copied) (copied from custom-cookie-message/trunk/custom-cookie-message.php) (1 diff)
-
tags/1.1/includes/ac-cookie-message.php (copied) (copied from custom-cookie-message/trunk/includes/ac-cookie-message.php)
-
tags/1.1/js/ac-custom-cookie-message-backend.js (copied) (copied from custom-cookie-message/trunk/js/ac-custom-cookie-message-backend.js)
-
tags/1.1/js/ac-custom-cookie-message-frontend.js (copied) (copied from custom-cookie-message/trunk/js/ac-custom-cookie-message-frontend.js) (5 diffs)
-
tags/1.1/views/cookie-notice.php (copied) (copied from custom-cookie-message/trunk/views/cookie-notice.php)
-
trunk/README.txt (modified) (1 diff)
-
trunk/custom-cookie-message.php (modified) (1 diff)
-
trunk/js/ac-custom-cookie-message-frontend.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-cookie-message/tags/1.1/README.txt
r1525138 r1525243 3 3 Tags: custom, cookie, message, consent, cookie bar, cookie compliance, cookie law, cookie notice, cookie notification, cookie notification bar, cookie notify, cookies, eu, eu cookie, eu cookie law, notice, notification, notify, custom cookie message, WPML, Polylang, Multisite, multisites 4 4 Requires at least: 1.0 5 Tested up to: 1. 06 Stable tag: 1. 05 Tested up to: 1.1 6 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
custom-cookie-message/tags/1.1/custom-cookie-message.php
r1525170 r1525243 5 5 * Plugin URI: https://angrycreative.se/ 6 6 * Description: A customizable cookie message. 7 * Version: 1. 07 * Version: 1.1 8 8 * Author: johansylvan 9 9 * Author URI: https://angrycreative.se/ -
custom-cookie-message/tags/1.1/js/ac-custom-cookie-message-frontend.js
r1525170 r1525243 4 4 */ 5 5 6 //Debounce from David Walsh https://davidwalsh.name/javascript-debounce-function 7 function debounce(func, wait, immediate) { 8 var timeout; 9 return function() { 10 var context = this, args = arguments; 11 var later = function() { 12 timeout = null; 13 if (!immediate) func.apply(context, args); 14 }; 15 var callNow = immediate && !timeout; 16 clearTimeout(timeout); 17 timeout = setTimeout(later, wait); 18 if (callNow) func.apply(context, args); 19 }; 20 }; 21 6 22 7 23 jQuery(document).ready(function($) { 8 // Feature detect + local reference 9 var storage = (function() { 10 var uid = new Date; 11 var storage; 12 var result; 13 try { 14 (storage = window.localStorage).setItem(uid, uid); 15 result = storage.getItem(uid) == uid; 16 storage.removeItem(uid); 17 return result && storage; 18 } catch (exception) {} 19 }()); 24 // Hide Header on on scroll 25 var didScroll; 26 var lastScrollTop = 0; 27 var lastScrollBot = 0; 28 var delta = 5; 29 var navbarHeight = $('#custom-cookie-message-container').outerHeight(); 30 31 var storage = (function() { 32 var uid = new Date; 33 var storage; 34 var result; 35 try { 36 (storage = window.localStorage).setItem(uid, uid); 37 result = storage.getItem(uid) == uid; 38 storage.removeItem(uid); 39 return result && storage; 40 } catch (exception) {} 41 }()); 42 43 $(window).on('scroll', debounce( function () { 44 hasScrolled(); 45 }, 250)); 20 46 21 47 setTimeout(function() { … … 34 60 }); 35 61 } 36 37 38 39 62 },10); 40 63 … … 50 73 }) 51 74 .done(function( data ) { 52 53 75 storage.setItem("ac-cookie-fallback", "fallback") 54 76 $('#custom-cookie-message-container').hide(); … … 59 81 }); 60 82 }); 61 62 // Hide Header on on scroll down 63 var didScroll; 64 var lastScrollTop = 0; 65 var lastScrollBot = 0; 66 var delta = 5; 67 var navbarHeight = $('#custom-cookie-message-container').outerHeight(); 68 69 $(window).scroll(function(event){ 70 didScroll = true; 71 }); 72 73 setInterval(function() { 74 if (didScroll) { 75 hasScrolled(); 76 didScroll = false; 77 } 78 }, 250); 79 83 80 84 function hasScrolled() { 81 85 var st = $(this).scrollTop(); … … 86 90 return; 87 91 88 // If they scrolled down and are past the navbar, add class .nav-up.89 // This is necessary so you never see what is "behind" the navbar.90 92 if (st > lastScrollTop && st > navbarHeight){ 91 93 // Scroll Down -
custom-cookie-message/trunk/README.txt
r1525138 r1525243 3 3 Tags: custom, cookie, message, consent, cookie bar, cookie compliance, cookie law, cookie notice, cookie notification, cookie notification bar, cookie notify, cookies, eu, eu cookie, eu cookie law, notice, notification, notify, custom cookie message, WPML, Polylang, Multisite, multisites 4 4 Requires at least: 1.0 5 Tested up to: 1. 06 Stable tag: 1. 05 Tested up to: 1.1 6 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
custom-cookie-message/trunk/custom-cookie-message.php
r1525170 r1525243 5 5 * Plugin URI: https://angrycreative.se/ 6 6 * Description: A customizable cookie message. 7 * Version: 1. 07 * Version: 1.1 8 8 * Author: johansylvan 9 9 * Author URI: https://angrycreative.se/ -
custom-cookie-message/trunk/js/ac-custom-cookie-message-frontend.js
r1525170 r1525243 4 4 */ 5 5 6 //Debounce from David Walsh https://davidwalsh.name/javascript-debounce-function 7 function debounce(func, wait, immediate) { 8 var timeout; 9 return function() { 10 var context = this, args = arguments; 11 var later = function() { 12 timeout = null; 13 if (!immediate) func.apply(context, args); 14 }; 15 var callNow = immediate && !timeout; 16 clearTimeout(timeout); 17 timeout = setTimeout(later, wait); 18 if (callNow) func.apply(context, args); 19 }; 20 }; 21 6 22 7 23 jQuery(document).ready(function($) { 8 // Feature detect + local reference 9 var storage = (function() { 10 var uid = new Date; 11 var storage; 12 var result; 13 try { 14 (storage = window.localStorage).setItem(uid, uid); 15 result = storage.getItem(uid) == uid; 16 storage.removeItem(uid); 17 return result && storage; 18 } catch (exception) {} 19 }()); 24 // Hide Header on on scroll 25 var didScroll; 26 var lastScrollTop = 0; 27 var lastScrollBot = 0; 28 var delta = 5; 29 var navbarHeight = $('#custom-cookie-message-container').outerHeight(); 30 31 var storage = (function() { 32 var uid = new Date; 33 var storage; 34 var result; 35 try { 36 (storage = window.localStorage).setItem(uid, uid); 37 result = storage.getItem(uid) == uid; 38 storage.removeItem(uid); 39 return result && storage; 40 } catch (exception) {} 41 }()); 42 43 $(window).on('scroll', debounce( function () { 44 hasScrolled(); 45 }, 250)); 20 46 21 47 setTimeout(function() { … … 34 60 }); 35 61 } 36 37 38 39 62 },10); 40 63 … … 50 73 }) 51 74 .done(function( data ) { 52 53 75 storage.setItem("ac-cookie-fallback", "fallback") 54 76 $('#custom-cookie-message-container').hide(); … … 59 81 }); 60 82 }); 61 62 // Hide Header on on scroll down 63 var didScroll; 64 var lastScrollTop = 0; 65 var lastScrollBot = 0; 66 var delta = 5; 67 var navbarHeight = $('#custom-cookie-message-container').outerHeight(); 68 69 $(window).scroll(function(event){ 70 didScroll = true; 71 }); 72 73 setInterval(function() { 74 if (didScroll) { 75 hasScrolled(); 76 didScroll = false; 77 } 78 }, 250); 79 83 80 84 function hasScrolled() { 81 85 var st = $(this).scrollTop(); … … 86 90 return; 87 91 88 // If they scrolled down and are past the navbar, add class .nav-up.89 // This is necessary so you never see what is "behind" the navbar.90 92 if (st > lastScrollTop && st > navbarHeight){ 91 93 // Scroll Down
Note: See TracChangeset
for help on using the changeset viewer.