Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3166 → Rev 3165

/trunk/widget/modules/manager/squelettes/js/manager.js
22,24 → 22,15
$('#profile-details-fields-section').append(html);
}
 
function enregistrerNouveauChamps() {
var $typeChamp = $('#type_champ'),
$valeurNouveauChamp = [];
$type_champ.change(function() {
$valeurNouveauChamp = $(this).val();
console.log($valeurNouveauChamp);
});
}
function inputFileStyle() {
 
 
function inputFile() {
 
// ajout de la classe JS à HTML
$('html').addClass('js');
 
// initialisation des variables
var $fileInput = $( ".input-file" ),
$button = $( ".label-file" );
$button = $( ".label-file" ),
$the_return = $(".file-return");
 
// action lorsque la "barre d'espace" ou "Entrée" est pressée
$button.on( 'keydown', function( event ) {
49,28 → 40,22
});
 
// action lorsque le label est cliqué
$button.click(function() {
$fileInput.focus();
return false;
$button.on( 'click', function( event ) {
$fileInput.focus();
return false;
});
 
// affiche un retour visuel dès que input:file change
$fileInput.change( function(event) {
var file = event.target.files[0]
var $theReturn = $('.' + $(this).attr('id'));
 
$theReturn.text(file.name);
 
if(file.type.match('image')) {
var tmppath = URL.createObjectURL(file);
$theReturn.append('<img src="' + tmppath + '" width="50%">');
}
});
// ...A voir ok=lus tard
// $fileInput.on( 'change', function( event ) {
// file = this.value();
// $the_return.html( file );
// });
}
 
jQuery(document).ready(function() {
 
inputFile()
inputFileStyle()
 
// var $projet = $('#projet');
 
/trunk/widget/modules/manager/squelettes/creation.tpl.html
73,7 → 73,6
<div class="register-section" id="basic-details-section">
<h2>Meta-données</h2>
 
<?php //var_dump($widget); ?>
<label for="projet">Projet *</label>
<input type="text" name="projet" id="projet" pattern="[a-z]*" <?php echo ($mode === 'modification') ? 'value="'.$widget['projet'].'" readonly' : 'required'; ?> title="Champ obligatoire : pas d'espace" />
 
119,7 → 118,7
<input type="file" class="input-file" name="logo" id="logo" accept="image" />
<label for="logo" class="label-file"><i class="fas fa-download"></i> Logo</label>
</div>
<div class="file-return logo"></div>
<p class="file-return"></p>
 
<?php echo isset($widget['logo']) ? '<img src="'.$widget['logo'].'" /><br />Pour changer, télécharger un nouveau fichier.': ''; ?>
 
127,7 → 126,7
<input type="file" class="input-file" name="fond" id="fond" value="<?php echo $widget['titre']; ?>" />
<label for="fond" class="label-file"><i class="fas fa-download"></i> Image de fond</label>
</div>
<div class="file-return fond"></div>
<p class="file-return"></p>
</div><!-- #profile-details-description-section -->
 
<div class="register-section" id="profile-details-fields-section">
165,7 → 164,7
<label for="especes"class="label-file"><i class="fas fa-download"></i> Espèces</label>
fichier type
</div>
<p class="file-return especes"></p>
<p class="file-return"></p>
 
 
<label for="add_fields">Ajouter un champ</label>
/trunk/widget/modules/manager/squelettes/css/manager.css
86,7 → 86,7
border: 0.1rem solid #ddd;
border-radius: 0.3rem;
padding: 1rem;
overflow: hidden;
overflow: visible;
}
 
 
108,7 → 108,7
margin: 1rem;
height: 300rem;
min-height: 100%;
width: 90%;
width: 100%;
pointer-events: none;
overflow: hidden
}
131,24 → 131,23
/* styles de base si JS est activé */
.js #group-settings-form .input-file-container {
position: relative;
width: 100%;
width: 225px;
}
.js #group-settings-form .label-file {
display: block;
padding: 1rem;
padding: 14px 45px;
background: #009FB8;
color: #fff !important;
font-size: 1.5rem;
font-size: 1em;
transition: all .4s;
cursor: pointer;
border-radius: 0.2rem;
border-radius: 0.2em;
}
.js #group-settings-form .input-file {
position: absolute;
top: 0; left: 0;
width: 80%;
padding: 1rem;
margin: auto;
width: 225px;
padding: 14px 0;
opacity: 0;
cursor: pointer;
}
163,26 → 162,21
}
 
/* styles du retour visuel */
#group-settings-form .file-return:not(:empty)::before{
content:'Nom du fichier: ';
font-size: 1rem;
#group-settings-form .file-return {
margin: 0;
}
 
#group-settings-form .file-return:not(:empty) img{
margin: 1rem auto;
display: block;
#group-settings-form .file-return:not(:empty) {
margin: 1em 0;
}
 
.js #group-settings-form .file-return {
font-style: italic;
font-size: 1.5rem;
font-size: .9em;
font-weight: bold;
}
/* on complète l'information d'un contenu textuel
uniquement lorsque le paragraphe n'est pas vide */
/*.js #group-settings-form .file-return:not(:empty):before {
content: "Fichier sélectionné: ";
.js #group-settings-form .file-return:not(:empty):before {
content: "Selected file: ";
font-style: normal;
font-weight: normal;
}
*/
/trunk/widget/modules/manager/Manager.php
111,7 → 111,7
//https://api.tela-botanica.org/service:cel:NomsChampsEtendus/cle
$retour['squelette'] ='creation';
$jsonlangue = $this->getDao()->consulter($this->config['manager']['languesUrl']);
$tableaulangue = (array) json_decode($jsonlangue, true);
$tableaulangue= (array) json_decode($jsonlangue, true);
$retour['donnees']['langues'] = $tableaulangue['resultat'] ;
$retour['donnees']['widget'] = array();
if (isset($this->parametres['projet'])) {
119,12 → 119,11
$json = $this->getDao()->consulter($url);
$tableau = (array) json_decode($json, true);
$retour['donnees']['widget'] = $tableau[0];
 
$urltype = $this->cel_url_tpl.'?esttype=1';
$jsontype = $this->getDao()->consulter($urltype);
$tableautype= (array) json_decode($jsontype, true);
$retour['donnees']['type'] = $tableautype;
}
$urltype = $this->cel_url_tpl.'?esttype=1';
$jsontype = $this->getDao()->consulter($urltype);
$tableautype= (array) json_decode($jsontype, true);
$retour['donnees']['type'] = $tableautype;
return $retour;
}
 
/trunk/widget/Widget.php
158,4 → 158,4
self::$config = array_merge(self::$config, $widget_config);
}
}
}
}
/trunk/widget/bibliotheque/WidgetCommun.php
454,4 → 454,4
 
return $str;
}
}
}