Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3986 → Rev 3987

/trunk/widget/modules/photo/squelettes/popup.tpl.html
329,7 → 329,9
<?php $urls = array_keys($infos_images); ?>
<?php for($index = 0; $index < count($urls); $index++):?>
<div id="img-cadre-<?php echo $index; ?>" class="carousel-item">
<img id="illustration-<?php echo $index;?>" class="d-block align-middle" src="<?php echo $urls[$index];?>" alt="" data-width="<?php echo $infos_image[$urls[$index]]['width'];?>" data-height="<?php echo $infos_image[$urls[$index]]['height'];?>">
<img id="illustration-<?php echo $index;?>" class="d-block align-middle"
src="<?php echo $urls[$index] . '?timestamp=' . time();?>" alt=""
data-width="<?php echo $infos_image[$urls[$index]]['width'];?>" data-height="<?php echo $infos_image[$urls[$index]]['height'];?>">
</div>
<?php endfor; ?>
<a id="precedent" class="carousel-control-prev carousel-control" href="#info-img-galerie" role="button" data-slide="prev">
/trunk/widget/modules/photo/squelettes/photo.tpl.html
320,7 → 320,7
<div class="cel-photo grid-item <?php echo $class_extra; ?> <?php echo $t; ?>">
<a href="<?php echo sprintf($item['url_tpl'], 'O'); ?>" class="cel-img"
title="<?php echo $item['titre']; ?> - Publiée le <?php echo $item['date_redige']; ?> - GUID : <?php echo $item['id_photo_formate']; ?>" rel="galerie-princ<?php echo $id; ?>">
<img src="<?php echo sprintf($item['url_tpl'], $dimention_img); ?>" alt="<?php echo $item['titre']; ?>">
<img src="<?php echo sprintf($item['url_tpl'], $dimention_img). '?timestamp=' . time(); ?>" alt="<?php echo $item['titre']; ?>">
</a>
<div id="cel-info-<?php echo $item['id_photo_formate']; ?>" class="cel-infos">
<strong>
/trunk/widget/modules/photo/squelettes/js/WidgetPhotoPopup.js
20,6 → 20,7
this.voteId = null;
this.votes = null;
this.mettreAJourInfosImage();
// console.log(proprietes)
}
 
WidgetPhotoPopup.prototype = new WidgetPhotoCommun();
77,6 → 78,7
let auteurMail = this.item['utilisateur']['mail_utilisateur'].split("@")[0];
this.auteur = this.item["utilisateur"]["nom_utilisateur"] ? this.item["utilisateur"]["nom_utilisateur"] : auteurMail;
this.date = this.item['date'];
this.urlTpl = this.item['url_tpl'];
};
 
WidgetPhotoPopup.prototype.tagsToArray = function( tags ) {
744,6 → 746,7
let url = lthis.urlServiceRegenererMiniature + lthis.idImage;
$.get( url, function( data ) {
console.log( data );
lthis.forcerMajImage(lthis.urlThisImage, lthis.urlTpl);
}
).fail( function() {
console.log( 'La régénération d´image ne s´est pas faite' );
970,7 → 973,13
url = "";
lthis.pivoter('droite');
url = newCel + "-90";
lthis.envoyerVersService('GET', url, lthis.token )
// lthis.envoyerVersService('GET', url, lthis.token )
 
lthis.envoyerVersService('GET', url, lthis.token, null, function (erreur, cb) {
lthis.forcerMajImage(lthis.urlThisImage, lthis.urlTpl);
});
 
// lthis.forcerMajImage(lthis.urlThisImage);
});
 
$( '#pivoter-gauche' ).off( 'click' ).on( 'click', function( event ) {
979,8 → 988,9
url = "";
lthis.pivoter('gauche');
url = newCel + "90";
lthis.envoyerVersService('GET', url, lthis.token)
 
lthis.envoyerVersService('GET', url, lthis.token, null, function (erreur, cb) {
lthis.forcerMajImage(lthis.urlThisImage, lthis.urlTpl);
});
});
};
 
1001,18 → 1011,16
$('#' + imageSelected).data('angle', angle);
}
 
// WidgetPhotoPopup.prototype.afficherTags = function() {
// const lthis = this;
// const TAGS_BASE = [
// 'port',
// 'fleur',
// 'fruit',
// 'feuille',
// 'ecorce',
// 'rameau',
// 'planche',
// 'insecte'
// ];
WidgetPhotoPopup.prototype.forcerMajImage = function (urlImage, urlTpl){
var indexPourcentage = urlTpl.indexOf('%');
urlTpl = urlTpl.substring(0, indexPourcentage);
 
// };
// Sélectionne l'élément img avec l'attribut src égal à this.urlImage
var $image = $('img[src^="' + urlTpl + '"]');
 
// Ajoute un paramètre unique à l'URL pour éviter le cache
var newSrc = urlImage + '?timestamp=' + new Date().getTime();
 
// Met à jour l'attribut 'src' de l'image avec la nouvelle URL
$image.attr('src', newSrc);
}