Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 1381 Rev 1389
Line 363... Line 363...
363
	$('.nom').children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
363
	$('.nom').children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
364
	$('.plus').css('display', 'inline');
364
	$('.plus').css('display', 'inline');
365
}
365
}
Line 366... Line 366...
366
 
366
 
367
function gestionBiblio(parent) {
367
function gestionBiblio(parent) {
368
	parent.children('.nom').each(function () {
-
 
369
		html = $(this).html();
-
 
370
		posCrochetGauche = html.indexOf('[');
368
	$('.nom').each(function () {
371
		if (posCrochetGauche > 0) {
-
 
372
			nom = html.substr(0, posCrochetGauche);
-
 
373
			biblio = html.substr(posCrochetGauche, html.length);
369
		if ($(this).children('.plus').length == 0) {
Line 374... Line 370...
374
			$(this).html(nom);
370
			html = $(this).html();
375
			
371
			
-
 
372
			// La partie biblio commence au premier crochet ouvrant
376
			imagettePlus = document.createElement('div');
373
			// ou bien au span de la biblio à exclure
-
 
374
			posCrochetGauche = html.indexOf('[');
-
 
375
			if(posCrochetGauche < 0) {
Line -... Line 376...
-
 
376
				posCrochetGauche = html.indexOf('<span class="bib_excl">');
-
 
377
			}
-
 
378
			
-
 
379
			if (posCrochetGauche > 0) {
-
 
380
				nom = html.substr(0, posCrochetGauche);
-
 
381
				biblio = html.substr(posCrochetGauche, html.length);
-
 
382
				$(this).html(nom);
-
 
383
				
-
 
384
				imagettePlus = document.createElement('div');
377
			$(imagettePlus).addClass('imagettePlus');
385
				$(imagettePlus).addClass('imagettePlus');
378
			$(this).prepend($(imagettePlus));
386
				$(this).prepend($(imagettePlus));
379
			
387
				
380
			plus = document.createElement('span');
388
				plus = document.createElement('span');
381
			$(plus).addClass('plus');
389
				$(plus).addClass('plus');
382
			$(plus).html(biblio);
390
				$(plus).html(biblio);
-
 
391
				$(plus).hide();
-
 
392
				
-
 
393
				$(this).click(function(e) {
383
			$(plus).hide();
394
					// test pour ne réagir que sur le clic sur le + ou -
384
			
395
					// TODO: fusionner ce bout de code en doublon avec synthese.js
385
			$(this).click(function() {
396
					if($(e.target).hasClass("imagettePlus") || $(e.target).hasClass("imagetteMoins")) {
386
				if (!$(this).children('.plus').is(':visible')) {
397
						if (!$(this).children('.plus').is(':visible')) {
387
					$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
398
							$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
388
					$(this).children('.plus').css('display', 'inline');
399
							$(this).children('.plus').css('display', 'inline');
-
 
400
						} else {
389
				} else {
401
							$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
-
 
402
							$(this).children('.plus').css('display', 'none');
390
					$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
403
						}
-
 
404
					}
391
					$(this).children('.plus').css('display', 'none');
405
					
-
 
406
				});
-
 
407
					
392
				}
408
				$(this).append($(plus));
393
			});				
409
				
394
			$(this).append($(plus));		
410
			}
Line 395... Line 411...
395
		}
411
		}