Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 475 | Rev 485 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 475 Rev 480
Line 1... Line -...
1
 
-
 
-
 
1
//+----------------------------------------------------------------------------------------------------------+
-
 
2
// Onglets et Portlets
2
/**
3
/**
3
 * Les variables suivantes ont été ajoutée par php
4
 * Les variables suivantes ont été ajoutée par php
4
 * 
5
 * 
5
 * var urlTexteBrutSectionWikiTpl : url pour obtenir le texte brut d'une section de wiki
6
 * var urlTexteBrutSectionWikiTpl : url pour obtenir le texte brut d'une section de wiki
6
 * var urlEditionSectionWikiTpl : url pour éditer une section du wiki 
7
 * var urlEditionSectionWikiTpl : url pour éditer une section du wiki 
Line 13... Line 14...
13
 * Variables globales du script
14
 * Variables globales du script
14
 */
15
 */
15
var modules = Array();
16
var modules = Array();
16
var tableauOnglets = Array();
17
var tableauOnglets = Array();
17
var nbOngletsInvisibles = 0;
18
var nbOngletsInvisibles = 0;
-
 
19
var ongletSyntheseCharge = true;
Line 18... Line 20...
18
	
20
 
19
/** Classe Module
21
/** Classe Module
20
* Définit un module de type portlet
22
* Définit un module de type portlet
21
**/
23
**/
Line 198... Line 200...
198
	// Suppression des classes css qui mettent en surbrillance l'onglet actif sur l'onglet acceuil
200
	// Suppression des classes css qui mettent en surbrillance l'onglet actif sur l'onglet acceuil
199
	$('#onglet_synthese').removeClass('ui-tabs-selected');
201
	$('#onglet_synthese').removeClass('ui-tabs-selected');
200
	$('#onglet_synthese').removeClass('ui-state-active'); 
202
	$('#onglet_synthese').removeClass('ui-state-active'); 
201
}
203
}
Line 202... Line 204...
202
 
204
 
203
function getUrlVars()
-
 
204
{
205
function getUrlVars() {
205
    var vars = [], hash;
206
    var vars = [], hash;
206
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
207
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
207
    for(var i = 0; i < hashes.length; i++)
-
 
208
    {
208
    for (var i = 0; i < hashes.length; i++) {
209
        hash = hashes[i].split('=');
209
        hash = hashes[i].split('=');
210
        vars.push(hash[0]);
210
        vars.push(hash[0]);
211
        vars[hash[0]] = hash[1];
211
        vars[hash[0]] = hash[1];
212
    }
212
    }
213
    return vars;
213
    return vars;
Line 214... Line -...
214
}
-
 
215
 
214
}
216
var ongletSyntheseCharge = true;
-
 
217
function selectionnerOngletParDefautOuEnregistre() {
215
 
218
	
216
function selectionnerOngletParDefautOuEnregistre() {
219
	// Si un onglet est précisé dans l'url
217
	// Si un onglet est précisé dans l'url
220
	// Récupération de l'adresse de l'onglet sélectionné
218
	// Récupération de l'adresse de l'onglet sélectionné
221
	var urlVars = getUrlVars();
219
	var urlVars = getUrlVars();
Line 302... Line 300...
302
					window.location = url;
300
					window.location = url;
303
				}
301
				}
304
			}
302
			}
305
		}
303
		}
306
	}
304
	}
307
 
-
 
308
	return true;
305
	return true;
309
}
306
}
Line 310... Line 307...
310
 
307
 
311
function obtenirOngletCookiePourPage() {
-
 
312
	
308
function obtenirOngletCookiePourPage() {
313
	var urlVars = getUrlVars();
309
	var urlVars = getUrlVars();
314
	var id_cookie = 'onglet_eflore';
310
	var id_cookie = 'onglet_eflore';
315
	if(urlVars['num_nom']) {
311
	if (urlVars['num_nom']) {
316
		id_cookie += '_'+urlVars['num_nom'];
312
		id_cookie += '_'+urlVars['num_nom'];
317
	}
-
 
318
	
313
	}	
319
	return $.cookie(id_cookie) ? $.cookie(id_cookie) : null;
314
	return $.cookie(id_cookie) ? $.cookie(id_cookie) : null;
Line 320... Line 315...
320
}
315
}
321
 
316
 
Line 398... Line 393...
398
			parent.find('.lien-onglet-synthese').click();
393
			parent.find('.lien-onglet-synthese').click();
399
		}
394
		}
400
	});
395
	});
401
}
396
}
Line -... Line 397...
-
 
397
 
-
 
398
//+----------------------------------------------------------------------------------------------------------+
-
 
399
// Wikini Flora
-
 
400
var htmlWikiOriginal = '';
-
 
401
var objetContenuWiki = null;
402
 
402
 
403
function getTemplateFormulaireEditionWiki(page, section, texte) {	
403
function getTemplateFormulaireEditionWiki(page, section, texte) {	
404
	var urlWebServiceWiki = getUrlEditionPourPageEtSection(page, section);
404
	var urlWebServiceWiki = getUrlEditionPourPageEtSection(page, section);
405
	var formulaire = 
405
	var formulaire = 
406
		'<form method="post" id="formulaire_edition_wiki" name="formulaire_edition_wiki" action="'+urlWebServiceWiki+'">'+
406
		'<form method="post" id="formulaire_edition_wiki" name="formulaire_edition_wiki" action="'+urlWebServiceWiki+'">'+
Line 412... Line 412...
412
	  	  '<input class="bouton_annuler_edition" type="button" value="annuler" />';
412
	  	  '<input class="bouton_annuler_edition" type="button" value="annuler" />';
413
		'</form>';		
413
		'</form>';		
414
	return formulaire;
414
	return formulaire;
415
}
415
}
Line 416... Line -...
416
 
