fontEdit en mieux

This commit is contained in:
Fred Tempez 2022-03-13 10:09:49 +01:00
parent d6c2cd62d2
commit 7355b06db4
3 changed files with 53 additions and 33 deletions

View File

@ -45,7 +45,7 @@ class common {
// Numéro de version // Numéro de version
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/';
const ZWII_VERSION = '11.3.04'; const ZWII_VERSION = '11.4.00';
const ZWII_UPDATE_CHANNEL = "v11"; const ZWII_UPDATE_CHANNEL = "v11";
public static $actions = []; public static $actions = [];

View File

@ -10,3 +10,35 @@
*/ */
/**
* Option par défaut du sélecteur de mode
*/
$(document).ready(function(){
$('input[name=fontEditFontImported]').prop('checked', true);
$('input[name=fontEditFontUrl]').prop('checked', false);
$('#containerfontEditFile').hide();
});
/**
* Mode téléchargement en ligne de la fonte ou installation locale
*/
$("input[name=fontEditFontImported]").on("click", function() {
if( $('input[name=fontEditFontImported]').is(':checked') ){
$('input[name=fontEditFontFile]').prop('checked', false);
} else {
$('input[name=fontEditFontFile]').prop('checked', true);
}
$('#containerfontEditFile').hide();
$('#containerfontEditUrl').show();
});
$("input[name=fontEditFontFile]").on("click", function() {
if( $('input[name=fontEditFontFile]').is(':checked') ){
$('input[name=fontEditFontImported]').prop('checked', false);
} else {
$('input[name=fontEditFontImported]').prop('checked', true);
}
$('#containerfontEditFile').show();
$('#containerfontEditUrl').hide();
});

View File

@ -30,19 +30,14 @@
<h4>Identité de la fonte</h4> <h4>Identité de la fonte</h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php switch ($this->getUrl(2)) { <?php echo template::checkbox('fontEditFontImported', true, 'Fonte en ligne', [
case 'imported': 'checked' => $this->getUrl(2) === 'imported' ? true : false
echo template::checkbox('fontEditFontImported', true, 'Fonte en ligne',[ ]); ?>
'checked' => true </div>
]); <div class="col6">
break; <?php echo template::checkbox('fontEditFontFile', true,'Fonte installée', [
case 'files': 'checked' => $this->getUrl(2) === 'file' ? true : false
echo template::checkbox('fontEditFontFile', true,'Fonte installée', [ ]); ?>
'checked' => true
]);
break;
}
?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -51,7 +46,6 @@
'autocomplete' => 'off', 'autocomplete' => 'off',
'label' => 'Identifiant (sans espace ni majuscule)', 'label' => 'Identifiant (sans espace ni majuscule)',
'value' => $this->getUrl(3) 'value' => $this->getUrl(3)
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
@ -61,7 +55,6 @@
'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'name']) 'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'name'])
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
@ -74,23 +67,18 @@
</div> </div>
<div class="row" id="containerfontEditFile"> <div class="row" id="containerfontEditFile">
<div class="col12"> <div class="col12">
<?php switch ($this->getUrl(2)) { <?php echo template::file('fontEditFile', [
case 'imported':
echo template::text('fontEditUrl', [
'label' => 'Url du fichier de fonte',
'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'ressource']),
'class' => $this->getUrl(2) === 'imported' ? '' : 'noDisplay'
]);
break;
case 'files':
echo template::file('fontEditFile', [
'label' => 'Fichier de fonte (Format WOFF)', 'label' => 'Fichier de fonte (Format WOFF)',
'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'ressource']), 'value' => $this->getUrl(2) === 'file' ? $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'ressource']) : ''
'class' => $this->getUrl(2) === 'file' ? '' : 'noDisplay' ]); ?>
]); </div>
break; </div>
} <div class="row" id="containerfontEditUrl">
?> <div class="col12">
<?php echo template::text('fontEditUrl', [
'label' => 'Url du fichier de fonte',
'value' => $this->getUrl(2) === 'imported' ? $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'ressource']) : ''
]); ?>
</div> </div>
</div> </div>
</div> </div>