[ Index ] |
|
Code source de SPIP 1.9.2c |
1 var bandeau_elements = false; 2 3 function changestyle(id_couche, element, style) { 4 5 // La premiere fois, regler l'emplacement des sous-menus 6 if (!bandeau_elements) { 7 bandeau_elements = $('#haut-page div.bandeau'); 8 if (bug_offsetwidth) { 9 $('#bandeau-principal div.bandeau').each(function(){ 10 var left = parseInt(this.style.left); 11 if (left > 0) { 12 demilargeur = Math.floor( this.offsetWidth / 2 ); 13 if (demilargeur == 0) demilargeur = 100; // bug offsetwidth MSIE, on fixe une valeur arbitraire 14 gauche = left 15 - demilargeur 16 + Math.floor(largeur_icone / 2); 17 if (gauche < 0) gauche = 0; 18 this.style.left = gauche+"px"; 19 } 20 }); 21 } 22 } 23 24 // Masquer les elements du bandeau 25 var select = $(bandeau_elements).not('#'+id_couche); 26 // sauf eventuellement la boite de recherche si la souris passe en-dessous 27 if (id_couche=='garder-recherche') select.not('#bandeaurecherche'); 28 select.css({'visibility':'hidden', 'display':'none'}); 29 // Afficher, le cas echeant, celui qui est demande 30 if (element) 31 $('#'+id_couche).css({element:style}); 32 else 33 $('#'+id_couche).css({'visibility':'visible', 'display':'block'}); 34 } 35 36 var accepter_change_statut = false; 37 38 function selec_statut(id, type, decal, puce, script) { 39 40 node = findObj('imgstatut'+type+id); 41 42 if (!accepter_change_statut) 43 accepter_change_statut = confirm(confirm_changer_statut); 44 45 if (!accepter_change_statut || !node) return; 46 47 bloc = 'statutdecal'+type+id; 48 changestyle (bloc, 'marginLeft', decal+'px'); 49 cacher (bloc); 50 51 $.get(script, function (c) {if (!c)node.src = puce; else { 52 r = window.open(); 53 r.document.write(c); 54 r.document.close();}}) 55 } 56 57 function prepare_selec_statut(nom, type, id, action) 58 { 59 $('#' + nom + type + id).load(action + '&type='+type+'&id='+id, 60 function(){ 61 findObj_forcer('statutdecal'+type+id).style.visibility = 'visible'; 62 }); 63 } 64 65 function changeclass(objet, myClass) { 66 objet.className = myClass; 67 } 68 function changesurvol(iddiv, myClass) { 69 document.getElementById(iddiv).className = myClass; 70 } 71 72 function setvisibility (objet, statut) { 73 element = findObj(objet); 74 if (element.style.visibility != statut) element.style.visibility = statut; 75 } 76 77 function montrer(objet) { 78 setvisibility(objet, 'visible'); 79 } 80 function cacher(objet) { 81 setvisibility(objet, 'hidden'); 82 } 83 84 85 function getHeight(obj) { 86 if (obj == "window") { 87 return hauteur_fenetre(); 88 } 89 else 90 { 91 obj = document.getElementById(obj); 92 if (obj.offsetHeight) return obj.offsetHeight; 93 } 94 } 95 function hauteur_fenetre() { 96 var myWidth = 0, myHeight = 0; 97 if( typeof( window.innerWidth ) == 'number' ) { 98 //Non-IE 99 myHeight = window.innerHeight; 100 } else { 101 if( document.documentElement && 102 ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { 103 //IE 6+ in 'standards compliant mode' 104 myHeight = document.documentElement.clientHeight; 105 } else { 106 if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { 107 //IE 4 compatible 108 myHeight = document.body.clientHeight; 109 } 110 } 111 } 112 return myHeight; 113 } 114 115 116 function hauteurFrame(nbCol) { 117 hauteur = hauteur_fenetre() - 40; 118 hauteur = hauteur - getHeight('haut-page'); 119 120 if (findObj('brouteur_hierarchie')) hauteur = hauteur - getHeight('brouteur_hierarchie'); 121 122 for (i=0; i<nbCol; i++) { 123 source = document.getElementById("iframe" + i); 124 source.style.height = hauteur + 'px'; 125 } 126 } 127 128 function hauteurTextarea() { 129 hauteur = hauteur_fenetre() - 80; 130 131 source = document.getElementById("text_area"); 132 source.style.height = hauteur + 'px'; 133 } 134 135 function changeVisible(input, id, select, nonselect) { 136 if (input) { 137 element = findObj(id); 138 if (element.style.display != select) element.style.display = select; 139 } else { 140 element = findObj(id); 141 if (element.style.display != nonselect) element.style.display = nonselect; 142 } 143 } 144 145 146 147 // livesearchlike... 148 149 150 151 // effacement titre quand new=oui 152 var antifocus=false; 153 // effacement titre des groupes de mots-cles de plus de 50 mots 154 var antifocus_mots = new Array(); 155 156 function puce_statut(selection){ 157 if (selection=="publie"){ 158 return "puce-verte.gif"; 159 } 160 if (selection=="prepa"){ 161 return "puce-blanche.gif"; 162 } 163 if (selection=="prop"){ 164 return "puce-orange.gif"; 165 } 166 if (selection=="refuse"){ 167 return "puce-rouge.gif"; 168 } 169 if (selection=="poubelle"){ 170 return "puce-poubelle.gif"; 171 } 172 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 10:20:27 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |