Skip to content

Commit

Permalink
Merge pull request #14 from coolcat-creations/Joomla4
Browse files Browse the repository at this point in the history
Joomla4
  • Loading branch information
coolcat-creations authored Jun 7, 2022
2 parents c3689fa + 451527c commit 3bee951
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 42 deletions.
7 changes: 4 additions & 3 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<element>mod_ccctwoclick</element>
<type>module</type>
<client>site</client>
<version>2.0.1</version>
<version>2.1-rc1</version>
<downloads>
<downloadurl type="full" format="zip">https://github.com/coolcat-creations/mod_ccctwoclick/releases/download/2.0.2/mod_ccctwoclick.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/coolcat-creations/mod_ccctwoclick/releases/download/2.1-rc1/mod_ccctwoclick.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand All @@ -17,6 +17,7 @@
</infourl>
<maintainer>Elisa Foltyn</maintainer>
<maintainerurl>https://www.coolcat-creations.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
<targetplatform name="joomla" version="(4|3\.([89]|10))\b"/>
</update>
</updates>

12 changes: 10 additions & 2 deletions mod_ccctwoclick/language/de-DE/de-DE.mod_ccctwoclick.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MOD_CCCTWOCLICK_SOURCE_URL="IFrame Link"
MOD_CCCTWOCLICK_STYLESHEET_LBL="Modul CSS laden"
MOD_CCCTWOCLICK_HIDEDONATION_LBL="Spendenhinweis ausblenden"
MOD_CCCTWOCLICK_SELECT="Bitte wählen"
MOD_CCCTWOCLICK_DONATE="<div class="_QQ_"alert alert-error"_QQ_"><strong>Coolcat-Creations - Two Click Module</strong><br>Danke, dass Sie mein Modul nutzen!<br>Wenn Sie meine Arbeit wertschätzen, freue ich mich über eine Spende:<br><a href="_QQ_"https://www.paypal.com/paypalme/coolcatcreations/15"_QQ_" target="_QQ_"_blank"_QQ_">Über paypal.me spenden</a></div>"
MOD_CCCTWOCLICK_DONATE="<div class=\"alert alert-error\"><strong>Coolcat-Creations - Two Click Module</strong><br>Danke, dass Sie mein Modul nutzen!<br>Wenn Sie meine Arbeit wertschätzen, freue ich mich über eine Spende:<br><a href=\"https://www.paypal.com/paypalme/coolcatcreations/25\" target=\"_blank\">Über paypal.me spenden</a></div>"

## since 2.0
MOD_CCCTWOCLICK_ENABLED_CONTENT_LBL="Inhalt"
Expand All @@ -45,4 +45,12 @@ MOD_CCCTWOCLICK_POS_BOTTOM="Unten"
MOD_CCCTWOCLICK_IFRAMENAME_LBL="iFrame Name"
MOD_CCCTWOCLICK_IFRAMENAME_DESC="Ein Names Atrribut kann genutzt werden um in JavaScript auf das Element zuzugreifen"
MOD_CCCTWOCLICK_IFRAMETITLE_LBL="IiFrame Titel"
MOD_CCCTWOCLICK_IFRAMETITLE_DESC="Beschreibt den Inhalt des iFrames (Accessibility)"
MOD_CCCTWOCLICK_IFRAMETITLE_DESC="Beschreibt den Inhalt des iFrames (Accessibility)"