-
 
417
 
-
 
418
var htmlWikiOriginal = '';
-
 
419
var objetContenuWiki = null;
416
 
420
function getSection() {
417
function getSection() {
421
	return objetContenuWiki.attr("title");
418
	return objetContenuWiki.attr("title");
Line 422... Line 419...
422
}
419
}
Line 467... Line 464...
467
		 event.preventDefault(); 
464
		 event.preventDefault(); 
468
		 objetContenuWiki.html(htmlWikiOriginal);
465
		 objetContenuWiki.html(htmlWikiOriginal);
469
	});
466
	});
470
}
467
}
Line -... Line 468...
-
 
468
 
-
 
469
//+----------------------------------------------------------------------------------------------------------+
471
 
470
// Plier / déplier
472
function plierTout() {
471
function plierTout() {
473
	$('.nom').children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
472
	$('.nom').children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
474
	$('.plus').css('display', 'none');
473
	$('.plus').css('display', 'none');
Line 497... Line 496...
497
			$(plus).addClass('plus');
496
			$(plus).addClass('plus');
498
			$(plus).html(biblio);
497
			$(plus).html(biblio);
499
			$(plus).hide();
498
			$(plus).hide();
Line 500... Line 499...
500
			
499
			
501
			$(this).click(function() {
-
 
502
				
500
			$(this).click(function() {
503
				if (!$(this).children('.plus').is(':visible')) {
501
				if (!$(this).children('.plus').is(':visible')) {
504
					$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
502
					$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
505
					$(this).children('.plus').css('display', 'inline');
503
					$(this).children('.plus').css('display', 'inline');
506
				} else {
504
				} else {
507
					$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
505
					$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
508
					$(this).children('.plus').css('display', 'none');
506
					$(this).children('.plus').css('display', 'none');
509
				}
-
 
510
				
507
				}
511
			});				
508
			});				
512
			$(this).append($(plus));		
509
			$(this).append($(plus));		
513
		}
510
		}
514
	});
511
	});
Line 522... Line 519...
522
		plierTout();
519
		plierTout();
523
	});
520
	});
524
	gestionBiblio(document);
521
	gestionBiblio(document);
525
}
522
}
Line -... Line 523...
-
 
523
 
-
 
524
//+----------------------------------------------------------------------------------------------------------+
-
 
525
//Images CEL
-
 
526
function ouvrirPopUpImgCel(event) {
-
 
527
	event.preventDefault();
-
 
528
	window.open($(this).attr('href'), "Photo "+$(this).children("img").attr("alt"), 
-
 
529
		'height=500, width=500, top=100, left=100, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=yes, status=no');
-
 
530
}
-
 
531
 
-
 
532
//+----------------------------------------------------------------------------------------------------------+
526
 
533
// Initialisation
Line 527... Line 534...
527
var fancyboxinitialise = false;
534
var fancyboxinitialise = false;
528
 
535
 
529
//Initialisation
536
//Initialisation
Line 563... Line 570...
563
	$('a.lien_externe').live('click',function(event) {
570
	$('a.lien_externe').live('click',function(event) {
564
		event.preventDefault();
571
		event.preventDefault();
565
		window.open($(this).attr('href'));
572
		window.open($(this).attr('href'));
566
	});
573
	});
Line 567... Line -...
567
	
-
 
568
	/*$('.illustration_taxon').live('click',function(event) {
-
 
569
		if(!fancyboxinitialise) {
-
 
570
			event.preventDefault();
-
 
571
			$('.illustration_taxon').fancybox({
-
 
572
				cyclic:true
-
 
573
			});
-
 
574
			fancyboxinitialise = true;
-
 
575
			$(this).click();
-
 
576
		}
-
 
577
	});*/
574
	
578
	$('.lien_image_cel').live('click', function(event) {
-
 
579
		event.preventDefault();
-
 
580
		window.open($(this).attr('href'), "Photo "+$(this).children("img").attr("alt"), 
-
 
581
				'height=500, width=500, top=100, left=100, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=yes, status=no');
-
 
Line 582... Line 575...
582
	});
575
	$('.lien-image-cel').live('click', ouvrirPopUpImgCel);
583
	
576
	
584
	creerMenuOngletsFermes();
577
	creerMenuOngletsFermes();
585
	afficherOngletsPourNiveau();
578
	afficherOngletsPourNiveau();
Line 598... Line 591...
598
	gererLiensOuvertureOnglets();
591
	gererLiensOuvertureOnglets();
599
	gererEvenementsWiki();
592
	gererEvenementsWiki();
600
	gererEvenementsPliage();
593
	gererEvenementsPliage();
601
});
594
});
Line 602... Line -...
602
 
-
 
603
 
595
 
604
$(document).ajaxStop(function() {
596
$(document).ajaxStop(function() {
605
	if (document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1') == false) {
597
	if (document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1') == false) {
606
	    $('.svg').each(function() {
-
 
607
	   	 
598
		$('.svg').each(function() {
608
	   	 alt = $(this).attr('alt');
599
			alt = $(this).attr('alt');
609
	   	 img = document.createElement('img');
600
			img = document.createElement('img');
610
	   	 img.src = alt;
601
			img.src = alt;
611
	   	 $(this).replaceWith(img);
602
			$(this).replaceWith(img);