Subversion Repositories eFlore/Applications.cel

Rev

Rev 3946 | Rev 3949 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3946 Rev 3948
Line 34... Line 34...
34
	this.initEvtsContact();
34
	this.initEvtsContact();
35
	$( window ).on( 'resize', lthis.redimentionnerModaleCarousel.bind( lthis ) );
35
	$( window ).on( 'resize', lthis.redimentionnerModaleCarousel.bind( lthis ) );
36
	this.initEvtsFonctionsPhoto();
36
	this.initEvtsFonctionsPhoto();
37
	this.initEvtsRetourGalerieResponsive();
37
	this.initEvtsRetourGalerieResponsive();
38
	this.initEvtsTagsPF();
38
	this.initEvtsTagsPF();
-
 
39
	this.initEvtsProtocole();
39
};
40
};
Line 40... Line 41...
40
 
41
 
41
WidgetPhotoPopup.prototype.mettreAJourPopup = function() {
42
WidgetPhotoPopup.prototype.mettreAJourPopup = function() {
42
	this.mettreAJourInfosImage();
43
	this.mettreAJourInfosImage();
43
	this.afficherTitreImage();
44
	this.afficherTitreImage();
44
	this.traiterMetas();
45
	this.traiterMetas();
45
	this.regenererMiniature();
46
	this.regenererMiniature();
-
 
47
	this.fournirLienIdentiplante();
-
 
48
	this.traiterVote();
46
	this.fournirLienIdentiplante();
49
	this.pivoterImage();
Line 47... Line 50...
47
};
50
};
48
 
51
 
49
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
52
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
Line 643... Line 646...
643
		let url = lthis.urlServiceRegenererMiniature + lthis.idImage;
646
		let url = lthis.urlServiceRegenererMiniature + lthis.idImage;
644
		$.get( url, function( data ) {
647
		$.get( url, function( data ) {
645
				console.log( data );
648
				console.log( data );
646
			}
649
			}
647
		).fail( function() {
650
		).fail( function() {
648
			console.log( 'La régénérétion d´image ne s´est pas faite' );
651
			console.log( 'La régénération d´image ne s´est pas faite' );
649
		});
652
		});
650
	});
653
	});
651
};
654
};
Line 652... Line 655...
652
 
655
 
Line 672... Line 675...
672
	$( '.signaler-erreur-obs' ).each( function() {
675
	$( '.signaler-erreur-obs' ).each( function() {
673
		$( this ).attr( 'href', lthis.urlIP );
676
		$( this ).attr( 'href', lthis.urlIP );
674
	});
677
	});
675
};
678
};
Line -... Line 679...
-
 
679
 
-
 
680
WidgetPhotoPopup.prototype.initEvtsProtocole = function() {
-
 
681
	const lthis = this;
-
 
682
 
-
 
683
	$( '#protocole').on( 'change', function( event ){
-
 
684
		event.preventDefault();
-
 
685
		var id = $(this).children(":selected").attr("id");
-
 
686
 
-
 
687
		$('#bloc-notes-protocole').removeClass('hidden');
-
 
688
 
-
 
689
		const message = {
-
 
690
			'capitalisation_image': "\"Capitalisation d'image\" est un programme de sciences participatives initié" +
-
 
691
				" dans le cadre du projet Pl@nttNet. En attribuant une note aux photos vous nous aidez à connaître" +
-
 
692
				" leur qualité.",
-
 
693
			'aide_identification': "Message du protocole aide identification",
-
 
694
			'defi_photo': "Message du protocole défi photo",
-
 
695
			'gentiane_azure': "Message du protocole gentiane_azure",
-
 
696
			'arbres_tetards': "Message du protocole arbres_tetards",
-
 
697
		}
-
 
698
		$('#message-protocole').html('<p>' + message[id] + '</p>');
-
 
699
	});
-
 
700
};
-
 
701
 
-
 
