From 735168596e8d2d238593454c677c0424920da913 Mon Sep 17 00:00:00 2001 From: pmleconte Date: Fri, 1 Dec 2023 12:52:55 +0100 Subject: [PATCH] 4.0.7 Loosing CSS : move mod_cg_memo.php back to module's root --- mod_cg_memo.php | 89 +++++++++++++++++++++++++++++++++++++++ mod_cg_memo.xml | 7 +-- mod_cg_memo_changelog.xml | 11 +++++ tmpl/default.php | 77 --------------------------------- 4 files changed, 104 insertions(+), 80 deletions(-) create mode 100644 mod_cg_memo.php diff --git a/mod_cg_memo.php b/mod_cg_memo.php new file mode 100644 index 0000000..0f40018 --- /dev/null +++ b/mod_cg_memo.php @@ -0,0 +1,89 @@ +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 e986647..9cba7c8 100644 --- a/mod_cg_memo.xml +++ b/mod_cg_memo.xml @@ -2,17 +2,18 @@ CG Responsive Memo ConseilGouz - 2023-10-27 + 2023-12-01 Copyright (C) 2023 ConseilGouz. All rights reserved. pascal.leconte@conseilgouz.com www.conseilgouz.com - 4.0.6 + 4.0.7 ConseilGouz\Module\Cgmemo CG_MEMO_DESC - services + mod_cg_memo.php index.html mod_cg_memo.xml + services src tmpl diff --git a/mod_cg_memo_changelog.xml b/mod_cg_memo_changelog.xml index 9992e32..559706d 100644 --- a/mod_cg_memo_changelog.xml +++ b/mod_cg_memo_changelog.xml @@ -1,4 +1,15 @@ + + mod_cg_memo + Module + 4.0.7 + + Update : 01/12/2023 + + + Loosing CSS : move mod_cg_memo.php back to module's root + + mod_cg_memo Module diff --git a/tmpl/default.php b/tmpl/default.php index fcb3a28..60accac 100644 --- a/tmpl/default.php +++ b/tmpl/default.php @@ -8,84 +8,7 @@ */ // 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"); ?>