Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3947 → Rev 3948

/trunk/widget/modules/photo/squelettes/js/WidgetPhotoPopup.js
36,6 → 36,7
this.initEvtsFonctionsPhoto();
this.initEvtsRetourGalerieResponsive();
this.initEvtsTagsPF();
this.initEvtsProtocole();
};
 
WidgetPhotoPopup.prototype.mettreAJourPopup = function() {
44,6 → 45,8
this.traiterMetas();
this.regenererMiniature();
this.fournirLienIdentiplante();
this.traiterVote();
this.pivoterImage();
};
 
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
645,7 → 648,7
console.log( data );
}
).fail( function() {
console.log( 'La régénérétion d´image ne s´est pas faite' );
console.log( 'La régénération d´image ne s´est pas faite' );
});
});
};
674,6 → 677,114
});
};
 
WidgetPhotoPopup.prototype.initEvtsProtocole = function() {
const lthis = this;
 
$( '#protocole').on( 'change', function( event ){
event.preventDefault();
var id = $(this).children(":selected").attr("id");
 
$('#bloc-notes-protocole').removeClass('hidden');
 
const message = {
'capitalisation_image': "\"Capitalisation d'image\" est un programme de sciences participatives initié" +
" dans le cadre du projet Pl@nttNet. En attribuant une note aux photos vous nous aidez à connaître" +
" leur qualité.",
'aide_identification': "Message du protocole aide identification",
'defi_photo': "Message du protocole défi photo",
'gentiane_azure': "Message du protocole gentiane_azure",
'arbres_tetards': "Message du protocole arbres_tetards",
}
$('#message-protocole').html('<p>' + message[id] + '</p>');
});
};
 
WidgetPhotoPopup.prototype.traiterVote = function () {
// console.log(this.idImage);
// console.log(this);
// console.log(this.tagsImage);
 
$("#note").attr("value", -1);
 
$("#note-remove").click(function (){
$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
 
$("#note").attr("value", -1);
})
 
$("#rating-star-1").hover(function () {
$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
 
$("#rating-star-1").removeClass('far').addClass('fa').css("color", "#c3d45d");
 
$("#note").attr("value", 1);
});
 
$("#rating-star-2").hover(function () {
$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
 
$("#rating-star-1, #rating-star-2").removeClass('far').addClass('fa').css("color", "#c3d45d");
 
$("#note").attr("value", 2);
});
 
$("#rating-star-3").hover(function () {
$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
 
$("#rating-star-1, #rating-star-2, #rating-star-3").removeClass('far').addClass('fa').css("color", "#c3d45d");
 
$("#note").attr("value", 3);
});
 
$("#rating-star-4").hover(function () {
$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
 
$("#rating-star-1, #rating-star-2, #rating-star-3, #rating-star-4").removeClass('far').addClass('fa').css("color", "#c3d45d");
 
$("#note").attr("value", 4);
});
 
$("#rating-star-5").hover(function () {
$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
 
$("#rating-star-1, #rating-star-2, #rating-star-3, #rating-star-4, #rating-star-5").removeClass('far').addClass('fa').css("color", "#c3d45d");
 
$("#note").attr("value", 5);
});
 
// TODO Envoyer le vote
};
 
WidgetPhotoPopup.prototype.pivoterImage = function() {
let imageSelected = $('img[src="' + this.urlThisImage + '"]').attr('id');
 
$( '#pivoter-droite' ).on( 'click', function( event ) {
event.preventDefault();
 
let existingAngle = $('#' + imageSelected).data('angle');
if (existingAngle == 360 || existingAngle == (-360) || existingAngle == undefined){
existingAngle = 0
}
 
let angle = (existingAngle + 90);
$('#' + imageSelected).css("transform", "rotate(" + angle + "deg) ");
$('#' + imageSelected).data('angle', angle);
});
 
$( '#pivoter-gauche' ).on( 'click', function( event ) {
event.preventDefault();
 
let existingAngle = $('#' + imageSelected).data('angle');
if (existingAngle == 360 || existingAngle == (-360) || existingAngle == undefined){
existingAngle = 0
}
 
let angle = (existingAngle - 90);
$('#' + imageSelected).css("transform", "rotate(" + angle + "deg) ");
$('#' + imageSelected).data('angle', angle);
});
};
 
// WidgetPhotoPopup.prototype.afficherTags = function() {
// const lthis = this;
// const TAGS_BASE = [