Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 587 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 587 Rev 591
1
<!-- DEBUT FORM_NIVEAU -->
1
<!-- DEBUT FORM_NIVEAU -->
2
<script type="text/javascript">
2
<script type="text/javascript">
3
	function gestionBiblio() {
3
	function gestionBiblio() {
4
		$('.nom').each(function () {
4
		$('.nom').each(function () {
5
			if ($(this).children('.plus').length == 0) {
5
			if ($(this).children('.plus').length == 0) {
6
				html = $(this).html();
6
				html = $(this).html();
7
				posCrochetGauche = html.indexOf('[');
7
				posCrochetGauche = html.indexOf('[');
8
				if (posCrochetGauche > 0) {
8
				if (posCrochetGauche > 0) {
9
					nom = html.substr(0, posCrochetGauche);
9
					nom = html.substr(0, posCrochetGauche);
10
					biblio = html.substr(posCrochetGauche, html.length);
10
					biblio = html.substr(posCrochetGauche, html.length);
11
					$(this).html(nom);
11
					$(this).html(nom);
12
					
12
					
13
					imagettePlus = document.createElement('div');
13
					imagettePlus = document.createElement('div');
14
					$(imagettePlus).addClass('imagettePlus');
14
					$(imagettePlus).addClass('imagettePlus');
15
					$(this).prepend($(imagettePlus));
15
					$(this).prepend($(imagettePlus));
16
					
16
					
17
					plus = document.createElement('span');
17
					plus = document.createElement('span');
18
					$(plus).addClass('plus');
18
					$(plus).addClass('plus');
19
					$(plus).html(biblio);
19
					$(plus).html(biblio);
20
					$(plus).hide();
20
					$(plus).hide();
21
					
21
					
22
					$(this).click(function(e) {
22
					$(this).click(function(e) {
23
						// test pour ne réagir que sur le clic sur le + ou -
23
						// test pour ne réagir que sur le clic sur le + ou -
24
						// TODO: fusionner ce bout de code en doublon avec synthese.js
24
						// TODO: fusionner ce bout de code en doublon avec synthese.js
25
						if($(e.target).hasClass("imagettePlus") || $(e.target).hasClass("imagetteMoins")) {
25
						if($(e.target).hasClass("imagettePlus") || $(e.target).hasClass("imagetteMoins")) {
26
							if (!$(this).children('.plus').is(':visible')) {
26
							if (!$(this).children('.plus').is(':visible')) {
27
								$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
27
								$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
28
								$(this).children('.plus').css('display', 'inline');
28
								$(this).children('.plus').css('display', 'inline');
29
							} else {
29
							} else {
30
								$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
30
								$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
31
								$(this).children('.plus').css('display', 'none');
31
								$(this).children('.plus').css('display', 'none');
32
							}
32
							}
33
						}
33
						}
34
						
34
						
35
					});
35
					});
36
						
36
						
37
					$(this).append($(plus));
37
					$(this).append($(plus));
38
					
38
					
39
				}
39
				}
40
			}
40
			}
41
		});
41
		});
42
	}
42
	}
43
 
43
 
44
	$(document).ready(function() {
44
	$(document).ready(function() {
45
		$( "#radio" ).buttonset();
45
		$( "#radio" ).buttonset();
46
		$('#eflore_niveau_submit').hide();
46
		$('#eflore_niveau_submit').hide();
47
		$(".zone-choix-niveau input").click(function() {
47
		$(".zone-choix-niveau input").click(function() {
48
			$('#eflore_niveau_submit').click();
48
			$('#eflore_niveau_submit').click();
49
		});
49
		});
50
		
50
		
51
		gestionBiblio();
51
		gestionBiblio();
52
	});
52
	});
53
</script>
53
</script>
54
<form id="ef-form-niveau" name="ef-form-niveau" action="<?=$url_form;?>" method="get">
-
 
55
	<fieldset>
-
 
56
		<span id="radio" class="zone-choix-niveau">
-
 
57
			
54
 
-
 
55
<div class="choixNiveau">
58
			<span class="choix-niveau">
56
		<span class="choix-niveau">
59
				<input id="niveau_1" name="niveau" value="1" type="radio" <?=($niveau == '1') ? 'checked="checked"': '';?> />
57
				<a href="<?=$parametres['url']?>&niveau=1" class="niveau1<?=$parametres['niveau'] == 1? ' actif' : ''?>">Débutant</a>
60
				<label for="niveau_1"><?=$i18n['niveau-1'];?></label>
-
 
61
			</span>
58
			</span>
62
			<span class="choix-niveau">
59
			<span class="choix-niveau">
63
				<input id="niveau_2" name="niveau" value="2" type="radio" <?=($niveau == '2') ? 'checked="checked"': '';?> />
60
				<a href="<?=$parametres['url']?>&niveau=2" class="niveau2<?=$parametres['niveau'] == 2? ' actif' : ''?>">Intermédiaire</a>
64
				<label for="niveau_2"><?=$i18n['niveau-2'];?></label>
-
 
65
			</span>
61
			</span>
66
			<span class="choix-niveau">
62
			<span class="choix-niveau">
67
				<input id="niveau_3" name="niveau" value="3" type="radio" <?=($niveau == '3') ? 'checked="checked"': '';?> />
63
				<a href="<?=$parametres['url']?>&niveau=3" class="niveau3<?=$parametres['niveau'] == 3? ' actif' : ''?>">Expert</a>
68
				<label for="niveau_3"><?=$i18n['niveau-3'];?></label>
-
 
69
			</span>
64
			</span>
70
		</span>
-
 
71
		<span id="zone-liens-niveau">
-
 
72
			<?php foreach ($parametres as $nom => $valeur) : ?>
-
 
73
				<input id="eflore_niveau_<?=$nom;?>" name="<?=$nom;?>" type="hidden" value="<?=$valeur;?>" />
-
 
74
			<?php endforeach; ?>
-
 
75
			<input id="eflore_niveau_submit" name="submit" type="submit" value="<?=$i18n['ok'];?>" class="ok"/>
-
 
76
		</span>
-
 
77
	</fieldset>
-
 
78
</form>
65
</div>
79
 
66
 
80
 
67
 
81
 
68
 
82
<!-- FIN FORM_NOM -->
69
<!-- FIN FORM_NOM -->