Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 577 | Rev 591 | 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
					nom = html.substr(0, posCrochetGauche);
10
					biblio = html.substr(posCrochetGauche, html.length);
11
					$(this).html(nom);
12
 
13
					imagettePlus = document.createElement('div');
14
					$(imagettePlus).addClass('imagettePlus');
15
					$(this).prepend($(imagettePlus));
16
 
17
					plus = document.createElement('span');
18
					$(plus).addClass('plus');
19
					$(plus).html(biblio);
20
					$(plus).hide();
21
 
577 aurelien 22
					$(this).click(function(e) {
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
25
						if($(e.target).hasClass("imagettePlus") || $(e.target).hasClass("imagetteMoins")) {
26
							if (!$(this).children('.plus').is(':visible')) {
27
								$(this).children('.imagettePlus').removeClass('imagettePlus').addClass('imagetteMoins');
28
								$(this).children('.plus').css('display', 'inline');
29
							} else {
30
								$(this).children('.imagetteMoins').removeClass('imagetteMoins').addClass('imagettePlus');
31
								$(this).children('.plus').css('display', 'none');
32
							}
404 gduche 33
						}
34
 
35
					});
36
 
37
					$(this).append($(plus));
38
 
39
				}
40
			}
41
		});
42
	}
43
 
198 delphine 44
	$(document).ready(function() {
192 delphine 45
		$( "#radio" ).buttonset();
46
		$('#eflore_niveau_submit').hide();
47
		$(".zone-choix-niveau input").click(function() {
48
			$('#eflore_niveau_submit').click();
49
		});
404 gduche 50
 
51
		gestionBiblio();
192 delphine 52
	});
53
</script>
178 delphine 54
<form id="ef-form-niveau" name="ef-form-niveau" action="<?=$url_form;?>" method="get">
55
	<fieldset>
192 delphine 56
		<span id="radio" class="zone-choix-niveau">
178 delphine 57
 
58
			<span class="choix-niveau">
59
				<input id="niveau_1" name="niveau" value="1" type="radio" <?=($niveau == '1') ? 'checked="checked"': '';?> />
60
				<label for="niveau_1"><?=$i18n['niveau-1'];?></label>
61
			</span>
62
			<span class="choix-niveau">
63
				<input id="niveau_2" name="niveau" value="2" type="radio" <?=($niveau == '2') ? 'checked="checked"': '';?> />
64
				<label for="niveau_2"><?=$i18n['niveau-2'];?></label>
65
			</span>
66
			<span class="choix-niveau">
67
				<input id="niveau_3" name="niveau" value="3" type="radio" <?=($niveau == '3') ? 'checked="checked"': '';?> />
68
				<label for="niveau_3"><?=$i18n['niveau-3'];?></label>
69
			</span>
70
		</span>
71
		<span id="zone-liens-niveau">
250 delphine 72
			<?php foreach ($parametres as $nom => $valeur) : ?>
73
				<input id="eflore_niveau_<?=$nom;?>" name="<?=$nom;?>" type="hidden" value="<?=$valeur;?>" />
74
			<?php endforeach; ?>
178 delphine 75
			<input id="eflore_niveau_submit" name="submit" type="submit" value="<?=$i18n['ok'];?>" class="ok"/>
76
		</span>
77
	</fieldset>
78
</form>
79
 
80
 
81
 
82
<!-- FIN FORM_NOM -->