Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 404 | Rev 587 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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