From 8c8057342e6a7164c39dfc81fc0e33958e65259c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Nu=CC=88bel?= Date: Thu, 24 May 2018 22:08:56 +0200 Subject: [PATCH] Fix #25 JS Comments Syntax Thanks @stell --- kickgdpr.php | 30 +++++++++++++++--------------- kickgdpr.xml | 2 +- update.xml | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/kickgdpr.php b/kickgdpr.php index ceebe23..f4a93b8 100644 --- a/kickgdpr.php +++ b/kickgdpr.php @@ -108,17 +108,17 @@ public function onBeforeCompileHead() $js[] = ""; $js[] = "var disableStr = 'ga-disable-" . $ga_code . "';"; $js[] = ""; - $js[] = "/* Function to detect opted out users */"; + $js[] = "// Function to detect opted out users"; $js[] = "function __kickgaTrackerIsOptedOut() {"; $js[] = " return document.cookie.indexOf(disableStr + '=true') > -1;"; $js[] = "};"; $js[] = ""; - $js[] = "/* Disable tracking if the opt-out cookie exists. */"; + $js[] = "// Disable tracking if the opt-out cookie exists."; $js[] = "if ( __kickgaTrackerIsOptedOut() ) {"; $js[] = " window[disableStr] = true;"; $js[] = "};"; $js[] = ""; - $js[] = "/* Disable tracking if do not track active. */"; + $js[] = "// Disable tracking if do not track active."; $js[] = "if (navigator.doNotTrack == 1) {"; $js[] = " window[disableStr] = true;"; $js[] = "};"; @@ -203,7 +203,7 @@ public function onBeforeCompileHead() } $js = array(); - $js[] = ''; + $js[] = '// Start Cookie Alert'; $js[] = 'window.addEventListener("load", function(){'; $js[] = 'window.cookieconsent.initialise({'; $js[] = ' "palette": {'; @@ -254,7 +254,7 @@ public function onBeforeCompileHead() $js[] = ' }'; $js[] = '})});'; - $js[] = ""; + $js[] = "// End Cookie Alert"; $js[] = "function handleCookies(status){"; if ($type != '' && $type == 'opt-out') @@ -270,7 +270,7 @@ public function onBeforeCompileHead() // Add Google Analytics to Head if ($ga_code && !$this->params->get('disable_ga', false)) { - $js[] = " "; + $js[] = " // Google Analytics"; $js[] = " if (!window[disableStr]) {"; $js[] = " (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){"; $js[] = " (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),"; @@ -300,14 +300,14 @@ public function onBeforeCompileHead() $js[] = " __kickgaTracker('send', 'pageview');"; $js[] = " }"; - $js[] = " "; + $js[] = " // End Google Analytics"; $js[] = ""; } // Add Facebook Pixel Code to Head if ($pixel_id && !$this->params->get('disable_facebook', false)) { - $js[] = " "; + $js[] = " // Facebook Pixel Code"; $js[] = " !function(f,b,e,v,n,t,s)"; $js[] = " {if(f.fbq)return;n=f.fbq=function(){n.callMethod?"; $js[] = " n.callMethod.apply(n,arguments):n.queue.push(arguments)};"; @@ -318,25 +318,25 @@ public function onBeforeCompileHead() $js[] = " 'https://connect.facebook.net/en_US/fbevents.js');"; $js[] = " fbq('init', '" . $pixel_id . "');"; $js[] = " fbq('track', 'PageView');"; - $js[] = " "; + $js[] = " // End Facebook Pixel Code"; $js[] = ""; } // Add Custom Code from Plugin Params to Head if ($customcode && $customcode != '') { - $js[] = ' '; + $js[] = ' // Custom Code'; $js[] = ' ' . $customcode; - $js[] = ' '; + $js[] = ' // End Custom Code'; } // Add Custom Code from Plugin Trigger onKickGDPR to Head $trigger_content = $this->trigger_content; if ($trigger_content && $trigger_content != '') { - $js[] = ' '; + $js[] = ' // Plugin Trigger Code'; $js[] = ' ' . $trigger_content; - $js[] = ' '; + $js[] = ' // End Plugin Trigger Code'; } // $js[] = 'PUT your Code here'; @@ -369,9 +369,9 @@ public function onBeforeCompileHead() { $customcssarray = array(); $customcssarray[] = ''; - $customcssarray[] = '/* Custom CSS */'; + $customcssarray[] = '// Custom CSS'; $customcssarray[] = $customcss; - $customcssarray[] = '/* End Custom CSS */'; + $customcssarray[] = '// End Custom CSS'; $customcssarray[] = ''; $headcss = implode("\n", $customcssarray); diff --git a/kickgdpr.xml b/kickgdpr.xml index cac17b6..8638d0f 100644 --- a/kickgdpr.xml +++ b/kickgdpr.xml @@ -7,7 +7,7 @@ GNU General Public License version 3 or later; see LICENSE.txt info@kicktemp.com www.kicktemp.com - 2.2.1 + 2.2.2 PLG_SYSTEM_KICKGDPR_XML_DESCRIPTION language diff --git a/update.xml b/update.xml index 67b4279..94a8a1a 100644 --- a/update.xml +++ b/update.xml @@ -7,10 +7,10 @@ plugin system 0 - 2.2.1 + 2.2.2 https://github.com/nielsnuebel/kickgdpr/ - https://github.com/nielsnuebel/kickgdpr/archive/2.2.1.zip + https://github.com/nielsnuebel/kickgdpr/archive/2.2.2.zip stable