Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2700 → Rev 2701

/trunk/widget/modules/saisie/squelettes/defaut/js/WidgetSaisie.js
490,8 → 490,7
WidgetSaisie.prototype.requeterIdentite = function() {
var lthis = this;
var courriel = $("#courriel").val();
//TODO: mettre ceci en paramètre de config
var urlAnnuaire = this.serviceAnnuaireIdUrl + courriel;//http://localhost/applications/annuaire/jrest/
var urlAnnuaire = this.serviceAnnuaireIdUrl + courriel;
$.ajax({
url : urlAnnuaire,
type : "GET",
505,6 → 504,7
$("#courriel_confirmation").val(courriel);
$("#prenom, #nom, #courriel_confirmation").attr('disabled', 'disabled');
$("#date").focus();
lthis.masquerPanneau("#dialogue-courriel-introuvable");
} else {
lthis.surErreurCompletionCourriel();
}
518,6 → 518,7
// @TODO harmoniser class="hidden" VS style="display:none;"
$("#zone-prenom-nom").removeClass("hidden").show();
$("#zone-courriel-confirmation").removeClass("hidden").show();
}
});
};
1172,8 → 1173,12
 
WidgetSaisie.prototype.afficherPanneau = function(selecteur) {
$(selecteur).fadeIn("slow").delay(this.dureeMessage).fadeOut("slow");
}
};
 
WidgetSaisie.prototype.masquerPanneau = function(selecteur) {
$(selecteur).hide();
};
 
// lib hors objet --
 
