1,60 → 1,60 |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// PARAMÊTRES et CONSTANTES |
// Mettre à true pour afficher les messages de débogage |
var DEBUG = false; |
/** |
* Indication de certaines variables ajoutée par php |
* Indication de certaines variables ajoutée par php |
* var communeImageUrl ; |
* var pointImageUrl ; |
* var groupeImageUrlTpl ; |
*/ |
var pointsOrigine = null; |
var boundsOrigine = null; |
var markerClusterer = null; |
var map = null; |
var infoBulle = new google.maps.InfoWindow(); |
var stations = null; |
var pointClique = null; |
var carteCentre = new google.maps.LatLng(25, 10); |
var carteOptions = { |
zoom: 3, |
center:carteCentre, |
mapTypeId: google.maps.MapTypeId.ROADMAP, |
mapTypeControlOptions: { |
mapTypeIds: ['OSM', |
google.maps.MapTypeId.ROADMAP, |
google.maps.MapTypeId.HYBRID, |
google.maps.MapTypeId.SATELLITE, |
google.maps.MapTypeId.TERRAIN] |
var DEBUG = false,// Mettre à true pour afficher les messages de débogage |
pointsOrigine = null, |
boundsOrigine = null, |
markerClusterer = null, |
map = null, |
infoBulle = new google.maps.InfoWindow(), |
stations = null, |
pointClique = null, |
carteCentre = new google.maps.LatLng(25, 10), |
carteOptions = { |
zoom: 3, |
center:carteCentre, |
mapTypeId: google.maps.MapTypeId.ROADMAP, |
mapTypeControlOptions: { |
mapTypeIds: ['OSM', |
google.maps.MapTypeId.ROADMAP, |
google.maps.MapTypeId.HYBRID, |
google.maps.MapTypeId.SATELLITE, |
google.maps.MapTypeId.TERRAIN] |
}, |
zoomControlOptions: { |
style: google.maps.ZoomControlStyle.LARGE, |
position: google.maps.ControlPosition.LEFT_CENTER |
}, |
panControl: false |
}, |
zoomControlOptions: { |
style: google.maps.ZoomControlStyle.LARGE, |
position: google.maps.ControlPosition.LEFT_CENTER |
}, |
panControl: false |
}; |
var osmMapType = new google.maps.ImageMapType({ |
getTileUrl: function(coord, zoom) { |
return "http://tile.openstreetmap.org/" + |
zoom + "/" + coord.x + "/" + coord.y + ".png"; |
}, |
tileSize: new google.maps.Size(256, 256), |
isPng: true, |
alt: "OpenStreetMap", |
name: "OSM", |
maxZoom: 19 |
}); |
var ctaLayer = null; |
var pagineur = {'limite':300, 'start':0, 'total':0, 'stationId':null, 'format':'tableau'}; |
var station = {'commune':'', 'obsNbre':0}; |
var obsStation = new Array(); |
var obsPage = new Array(); |
var taxonsCarte = new Array(); |
var mgr = null; |
var marqueursCache = new Array(); |
var zonesCache = new Array(); |
var requeteChargementPoints; |
var urlVars = null; |
osmMapType = new google.maps.ImageMapType({ |
getTileUrl: function(coord, zoom) { |
return "http://tile.openstreetmap.org/" + |
zoom + "/" + coord.x + "/" + coord.y + ".png"; |
}, |
tileSize: new google.maps.Size(256, 256), |
isPng: true, |
alt: "OpenStreetMap", |
name: "OSM", |
maxZoom: 19 |
}), |
ctaLayer = null, |
pagineur = {'limite':300, 'start':0, 'total':0, 'stationId':null, 'format':'tableau'}, |
station = {'commune':'', 'obsNbre':0}, |
obsStation = new Array(), |
obsPage = new Array(), |
taxonsCarte = new Array(), |
mgr = null, |
marqueursCache = new Array(), |
zonesCache = new Array(), |
requeteChargementPoints, |
urlVars = null; |
|
/*+--------------------------------------------------------------------------------------------------------+*/ |
// INITIALISATION DU CODE |
|
78,19 → 78,17 |
attribuerListenerCarte(); |
} |
|
function getUrlVars() |
{ |
var vars = [], hash; |
if(window.location.href.indexOf('?') != -1) { |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
for(var i = 0; i < hashes.length; i++) |
{ |
hash = hashes[i].split('='); |
vars.push(hash[0]); |
vars[hash[0]] = hash[1]; |
} |
} |
return vars; |
function getUrlVars() { |
var vars = [], hash; |
if (window.location.href.indexOf('?') != -1) { |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
for (var i = 0; i < hashes.length; i++) { |
hash = hashes[i].split('='); |
vars.push(hash[0]); |
vars[hash[0]] = hash[1]; |
} |
} |
return vars; |
} |
|
/*+--------------------------------------------------------------------------------------------------------+*/ |
105,8 → 103,8 |
} |
var plteNbre = taxonsCarte.length; |
var plteNbreFormate = plteNbre; |
if(plteNbre != 0) { |
plteNbreFormate = taxonsCarte.length.formaterNombre(); |
if (plteNbre != 0) { |
plteNbreFormate = taxonsCarte.length.formaterNombre(); |
} |
var communeNbre = stations.stats.communes; |
var communeNbreFormate = communeNbre; |
122,7 → 120,7 |
var stats = obsNbreFormate+' observation'; |
stats += (obsNbre > 1) ? 's' : '' ; |
|
if(photos != null && photos == 1) { |
if (photos != null && photos == 1) { |
stats += ' avec photos '; |
} |
|
136,8 → 134,8 |
if($('.taxon-actif .taxon').text() != '') { |
var element = $('.taxon-actif .taxon').clone(); |
element.children().remove(); |
var taxon = element.text(); |
stats += ' pour '+taxon; |
var taxon = element.text(); |
stats += ' pour '+taxon; |
} else { |
if (taxonsCarte[0]) { |
var taxon = taxonsCarte[0]; |
160,7 → 158,6 |
} |
|
function attribuerListenersOverlay() { |
|
$(window).resize(function() { |
dimensionnerCarte(); |
definirTailleOverlay(); |
182,12 → 179,12 |
|
var tailleMaxFiltreUtilisateur; |
function definirTailleOverlay() { |
var largeurViewPort = $(window).width(); |
var taille = '1.6'; |
var tailleMaxLogo = 60; |
var tailleMaxIcones = 10; |
var padding_icones = 8; |
var tailleFiltre = 80; |
var largeurViewPort = $(window).width(), |
taille = '1.6', |
tailleMaxLogo = 60, |
tailleMaxIcones = 10, |
padding_icones = 8, |
tailleFiltre = 80; |
tailleMaxFiltreUtilisateur = 350; |
$('#raz-filtre-utilisateur').css('display', 'block'); |
if (largeurViewPort <= 450) { |
259,13 → 256,13 |
hauteurLogo = $('.image-logo').height(); |
// Redimensionnement du logo s'il est trop grand |
// on perd en qualité mais ça vaut mieux que de casser l'affichage |
if(hauteurLogo > tailleMaxLogo) { |
if (hauteurLogo > tailleMaxLogo) { |
hauteurLogo = tailleMaxLogo; |
$('.image-logo').css("top", "5px"); |
$('.image-logo').height(tailleMaxLogo); |
} |
|
if(hauteurLogo == 0) { |
if (hauteurLogo == 0) { |
$('.image-logo').load(function(event) { |
definirTailleOverlay(); |
}); |
277,7 → 274,7 |
|
function dimensionnerImage(largeurViewPort) { |
// Dimensionnement de l'image |
if(largeurViewPort > 500) { |
if (largeurViewPort > 500) { |
largeurLogo = 155; |
} else { |
largeurLogo = 70; |
293,7 → 290,7 |
carteOptions.mapTypeControlOptions.style = google.maps.MapTypeControlStyle.DEFAULT; |
} |
|
if(map != null) { |
if (map != null) { |
map.setOptions(carteOptions); |
} |
} |
304,12 → 301,13 |
} |
|
function centrerTitre() { |
var largeurViewPort = $(window).width(); |
var largeurTitre = $('#zone-titre').width(); |
var marge = (largeurViewPort - largeurTitre)/2; |
var largeurViewPort = $(window).width(), |
largeurTitre = $('#zone-titre').width(), |
marge = (largeurViewPort - largeurTitre)/2; |
$('#zone-titre').css("margin-left",marge); |
|
var tailleRestante = largeurViewPort - (marge + largeurTitre); |
if(tailleRestante <= 170) { |
if (tailleRestante <= 170) { |
$('#zone-titre').css("top", "25px"); |
} else { |
$('#zone-titre').css("top", "5px"); |
317,9 → 315,9 |
} |
|
function centrerStats() { |
var largeurViewPort = $(window).width(); |
var largeurStats = $('#zone-stats').width(); |
var marge = ((largeurViewPort - largeurStats)/2); |
var largeurViewPort = $(window).width(), |
largeurStats = $('#zone-stats').width(), |
marge = ((largeurViewPort - largeurStats)/2); |
$('#zone-stats').css("margin-left",marge); |
} |
|
353,8 → 351,9 |
} |
} |
|
var listener = null; |
var timer = null; |
var listener = null, |
timer = null; |
|
function attribuerListenerCarte() { |
listener = google.maps.event.addListener(map, 'bounds_changed', function(){ |
programmerRafraichissementCarte(); |
363,29 → 362,30 |
programmerRafraichissementCarte(); |
}); |
} |
|
function programmerRafraichissementCarte() { |
if(timer != null) { |
window.clearTimeout(timer); |
} |
if(requeteChargementPoints != null) { |
if (timer != null) { |
window.clearTimeout(timer); |
} |
if (requeteChargementPoints != null) { |
requeteChargementPoints.abort(); |
} |
timer = window.setTimeout(function() { |
if(map.getBounds() != undefined) { |
var zoom = map.getZoom(); |
var lngNE = map.getBounds().getNorthEast().lng(); |
var lngSW = map.getBounds().getSouthWest().lng() |
if(map.getBounds().getNorthEast().lng() < map.getBounds().getSouthWest().lng()) { |
if (map.getBounds() != undefined) { |
var zoom = map.getZoom(), |
lngNE = map.getBounds().getNorthEast().lng(), |
lngSW = map.getBounds().getSouthWest().lng() |
if (map.getBounds().getNorthEast().lng() < map.getBounds().getSouthWest().lng()) { |
lngNE = 176; |
lngSW = -156; |
} |
var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(lngNE); |
var SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(lngSW); |
var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(lngNE), |
SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(lngSW); |
chargerMarqueurs(zoom, NELatLng, SWLatLng); |
} else { |
programmerRafraichissementCarte(); |
} |
}, 400); |
}, 400); |
} |
|
var marqueurs = new Array(); |
396,11 → 396,11 |
'&ne='+NELatLng+ |
'&sw='+SWLatLng; |
|
if(infoBulleOuverte) { |
if (infoBulleOuverte) { |
return; |
} |
|
if(requeteChargementPoints != null) { |
if (requeteChargementPoints != null) { |
requeteChargementPoints.abort(); |
cacherMessageChargementPoints(); |
} |
413,11 → 413,11 |
} |
|
function centrerDansLaPage(selecteur) { |
var largeurViewport = $(window).width(); |
var hauteurViewport = $(window).height(); |
var largeurViewport = $(window).width(), |
hauteurViewport = $(window).height(); |
selecteur.css('display','block'); |
var left = (largeurViewport/2) - (selecteur.width())/2; |
var top = (hauteurViewport/2) - (selecteur.height())/2 |
var left = (largeurViewport/2) - (selecteur.width())/2, |
top = (hauteurViewport/2) - (selecteur.height())/2 |
selecteur.css('left',left); |
selecteur.css('top',top); |
} |
447,7 → 447,6 |
} |
|
function rafraichirMarqueurs(data) { |
|
$.each(marqueurs, function(index, marqueur) { |
marqueur.setMap(null); |
}); |
455,9 → 454,8 |
marqueurs = new Array(); |
stations = null; |
|
if(data.points.length > 0) { |
if (data.points.length > 0) { |
marqueurs = new Array(); |
|
stations = data; |
|
$.each(stations.points, function (index, station) { |
467,11 → 465,11 |
} |
}); |
|
if(doitCentrerCarte()) { |
if (doitCentrerCarte()) { |
premierChargement = false; |
var bounds = new google.maps.LatLngBounds(); |
var latMax = new google.maps.LatLng(data.stats.coordmax.latMax, data.stats.coordmax.lngMax); |
var latMin = new google.maps.LatLng(data.stats.coordmax.latMin, data.stats.coordmax.lngMin); |
var bounds = new google.maps.LatLngBounds(), |
latMax = new google.maps.LatLng(data.stats.coordmax.latMax, data.stats.coordmax.lngMax), |
latMin = new google.maps.LatLng(data.stats.coordmax.latMin, data.stats.coordmax.lngMin); |
bounds.extend(latMax); |
bounds.extend(latMin); |
rendrePointsVisibles(bounds); |
483,7 → 481,7 |
|
function creerMarqueur(station) { |
var titre = ''; |
if(station.nbreMarqueur) { |
if (station.nbreMarqueur) { |
titre = station.nbreMarqueur+' points renseignés'; |
} else { |
if(station.nom) { |
491,18 → 489,18 |
} |
} |
|
var icone = attribuerImageMarqueur(station['id'], station['nbreMarqueur']); |
var latLng = new google.maps.LatLng(station['lat'], station['lng']); |
var marqueur = new google.maps.Marker({ |
position: latLng, |
icon: icone, |
title: ''+titre, |
map: map, |
stationInfos: station |
}); |
var icone = attribuerImageMarqueur(station['id'], station['nbreMarqueur']), |
latLng = new google.maps.LatLng(station['lat'], station['lng']), |
marqueur = new google.maps.Marker({ |
position: latLng, |
icon: icone, |
title: ''+titre, |
map: map, |
stationInfos: station |
}); |
attribuerListenerClick(marqueur, station['id']); |
marqueur.setMap(map); |
return marqueur; |
return marqueur; |
} |
|
function rendrePointsVisibles(bounds) { |
517,9 → 515,9 |
} else if (etreMarqueurStation(id)) { |
marqueurImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(16, 16)); |
} else if (etreMarqueurGroupe(id)) { |
var type = 0; |
var largeur = 0; |
var hauteur = 0; |
var type = 0, |
largeur = 0, |
hauteur = 0; |
if (nbreMarqueur != null) { |
if (nbreMarqueur >= 2 && nbreMarqueur < 100 ) { |
type = '1'; |
561,19 → 559,19 |
var pointCentreAvantAffichageInfoBulle = null; |
function surClickMarqueur(event) { |
pointCentreAvantAffichageInfoBulle = map.getCenter(); |
|
|
if(infoBulleOuverte) { |
infoBulle.close(); |
infoBulle.close(); |
} |
|
|
pointClique = this; |
infoBulle.open(map, this); |
actualiserPagineur(); |
|
var limites = map.getBounds(); |
var centre = limites.getCenter(); |
var nordEst = limites.getNorthEast(); |
var centreSudLatLng = new google.maps.LatLng(nordEst.lat(), centre.lng()); |
|
var limites = map.getBounds(), |
centre = limites.getCenter(), |
nordEst = limites.getNorthEast(), |
centreSudLatLng = new google.maps.LatLng(nordEst.lat(), centre.lng()); |
map.panTo(centreSudLatLng); |
|
afficherInfoBulle(); |
587,8 → 585,8 |
} |
|
function etreMarqueurGroupe(id) { |
var groupe = false; |
var motif = /^GROUPE/; |
var groupe = false, |
motif = /^GROUPE/; |
if (motif.test(id)) { |
groupe = true; |
} |
596,8 → 594,8 |
} |
|
function etreMarqueurCommune(id) { |
var commune = false; |
var motif = /^COMMUNE:/; |
var commune = false, |
motif = /^COMMUNE:/; |
if (motif.test(id)) { |
commune = true; |
} |
605,8 → 603,8 |
} |
|
function etreMarqueurStation(id) { |
var station = false; |
var motif = /^STATION:/; |
var station = false, |
motif = /^STATION:/; |
if (motif.test(id)) { |
station = true; |
} |
642,21 → 640,20 |
} |
|
function centrerInfoBulle() { |
var limites = map.getBounds(); |
var centre = limites.getCenter(); |
var nordEst = limites.getNorthEast(); |
var centreSudLatLng = new google.maps.LatLng(nordEst.lat(), centre.lng()); |
var limites = map.getBounds(), |
centre = limites.getCenter(), |
nordEst = limites.getNorthEast(), |
centreSudLatLng = new google.maps.LatLng(nordEst.lat(), centre.lng()); |
map.panTo(centreSudLatLng); |
} |
|
function afficherInfoBulle() { |
var obsHtml = $("#tpl-obs").html(); |
var largeur = definirLargeurInfoBulle(); |
var taillePolice = definirTaillePoliceInfoBulle(); |
var obsHtml = $('#tpl-obs').html(), |
largeur = definirLargeurInfoBulle(), |
taillePolice = definirTaillePoliceInfoBulle(); |
obsHtml = obsHtml.replace(/\{largeur\}/, largeur); |
obsHtml = mettreAJourUrlSaisie(obsHtml); |
infoBulle.setContent(obsHtml); |
$('#observations').css('font-size',taillePolice+'em'); |
$('#observations').css('font-size', taillePolice + 'em'); |
chargerObs(0, 0); |
infoBulleOuverte = true; |
} |
664,9 → 661,9 |
//TODO utiliser cette fonction lors des remplacements de |
//paramètres url sur changement de filtre |
function parserFiltre(filtre) { |
var nvpair = {}; |
var qs = filtre.replace('?', ''); |
var pairs = qs.split('&'); |
var nvpair = {}, |
qs = filtre.replace('?', ''), |
pairs = qs.split('&'); |
$.each(pairs, function(i, v){ |
var pair = v.split('='); |
nvpair[pair[0]] = pair[1]; |
674,26 → 671,30 |
return nvpair; |
} |
|
function mettreAJourUrlSaisie(obsHtml) { |
var filtreTableau = parserFiltre(filtreCommun); |
var filtresGardes = new Array(); |
filtre = ''; |
for(i in filtreTableau) { |
if(filtreTableau[i] != undefined && filtreTableau[i] != '' && decodeURIComponent(filtreTableau[i]) != '*') { |
console.log(i+" "+filtreTableau[i]); |
filtresGardes.push(i+'='+filtreTableau[i]); |
function mettreAJourUrlSaisie(obs) { |
if (obs.observations.length > 0) { |
var filtreTableau = parserFiltre(filtreCommun), |
filtresGardes = new Array() |
idObs = obs.observations[0].idObs; |
filtre = ''; |
for (i in filtreTableau) { |
if (filtreTableau[i] != undefined && filtreTableau[i] != '' && decodeURIComponent(filtreTableau[i]) != '*') { |
console.log(i + ' ' + filtreTableau[i]); |
filtresGardes.push(i + '=' + filtreTableau[i]); |
} |
} |
filtresGardes.push('id-obs=' + idObs); |
if (filtresGardes.length > 0) { |
filtre = '?' + filtresGardes.join('&'); |
} |
var urlAvecFiltre = urlWidgetSaisie + filtre; |
$('.lien-widget-saisie').attr('href', urlAvecFiltre).parents('.conteneur-lien-saisie').show(); |
} |
if(filtresGardes.length > 0) { |
filtre = '?'+filtresGardes.join('&'); |
} |
obsHtml = obsHtml.replace(/\{parametres-lien-saisie\}/, filtre); |
return obsHtml; |
} |
|
function definirLargeurInfoBulle() { |
var largeurViewPort = $(window).width(); |
var largeurInfoBulle = null; |
var largeurViewPort = $(window).width(), |
largeurInfoBulle = null; |
if (largeurViewPort < 400) { |
largeurInfoBulle = 300; |
} else if (largeurViewPort < 800) { |
707,8 → 708,8 |
} |
|
function definirTaillePoliceInfoBulle() { |
var largeurViewPort = $(window).width(); |
var taillePolice = null; |
var largeurViewPort = $(window).width(), |
taillePolice = null; |
if (largeurViewPort < 400) { |
taillePolice = 0.8; |
} else if (largeurViewPort < 800) { |
775,7 → 776,9 |
if (depart == 0) { |
actualiserInfosStation(observations); |
creerTitreInfoBulle(); |
surClicPagePagination(0, null); |
surClicPagePagination(0, null); |
console.log(observations); |
mettreAJourUrlSaisie(observations); |
} |
|
afficherPagination(); |
789,8 → 792,8 |
} |
|
function creerTitreInfoBulle() { |
$("#obs-total").text(station.obsNbre); |
$("#obs-commune").text(station.commune); |
$('#obs-total').text(station.obsNbre); |
$('#obs-commune').text(station.commune); |
var titre = ''; |
titre += pointClique.stationInfos.obsNbre+' observation'; |
titre += (pointClique.stationInfos.obsNbre > 1) ? 's': '' ; |
801,7 → 804,7 |
nomStation = 'la station : '; |
} |
titre += pointClique.stationInfos.nom; |
$("#obs-station-titre").text(titre); |
$('#obs-station-titre').text(titre); |
} |
|
function actualiserPagineur() { |
817,7 → 820,7 |
} |
|
function afficherPagination(observations) { |
$(".navigation").pagination(pagineur.total, { |
$('.navigation').pagination(pagineur.total, { |
items_per_page:pagineur.limite, |
callback:surClicPagePagination, |
next_text:'Suivant', |
830,29 → 833,29 |
} |
|
function surClicPagePagination(pageIndex, paginationConteneur) { |
var index = pageIndex * pagineur.limite; |
var indexMax = index + pagineur.limite; |
var index = pageIndex * pagineur.limite, |
indexMax = index + pagineur.limite; |
pagineur.depart = index; |
obsPage = new Array(); |
for(index; index < indexMax; index++) { |
obsPage.push(obsStation[index]); |
} |
|
supprimerMessageChargement(); |
mettreAJourObservations(); |
for (index; index < indexMax; index++) { |
obsPage.push(obsStation[index]); |
} |
|
supprimerMessageChargement(); |
mettreAJourObservations(); |
return false; |
} |
|
function mettreAJourObservations() { |
$("#obs-"+pagineur.format+"-lignes").empty(); |
$("#obs-vue-"+pagineur.format).css('display', 'block'); |
$(".obs-conteneur").css('counter-reset', 'item '+pagineur.depart); |
$("#tpl-obs-"+pagineur.format).tmpl(obsPage).appendTo("#obs-"+pagineur.format+"-lignes"); |
$('#obs-'+pagineur.format+'-lignes').empty(); |
$('#obs-vue-'+pagineur.format).css('display', 'block'); |
$('.obs-conteneur').css('counter-reset', 'item '+pagineur.depart); |
$('#tpl-obs-'+pagineur.format).tmpl(obsPage).appendTo('#obs-'+pagineur.format+'-lignes'); |
|
// Actualisation de Fancybox |
ajouterFormulaireContact("a.contact"); |
ajouterFormulaireContact('a.contact'); |
if (pagineur.format == 'liste') { |
ajouterGaleriePhoto("a.cel-img"); |
ajouterGaleriePhoto('a.cel-img'); |
} |
} |
|
860,14 → 863,14 |
afficherMessageChargement('#observations'); |
cacherContenuOnglets(); |
afficherOnglets(); |
ajouterTableauTriable("#obs-tableau"); |
ajouterTableauTriable('#obs-tableau'); |
afficherTextStationId(); |
corrigerLargeurInfoWindow(); |
} |
|
function cacherContenuOnglets() { |
$("#obs-vue-tableau").css("display", "none"); |
$("#obs-vue-liste").css("display", "none"); |
$('#obs-vue-tableau').css('display', 'none'); |
$('#obs-vue-liste').css('display', 'none'); |
} |
|
function afficherOnglets() { |
931,11 → 934,11 |
type: 'numeric' |
}); |
$(element).tablesorter({ |
headers: { |
headers: { |
1: { |
sorter:'date_cel' |
} |
} |
sorter: 'date_cel' |
} |
} |
}); |
} |
|
945,23 → 948,23 |
|
function ajouterGaleriePhoto(element) { |
$(element).fancybox({ |
transitionIn:'elastic', |
transitionOut:'elastic', |
speedIn :600, |
speedOut:200, |
overlayShow:true, |
titleShow:true, |
titlePosition:'inside', |
titleFormat:function (titre, currentArray, currentIndex, currentOpts) { |
transitionIn: 'elastic', |
transitionOut: 'elastic', |
speedIn: 600, |
speedOut: 200, |
overlayShow: true, |
titleShow: true, |
titlePosition: 'inside', |
titleFormat: function (titre, currentArray, currentIndex, currentOpts) { |
var motif = /urn:lsid:tela-botanica[.]org:cel:img([0-9]+)$/; |
motif.exec(titre); |
var id = RegExp.$1; |
var info = $('#cel-info-'+id).clone().html(); |
var tpl = |
'<div class="cel-legende">'+ |
'<p class="cel-legende-vei">'+'Image n°' + (currentIndex + 1) + ' sur ' + currentArray.length +'<\/p>'+ |
(titre && titre.length ? '<p>'+info+'<\/p>' : '' )+ |
'<\/div>'; |
var id = RegExp.$1, |
info = $('#cel-info-'+id).clone().html(), |
tpl = |
'<div class="cel-legende">'+ |
'<p class="cel-legende-vei">'+'Image n°' + (currentIndex + 1) + ' sur ' + currentArray.length +'<\/p>'+ |
(titre && titre.length ? '<p>'+info+'<\/p>' : '' )+ |
'<\/div>'; |
return tpl; |
} |
}).live('click', function(e) { |
1144,7 → 1147,6 |
} |
|
function attribuerListenersFiltreUtilisateur() { |
|
$('#valider-filtre-utilisateur').click(function() { |
var utilisateur = $('#filtre-utilisateur').val(); |
filtrerParUtilisateur(utilisateur); |
1152,11 → 1154,11 |
}); |
|
$('#filtre-utilisateur').keypress(function(e) { |
if(e.which == 13) { |
var utilisateur = $('#filtre-utilisateur').val(); |
if (e.which == 13) { |
var utilisateur = $('#filtre-utilisateur').val(); |
filtrerParUtilisateur(utilisateur); |
$('#raz-filtre-utilisateur').show(); |
} |
} |
}); |
|
$('#raz-filtre-utilisateur').click(function() { |
1169,7 → 1171,7 |
$('#lien-affichage-filtre-utilisateur').click(function() { |
afficherCacherFiltreUtilisateur(); |
}); |
|
|
$('#raz-filtre-utilisateur').hide(); |
$('#formulaire-filtre-utilisateur').hide(); |
} |
1177,7 → 1179,7 |
function afficherCacherFiltreUtilisateur() { |
$('#formulaire-filtre-utilisateur').slideToggle(); |
$('#conteneur-filtre-utilisateur').toggleClass('ferme'); |
if(!$('#conteneur-filtre-utilisateur').hasClass('ferme')) { |
if (!$('#conteneur-filtre-utilisateur').hasClass('ferme')) { |
$('#conteneur-filtre-utilisateur').width(tailleMaxFiltreUtilisateur); |
} else { |
$('#conteneur-filtre-utilisateur').width('auto'); |
1185,12 → 1187,12 |
} |
|
function filtrerParUtilisateur(utilisateurFiltre) { |
if(utilisateurFiltre == '') { |
if (utilisateurFiltre == '') { |
utilisateurFiltre = '*'; |
} |
utilisateur = utilisateurFiltre; |
var pattern = /utilisateur=[^&]*/i; |
var utilisateurCourant = pattern.exec(stationsUrl); |
var pattern = /utilisateur=[^&]*/i, |
utilisateurCourant = pattern.exec(stationsUrl); |
stationsUrl = stationsUrl.replace(utilisateurCourant, "utilisateur="+utilisateurFiltre); |
taxonsUrl = taxonsUrl.replace(utilisateurCourant, "utilisateur="+utilisateurFiltre); |
observationsUrl = observationsUrl.replace(utilisateurCourant, "utilisateur="+utilisateurFiltre); |
1214,8 → 1216,8 |
//console.log(urlTax); |
$.getJSON(urlTax, function(infos) { |
nbTaxons += infos.taxons.length; |
$(".plantes-nbre").text(nbTaxons); |
$("#tpl-taxons-liste").tmpl({'taxons':infos.taxons}).appendTo("#taxons"); |
$('.plantes-nbre').text(nbTaxons); |
$('#tpl-taxons-liste').tmpl({'taxons': infos.taxons}).appendTo('#taxons'); |
taxonsCarte = taxonsCarte.concat(infos.taxons); |
//console.log("Nbre taxons :"+taxonsCarte.length); |
chargerTaxons(depart+limite, infos.total); |
1249,8 → 1251,8 |
}; |
|
function cacherPanneauLateral() { |
$('#panneau-lateral').height(25+"px"); |
$('#panneau-lateral').width(largeurPanneauLateralFerme+"px"); |
$('#panneau-lateral').height(25 + 'px'); |
$('#panneau-lateral').width(largeurPanneauLateralFerme + 'px'); |
$('#pl-contenu').css('display', 'none'); |
$('#pl-ouverture').css('display', 'block'); |
$('#pl-fermeture').css('display', 'none'); |
1386,7 → 1388,7 |
|
if (_sNombre.indexOf('.') == -1) { |
for (i = 0; i < decimales; i++) { |
_sDecimales += "0"; |
_sDecimales += '0'; |
} |
_sRetour = separeMilliers(_sNombre) + signe + _sDecimales; |
} else { |
1408,10 → 1410,10 |
var msg = ''; |
if (objet != null) { |
$.each(objet, function (cle, valeur) { |
msg += cle+":"+valeur + "\n"; |
msg += cle+':'+valeur + "\n"; |
}); |
} else { |
msg = "La variable vaut null."; |
msg = 'La variable vaut null.'; |
} |
console.log(msg); |
} |