Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3985 → Rev 3987

/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);
}