Changeset 2019905
- Timestamp:
- 01/27/2019 01:55:35 PM (7 years ago)
- Location:
- easy-cookie-law/trunk
- Files:
-
- 3 edited
-
class/easy-cookie-law.php (modified) (3 diffs)
-
easy-cookie-law.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-cookie-law/trunk/class/easy-cookie-law.php
r2019898 r2019905 86 86 */ 87 87 public function printNotice() 88 { 89 echo "<div id='ecl-notice'></div>"; 90 91 $ecl_style_otuput = ""; 92 if( $this->options['custom'] == 0 ) { 93 $position = $this->options['position'] == "top" ? "top: 0" : "bottom: 0"; 94 $ecl_style_otuput = "<style type='text/css'>#ecl-notice{position: fixed; z-index: 1000000; $position; left: 0; width: 100%; font-size: 14px; padding: 0.5em; background-color: ".$this->options['noticecolor']."; color: ".$this->options['textcolor'].";}#ecl-notice a{color:".$this->options['linkscolor'].";}</style>"; 95 } 96 97 $ecl_notice_output = $ecl_style_otuput . $this->options['text'] ." <a href='". $this->options['link'] ."' target='". $this->options['link_target'] ."'>". $this->options['link_text'] ."</a> | <a href onclick='ecl_close_and_send();' >". $this->options['close'] ."</a>"; 98 99 /** 100 * Not minimized JS 101 * 102 var ecln = document.getElementById('ecl-notice') 88 { 89 ?> 90 <script type="text/javascript"> 103 91 function ecl_set_cookie() { 104 92 var d = new Date(); … … 106 94 var expires = "expires="+ d.toUTCString(); 107 95 document.cookie = "<?php echo self::ECL_COOKIE_NAME; ?>" + "=" + "visited" + ";" + expires + ";path=/"; 108 }109 function ecl_close_notice(){110 if(ecln) ecln.style.display = "none";111 96 } 112 97 function ecl_is_cookie_accepted(){ … … 121 106 } 122 107 } 108 if(ecl_is_cookie_accepted()) { 109 <?php echo $this->printGtmHeader(); ?> 110 111 } 112 </script> 113 <?php 114 } 115 116 public function printFooterNotice() 117 { 118 $ecl_style_otuput = ""; 119 if( $this->options['custom'] == 0 ) { 120 $position = $this->options['position'] == "top" ? "top: 0" : "bottom: 0"; 121 $ecl_style_otuput = "<style type='text/css'>#ecl-notice{position: fixed; z-index: 1000000; $position; left: 0; width: 100%; font-size: 14px; padding: 0.5em; background-color: ".$this->options['noticecolor']."; color: ".$this->options['textcolor'].";}#ecl-notice a{color:".$this->options['linkscolor'].";}</style>"; 122 } 123 124 $ecl_notice_output = $ecl_style_otuput . "<div id='ecl-notice'>" . $this->options['text'] ." <a href='". $this->options['link'] ."' target='". $this->options['link_target'] ."'>". $this->options['link_text'] ."</a> | <a href onclick='ecl_close_and_send();' >". $this->options['close'] ."</a></div>"; 125 126 ?> 127 <div id='ecl-notice'></div> 128 <script type="text/javascript"> 129 var ecln = document.getElementById('ecl-notice'); 123 130 function ecl_close_and_send(){ 124 131 ecl_close_notice(); 125 132 ecl_set_cookie(); 126 133 } 134 function ecl_close_notice(){ 135 if(ecln) ecln.style.display = "none"; 136 } 127 137 if(ecl_is_cookie_accepted()) { 128 138 ecl_close_notice(); 129 <?php echo $this->printGtmHeader(); ?>130 131 139 }else{ 132 140 ecln.innerHTML = "<?php echo $ecl_notice_output; ?>"; 133 141 } 134 */135 136 ?>137 <script type="text/javascript">138 var ecln=document.getElementById("ecl-notice");function ecl_set_cookie(){var e=new Date;e.setTime(e.getTime()+2592e6);var c="expires="+e.toUTCString();document.cookie="<?php echo self::ECL_COOKIE_NAME; ?>=visited;"+c+";path=/"}function ecl_close_notice(){ecln&&(ecln.style.display="none")}function ecl_is_cookie_accepted(){for(var e=decodeURIComponent(document.cookie).split(";"),c=0;c<e.length;c++){for(var o=e[c];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf("<?php echo self::ECL_COOKIE_NAME; ?>="))return!0}}function ecl_close_and_send(){ecl_close_notice(),ecl_set_cookie()}139 if(ecl_is_cookie_accepted()) {140 ecl_close_notice();141 <?php echo $this->printGtmHeader(); ?>142 143 }else{144 ecln.innerHTML = "<?php echo $ecl_notice_output; ?>";145 }146 142 </script> 147 <?php 143 <?php 148 144 } 149 145 -
easy-cookie-law/trunk/easy-cookie-law.php
r2019902 r2019905 4 4 * Description: Minimal code to help your website respect the cookie law 5 5 * Plugin URI: https://antsanchez.com 6 * Version: 2. 26 * Version: 2.3 7 7 * Author: antsanchez 8 8 * Author URI: https://antsanchez.com … … 118 118 } 119 119 120 function ecl_print_div() 121 { 122 global $ecl_plugin; 123 $ecl_plugin->printFooterNotice(); 124 } 125 add_action('wp_footer', 'ecl_print_div', 1); 126 120 127 ?> -
easy-cookie-law/trunk/readme.txt
r2019898 r2019905 5 5 Requires PHP: 5.2 6 6 Tested up to: 5.0.3 7 Stable tag: 2. 27 Stable tag: 2.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 70 70 == Changelog == 71 71 72 = 2.3 = 73 * Fixed some small JavaScript bugs 74 72 75 = 2.2 = 73 76 * Added support for Google Tag Manager
Note: See TracChangeset
for help on using the changeset viewer.