4 |
david |
1 |
var init_gauche = true;
|
|
|
2 |
|
|
|
3 |
function changestyle(id_couche, element, style) {
|
|
|
4 |
|
|
|
5 |
if (admin) {
|
|
|
6 |
hide_obj("bandeaudocuments");
|
|
|
7 |
hide_obj("bandeauredacteurs");
|
|
|
8 |
hide_obj("bandeauauteurs");
|
|
|
9 |
if (stat) { hide_obj("bandeausuivi"); }
|
|
|
10 |
hide_obj("bandeauadministration");
|
|
|
11 |
}
|
|
|
12 |
hide_obj("bandeaudeconnecter");
|
|
|
13 |
hide_obj("bandeautoutsite");
|
|
|
14 |
hide_obj("bandeaunavrapide");
|
|
|
15 |
hide_obj("bandeauagenda");
|
|
|
16 |
hide_obj("bandeaumessagerie");
|
|
|
17 |
hide_obj("bandeausynchro");
|
|
|
18 |
hide_obj("bandeaurecherche");
|
|
|
19 |
hide_obj("bandeauinfoperso");
|
|
|
20 |
hide_obj("bandeaudisplay");
|
|
|
21 |
hide_obj("bandeauecran");
|
|
|
22 |
hide_obj("bandeauinterface");
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
if (init_gauche) {
|
|
|
26 |
if (admin) {
|
|
|
27 |
decalerCouche('bandeaudocuments');
|
|
|
28 |
decalerCouche('bandeauredacteurs');
|
|
|
29 |
decalerCouche('bandeauauteurs');
|
|
|
30 |
if (stat) decalerCouche('bandeausuivi');
|
|
|
31 |
decalerCouche('bandeauadministration');
|
|
|
32 |
}
|
|
|
33 |
init_gauche = false;
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
if (!(layer = findObj(id_couche))) return;
|
|
|
38 |
|
|
|
39 |
layer.style[element] = style;
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
function decalerCouche(id_couche) {
|
|
|
43 |
if (!(layer = findObj(id_couche))) return;
|
|
|
44 |
if (bug_offsetwidth && ( parseInt(layer.style.left) > 0)) {
|
|
|
45 |
demilargeur = Math.floor( layer.offsetWidth / 2 );
|
|
|
46 |
if (demilargeur == 0) demilargeur = 100; // bug offsetwidth MSIE, on fixe une valeur arbitraire
|
|
|
47 |
gauche = parseInt(layer.style.left)
|
|
|
48 |
- demilargeur
|
|
|
49 |
+ Math.floor(largeur_icone / 2);
|
|
|
50 |
|
|
|
51 |
if (gauche < 0) gauche = 0;
|
|
|
52 |
|
|
|
53 |
layer.style.left = gauche+"px";
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
var accepter_change_statut;
|
|
|
59 |
|
|
|
60 |
function selec_statut(id, type, decal, puce, statut) {
|
|
|
61 |
|
|
|
62 |
if (!accepter_change_statut) {
|
|
|
63 |
accepter_change_statut = confirm(confirm_changer_statut)
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
if (accepter_change_statut) {
|
|
|
67 |
changestyle ('statutdecal'+type+id, 'marginLeft', decal+'px');
|
|
|
68 |
cacher ('statutdecal'+type+id);
|
|
|
69 |
|
|
|
70 |
findObj('imgstatut'+type+id).src = puce;
|
|
|
71 |
frames['iframe_action'].location.href =
|
|
|
72 |
'iframe_action.php3?action=statut_'+ type +'&id='+id+'&statut='+statut;
|
|
|
73 |
|
|
|
74 |
}
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
function changeclass(objet, myClass)
|
|
|
78 |
{
|
|
|
79 |
objet.className = myClass;
|
|
|
80 |
}
|
|
|
81 |
function changesurvol(iddiv, myClass)
|
|
|
82 |
{
|
|
|
83 |
document.getElementById(iddiv).className = myClass;
|
|
|
84 |
}
|
|
|
85 |
function setActiveStyleSheet(title) {
|
|
|
86 |
var i, a, main;
|
|
|
87 |
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
|
|
|
88 |
if(a.getAttribute("rel").indexOf("style") != -1
|
|
|
89 |
&& a.getAttribute("title")) {
|
|
|
90 |
a.disabled = true;
|
|
|
91 |
if(a.getAttribute("title") == title) a.disabled = false;
|
|
|
92 |
}
|
|
|
93 |
}
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
function setvisibility (objet, statut) {
|
|
|
97 |
element = findObj(objet);
|
|
|
98 |
if (element.style.visibility != statut) element.style.visibility = statut;
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
function montrer(objet) {
|
|
|
102 |
setvisibility(objet, 'visible');
|
|
|
103 |
}
|
|
|
104 |
function cacher(objet) {
|
|
|
105 |
setvisibility(objet, 'hidden');
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
function getHeight(obj) {
|
|
|
111 |
if (obj == "window") {
|
|
|
112 |
return hauteur_fenetre();
|
|
|
113 |
}
|
|
|
114 |
else
|
|
|
115 |
{
|
|
|
116 |
obj = document.getElementById(obj);
|
|
|
117 |
if (obj.offsetHeight) return obj.offsetHeight;
|
|
|
118 |
}
|
|
|
119 |
}
|
|
|
120 |
function hauteur_fenetre() {
|
|
|
121 |
var myWidth = 0, myHeight = 0;
|
|
|
122 |
if( typeof( window.innerWidth ) == 'number' ) {
|
|
|
123 |
//Non-IE
|
|
|
124 |
myHeight = window.innerHeight;
|
|
|
125 |
} else {
|
|
|
126 |
if( document.documentElement &&
|
|
|
127 |
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
|
|
|
128 |
//IE 6+ in 'standards compliant mode'
|
|
|
129 |
myHeight = document.documentElement.clientHeight;
|
|
|
130 |
} else {
|
|
|
131 |
if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
|
|
|
132 |
//IE 4 compatible
|
|
|
133 |
myHeight = document.body.clientHeight;
|
|
|
134 |
}
|
|
|
135 |
}
|
|
|
136 |
}
|
|
|
137 |
return myHeight;
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
|
|
|
141 |
function hauteurFrame(nbCol) {
|
|
|
142 |
hauteur = hauteur_fenetre() - 40;
|
|
|
143 |
hauteur = hauteur - getHeight('haut-page');
|
|
|
144 |
|
|
|
145 |
if (findObj('brouteur_hierarchie')) hauteur = hauteur - getHeight('brouteur_hierarchie');
|
|
|
146 |
|
|
|
147 |
for (i=0; i<nbCol; i++) {
|
|
|
148 |
source = document.getElementById("iframe" + i);
|
|
|
149 |
source.style.height = hauteur + 'px';
|
|
|
150 |
}
|
|
|
151 |
}
|
|
|
152 |
|
|
|
153 |
function hauteurTextarea() {
|
|
|
154 |
hauteur = hauteur_fenetre() - 80;
|
|
|
155 |
|
|
|
156 |
source = document.getElementById("text_area");
|
|
|
157 |
source.style.height = hauteur + 'px';
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
function changeVisible(input, id, select, nonselect) {
|
|
|
161 |
if (input) {
|
|
|
162 |
element = findObj(id);
|
|
|
163 |
if (element.style.display != select) element.style.display = select;
|
|
|
164 |
} else {
|
|
|
165 |
element = findObj(id);
|
|
|
166 |
if (element.style.display != nonselect) element.style.display = nonselect;
|
|
|
167 |
}
|
|
|
168 |
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
|
175 |
// pour MOzilla >= 1.7
|
|
|
176 |
function verifForm() {
|
|
|
177 |
/* if (pluginlist.indexOf("SVG")!=-1)
|
|
|
178 |
document.cookie = "spip_svg_plugin=oui";
|
|
|
179 |
else
|
|
|
180 |
document.cookie = "spip_svg_plugin=non";
|
|
|
181 |
*/
|
|
|
182 |
|
|
|
183 |
//convert2math();
|
|
|
184 |
|
|
|
185 |
retrait = 16;
|
|
|
186 |
var obj=document.getElementsByTagName("input");
|
|
|
187 |
for(i=0;i<obj.length;i++) {
|
|
|
188 |
if(obj[i].className=="forml" || obj[i].className=="formo") {
|
|
|
189 |
element = obj[i];
|
|
|
190 |
if (element.offsetWidth) {
|
|
|
191 |
obj[i]["nouvelle-largeur"] = (element.offsetWidth - retrait) + "px";
|
|
|
192 |
} else {
|
|
|
193 |
obj[i]["nouvelle-largeur"] = "95%";
|
|
|
194 |
}
|
|
|
195 |
}
|
|
|
196 |
}
|
|
|
197 |
|
|
|
198 |
var objx=document.getElementsByTagName("textarea");
|
|
|
199 |
for(i=0;i<objx.length;i++) {
|
|
|
200 |
if(objx[i].className=="forml" || objx[i].className=="formo") {
|
|
|
201 |
element = objx[i];
|
|
|
202 |
if (element.offsetWidth) {
|
|
|
203 |
objx[i]["nouvelle-largeur"] = (element.offsetWidth - retrait) + "px";
|
|
|
204 |
} else {
|
|
|
205 |
objx[i]["nouvelle-largeur"] = "95%";
|
|
|
206 |
}
|
|
|
207 |
}
|
|
|
208 |
}
|
|
|
209 |
|
|
|
210 |
// Appliquer les modifs apres les calculs, sinon des decalages peuvent apparaitre
|
|
|
211 |
for(i=0;i<obj.length;i++) {
|
|
|
212 |
if (obj[i]["nouvelle-largeur"]) obj[i].style.width = obj[i]["nouvelle-largeur"];
|
|
|
213 |
}
|
|
|
214 |
|
|
|
215 |
for(i=0;i<objx.length;i++) {
|
|
|
216 |
if (objx[i]["nouvelle-largeur"]) objx[i].style.width = objx[i]["nouvelle-largeur"];
|
|
|
217 |
}
|
|
|
218 |
}
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
// effacement titre quand new=oui
|
|
|
222 |
var antifocus=false;
|
|
|
223 |
// effacement titre des groupes de mots-cles de plus de 50 mots
|
|
|
224 |
var antifocus_mots = new Array();
|