Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 895 Rev 905
Line 30... Line 30...
30
	ajouterAutocompletion();
30
	ajouterAutocompletion();
31
	ajouterActionClicSurTexteRecherche(champs_ts);
31
	ajouterActionClicSurTexteRecherche(champs_ts);
32
	gererAffichageValeursParDefaut(champs_ts);
32
	gererAffichageValeursParDefaut(champs_ts);
33
	afficherValeurParDefaut(champs_ts);
33
	afficherValeurParDefaut(champs_ts);
34
	gererAccesFicheFlecheDroite();
34
	gererAccesFicheFlecheDroite();
35
	gererClicIllustrationsResultats()
35
	gererClicIllustrationsResultats();
-
 
36
	gererAccesFicheBouton();
36
});
37
});
Line 37... Line 38...
37
 
38
 
38
/**------------------- Fonctions de gestion de l'autocompletion ---------------------------------*/
39
/**------------------- Fonctions de gestion de l'autocompletion ---------------------------------*/
39
function ajouterAutocompletion(){
40
function ajouterAutocompletion(){
Line 110... Line 111...
110
	$(document).keypress(function(event) {
111
	$(document).keypress(function(event) {
111
		// flèche droite
112
		// flèche droite
112
		if(event.keyCode == 39) {
113
		if(event.keyCode == 39) {
113
			if(autocompletionFicheOuverte && elementAutocompletionSelectionne != null && nomSciEstDemande()) {
114
			if(autocompletionFicheOuverte && elementAutocompletionSelectionne != null && nomSciEstDemande()) {
114
				$('#nom').val(elementAutocompletionSelectionne.value);
115
				$('#nom').val(elementAutocompletionSelectionne.value);
-
 
116
				if(elementAutocompletionSelectionne.nn != undefined && elementAutocompletionSelectionne.nn != null) {
-
 
117
					var url_fiche_taxon = URL_BASE_FICHE_TAXON.replace('{num_taxon}',elementAutocompletionSelectionne.nn);
115
				$('#eflore_nomenclature_fiche').click();
118
					window.location.href = url_fiche_taxon; 
-
 
119
				}
116
				$('#nom').autocomplete( "disable" );
120
				$('#nom').autocomplete( "disable" );
117
				//TODO : ajout d'un message de chargement ?
121
				//TODO : ajout d'un message de chargement ?
118
			}
122
			}
119
		}
123
		}
Line 124... Line 128...
124
			}
128
			}
125
		}
129
		}
126
	});
130
	});
127
}
131
}
Line -... Line 132...
-
 
132
 
-
 
133
function gererAccesFicheBouton() {
-
 
134
	$('#eflore_nomenclature_fiche').click(function(event) {
-
 
135
		if(elementAutocompletionSelectionne != null && nomSciEstDemande()) {
-
 
136
			$('#nom').val(elementAutocompletionSelectionne.value);
-
 
137
			if(elementAutocompletionSelectionne.nn != undefined && elementAutocompletionSelectionne.nn != null) {
-
 
138
				var url_fiche_taxon = URL_BASE_FICHE_TAXON.replace('{num_taxon}',elementAutocompletionSelectionne.nn);
-
 
139
				window.location.href = url_fiche_taxon; 
-
 
140
			}
-
 
141
			event.preventDefault();
-
 
142
		}
-
 
143
	});
-
 
144
}
128
 
145
 
129
function traiterRetourNomsSci(data) {
146
function traiterRetourNomsSci(data) {
130
	var suggestions = [];  
147
	var suggestions = [];  
131
	if (data.resultat != undefined) {
148
	if (data.resultat != undefined) {
132
		$.each(data.resultat, function(i, val) {
149
		$.each(data.resultat, function(i, val) {