From 4e0c3f0085678ff2dfd2d1e5341b67baff20d83d Mon Sep 17 00:00:00 2001 From: pmleconte Date: Fri, 1 Dec 2023 14:53:01 +0100 Subject: [PATCH] 4.0.8 Revert 4.0.7 updates --- mod_cg_memo.php | 89 --------------------------------------- mod_cg_memo.xml | 5 +-- mod_cg_memo_changelog.xml | 13 +++++- script.php | 10 ++++- src/index.html | 10 +++++ tmpl/default.php | 77 +++++++++++++++++++++++++++++++++ 6 files changed, 110 insertions(+), 94 deletions(-) delete mode 100644 mod_cg_memo.php create mode 100644 src/index.html diff --git a/mod_cg_memo.php b/mod_cg_memo.php deleted file mode 100644 index 0f40018..0000000 --- a/mod_cg_memo.php +++ /dev/null @@ -1,89 +0,0 @@ -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); -require_once(ModuleHelper::getLayoutPath($module->module)); diff --git a/mod_cg_memo.xml b/mod_cg_memo.xml index 9cba7c8..111e346 100644 --- a/mod_cg_memo.xml +++ b/mod_cg_memo.xml @@ -6,14 +6,13 @@ Copyright (C) 2023 ConseilGouz. All rights reserved. pascal.leconte@conseilgouz.com www.conseilgouz.com - 4.0.7 + 4.0.8 ConseilGouz\Module\Cgmemo CG_MEMO_DESC - mod_cg_memo.php + services index.html mod_cg_memo.xml - services src tmpl diff --git a/mod_cg_memo_changelog.xml b/mod_cg_memo_changelog.xml index 559706d..0bcc991 100644 --- a/mod_cg_memo_changelog.xml +++ b/mod_cg_memo_changelog.xml @@ -1,4 +1,15 @@ + + mod_cg_memo + Module + 4.0.8 + + Update : 01/12/2023 + + + Revert 4.0.7 updates + + mod_cg_memo Module @@ -7,7 +18,7 @@ Update : 01/12/2023 - Loosing CSS : move mod_cg_memo.php back to module's root + Loosing CSS : move mod_cg_memo.php back to module's root diff --git a/script.php b/script.php index 01d31a2..eb41469 100644 --- a/script.php +++ b/script.php @@ -1,7 +1,7 @@ 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), diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..4f07ffa --- /dev/null +++ b/src/index.html @@ -0,0 +1,10 @@ + + + + +No Access + + + + + diff --git a/tmpl/default.php b/tmpl/default.php index 60accac..fcb3a28 100644 --- a/tmpl/default.php +++ b/tmpl/default.php @@ -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"); ?>