702
WidgetPhotoPopup.prototype.traiterVote = function () {
-
 
703
	// console.log(this.idImage);
-
 
704
	// console.log(this);
-
 
705
	// console.log(this.tagsImage);
-
 
706
 
-
 
707
	$("#note").attr("value", -1);
-
 
708
 
-
 
709
	$("#note-remove").click(function (){
-
 
710
		$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
-
 
711
 
-
 
712
		$("#note").attr("value", -1);
-
 
713
	})
-
 
714
 
-
 
715
	$("#rating-star-1").hover(function () {
-
 
716
		$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
-
 
717
 
-
 
718
		$("#rating-star-1").removeClass('far').addClass('fa').css("color", "#c3d45d");
-
 
719
 
-
 
720
		$("#note").attr("value", 1);
-
 
721
	});
-
 
722
 
-
 
723
	$("#rating-star-2").hover(function () {
-
 
724
		$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
-
 
725
 
-
 
726
		$("#rating-star-1, #rating-star-2").removeClass('far').addClass('fa').css("color", "#c3d45d");
-
 
727
 
-
 
728
		$("#note").attr("value", 2);
-
 
729
	});
-
 
730
 
-
 
731
	$("#rating-star-3").hover(function () {
-
 
732
		$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
-
 
733
 
-
 
734
		$("#rating-star-1, #rating-star-2, #rating-star-3").removeClass('far').addClass('fa').css("color", "#c3d45d");
-
 
735
 
-
 
736
		$("#note").attr("value", 3);
-
 
737
	});
-
 
738
 
-
 
739
	$("#rating-star-4").hover(function () {
-
 
740
		$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
-
 
741
 
-
 
742
		$("#rating-star-1, #rating-star-2, #rating-star-3, #rating-star-4").removeClass('far').addClass('fa').css("color", "#c3d45d");
-
 
743
 
-
 
744
		$("#note").attr("value", 4);
-
 
745
	});
-
 
746
 
-
 
747
	$("#rating-star-5").hover(function () {
-
 
748
		$(".notation-star").removeClass('fa').addClass('far').css("color", "grey");
-
 
749
 
-
 
750
		$("#rating-star-1, #rating-star-2, #rating-star-3, #rating-star-4, #rating-star-5").removeClass('far').addClass('fa').css("color", "#c3d45d");
-
 
751
 
-
 
752
		$("#note").attr("value", 5);
-
 
753
	});
-
 
754
 
-
 
755
	// TODO Envoyer le vote
-
 
756
};
-
 
757
 
-
 
758
WidgetPhotoPopup.prototype.pivoterImage = function() {
-
 
759
	let imageSelected = $('img[src="' + this.urlThisImage + '"]').attr('id');
-
 
760
 
-
 
761
	$( '#pivoter-droite' ).on( 'click', function( event ) {
-
 
762
		event.preventDefault();
-
 
763
 
-
 
764
		let existingAngle = $('#' + imageSelected).data('angle');
-
 
765
		if (existingAngle == 360 || existingAngle == (-360) || existingAngle == undefined){
-
 
766
			existingAngle = 0
-
 
767
		}
-
 
768
 
-
 
769
		let angle = (existingAngle + 90);
-
 
770
		$('#' + imageSelected).css("transform", "rotate(" + angle + "deg) ");
-
 
771
		$('#' + imageSelected).data('angle', angle);
-
 
772
	});
-
 
773
 
-
 
774
	$( '#pivoter-gauche' ).on( 'click', function( event ) {
-
 
775
		event.preventDefault();
-
 
776
 
-
 
777
		let existingAngle = $('#' + imageSelected).data('angle');
-
 
778
		if (existingAngle == 360 || existingAngle == (-360) || existingAngle == undefined){
-
 
779
			existingAngle = 0
-
 
780
		}
-
 
781
 
-
 
782
		let angle = (existingAngle - 90);
-
 
783
		$('#' + imageSelected).css("transform", "rotate(" + angle + "deg) ");
-
 
784
		$('#' + imageSelected).data('angle', angle);
-
 
785
	});
-
 
786
};
676
 
787
 
677
// WidgetPhotoPopup.prototype.afficherTags = function() {
788
// WidgetPhotoPopup.prototype.afficherTags = function() {
678
// 	const lthis = this;
789
// 	const lthis = this;
679
// 	const TAGS_BASE = [
790
// 	const TAGS_BASE = [
680
// 		'port',
791
// 		'port',