/**
/trunk/widget/modules/saisie/squelettes/sauvages/js/WidgetSaisieSauvages.js
14,7 → 14,7
this.googleMapMarqueurFinUrl = null;
this.ville = null;
this.supprimerIconeUrl = null;
}
}
WidgetSaisieSauvages.prototype = new WidgetSaisie();
 
// surcharge
21,7 → 21,7
WidgetSaisieSauvages.prototype.initCarto = function() {
this.initialiserGoogleMap();
this.afficherEtapeGeolocalisation(1);
}
};
 
//surcharge
WidgetSaisieSauvages.prototype.initForm = function() {
39,7 → 39,7
}
$('#taxon-liste').on('blur', this.surChangementValeurTaxon);
$('#taxon').on('blur', this.surChangementValeurTaxon);
}
};
 
//surcharge
WidgetSaisieSauvages.prototype.initEvts = function() {
154,11 → 154,11
}
});
$('#geolocaliser').on('click', this.geolocaliser.bind(this));
}
};
 
WidgetSaisieSauvages.prototype.montrerFormIdentite = function() {
$('#zone-courriel-confirmation, #zone-prenom-nom').css('display', 'block');
}
};
 
// surcharge
WidgetSaisieSauvages.prototype.initialiserGoogleMap = function() {
214,7 → 214,7
 
// Création du Geocoder
this.geocoder = new google.maps.Geocoder();
}
};
 
// surcharge
WidgetSaisieSauvages.prototype.prechargerForm = function(data) {
254,7 → 254,7
} else if(data.hasOwnProperty("latitude") && data.hasOwnProperty("longitude")) {
this.deplacerMarkerDeb(pos);
}
}
};
 
WidgetSaisieSauvages.prototype.initialiserMarkerDeb = function() {
this.premierDeplacement = true;
278,11 → 278,11
if (this.ligneRue != undefined) {
this.ligneRue.setMap(null);
}
}
};
 
WidgetSaisieSauvages.prototype.surDeplacementMarkerDeb = function() {
this.deplacerMarkerDeb(this.markerDeb.getPosition());
}
};
 
WidgetSaisieSauvages.prototype.deplacerMarkerDeb = function(nouvellePosition) {
this.latLngDeb = nouvellePosition;
300,7 → 300,7
this.deplacerMarkerFin(nouvellePositionFin)
this.afficherEtapeGeolocalisation(3);
}
}
};
 
WidgetSaisieSauvages.prototype.initialiserMarkerFin = function() {
if (this.markerFin == undefined) {
315,7 → 315,7
} else {
this.markerFin.setMap(null);
}
}
};
 
WidgetSaisieSauvages.prototype.deplacerMarkerFin = function(nouvellePosition) {
this.latLngFin = nouvellePosition;
322,13 → 322,13
this.markerFin.setMap(this.map);
this.markerFin.setPosition(this.latLngFin);
this.dessinerLigneRue(this.latLngDeb, this.latLngFin);
}
};
 
WidgetSaisieSauvages.prototype.surDeplacementMarkerFin = function() {
this.dessinerLigneRue(this.markerDeb.getPosition(), this.markerFin.getPosition());
this.afficherCentreRue();
this.afficherEtapeGeolocalisation(4);
}
};
 
WidgetSaisieSauvages.prototype.dessinerLigneRue = function(pointDebut, pointFin) {
if (this.ligneRue != undefined) {
343,7 → 343,7
});
 
this.ligneRue.setMap(this.map);
}
};
 
WidgetSaisieSauvages.prototype.afficherCentreRue = function() {
this.latLngDeb = this.markerDeb.getPosition();
350,7 → 350,7
this.latLngFin = this.markerFin.getPosition();
this.latLngCentre = new google.maps.LatLng((this.latLngFin.lat() + this.latLngDeb.lat())/2, (this.latLngFin.lng() + this.latLngDeb.lng())/2);
this.mettreAJourStationPosition(this.latLngCentre);
}
};
 
WidgetSaisieSauvages.prototype.mettreAJourStationPosition = function(latLng) {
var lat = latLng.lat().toFixed(5),
357,12 → 357,12
lng = latLng.lng().toFixed(5);
this.remplirChampLatitude(lat);
this.remplirChampLongitude(lng);
}
};
 
WidgetSaisieSauvages.prototype.afficherEtapeGeolocalisation = function(numEtape) {
$('.liste_indication_geolocalisation').children().hide();
$('.liste_indication_geolocalisation :nth-child('+numEtape+')').show();
}
};
 
// surcharge
WidgetSaisieSauvages.prototype.geolocaliser = function(event) {
374,7 → 374,7
this.afficherEtapeGeolocalisation(2);
this.map.setZoom(16);
arreter(event);
}
};
 
WidgetSaisieSauvages.prototype.tenterGeolocalisation = function() {
if (navigator.geolocation) {
387,7 → 387,7
this.map.setZoom(16);
});
}
}
};
 
/**
* AUTO-COMPLÉTION Noms Scientifiques => OK
425,7 → 425,7
}
lthis.valeurChamp = $('#taxon').val();
});
}
};
 
WidgetSaisieSauvages.prototype.getUrlAutocompletionNomsSci = function() {
var mots = $('#taxon').val(),
432,7 → 432,7
url = this.serviceAutocompletionNomSciUrlTpl.replace('{referentiel}', this.nomSciReferentiel);
url = url.replace('{masque}', mots);
return url;
}
};
 
WidgetSaisieSauvages.prototype.traiterRetourNomsSci = function(data) {
var suggestions = [];
464,12 → 464,8
});
}
return suggestions;
}
};
 
WidgetSaisieSauvages.prototype.supprimerMiniature = function(miniature) {
miniature.parents('.miniature').remove();
}
 
// surcharge
WidgetSaisieSauvages.prototype.configurerFormValidator = function() {
$.validator.addMethod(
500,7 → 496,7
}
}
});
}
};
 
// surcharge
WidgetSaisieSauvages.prototype.definirReglesFormValidator = function() {
552,7 → 548,7
'milieu[]': 'Vous devez sélectionner au moins un milieu'
}
});
}
};
 
WidgetSaisieSauvages.prototype.validerFormulaire = function() {
var observateur = $('#form-observateur').valid(),
562,7 → 558,7
var ok = (observateur && obs && debRue && finRue) ? true : false;
//console.log('observateur:'+observateur+'-obs:'+obs+'-debRue:'+debRue+'('+latLngDeb+')-finRue:'+finRue+'('+latLngDeb+')');
return ok;
}
};
 
WidgetSaisieSauvages.prototype.surChangementTaxonListe = function() {
if ($('#taxon-liste').val() === '?') {
570,7 → 566,7
} else {
$('#taxon-input-groupe').addClass('hidden');
}
}
};
 
WidgetSaisieSauvages.prototype.surChangementValeurTaxon = function() {
var nomHorsListe = $('#taxon-liste').val() == '?' ? true : false;
583,9 → 579,9
} else {
$('#certitude-adeterminer').removeAttr('checked');
}
}
};
 
// surcharge
// surcharge @TODO fusionner
WidgetSaisieSauvages.prototype.configurerDatePicker = function(selector) {
$.datepicker.setDefaults($.datepicker.regional['fr']);
$(selector).datepicker({
601,7 → 597,7
}
});
$(selector + ' + img.ui-datepicker-trigger').appendTo(selector + '-icone.add-on');
}
};
 
// surcharge @TODO uniformiser .has-tooltip & rel="tooltip"
WidgetSaisieSauvages.prototype.basculerAffichageAide = function() {
614,7 → 610,7
$(this).removeClass('btn-success').addClass('btn-warning');
$('#btn-aide-txt', this).text("Activer l'aide");
}
}
};
 
// surcharge
WidgetSaisieSauvages.prototype.ajouterObs = function() {
775,7 → 771,7
}
}
miniatureAffichee.addClass('miniature-selectionnee').removeClass('miniature-cachee');
}
};
 
WidgetSaisieSauvages.prototype.formaterNumNomSel = function(numNomSel) {
var nn = '';
785,13 → 781,13
nn = '<span class="nn">[nn'+numNomSel+']</span>';
}
return nn;
}
};
 
// surcharge
WidgetSaisieSauvages.prototype.surChangementReferentiel = function() {
this.nomSciReferentiel = $('#referentiel').val();
$('#taxon').val('');
}
};
 
// surcharge
WidgetSaisieSauvages.prototype.stockerObsData = function() {
839,7 → 835,7
if (this.debug) {
console.log($('#liste-obs').data('obsId'+this.obsNbre));
}
}
};
 
WidgetSaisieSauvages.prototype.getObsChpEtendus = function() {
var champs = [];
866,4 → 862,4
}
});
return champs;
}
};