Skip to content

Commit

Permalink
4.0.8
Browse files Browse the repository at this point in the history
Revert 4.0.7 updates
  • Loading branch information
conseilgouz committed Dec 1, 2023
1 parent 7351685 commit 4e0c3f0
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 94 deletions.
89 changes: 0 additions & 89 deletions mod_cg_memo.php

This file was deleted.

5 changes: 2 additions & 3 deletions mod_cg_memo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<copyright>Copyright (C) 2023 ConseilGouz. All rights reserved.</copyright>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>4.0.7</version>
<version>4.0.8</version>
<namespace path="src">ConseilGouz\Module\Cgmemo</namespace>
<description>CG_MEMO_DESC</description>
<files>
<filename module="mod_cg_memo">mod_cg_memo.php</filename>
<folder module="mod_cg_memo">services</folder>
<filename>index.html</filename>
<filename>mod_cg_memo.xml</filename>
<folder>services</folder>
<folder>src</folder>
<folder>tmpl</folder>
</files>
Expand Down
13 changes: 12 additions & 1 deletion mod_cg_memo_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<changelogs>
<changelog>
<element>mod_cg_memo</element>
<type>Module</type>
<version>4.0.8</version>
<note>
<item>Update : 01/12/2023</item>
</note>
<fix>
<item>Revert 4.0.7 updates</item>
</fix>
</changelog>
<changelog>
<element>mod_cg_memo</element>
<type>Module</type>
Expand All @@ -7,7 +18,7 @@
<item>Update : 01/12/2023</item>
</note>
<fix>
<item>Loosing CSS : move mod_cg_memo.php back to module's root </item>
<item>Loosing CSS : move mod_cg_memo.php back to module's root</item>
</fix>
</changelog>
<changelog>
Expand Down
10 changes: 9 additions & 1 deletion script.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* CG Memo - Joomla 4.x/5.x Module
* Version : 4.0.0
* Version : 4.0.8
* copyright : Copyright (C) 2023 ConseilGouz. All rights reserved.
* license : http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* from : Joomla 3.x Polished Geek Responsive Post-it module
Expand Down Expand Up @@ -78,6 +78,14 @@ private function postinstall_cleanup() {
}
Folder::delete($f);
}
$obsoleteFiles = [
sprintf("%s/modules/mod_cg_memo/mod_%s/mod_%.php", JPATH_SITE,$this->extname,$this->extname),
];
foreach ($obsoleteFiles as $file) {
if (@is_file($file)) {
File::delete($file);
}
}
$langFiles = [
sprintf("%s/language/en-GB/en-GB.mod_postit.ini", JPATH_SITE),
sprintf("%s/language/en-GB/en-GB.mod_postit.sys.ini", JPATH_SITE),
Expand Down
10 changes: 10 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>No Access</title>
</head>

<body bgcolor="#FFFFFF">
</body>
</html>
Expand Down
77 changes: 77 additions & 0 deletions tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,84 @@
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
$modulefield = 'media/mod_cg_memo/';
$document = Factory::getDocument();
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getDocument()->getWebAssetManager();
$wa->registerAndUseStyle('cgmemo',$modulefield.'css/cgmemo.css');
$core = $wa->useAsset('script', 'core');
if ((bool)Factory::getConfig()->get('debug')) { // Mode debug
$document->addScript(''.URI::base(true).'/media/mod_cg_memo/js/cgmemo.js');
} else {
$wa->registerAndUseScript('cgmemo',$modulefield.'js/cgmemo.js');
}
$style = "";
if ($params->get('font-family') == 'allthatmattersmedium') {
$style = "@font-face {
font-family: 'allthatmattersmedium';
src: url('".URI::root()."media/mod_cg_memo/fonts/allthatmatters-webfont.eot');
src: url('".URI::root()."media/mod_cg_memo/fonts/allthatmatters-webfont.eot?#iefix') format('embedded-opentype'), url('".URI::root()."media/mod_cg_memo/fonts/allthatmatters-webfont.woff') format('woff'), url('".URI::root()."media/mod_cg_memo/fonts/allthatmatters-webfont.ttf') format('truetype'), url('".URI::root()."media/mod_cg_memo/fonts/allthatmatters-webfont.svg#allthatmattersmedium') format('svg');
font-weight: normal;
font-style: normal;
}";
$style .= "@font-face {
font-family: 'Indie Flower';
url('".URI::root()."media/mod_cg_memo/fonts/IndieFlower-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}";
} else {
$wa->registerAndUseScript('googleFont','//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
}
$style .= ".".$params->get('class').".cg-memo-note {
max-height:".$params->get('max-height')."%;
max-width:".$params->get('max-width')."%;
font-size:".$params->get('font-size')."px;
color:".$params->get('color','black')."!important;
font-family:".$params->get('font-family').";
line-height:".$params->get('line-height')."px !important;
background-color:".$params->get('note-color').";
padding-top:".$params->get('padding-top')."px;
padding-right:".$params->get('padding-right')."px;
padding-bottom:".$params->get('padding-bottom')."px;
padding-left:".$params->get('padding-left')."px;
-webkit-transform: rotate(".$params->get('degrees')."deg);
/* Firefox */
-moz-transform: rotate(".$params->get('degrees')."deg);
/* IE */
-ms-transform: rotate(".$params->get('degrees')."deg);
/* Opera */
-o-transform: rotate(".$params->get('degrees')."deg);
box-shadow:".$params->get('shadow-horizontal')."px
".$params->get('shadow-vertical')."px
".$params->get('shadow-blur')."px'
".$params->get('shadow-color').";
}";
$style .= ".".$params->get('class').".editor-output {line-height:".$params->get('line-height')."px !important;}";
$style .= ".".$params->get('class')." ol li, .".$params->get('class')." ul li {line-height:".$params->get('line-height')."px!important;}";
$style .= ".".$params->get('class')." .tack {position: absolute;
top:".$params->get('tack-top')."px;left:".$params->get('tack-left')."px;";
$style .= 'background-image: url("'.URI::root().'/media/'.$module->module.'/img/'.$params->get('tack-color').'");
background-repeat: no-repeat;
background-position: center center;
height: 42px;
width: 31px;
}';
$style .= ".hidepin.tack {display:none !important;}";
$style .= ".".$params->get('class')." .line {display: block;}";
$style .= ".".$params->get('class')." .wf-loading h1 {visibility: hidden;}";
$style .= ".".$params->get('class')." .wf-active h1,. ".$params->get('class').".wf-inactive h1 {
visibility: visible;
font-family: 'Cantarell';
}";
$document->addScriptOptions('mod_cg_memo_'.$module->id,
array('fontfamily' => $params->get('font-family'),
));

// Add an inline content as usual, will be rendered in flow after all assets
$wa->addInlineStyle($style);
header("Content-type: text/css; charset: UTF-8");
?>
<div class="<?php echo $params->get('class');?> cg-memo-note <?php echo $params->get('customclass');?>" data="<?php echo $module->id;?>" >
Expand Down

0 comments on commit 4e0c3f0

Please sign in to comment.