Amélioration du formulaire de fonte

This commit is contained in:
fredtempez 2022-02-10 09:10:21 +01:00
parent ce1b69d42b
commit 77781aa817
3 changed files with 58 additions and 10 deletions

View File

@ -0,0 +1,41 @@
/**
* This file is part of Zwii.
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2022, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* Option par défaut du sélecteur de mode
*/
$(document).ready(function(){
$('input[name=fontAddFontImported]').prop('checked', true);
$('#fontAddFileWrapper').hide();
});
/**
* Mode téléchargement en ligne de la fonte ou installation locale
*/
$("input[name=fontAddFontImported]").on("click", function() {
if( $('input[name=fontAddFontImported]').is(':checked') ){
$('input[name=fontAddFontFile]').prop('checked', false);
} else {
$('input[name=fontAddFontFile]').prop('checked', true);
}
$('#fontAddFileWrapper').hide();
});
$("input[name=fontAddFontFile]").on("click", function() {
if( $('input[name=fontAddFontFile]').is(':checked') ){
$('input[name=fontAddFontImported]').prop('checked', false);
} else {
$('input[name=fontAddFontImported]').prop('checked', true);
}
$('#fontAddFileWrapper').show();
});

View File

@ -20,8 +20,15 @@
<div class="block">
<h4>Identité de la fonte</h4>
<div class="row">
<div class="col12">
Police utilisée en ligne se connecter sur <a href="https://www.cdnfonts.com/" target="_blank">https://www.cdnfonts.com/</a> pour récupérer les informations nécessaires.<br/>Sinon, précisez le nom du fichier de fonte au format WOFF.
<div class="col6">
<?php echo template::checkbox('fontAddFontImported', true, 'Fonte téléchargée sur cdnFonts', [
'help' => 'Police utilisée en ligne, se connecter sur cdnFonts pour récupérer les informations nécessaires.'
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('fontAddFontFile', true,'Fonte installée', [
'help' => '<br/>Sélectionnez un fichier de fonte au format WOFF.'
]); ?>
</div>
</div>
<div class="row">