## since 2.1
MOD_CCCTWOCLICK_PRIVACY_LINK_LBL="Datenschutz Link"
MOD_CCCTWOCLICK_PRIVACY_LINK_DESC="Link zu einer Datenschutzerklärung (z.B. https://www.deinedomain.de/datenschutz)"
MOD_CCCTWOCLICK_DISPLAYPRIVACYLINK_LBL="Datenschutz Link anzeigen"
MOD_CCCTWOCLICK_PRIVACYLINK_TXT_LBL="Datenschutz Link Beschriftung"
MOD_CCCTWOCLICK_PRIVACYLINK_TXT="Datenschutzerklärung"
MOD_CCCTWOCLICK_PRIVACYLINK_TXT_DESC="Erstelle einen Sprachoverride für MOD_CCCTWOCLICK_PRIVACYLINK_TXT oder lege einen eigenen Sprachstring an"
12 changes: 10 additions & 2 deletions mod_ccctwoclick/language/en-GB/en-GB.mod_ccctwoclick.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MOD_CCCTWOCLICK_SOURCE_URL="iFrame source"
MOD_CCCTWOCLICK_STYLESHEET_LBL="Load module css"
MOD_CCCTWOCLICK_HIDEDONATION_LBL="Hide Donation message"
MOD_CCCTWOCLICK_SELECT="Please select"
MOD_CCCTWOCLICK_DONATE="<div class="_QQ_"alert alert-error"_QQ_"><strong>Coolcat-Creations - Two Click Module</strong><br>Thank you for using my module!<br>If you appreciate my work, I would be happy if you donate:<br><a href="_QQ_"https://www.paypal.com/paypalme/coolcatcreations/15"_QQ_" target="_QQ_"_blank"_QQ_">Donate via paypal.me</a></div>"
MOD_CCCTWOCLICK_DONATE="<div class=\"alert alert-error\"><strong>Coolcat-Creations - Two Click Module</strong><br>Thank you for using my module!<br>If you appreciate my work, I would be happy if you donate:<br><a href=\"https://www.paypal.com/paypalme/coolcatcreations/25\" target=\"_blank\">Donate via paypal.me</a></div>"

## since 2.0
MOD_CCCTWOCLICK_ENABLED_CONTENT_LBL="Content"
Expand All @@ -45,4 +45,12 @@ MOD_CCCTWOCLICK_POS_BOTTOM="Bottom"
MOD_CCCTWOCLICK_IFRAMENAME_LBL="iFrame name"
MOD_CCCTWOCLICK_IFRAMENAME_DESC="A name attribute can be used to reference the element in a JavaScript"
MOD_CCCTWOCLICK_IFRAMETITLE_LBL="iFrame title"
MOD_CCCTWOCLICK_IFRAMETITLE_DESC="Describes the content of the iframe (Accessibility)"
MOD_CCCTWOCLICK_IFRAMETITLE_DESC="Describes the content of the iframe (Accessibility)"

## since 2.1
MOD_CCCTWOCLICK_PRIVACY_LINK_LBL="Privacy Policy Link"
MOD_CCCTWOCLICK_PRIVACY_LINK_DESC="Link to your Privacy Policy"
MOD_CCCTWOCLICK_DISPLAYPRIVACYLINK_LBL="Display Privacy Policy Link"
MOD_CCCTWOCLICK_PRIVACYLINK_TXT_LBL="Privacy Policy Link Text"
MOD_CCCTWOCLICK_PRIVACYLINK_TXT="Privacy Policy"
MOD_CCCTWOCLICK_PRIVACYLINK_TXT_DESC="Create a Language override for MOD_CCCTWOCLICK_PRIVACYLINK_TXT or define a custom languagestring for the Privacy Policy Link"
3 changes: 3 additions & 0 deletions mod_ccctwoclick/mod_ccctwoclick.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
$iframetitle = $params->get('iframetitle', '');
$iframename = $params->get('iframename', '');
$contentBefore = $params->get('contentbeforereplacement', '');
$privacyLink = $params->get('privacypolicy', false);
$displayPrivacyLink = $params->get('displayprivacypolicy', false);
$privacyLinkText = $params->get('privacypolicytext', 'MOD_CCCTWOCLICK_PRIVACYLINK_TXT');
$contentAfter = $params->get('contentafterreplacement', '');
$btntxtReveal = $params->get('buttontxtreveal', 'MOD_CCCTWOCLICK_BTN_REVEAL_TEXT');
$btnrevpos = $params->get('btnrevpos', 'bottom');
Expand Down
82 changes: 61 additions & 21 deletions mod_ccctwoclick/mod_ccctwoclick.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.8.0" client="site" method="upgrade">
<extension type="module" version="3.10.0" client="site" method="upgrade">
<name>mod_ccctwoclick</name>
<creationDate>06/2017</creationDate>
<author>Elisa Foltyn</author>
Expand Down Expand Up @@ -59,10 +59,10 @@
default="auto"
class="inputbox chzn-color chzn-color-permissive"
>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="auto">MOD_CCCTWOCLICK_DISABLED_BACKGROUND_SIZE_AUTO</option>
<option value="cover">MOD_CCCTWOCLICK_DISABLED_BACKGROUND_SIZE_COVER</option>
<option value="contain">MOD_CCCTWOCLICK_DISABLED_BACKGROUND_SIZE_CONTAIN</option>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="auto">MOD_CCCTWOCLICK_DISABLED_BACKGROUND_SIZE_AUTO</option>
<option value="cover">MOD_CCCTWOCLICK_DISABLED_BACKGROUND_SIZE_COVER</option>
<option value="contain">MOD_CCCTWOCLICK_DISABLED_BACKGROUND_SIZE_CONTAIN</option>
</field>

