diff --git a/dist/javascript/layer.js b/dist/javascript/layer.js index ce88e8f75e4a1fbddcbd44b9dadd49c74f1b6ece..b203ecf8be142b7912d87be401eba2e66de46e17 100644 --- a/dist/javascript/layer.js +++ b/dist/javascript/layer.js @@ -44,6 +44,18 @@ function hide_obj(obj) { } } +function toggleBouton(bouton,cible){ + //alert(jQuery(bouton)); + if (jQuery(bouton).is('.deplie')){ + jQuery(bouton).addClass('replie').removeClass('deplie'); + jQuery(cible).addClass('replie').removeClass('deplie'); + } + else if (jQuery(bouton).is('.replie')){ + jQuery(bouton).addClass('deplie').removeClass('replie'); + jQuery(cible).addClass('deplie').removeClass('replie'); + } +} + function swap_couche(couche, rtl, dir, no_swap) { var layer; var triangle = document.getElementById('triangle' + couche); diff --git a/dist/style_prive.html b/dist/style_prive.html index 647634d49fca6f13a7bb63d8def60efc56fadf80..81c89b303eda8deb9126ac07fc1414a86e6c92d9 100644 --- a/dist/style_prive.html +++ b/dist/style_prive.html @@ -1000,19 +1000,26 @@ td.icone a img { /* * Cadre couleur foncee */ - +/* .cadre-padding { font-family: verdana, arial, helvetica, sans; font-size: 12px; padding: 6px; position: relative; -} - +}*/ +/* .cadre-titre { font-family: verdana, arial, helvetica, sans; font-weight: bold; font-size: 12px; padding: 3px; +}*/ + +.cadre { + margin-bottom:5px; + font-family: verdana, arial, helvetica, sans; + font-size: 12px; + position:relative; } .cadre-fonce { @@ -1044,8 +1051,6 @@ td.icone a img { color: #fff; } - - .cadre-trait-couleur { background-color: #fff; border: 2px solid ##ENV{couleur_foncee,3874b0}; @@ -1061,7 +1066,6 @@ td.icone a img { border: 1px solid #666; } - .cadre-r div.cadre-titre { background-color: #aaa; border-bottom: 1px solid #666; @@ -1074,6 +1078,7 @@ td.icone a img { border-left: 1px solid #aaa; border-bottom: 1px solid #fff; border-right: 1px solid #fff; + border: 1px solid #666; } .cadre-e div.cadre-titre { @@ -1082,13 +1087,10 @@ td.icone a img { color: #000; } -.cadre-e-noir { - border: 1px solid #666; -} - .cadre-forum { background-color: #fff; border: 1px solid #aaa; + margin-bottom:0; } .cadre-forum div.cadre-titre { background-color: ##ENV{couleur_claire,edf3fe}; @@ -1106,6 +1108,7 @@ td.icone a img { background-color: #eee; border: 1px solid #ccc; border-top: 0; + margin-bottom:0; } .cadre-thread-forum div.cadre-titre { background-color: #CCC; @@ -1680,11 +1683,15 @@ a.ical { width: 10px; } -.bouton_depliable { display: block; -background-image: url(#EVAL{_DIR_IMG_PACK}wrapper.php?file=deplierhaut[(#ENV{ltr}|choixsiegal{left,'',_rtl})].gif); background-repeat: no-repeat; -background-position: [(#ENV{ltr}|choixsiegal{left,left,right})] top; padding-[(#ENV{ltr}|choixsiegal{left,left,right})]: 16px; } -.bouton_depliable.hover { background-color: #eee; } -.bouton_depliable.deplie { display: block; background-image: url(#EVAL{_DIR_IMG_PACK}wrapper.php?file=deplierbas.gif); } +.titrem { + display: block; + background-position: [(#ENV{ltr}|choixsiegal{left,left,right})] top; + padding-[(#ENV{ltr}|choixsiegal{left,left,right})]: 16px; + background-repeat: no-repeat; + } +.titrem.replie {background-image: url(#EVAL{_DIR_IMG_PACK}wrapper.php?file=deplierhaut[(#ENV{ltr}|choixsiegal{left,'',_rtl})].gif);} +.titrem.hover { background-color: #eee; } +.titrem.deplie { display: block; background-image: url(#EVAL{_DIR_IMG_PACK}wrapper.php?file=deplierbas.gif); } .bloc_depliable { display: none; } .bloc_depliable.deplie { display: block; } diff --git a/ecrire/inc/editer_auteurs.php b/ecrire/inc/editer_auteurs.php index ac75f0c46078ac689be54844337c1a66b3fcbdcb..3aa4638ee95a0fdd2e03bc9b2262a7bc3732a227 100644 --- a/ecrire/inc/editer_auteurs.php +++ b/ecrire/inc/editer_auteurs.php @@ -106,7 +106,7 @@ function editer_auteurs_objet($type, $id, $flag, $cherche_auteur, $ids, $les_aut . $res; } - $bouton = (!$flag ? $titre_boite : bouton_block_depliable($titre_boite,$flag === 'ajax',"auteurs$type")); + $bouton = bouton_block_depliable($titre_boite,$flag ?($flag === 'ajax'):-1,"auteurs$type"); $res = debut_cadre_enfonce("auteur-24.gif", true, "", $bouton) . $reponse . debut_block_depliable($flag === 'ajax',"auteurs$type") diff --git a/ecrire/inc/iconifier.php b/ecrire/inc/iconifier.php index 54a49d8031173c76ec60ab26b99bc440967168b1..6f68ef8500165864b13193079209b24cb12600fd 100644 --- a/ecrire/inc/iconifier.php +++ b/ecrire/inc/iconifier.php @@ -27,12 +27,13 @@ function inc_iconifier_dist($id_objet, $id, $script, $visible=false) { if (!$logo = $chercher_logo($id, $id_objet, 'on')) { $masque = indiquer_logo($texteon, $id_objet, 'on', $id, $script, $iframe); - $res = block_parfois_visible('on', "<b>$texteon</b>", $masque,'',$visible); + $bouton = bouton_block_depliable($texteon,$visible,'on'); + $res = debut_block_depliable($visible,'on') . $masque . fin_block(); } else { list($img, $clic) = decrire_logo($id_objet,'on',$id, 170, 170, $logo, $texteon, $script); - $masque = block_parfois_visible('on', "<b>$texteon</b><br />$img", $clic, 'margin-bottom: -2px',$visible); - + $bouton = bouton_block_depliable("$texteon<br />$img",$visible,'on'); + $masque = debut_block_depliable($visible,'on') . $clic . fin_block(); $res = "<div style='text-align: center'>$masque</div><br /><br />";; $texteoff = _T('logo_survol'); @@ -40,16 +41,15 @@ function inc_iconifier_dist($id_objet, $id, $script, $visible=false) { list($img, $clic) = decrire_logo($id_objet, 'off', $id, 170, 170, $logo, $texteoff, $script); - $masque = block_parfois_visible('off', "<b>$texteoff</b><br />$img", $clic, 'margin-bottom: -2px'); - + $masque = block_parfois_visible('off', "$texteoff<br />$img", $clic, 'margin-bottom: -2px'); $res .= "<div style='text-align: center'>$masque</div>"; } else { $masque = indiquer_logo($texteoff, $id_objet, 'off', $id, $script, $iframe); - $res .= block_parfois_visible('off', "<b>$texteoff</b>", $masque); + $res .= block_parfois_visible('off', "$texteoff", $masque); } } - $res = debut_cadre_relief("image-24.gif", true) + $res = debut_cadre_relief("image-24.gif", true,'',$bouton) . "<div class='verdana1' style='text-align: center;'>" . $res . "</div>" diff --git a/ecrire/inc/layer.php b/ecrire/inc/layer.php index 89b0f5cb8ef574b2e53185b892a9d07967bb8e1e..1088a0f963a03a77d184f44ec914c1d00fb7025e 100644 --- a/ecrire/inc/layer.php +++ b/ecrire/inc/layer.php @@ -24,12 +24,6 @@ $compteur_block = rand(1,2500)*500; // astuce idiote pour que les blocs ahah n'a function block_parfois_visible($nom, $invite, $masque, $style='', $visible=false){ if (!$GLOBALS['browser_layer']) return ''; - $bouton = bouton_block_depliable($invite,$visible,$nom); - // initialement invisible, seulement si on sait rendre visible - if (!$visible AND _SPIP_AJAX) - $visible = 'display:none;'; - else $visible = 'display:block;'; - return "\n" . bouton_block_depliable($invite,$visible,$nom) . debut_block_depliable($visible,$nom) @@ -49,11 +43,12 @@ function fin_block() { return "<br class='nettoyeur' /></div>"; } // $texte : texte du bouton -// $deplie : true ou false +// $deplie : true (deplie) ou false (plie) ou -1 (inactif) // $ids : id des div lies au bouton (facultatif, par defaut c'est le div.bloc_depliable qui suit) function bouton_block_depliable($texte,$deplie,$ids=""){ + if (!_SPIP_AJAX) $deplie=true; // forcer un bouton deplie si pas de js $bouton_id = substr(md5($texte.microtime()),8); - $class= $deplie?" deplie":""; + $class= ($deplie==true)?" deplie":(($deplie==-1)?" impliable":" replie"); if (strlen($ids)){ $cible = explode(',',$ids); $cible = 'div#'.implode(",div#",$cible); @@ -64,10 +59,11 @@ function bouton_block_depliable($texte,$deplie,$ids=""){ } return "<div " .($bouton_id?"id='$bouton_id' ":"") - ."class='bouton_depliable$class'" - ." onclick=\"jQuery('$cible').toggleClass('deplie');jQuery(this).toggleClass('deplie');\"" + ."class='titrem$class'" + . (($deplie==-1)?"": + " onclick=\"toggleBouton(jQuery(this),jQuery('$cible'));\"" ." onmouseover=\"jQuery(this).addClass('hover');\"" - ." onmouseout=\"jQuery(this).removeClass('hover');\"" + ." onmouseout=\"jQuery(this).removeClass('hover');\"") .">$texte</div>"; } diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index a84075137b4d7e30d8ab2248188db56359d06fc6..5ff74c2edb6b3e2911c580902b11e927b9f69d4b 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -43,7 +43,7 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") { $style_cadre = " style='"; if ($spip_display != 1 AND $spip_display != 4 AND strlen($icone) > 1) { $style_gauche = "padding-$spip_lang_left: 38px;"; - $style_cadre .= "margin-top: 14px;'"; + $style_cadre .= "margin-top: 20px;'"; } else { $style_cadre .= "'"; $style_gauche = ''; @@ -56,14 +56,9 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") { $ret = "<a id='access-$accesskey_c' href='#access-$accesskey_c' accesskey='$accesskey_c'></a>"; } else $ret =''; - if ($style == "e") { - $ret .= "\n<div class='cadre-e-noir'$style_cadre><div class='cadre-$style'>"; - } - else { - $ret .= "\n<div class='cadre-$style'$style_cadre>"; - } + $ret .= "\n<div class='cadre cadre-$style'$style_cadre>"; - $ret .= "\n<div style='position: relative;'>"; + //$ret .= "\n<div style='position: relative;'>"; if ($spip_display != 1 AND $spip_display != 4 AND strlen($icone) > 1) { $ret .= "\n<div style='position: absolute; top: -16px; $spip_lang_left: 10px;'>"; @@ -79,23 +74,28 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") { } if (strlen($titre) > 0) { - if ($spip_display == 4) { + if (strpos($titre,'titrem')!==false) { + $ret .= $titre; + } elseif ($spip_display == 4) { $ret .= "\n<h3 class='cadre-titre'>$titre</h3>"; } else { - $ret .= "\n<div class='cadre-titre' style='margin: 0px;$style_gauche'>$titre</div>"; + $ret .= bouton_block_depliable($titre,-1); } } - return $ret . "</div>\n<div class='cadre-padding' style='overflow:hidden'>"; + return $ret + //. "</div>\n" + ."<div class='cadre-padding' style='overflow:hidden'>" + ; } // http://doc.spip.org/@fin_cadre function fin_cadre($style='') { - $ret = ($style == "e") ? "</div></div></div>\n" : "</div></div>\n"; + $ret = "</div></div>\n"; - if ($style != "forum" AND $style != "thread-forum") - $ret .= "<div style='height: 5px;'></div>\n"; + /*if ($style != "forum" AND $style != "thread-forum") + $ret .= "<div style='height: 5px;'></div>\n";*/ return $ret; } @@ -1685,7 +1685,7 @@ function enfant_rub($collection){ $les_enfants = "\n<div class='enfants'>" . debut_cadre_sous_rub(($id_parent ? "rubrique-24.gif" : "secteur-24.gif"), true) . (is_string($logo) ? $logo : '') . - (!$les_sous_enfants ? $lib_bouton : bouton_block_depliable($lib_bouton,false,"enfants$id_rubrique")) . + bouton_block_depliable($lib_bouton,$les_sous_enfants ?false:-1,"enfants$id_rubrique") . (!$descriptif ? '' : "\n<div class='verdana1'>$descriptif</div>") . (($spip_display == 4) ? '' : $les_sous_enfants) . "\n<div style='clear:both;'></div>" .