Skip to content

Commit

Permalink
Fix #25 JS Comments Syntax
Browse files Browse the repository at this point in the history
Thanks @stell
  • Loading branch information
Niels Nübel committed May 24, 2018
1 parent 3a1362f commit 8c80573
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions kickgdpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = "};";
Expand Down Expand Up @@ -203,7 +203,7 @@ public function onBeforeCompileHead()
}

$js = array();
$js[] = '<!-- Start Cookie Alert -->';
$js[] = '// Start Cookie Alert';
$js[] = 'window.addEventListener("load", function(){';
$js[] = 'window.cookieconsent.initialise({';
$js[] = ' "palette": {';
Expand Down Expand Up @@ -254,7 +254,7 @@ public function onBeforeCompileHead()
$js[] = ' }';
$js[] = '})});';

$js[] = "<!-- End Cookie Alert -->";
$js[] = "// End Cookie Alert";
$js[] = "function handleCookies(status){";

if ($type != '' && $type == 'opt-out')
Expand All @@ -270,7 +270,7 @@ public function onBeforeCompileHead()
// Add Google Analytics to Head
if ($ga_code && !$this->params->get('disable_ga', false))
{
$js[] = " <!-- Google Analytics -->";
$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),";
Expand Down Expand Up @@ -300,14 +300,14 @@ public function onBeforeCompileHead()

$js[] = " __kickgaTracker('send', 'pageview');";
$js[] = " }";
$js[] = " <!-- End Google Analytics -->";
$js[] = " // End Google Analytics";
$js[] = "";
}

// Add Facebook Pixel Code to Head
if ($pixel_id && !$this->params->get('disable_facebook', false))
{
$js[] = " <!-- Facebook Pixel Code -->";
$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)};";
Expand All @@ -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[] = " <!-- End Facebook Pixel Code -->";
$js[] = " // End Facebook Pixel Code";
$js[] = "";
}

// Add Custom Code from Plugin Params to Head
if ($customcode && $customcode != '')
{
$js[] = ' <!-- Custom Code -->';
$js[] = ' // Custom Code';
$js[] = ' ' . $customcode;
$js[] = ' <!-- End Custom Code -->';
$js[] = ' // End Custom Code';
}

// Add Custom Code from Plugin Trigger onKickGDPR to Head
$trigger_content = $this->trigger_content;
if ($trigger_content && $trigger_content != '')
{
$js[] = ' <!-- Plugin Trigger Code -->';
$js[] = ' // Plugin Trigger Code';
$js[] = ' ' . $trigger_content;
$js[] = ' <!-- End Plugin Trigger Code -->';
$js[] = ' // End Plugin Trigger Code';
}
// $js[] = 'PUT your Code here';

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion kickgdpr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.kicktemp.com</authorUrl>
<version>2.2.1</version>
<version>2.2.2</version>
<description>PLG_SYSTEM_KICKGDPR_XML_DESCRIPTION</description>
<files>
<folder>language</folder>
Expand Down
4 changes: 2 additions & 2 deletions update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<type>plugin</type>
<folder>system</folder>
<client>0</client>
<version>2.2.1</version>
<version>2.2.2</version>
<infourl title="KickGDPR Plugin">https://github.com/nielsnuebel/kickgdpr/</infourl>
<downloads>
<downloadurl type="upgrade" format="zip">https://github.com/nielsnuebel/kickgdpr/archive/2.2.1.zip</downloadurl>
<downloadurl type="upgrade" format="zip">https://github.com/nielsnuebel/kickgdpr/archive/2.2.2.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down

0 comments on commit 8c80573

Please sign in to comment.