Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
cgwebp.js : don't fire it if cgwebp plugin is not shown
  • Loading branch information
conseilgouz committed Apr 21, 2024
1 parent 714b4a9 commit 1d8c2a4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cgwebp.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<extension type="plugin" version="4.0" group="system" method="upgrade">
<name>System - CG Webp</name>
<creationDate>2024-04-20</creationDate>
<creationDate>2024-04-21</creationDate>
<author>ConseilGouz</author>
<copyright>Copyright (C) 2024 ConseilGouz. All rights reserved.</copyright>
<license>GNU/GPL</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>https://www.conseilgouz.com</authorUrl>
<version>1.1.0</version>
<version>1.1.1</version>
<description>PLG_SYSTEM_CGWEBP_DESCRIPTION</description>
<namespace path="src">Conseilgouz\Plugin\System\Cgwebp</namespace>
<scriptfile>script.cgwebp.php</scriptfile>
Expand Down
14 changes: 8 additions & 6 deletions media/js/cgwebp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @version 1.1.0
* @version 1.1.1
* @package CGWebp system plugin
* @author ConseilGouz
* @copyright Copyright (C) 2024 ConseilGouz. All rights reserved.
Expand All @@ -9,6 +9,13 @@

document.addEventListener("DOMContentLoaded", function(){

// Destroy button
deletewebp = document.querySelector('#webpdestroy');
if (!deletewebp) return; // not defined : ignore
deletewebp.addEventListener('click',function() {
delete_webp();
})

clears = document.querySelectorAll('.clear');
for(var i=0; i< clears.length; i++) {
let clear = clears[i];
Expand All @@ -25,11 +32,6 @@ document.addEventListener("DOMContentLoaded", function(){
group = half.parentNode.parentNode.parentNode.style.width = "50%";
}

// Destroy button
deletewebp = document.querySelector('#webpdestroy');
deletewebp.addEventListener('click',function() {
delete_webp();
})
// show/hide button depending on Storage value
storageMedia = document.querySelector('#jform_params_storage1');
storageSame = document.querySelector('#jform_params_storage0');
Expand Down
12 changes: 12 additions & 0 deletions plg_system_cgwebp_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<changelogs>
<changelog>
<element>plg_system_cgwebp</element>
<type>plugin</type>
<group>system</group>
<version>1.1.1</version>
<note>
<item>Update : 21/04/2024</item>
</note>
<fix>
<item>cgwebp.js : don't fire it if cgwebp plugin is not shown</item>
</fix>
</changelog>
<changelog>
<element>plg_system_cgwebp</element>
<type>plugin</type>
Expand Down

0 comments on commit 1d8c2a4

Please sign in to comment.