creareeucookielaw - Version 1.0.2

Version Notes

Fixed JS to ensure banner shows in IE with correct styling.

Download this release

Release Info

Developer Magento Core Team
Extension creareeucookielaw
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

app/design/frontend/base/default/template/eucookielaw/js.phtml DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
- */
25
- ?>
26
- <?php if (Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/show_banner')) : ?>
27
- <script type="text/javascript">
28
- <?php if (Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/developer_mode')) : ?>
29
- var devMode = true;
30
- <?php else : ?>
31
- var devMode = false;
32
- <?php endif ?>
33
- var dropCookie = true;
34
- var cookieDuration = <?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/cookie_lifetime') ?>;
35
- var cookieName = 'complianceCookie';
36
- var cookieValue = 'on';
37
- var css = '<?php echo preg_replace( "/\r|\n/", "", Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/css')) ?>';
38
- var privacyUrl = '<?php echo $this->getUrl(Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_url')) ?>';
39
- var privacyMessage = '<?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_message') ?>';
40
- var privacyLinkText = '<?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_url_text') ?>';
41
- var fadeOutTime = <?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/fadeout') ?>;
42
-
43
- window.onload = function(){
44
- if(checkCookie(window.cookieName) != window.cookieValue){
45
- createDiv();
46
- } else
47
- {
48
- if (devMode)
49
- createDiv();
50
- }
51
- }
52
- </script>
53
- <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,27 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>creareeucookielaw</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>An extremely lightweight, prototype-friendly cookie law banner extension for Magento. Includes a host of configurable options such as:&#xD;
10
- &#xD;
11
- Show or hide banner&#xD;
12
- Link text&#xD;
13
- Banner text&#xD;
14
- Fade out delay&#xD;
15
- Cookie lifetime&#xD;
16
- CSS styles</summary>
17
- <description>This module adds a very simple privacy policy banner to your website which shows up only once when the customer visits the site. This is in accordance with the latest EU Cookie Law.&#xD;
18
- &#xD;
19
- The banner text and link is fully customisable in the Magento administration area, and can be translated per store or website view.</description>
20
- <notes>First official version release.</notes>
21
- <authors><author><name>Adam Moss</name><user>auto-converted</user><email>magento@creare.co.uk</email></author></authors>
22
- <date>2013-11-12</date>
23
- <time>16:19:42</time>
24
- <contents><target name="magecommunity"><dir name="Creare"><dir name="Eucookielaw"><dir name="etc"><file name="adminhtml.xml" hash="0986fee5af8fe7c96b1541dacfc814ab"/><file name="config.xml" hash="ccc9f7c92877497d7ef24fd5811d2116"/><file name="system.xml" hash="9fd9938aec46d12f6c50642c45917d51"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creare_Eucookielaw.xml" hash="10a0821ea406101e473f73ed011c7ab8"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="eucookielaw"><file name="js.phtml" hash="fd4920ac050f2e9640c749da2a7340b6"/></dir></dir><dir name="layout"><file name="eucookielaw.xml" hash="10585a1bbaab692922d417a1caa16849"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><file name="eucookielaw.js" hash="de191946f4509cd6f7230f9ad325b8a8"/></dir></dir></dir></dir></target></contents>
25
  <compatible/>
26
  <dependencies/>
27
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>creareeucookielaw</name>
4
+ <version>1.0.2</version>
5
  <stability>stable</stability>
6
+ <license/>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>A simple, effective EU Cookie Law banner with a link to your privacy policy page.</summary>
10
+ <description>A simple, effective EU Cookie Law banner with a link to your privacy policy page.</description>
11
+ <notes>Fixed JS to ensure banner shows in IE with correct styling.</notes>
12
+ <authors><author><name>Adam Moss</name><user>auto-converted</user><email>adam@creare.co.uk</email></author></authors>
13
+ <date>2014-02-20</date>
14
+ <time>17:21:18</time>
15
+ <contents><target name="magecommunity"><dir name="Creare"><dir name="Eucookielaw"><dir name="etc"><file name="adminhtml.xml" hash="0986fee5af8fe7c96b1541dacfc814ab"/><file name="config.xml" hash="ccc9f7c92877497d7ef24fd5811d2116"/><file name="system.xml" hash="9fd9938aec46d12f6c50642c45917d51"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creare_Eucookielaw.xml" hash="10a0821ea406101e473f73ed011c7ab8"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="eucookielaw.xml" hash="10585a1bbaab692922d417a1caa16849"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><file name="eucookielaw.js" hash="e9d6845f820d52cb93551a51b571c51f"/></dir></dir></dir></dir></target></contents>
 
 
 
 
 
 
 
 
 
16
  <compatible/>
17
  <dependencies/>
18
  </package>
skin/frontend/base/default/js/eucookielaw.js CHANGED
@@ -20,10 +20,17 @@ function createDiv(){
20
  }
21
 
22
  function appendCSS(){
23
- var head = document.head;
 
 
24
  var style = document.createElement('style');
25
  style.type = 'text/css';
26
- style.appendChild(document.createTextNode(css));
 
 
 
 
 
27
  head.appendChild(style);
28
  }
29
 
20
  }
21
 
22
  function appendCSS(){
23
+
24
+ var head = document.getElementsByTagName('head')[0];
25
+ //var css = '';
26
  var style = document.createElement('style');
27
  style.type = 'text/css';
28
+ var cssText = css;
29
+ if(style.styleSheet) { // IE does it this way
30
+ style.styleSheet.cssText = cssText;
31
+ } else { // everyone else does it this way
32
+ style.appendChild(document.createTextNode(css));
33
+ }
34
  head.appendChild(style);
35
  }
36