<field
Expand All @@ -75,6 +75,44 @@
default=""
/>


<field
name="displayprivacypolicy"
label="MOD_CCCTWOCLICK_DISPLAYPRIVACYLINK_LBL"
type="radio"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>

</field>

<field
name="privacypolicy"
type="menuitem"
default=""
label="MOD_CCCTWOCLICK_PRIVACY_LINK_LBL"
description="MOD_CCCTWOCLICK_PRIVACY_LINK_DESC"
showon="displayprivacypolicy:1"
/>

<field
name="privacypolicytext"
label="MOD_CCCTWOCLICK_PRIVACYLINK_TXT_LBL"
type="text"
default="MOD_CCCTWOCLICK_PRIVACYLINK_TXT"
showon="displayprivacypolicy:1"
/>

<field
name="privacytextdesc"
label="MOD_CCCTWOCLICK_PRIVACYLINK_TXT_DESC"
type="spacer"
showon="displayprivacypolicy:1"
/>


<field
name="buttontxtreveal"
label="MOD_CCCTWOCLICK_BTN_REVEAL"
Expand Down Expand Up @@ -182,9 +220,9 @@
default="true"
class="inputbox chzn-color chzn-color-permissive"
>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="true">JYES</option>
<option value="8">JNO</option>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="true">JYES</option>
<option value="8">JNO</option>
</field>

<field
Expand All @@ -194,9 +232,9 @@
default="true"
class="inputbox chzn-color chzn-color-permissive"
>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="true">JYES</option>
<option value="false">JNO</option>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="true">JYES</option>
<option value="false">JNO</option>
</field>

<field
Expand All @@ -206,9 +244,9 @@
default="no"
class="inputbox chzn-color chzn-color-permissive"
>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="yes">JYES</option>
<option value="no">JNO</option>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="yes">JYES</option>
<option value="no">JNO</option>
</field>

<field
Expand Down Expand Up @@ -274,9 +312,9 @@
default="yes"
class="inputbox chzn-color chzn-color-permissive"
>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="yes">JYES</option>
<option value="no">JNO</option>
<option value="">MOD_CCCTWOCLICK_SELECT</option>
<option value="yes">JYES</option>
<option value="no">JNO</option>
</field>

</fieldset>
Expand All @@ -289,8 +327,8 @@
type="radio"
default="show"
>
<option value="show">JNO</option>
<option value="hide">JYES</option>
<option value="show">JNO</option>
<option value="hide">JYES</option>
</field>

<field
Expand All @@ -315,7 +353,9 @@
</languages>

<updateservers>
<server type="extension" name="mod_ccctwoclick Update Site">https://raw.githubusercontent.com/coolcat-creations/mod_ccctwoclick/master/manifest.xml</server>
</updateservers>
<server type="extension" name="mod_ccctwoclick Update Site">
https://raw.githubusercontent.com/coolcat-creations/mod_ccctwoclick/master/manifest.xml
</server>
</updateservers>

</extension>
42 changes: 28 additions & 14 deletions mod_ccctwoclick/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
<?php
// No direct access
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

defined('_JEXEC') or die;

$privacy = false;
if ($displayPrivacyLink) {
$privacyLink = Route::_('index.php?Itemid=' . $privacyLink);
$privacy = '<a href="' . $privacyLink .'" target="_blank">' . Text::_($privacyLinkText) . '</a>';
}

if ($privacy) {
$contentBefore = $contentBefore . ' <span class="ccctwoclick-privacy">' . $privacy . '</span>';
}

