Subversion Repositories eFlore/Applications.cel

Rev

Rev 2852 | Rev 2856 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2850 aurel 1
/* Héritage */
2
function WidgetSaisieMessicoles()
3
{
4
	this.lieuReleve = null;
5
	this.identification = null;
6
	this.abondance = null;
7
	this.zoneChamps = null;
8
 
9
}
10
WidgetSaisieMessicoles.prototype = new WidgetSaisie();
11
 
12
/* Surcharge des fonctions */
2854 mathias 13
 
2852 mathias 14
WidgetSaisie.prototype.ajouterObs = function() {
15
	// Fermeture automatique des dialogue de transmission de données
16
	// @WARNING TEST
17
	$('#dialogue-obs-transaction-ko').hide();
18
	$('#dialogue-obs-transaction-ok').hide();
2850 aurel 19
 
2852 mathias 20
	// vérification : si la détermination est incertaine, obligation
21
	// de fournir au moins une image
22
	var certitude = $('#identification').val(),
23
		nbImages = $("#miniatures img").length,
24
		imagesOK = true;
25
	if (certitude != "certaine" && nbImages == 0) {
26
		imagesOK = false;
27
		$("#image-obligatoire").show();
28
	} else {
29
		$("#image-obligatoire").hide();
30
	}
31
 
32
	if ((this.validerFormulaire() == true) && imagesOK) {
33
		this.masquerPanneau('#dialogue-form-invalide');
34
		return false;
35
		// suite des opérations
36
		this.obsNbre = this.obsNbre + 1;
37
		$(".obs-nbre").text(this.obsNbre);
38
		$(".obs-nbre").triggerHandler('changement');
39
		this.afficherObs();
40
		this.stockerObsData();
41
		this.supprimerMiniatures();
42
		if(! this.especeImposee) {
43
			$("#taxon").val("");
44
			$("#taxon").data("numNomSel",undefined);
45
		}
46
		$('#barre-progression-upload').attr('aria-valuemax', this.obsNbre);
47
		$('#barre-progression-upload .sr-only').text('0/'+this.obsNbre+" observations transmises");
48
	} else {
49
		this.afficherPanneau('#dialogue-form-invalide');
50
	}
51
};
52
 
53
 
2850 aurel 54
/* Ecouteurs */
2851 mathias 55
/*$('.aide').on('mouseover', function() {
2850 aurel 56
	$('#test').prop('src','../img/icones/plus.png');
2851 mathias 57
});*/
58
 
59
/* jQuery en vrac */
60
$(document).ready(function() {
61
	// super popover qui va chercher son contenu dans un div à côté (pour les
62
	// boutons d'aide des types de champs, etc.)
63
	$('[data-toggle="popover"]').popover({
64
        html : true,
65
        content: function() {
66
			var parentFor = $(this).parent().attr("for");
67
			var popoverHtmlContentDiv = $('.popover-html-content[data-for="' + parentFor + '"]');
68
			return popoverHtmlContentDiv.html();
69
        }
70
    });
2850 aurel 71
});