Skip to content

Commit

Permalink
2.2.4
Browse files Browse the repository at this point in the history
Changelog file on github
Demo mode : hide button
Single user not working
  • Loading branch information
conseilgouz committed Oct 13, 2023
1 parent ceffb2c commit 62a255a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 266 deletions.
6 changes: 3 additions & 3 deletions bday.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="4.0" type="plugin" group="system" method="upgrade">
<name>plg_system_bday</name>
<author>ConseilGouz</author>
<creationDate>2023-10-12</creationDate>
<creationDate>2023-10-13</creationDate>
<copyright>(C)2023 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>2.2.3</version>
<version>2.2.4</version>
<description>PLG_SYSTEM_BDAY_XML_DESCRIPTION</description>
<files>
<folder plugin="bday">services</folder>
Expand All @@ -25,7 +25,7 @@
<filename>index.html</filename>
</media>
<scriptfile>script.php</scriptfile>
<changelogurl>https://www.conseilgouz.com/updates/plg_system_bday_changelog.xml</changelogurl>
<changelogurl>https://raw.githubusercontent.com/conseilgouz/plg_system_bday_j4/master/plg_system_bday_changelog.xml</changelogurl>
<languages folder="language">
<language tag="en-GB">en-GB/plg_system_bday.ini</language>
<language tag="en-GB">en-GB/plg_system_bday.sys.ini</language>
Expand Down
29 changes: 11 additions & 18 deletions media/js/bday.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @copyright (c) 2023 ConseilGouz. All Rights Reserved.
* @author ConseilGouz
* using https://animate.style/
* @version 2.2.2
* @version 2.2.4
*/
var lefttime;
var animate_effects = []; // animate 2 to animate 3
Expand Down Expand Up @@ -48,11 +48,13 @@ function go_popup() {
sp_popup.style.opacity = 0; // hide popup
sp_popup.style.display = 'none'; // hide popup
sp_popup.style.setProperty('--animate-duration', '800ms');
sp_wrap.style.width = options_bday.scroll_width;
if (options_bday.scroll_height.substr(-2) == "em") {
sp_wrap.style.height = (parseInt(options_bday.scroll_height) * 12)+"px";
} else {
sp_wrap.style.height = options_bday.scroll_height;
if (options_bday.multi) { // scroll multi only
sp_wrap.style.width = options_bday.scroll_width;
if (options_bday.scroll_height.substr(-2) == "em") {
sp_wrap.style.height = (parseInt(options_bday.scroll_height) * 12)+"px";
} else {
sp_wrap.style.height = options_bday.scroll_height;
}
}
if (sp_button) {
sp_button.style.backgroundColor = options_bday.background;
Expand All @@ -62,10 +64,7 @@ function go_popup() {
sp_button.style.setProperty('--animate-duration', '800ms');
}
$cookieName = 'plg_bday';
if (!options_bday.test) { // mode normal
setCookie('plg_bday',1,1);
}
if ((getCookie($cookieName) != "") ) { // affichage bouton
if ((getCookie($cookieName) != "") && (options_bday.test == "0") ) { // affichage bouton
show_button();
} else { // on cache le bouton
hide_button();
Expand Down Expand Up @@ -103,13 +102,7 @@ function go_popup() {
});
}
if (getCookie("plg_bday") == "") {// pas de cookie: on affiche la popup
if (options_bday.delay > 0) {
setTimeout(function(){
show_popup();
}, options_bday.delay);
} else {
show_popup();
}
show_popup();
}

// from https://www.w3docs.com/snippets/javascript/how-to-detect-a-click-outside-an-element.html
Expand Down Expand Up @@ -187,7 +180,7 @@ function getCookie(name) {
}
function pad(s) { return (s < 10) ? '0' + s : s; }
function setCookie(cname, cvalue, exdays) {
if (options_bday.test) return; // mode test : no cookie
if (options_bday.test == "1") return; // mode test : no cookie
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+ d.toUTCString();
Expand Down
243 changes: 0 additions & 243 deletions media/js/cg_anniv.js

This file was deleted.

14 changes: 14 additions & 0 deletions plg_system_bday_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<changelogs>
<changelog>
<element>plg_system_bday</element>
<type>plugin</type>
<group>system</group>
<version>2.2.4</version>
<note>
<item>Update : 13/10/2023</item>
</note>
<fix>
<item>Changelog file on github</item>
<item>Demo mode : hide button</item>
<item>Single user not working</item>
</fix>
</changelog>
<changelog>
<element>plg_system_bday</element>
<type>plugin</type>
Expand Down
6 changes: 4 additions & 2 deletions src/Extension/Bday.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function onAfterRenderModules(&$buffer,$params) {
if ($un_menu->id == $testMenu) {
$users = array();
$users[] = $currUser;
$this->popup($users); // happy birthday.....
$res = $this->popup($users); // happy birthday.....
$buffer .= $res;
}
}
}
Expand Down Expand Up @@ -78,7 +79,8 @@ public function onAfterRenderModules(&$buffer,$params) {
}
}
if (count($users) > 0) { // il y a des anniv.....
$this->popup($users); // happy birthday.....
$res = $this->popup($users); // happy birthday.....
$buffer .= $res;
}
return;
}
Expand Down

0 comments on commit 62a255a

Please sign in to comment.