$contentBefore = '<div class="tccontentbefore contentbefore-' . $moduleId . '">' . $contentBefore .'</div>';
$contentBeforeCenter = '<div class="tccontentbefore contentbefore-' . $moduleId . '" style="position:relative; top:50%;">' . $contentBefore .'</div>';

$contentBeforeCenter = '<div class="tccontentbefore contentbefore-' . $moduleId . '" style="position:relative; top:50%;">' . $contentBefore . '</div>';


$contentAfter = '<div class="tccontentafter contentafter-' . $moduleId . '" style="display:none;">' . $contentAfter .'</div>';

$btnReveal = '<a class="' . $btnclassEnable . ' ccctwoclickreveal-' . $moduleId . '">' . JText::_($btntxtReveal) .'</a>';
$btnRevealCenter = '<a class="' . $btnclassEnable . ' ccctwoclickreveal-' . $moduleId . '" style="position:relative; top:50%;">' . JText::_($btntxtReveal) .'</a>';
$btnDisable = '<a class="' . $btnclassDisable . ' ccctwoclickdisable-' . $moduleId . '" style="display:none;">' . JText::_($btntxtDisable) .'</a>';
$btnReveal = '<a class="' . $btnclassEnable . ' ccctwoclickreveal-' . $moduleId . '">' . Text::_($btntxtReveal) .'</a>';
$btnRevealCenter = '<a class="' . $btnclassEnable . ' ccctwoclickreveal-' . $moduleId . '" style="position:relative; top:50%;">' . Text::_($btntxtReveal) .'</a>';
$btnDisable = '<a class="' . $btnclassDisable . ' ccctwoclickdisable-' . $moduleId . '" style="display:none;">' . Text::_($btntxtDisable) .'</a>';

$centered = "";
if ($contentbeforepos == 'center') :
Expand All @@ -31,19 +45,19 @@

(function () {

var ccctwoclickcontainer = document.querySelectorAll(".ccctwoclickcontainer-<?php echo $moduleId; ?>");
let ccctwoclickcontainer = document.querySelectorAll(".ccctwoclickcontainer-<?php echo $moduleId; ?>");

for (var i = 0; i < ccctwoclickcontainer.length; i++) {
for (let i = 0; i < ccctwoclickcontainer.length; i++) {

var content = ccctwoclickcontainer[i].querySelectorAll(".ccctwoclick-<?php echo $moduleId; ?>");
var enablebtn = ccctwoclickcontainer[i].querySelectorAll(".ccctwoclickreveal-<?php echo $moduleId; ?>");
var disablebtn = ccctwoclickcontainer[i].querySelectorAll(".ccctwoclickdisable-<?php echo $moduleId; ?>");
var contentafter = ccctwoclickcontainer[i].querySelectorAll(".contentafter-<?php echo $moduleId; ?>");
var contentbefore = ccctwoclickcontainer[i].querySelectorAll(".contentbefore-<?php echo $moduleId; ?>");
let content = ccctwoclickcontainer[i].querySelectorAll(".ccctwoclick-<?php echo $moduleId; ?>");
let enablebtn = ccctwoclickcontainer[i].querySelectorAll(".ccctwoclickreveal-<?php echo $moduleId; ?>");
let disablebtn = ccctwoclickcontainer[i].querySelectorAll(".ccctwoclickdisable-<?php echo $moduleId; ?>");
let contentafter = ccctwoclickcontainer[i].querySelectorAll(".contentafter-<?php echo $moduleId; ?>");
let contentbefore = ccctwoclickcontainer[i].querySelectorAll(".contentbefore-<?php echo $moduleId; ?>");

function enableContent() {

var iframe = document.createElement("iframe");
let iframe = document.createElement("iframe");

iframe.setAttribute('frameborder', '0');
iframe.setAttribute('allowfullscreen', 'true');
Expand Down Expand Up @@ -88,7 +102,7 @@ function enableContent() {

<?php if ($btnrevpos == 'center' || $contentbeforepos == 'center') : ?>

var centered = document.createElement('div');
let centered = document.createElement('div');
centered.style.position='relative';
centered.style.width='<?php echo $iwidth; ?>';
centered.style.height='<?php echo $iheight; ?>';
Expand Down

0 comments on commit 3bee951

Please sign in to comment.