Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 3833 Rev 3837
Line 1... Line 1...
1
function WidgetPhotoPopup( proprietes ) {
1
function WidgetPhotoPopup( proprietes ) {
2
	if( this.valOk( proprietes ) ) {
2
	if( this.valOk( proprietes ) ) {
3
		this.urlWidget                    = proprietes.urlWidget;
3
		this.urlWidget                    = proprietes.urlWidget;
4
		this.urls                         = proprietes.urls;
4
		this.urls                         = proprietes.urls;
5
		this.infos_images                 = proprietes.infos_images;
5
		this.infosImages                  = proprietes.infosImages;
6
		this.indexPremiereImage           = proprietes.indexImage;
-
 
7
		this.indexImage                   = this.indexPremiereImage;
-
 
8
		this.urlImage                     = proprietes.urlImage;
6
		this.urlImage                     = proprietes.urlImage;
-
 
7
		this.indexPremiereImage           = proprietes.indexPremiereImage;
-
 
8
		this.indexImage                   = this.indexPremiereImage;
9
		this.tailleMax                    = proprietes.tailleMax;
9
		this.tailleMax                    = proprietes.tailleMax;
10
		this.popupUrl                     = proprietes.popupUrl;
10
		this.popupUrl                     = proprietes.popupUrl;
11
		this.urlBaseTelechargement        = proprietes.urlBaseTelechargement;
11
		this.urlBaseTelechargement        = proprietes.urlBaseTelechargement;
12
		this.urlServiceRegenererMiniature = proprietes.urlServiceRegenererMiniature;
12
		this.urlServiceRegenererMiniature = proprietes.urlServiceRegenererMiniature;
13
	}
13
	}
Line 17... Line 17...
17
 
17
 
Line 18... Line 18...
18
WidgetPhotoPopup.prototype = new WidgetPhotoCommun();
18
WidgetPhotoPopup.prototype = new WidgetPhotoCommun();
19
 
19
 
20
WidgetPhotoPopup.prototype.initTpl = function() {
20
WidgetPhotoPopup.prototype.initTpl = function() {
21
	this.redimensionnerGalerie();
-
 
22
	if( this.valOk( this.urlImage, false, 'null' ) ) {
21
	this.redimensionnerGalerie();
23
 
-
 
Line 24... Line -...
24
		this.indexImage = this.indexPremiereImage + this.urls.indexOf( this.urlImage );
-
 
25
	console.log(this.indexImage);
-
 
26
 
-
 
27
		$( '#info-img-galerie' ).find( '.active' ).removeClass( 'active' );
22
	$( '#info-img-galerie' ).find( '.active' ).removeClass( 'active' );
28
		$( '#img-cadre-' + this.indexImage + ',#indicateur-img-' + this.indexImage ).addClass( 'active' );
-
 
Line 29... Line 23...
29
 
23
	$( '#img-cadre-' + this.indexImage + ',#indicateur-img-' + this.indexImage ).addClass( 'active' );
30
		this.mettreAJourPopup();
24
 
Line 31... Line 25...
31
	}
25
	this.mettreAJourPopup();
Line 51... Line 45...
51
	this.regenererMiniature();
45
	this.regenererMiniature();
52
	this.fournirLienIdentiplante();
46
	this.fournirLienIdentiplante();
53
};
47
};
Line 54... Line 48...
54
 
48
 
55
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
49
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
56
	this.item          = this.infos_images[this.urls[this.indexImage]];
50
	this.item          = this.infosImages[this.urls[this.indexImage]];
57
	this.titreImage    = this.item['titre'];
51
	this.titreImage    = this.item['titre'];
58
	this.urlLienEflore = this.item['lien'];
52
	this.urlLienEflore = this.item['lien'];
59
	this.idImage       = this.item['id_photo'];
53
	this.idImage       = this.item['id_photo'];
60
	this.urlThisImage  = this.item['url_photo']+'.jpg';
54
	this.urlThisImage  = this.item['url_photo']+'.jpg';
Line 218... Line 212...
218
		}
212
		}
219
	});
213
	});
220
};
214
};
Line 221... Line 215...
221
 
215
 
222
WidgetPhotoPopup.prototype.defilerImage = function( sens ) {
-
 
223
	let indexDerniereImage = this.indexPremiereImage + this.urls.length;
216
WidgetPhotoPopup.prototype.defilerImage = function( sens ) {
224
	if ( 'suivant' === sens ) {
217
	if ( 'suivant' === sens ) {
225
		this.indexImage++ ;
218
		this.indexImage++ ;
226
		if( this.indexImage >= indexDerniereImage ) {
219
		if( this.indexImage >= this.urls.length ) {
227
			this.indexImage = 0;
220
			this.indexImage = 0;
228
		}
221
		}
229
	} else if ( 'precedent' === sens ) {
222
	} else if ( 'precedent' === sens ) {
230
		this.indexImage--;
223
		this.indexImage--;
231
		if( this.indexImage <= 0 ) {
224
		if( this.indexImage <= 0 ) {
232
			this.indexImage = indexDerniereImage -1;
225
			this.indexImage = this.urls.length -1;
233
		}
226
		}
234
	}
227
	}
235
	// @TODO: Modifier l'attr content de 'meta[property=og:image]' et y mettre l'url de l'image
228
	// @TODO: Modifier l'attr content de 'meta[property=og:image]' et y mettre l'url de l'image
236
	this.mettreAJourPopup();
229
	this.mettreAJourPopup();