[SPIP] +2.1.12
[velocampus/web/www.git] / www / plugins / auto / couteau_suisse / couteau_suisse / exec / admin_couteau_suisse_head.html
1 <style type='text/css'>
2
3 [(#VAL{_SPIP19300}|defined|non)
4 div.cadre-info a { background:none; padding:0; border:0; }
5 div.cadre-info { margin-bottom:1em; }
6 div.cadre-padding form{ padding:0; margin:0; }
7 div.cadre-padding .titrem { background-color:#EEEEEE; color:#000000; }
8 ]
9 div.cadre_padding form { padding:0; margin:0; }
10 [(#VAL{_SPIP20100}|defined|oui)
11 #contenu .cadre_padding .titrem { background-color:#EEEEEE !important; color:#000000 !important; padding:2px !important; }
12 #contenu .cadre_padding { padding:6px !important; }
13 ]
14 [(#VAL{_SPIP30000}|defined|oui)
15 #SET{claire,##ENV{couleur_claire,edf3fe}}
16 #SET{foncee,##ENV{couleur_foncee,3874b0}}
17 div.cs_outils fieldset, div.cs_intros_inner { border:2px solid #GET{claire}; background:#fcfcfc;}
18 div.cs_infos fieldset { border: 1px threedface groove; padding: 0.3em; }
19 table.spip td,table.spip th,th,td,caption { padding: 0.20em 0.40em; }
20 div.cs_aide p { margin: 1em 0; }
21 div.cs_boite_rss ul { font-size: 95%; }
22 ]
23
24
25 .cs_hidden { display:none; }
26
27 div.cs-cadre{ padding:0.5em; margin:1px; width=100%; border:1px solid #666666; }
28 div.cs-cadre h3 { margin:0.2em 0; border-bottom:1px solid #666666; }
29 div.cs_infos { overflow:hidden; }
30 div.cs_infos p { margin:0.3em 1em 0.3em 0; padding:0; }
31 div.cs_infos h3.titrem { border-bottom:solid 1px; font-weight:bold; display:block; background-color: #EEE;}
32 div.cs_infos legend { font-weight:bold; }
33 div.cs_infos fieldset { margin:.8em 4em .5em 4em; }
34 div.cs_infos fieldset fieldset { border:0; margin:0 0 0 4em; padding:0.3em; }
35 div.cs_infos fieldset>div { margin:0; }
36 div.cs_infos sup { font-size:85%; font-variant:normal; vertical-align:super; }
37 div.cs_infos hr { border:0; border-top:1px solid #67707F; }
38 div.cs_infos img { border:0; }
39 div.cs_infos div.cs_bouton { margin-top: 0; text-align: right; }
40 div.cs_infos div.cs_modif_ok { font-weight:bold; color:green; margin:0.4em; text-align:center; }
41 div.cs_infos div.cs_menu_outil { text-align:right; font-size:85%; margin-bottom:0.8em; }
42 div.cs_infos div.cs_details_outil { font-size:85%; margin-top:0.8em; border-top:solid 1px; }
43 div.cs_infos fieldset ul { margin:0; padding:0; }
44 div.cs_infos fieldset ul li { list-style:none; display:inline; }
45
46 div.cs_action_rapide { border:1px dotted; margin-bottom:1em; padding-bottom:0.4em; background-color:#F0EEEE; }
47 div.cs_action_rapide select.ar_select { width:auto; display:inline; }
48 div.cs_action_rapide .ar_edit_info { font-size:85%; font-style:italic; }
49
50 .cs_raccourcis {
51 list-style-type:none; padding:0; margin: 0; list-style-image: none; list-style-position: outside;
52 }
53 .cs_raccourcis b { color:darkRed; }
54
55 .conteneur {
56 clear:both;
57 width:100%;
58 margin:0.8em 0 0 0;
59 padding:0;
60 }
61
62 a.cs_href {
63 font-weight:normal;
64 }
65 a.outil_on {
66 font-weight:bold;
67 border:1px dotted;
68 }
69 div.cs_liste {
70 float:left;
71 width:45%;
72 line-height:120%;
73 }
74
75 div.cs_outils {
76 clear:both;
77 float:none;
78 width:100%;
79 }
80
81 div.cs_actifs {
82 float:right;
83 }
84 div.cs_toggle {
85 float:left;
86 width:9.6%; /* pour IE6 */
87 text-align:center;
88 margin:50px 0 0 0;
89 }
90
91 div.categorie, div.cs_intros {
92 margin-top:.6em;
93 padding:2px;
94 font-weight:bold;
95 display:block;
96 cursor:pointer;
97 background-color:#EEE;
98 }
99 div.categorie span {
100 font-size:85%;
101 }
102 div.categorie span.light {
103 font-weight:normal;
104 }
105
106 div.cs_intros_inner {
107 margin-left:1em;
108 padding:0.4em;
109 font-size:90%;
110 }
111
112 .cs_sobre {
113 background:transparent none repeat scroll 0% !important;
114 border:medium none !important;
115 color:#000099 !important;
116 display:inline;
117 font-size:100%;
118 font-family: inherit;
119 font-weight:normal !important;
120 margin:0pt !important;
121 padding:0pt !important;
122 cursor:pointer;
123 text-align:left;
124 width:180px;
125 }
126
127 .cs_droite {
128 text-align:right;
129 }
130
131 /* rss */
132 .cs_boite_rss li { padding-top:0.5em; }
133 .cs_boite_rss ul { list-style-type:none; padding:0; margin:0; }
134 .cs_boite_rss p.rss-small { font-size: 85%; border-top:solid gray thin; margin: 1em 0; }
135
136 /* classes de description */
137 .q1 { margin:0 2em; }
138 .q2 { margin-left:2em; }
139 .q3 { font-size:85%; }
140
141 </style>
142
143 <script type="text/javascript"><!--
144 var cs_selected, cs_descripted;
145
146 function set_selected() {
147 cs_selected = new Array();
148 jQuery('a.outil_on').each( function(i){
149 cs_selected[i] = this.id;
150 });
151 if(cs_selected.length) {
152 jQuery('div.cs_toggle div').show();
153 jQuery('#cs_toggle_p').html('('+cs_selected.length+')');
154 } else jQuery('div.cs_toggle div').hide();
155 }
156
157 function set_categ(id) {
158 nb = jQuery('#'+id+' a.outil_on').length;
159 if(nb>0) jQuery('#'+id).prev().children().removeClass('light');
160 else jQuery('#'+id).prev().children().addClass('light');
161 }
162
163 function outils_toggle() {
164 if(cs_selected.length>1) {
165 msg="<:couteauprive:outils_permuter_gras2|cs_javascript:>";
166 msg=msg.replace(/@nb@/, cs_selected.length);
167 } else {
168 msg="<:couteauprive:outil_permuter|cs_javascript:>";
169 msg=msg.replace(/@text@/, jQuery('a.outil_on').text());
170 }
171 if(!confirm(msg)) return false;
172 jQuery('#cs_selection').attr('value', cs_selected.join(','));
173 jQuery('#cs_infos').html('');
174 jQuery('.cs_patience').css('display','block');
175 document.csform.submit();
176 }
177
178 // clic sur un outil (fonction egalement utilisee par l'outil 'maj_auto')
179 function cs_href_click(this_, force) {
180 var this_id = this_.id.replace(/^href_/,'');
181 // on s'en va si l'outil est deja affiche
182 if(!force && cs_descripted==this_id) return false;
183 cs_descripted=this_id;
184 // on charge la nouvelle description
185 jQuery('#cs_infos')
186 .css('opacity', '0.5')
187 .parent()
188 .prepend(ajax_image_searching)
189 .load('[(#URL_ECRIRE{charger_description_outil}|parametre_url{source,#ENV{exec},&})]&outil='+this_id);
190 // annulation du clic
191 return false;
192 }
193
194 if(window.jQuery) jQuery(function(){
195 // decalage a supprimer sur FF2
196 if(jQuery.browser.mozilla) jQuery('input.cs_sobre').css('margin-left','-3px');
197
198 jQuery('div.sous_liste').each(cs_Categorie2);
199 if(window.location.search.match(/cmd=pack/)!=null)
200 jQuery("div.cs_aide a["+cs_sel_jQuery+"href*='cmd=pack']")
201 .click( function() { window.location.reload(true); return false; });
202 jQuery("div.cs_aide a["+cs_sel_jQuery+"href*='cmd=install']").click( function() {
203 msg="<:couteauprive:pack_installer|cs_javascript:>\n\n<:couteauprive:cs_reset2|cs_javascript:>";
204 return window.confirm(msg.replace(/@pack@/,jQuery(this).text()));
205 });
206 jQuery("div.cs_aide a["+cs_sel_jQuery+"href*='cmd=resetall']").click( function() {
207 msg="<:couteauprive:cs_reset|cs_javascript:>\n\n<:couteauprive:cs_reset2|cs_javascript:>";
208 return window.confirm(msg);
209 });
210
211 jQuery('div.cs_liste script').remove();
212 // clic sur un titre de categorie
213 jQuery('div.categorie, div.cs_intros').click( function() {
214 jQuery(this).children().toggleClass('cs_hidden');
215 next = jQuery(this).next();
216 next.toggleClass('cs_hidden');
217 cs_EcrireCookie(next[0].id, '+'+next[0].className, dixans);
218 // annulation du clic
219 return false;
220 });
221 jQuery('div.categorie').dblclick(function(){
222 id = '#'+this.nextSibling.id;
223 a = jQuery(id+' a.outil_on').length;
224 b = jQuery(id+' a.cs_href').length;
225 if(a==b) jQuery(id+' a.outil_on').removeClass('outil_on');
226 else jQuery(id+' a.cs_href').addClass('outil_on');
227 jQuery(this).children().addClass('cs_hidden');
228 next = jQuery(this).next();
229 next.removeClass('cs_hidden');
230 cs_EcrireCookie(next[0].id, '+'+next[0].className, dixans);
231 set_selected();
232 set_categ(this.nextSibling.id);
233 return false;
234 });
235
236 // clic sur un outil
237 jQuery('a.cs_href').click( function() {
238 jQuery(this).toggleClass('outil_on');
239 set_selected();
240 set_categ(this.parentNode.id);
241 return cs_href_click(this, false);
242 })
243 .dblclick(function(){
244 jQuery('a.outil_on').removeClass('outil_on');
245 jQuery('div.categorie span').addClass('light');
246 jQuery(this).addClass('outil_on');
247 set_selected();
248 set_categ(this.parentNode.id);
249 outils_toggle();
250 return false;
251 });
252
253 // clic sur le bouton de permutation
254 jQuery('#cs_toggle_a').click( function() {
255 outils_toggle();
256 // annulation du clic
257 return false;
258 });
259
260 // clic sur le bouton de reset
261 jQuery('#cs_reset_a').click( function() {
262 jQuery('a.outil_on').removeClass('outil_on');
263 jQuery('div.cs_toggle div').hide();
264 jQuery('div.categorie span').addClass('light');
265 // annulation du clic
266 return false;
267 });
268
269 // clic sur le bouton 'tous les actifs'
270 jQuery('#cs_tous_a').click( function() {
271 jQuery('div.cs_actifs a.cs_href').addClass('outil_on');
272 jQuery('div.categorie span').removeClass('light');
273 set_selected();
274 // annulation du clic
275 return false;
276 });
277
278 // masquage/demasquage des blocs <variable> liees a des checkbox
279 input_init.apply(document);
280
281 // verifier la version du CS
282 jQuery('span.cs_version').load('[(#URL_ECRIRE{cs_version}|parametre_url{version,#ENV*{cs_version},&}|parametre_url{force,#ENV*{force},&})]',
283 // afficher la boite rss, si elle existe
284 jQuery('div.cs_boite_rss').load('[(#URL_ECRIRE{cs_boite_rss}|parametre_url{force,#ENV*{force},&})]')
285 );
286
287 });
288
289 // masquage/demasquage des blocs <variable> liees a des checkbox
290 // compatibilite Ajax : ajouter this dans jQuery()
291 var input_init=function(){
292 // outil actif
293 jQuery('.cs_input_checkbox', this).cs_todo().click(bloc_variables);
294 jQuery('input.cs_input_checkbox:checked',this).each(bloc_variables);
295 // outil inactif
296 jQuery('.cs_hidden_checkbox', this).cs_todo().each(bloc_variables);
297 }
298 function bloc_variables(index, domElement) {
299 //alert(this.name+' - '+this.value);
300 jQuery('.groupe_'+this.name).addClass('cs_hidden');
301 jQuery('.valeur_'+this.name+'_'+this.value).removeClass('cs_hidden');
302 }
303 if(typeof onAjaxLoad=='function') onAjaxLoad(input_init);
304
305 // TODO : cookies en jQuery sous SPIP>=2.0 (plugin jquery.cookie.js)
306
307 var dixans=new Date;
308 dixans.setFullYear(dixans.getFullYear()+10);
309
310 // ref : http://www.actulab.com/ecrire-les-cookies.php
311 function cs_EcrireCookie(nom, valeur){
312 var argv=cs_EcrireCookie.arguments;
313 var argc=cs_EcrireCookie.arguments.length;
314 var expires=(argc > 2) ? argv[2] : null;
315 var path=(argc > 3) ? argv[3] : null;
316 var domain=(argc > 4) ? argv[4] : null;
317 var secure=(argc > 5) ? argv[5] : false;
318 document.cookie=nom+'='+escape(valeur)+
319 ((expires==null) ? '' : ('; expires='+expires.toGMTString()))+
320 ((path==null) ? '' : ('; path='+path))+
321 ((domain==null) ? '' : ('; domain='+domain))+
322 ((secure==true) ? '; secure' : '');
323 }
324 function cs_getCookieVal(offset){
325 var endstr=document.cookie.indexOf (';', offset);
326 if(endstr==-1) endstr=document.cookie.length;
327 return unescape(document.cookie.substring(offset, endstr));
328 }
329 function cs_LireCookie(nom){
330 var arg=nom+'=';
331 var alen=arg.length;
332 var clen=document.cookie.length;
333 var i=0;
334 while (i<clen){
335 var j=i+alen;
336 if(document.cookie.substring(i, j)==arg) return cs_getCookieVal(j);
337 i=document.cookie.indexOf(' ',i)+1;
338 if(i==0) break;
339 }
340 return null;
341 }
342 function cs_EffaceCookie(nom){
343 date=new Date;
344 date.setFullYear(date.getFullYear()-1);
345 cs_EcrireCookie(nom,null,date);
346 }
347
348 function cs_Categorie2(i,e){
349 var c=cs_LireCookie(this.id);
350 if(c===null || c.match('cs_hidden')) {
351 var j=jQuery(this);
352 j.addClass('cs_hidden');
353 j.prev().children('span.light').removeClass('cs_hidden');
354 }
355 }
356 //--></script>