[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / prive / javascript / gadgets.js
1 function init_bandeau_gadgets(url_toutsite,url_navrapide,url_agenda,html_messagerie){
2 verifForm();
3 calculer_top_bandeau_sec();
4 $("#page,#bandeau-principal")
5 .mouseover(function(){
6 if (typeof(window["changestyle"])!=="undefined") window.changestyle("garder-recherche");
7 });
8 init_gadgets(url_toutsite,url_navrapide,url_agenda,html_messagerie);
9 }
10
11 function calculer_top_bandeau_sec() {
12 var hauteur_max = 0;
13 var hauteur_bouton = 0;
14
15 $(".boutons_admin a.boutons_admin .icon_texte").each(function(){
16 hauteur_bouton = parseInt($(this).height());
17 if (hauteur_bouton > hauteur_max) hauteur_max = hauteur_bouton;
18 });
19 $(".boutons_admin a.boutons_admin .icon_texte").height(hauteur_max);
20 }
21
22 function init_gadgets(url_toutsite,url_navrapide,url_agenda,html_messagerie){
23 jQuery('#boutonbandeautoutsite')
24 .one('mouseover',function(event){
25 if ((typeof(window['_OUTILS_DEVELOPPEURS']) == 'undefined') || ((event.altKey || event.metaKey) != true)) {
26 changestyle('bandeautoutsite');
27 jQuery('#gadget-rubriques')
28 .load(url_toutsite);
29 } else { window.open(url_toutsite+'&transformer_xml=valider_xml'); }
30 })
31 .one('focus', function(){jQuery(this).mouseover();});
32
33 jQuery('#boutonbandeaunavrapide')
34 .one('mouseover',function(event){
35 if ((typeof(window['_OUTILS_DEVELOPPEURS']) == 'undefined') || ((event.altKey || event.metaKey) != true)) {
36 changestyle('bandeaunavrapide');
37 jQuery('#gadget-navigation')
38 .load(url_navrapide);
39 } else { window.open(url_navrapide+'&transformer_xml=valider_xml'); }
40 })
41 .one('focus', function(){jQuery(this).mouseover();});
42
43 jQuery('#boutonbandeauagenda')
44 .one('mouseover',function(event){
45 if ((typeof(window['_OUTILS_DEVELOPPEURS']) == 'undefined') || ((event.altKey || event.metaKey) != true)) {
46 changestyle('bandeauagenda');
47 jQuery('#gadget-agenda')
48 .load(url_agenda);
49 } else { window.open(url_agenda+'&transformer_xml=valider_xml'); }
50 })
51 .one('focus', function(){jQuery(this).mouseover();});
52
53 jQuery('#gadget-messagerie')
54 .html(html_messagerie);
55
56 // la case de recherche s'efface la premiere fois qu'on la clique
57 jQuery('#form_recherche')
58 .one('click',function(){this.value='';});
59 }