Skip to content
Extraits de code Groupes Projets
Valider 89597e59 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

changement de convention : bouton_depliable devient titrem, et une classe pour...

changement de convention : bouton_depliable devient titrem, et une classe pour chaque etat (deplie,replie,impliable,)
parent dc256c59
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -44,6 +44,18 @@ function hide_obj(obj) { ...@@ -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) { function swap_couche(couche, rtl, dir, no_swap) {
var layer; var layer;
var triangle = document.getElementById('triangle' + couche); var triangle = document.getElementById('triangle' + couche);
......
...@@ -1000,19 +1000,26 @@ td.icone a img { ...@@ -1000,19 +1000,26 @@ td.icone a img {
/* /*
* Cadre couleur foncee * Cadre couleur foncee
*/ */
/*
.cadre-padding { .cadre-padding {
font-family: verdana, arial, helvetica, sans; font-family: verdana, arial, helvetica, sans;
font-size: 12px; font-size: 12px;
padding: 6px; padding: 6px;
position: relative; position: relative;
} }*/
/*
.cadre-titre { .cadre-titre {
font-family: verdana, arial, helvetica, sans; font-family: verdana, arial, helvetica, sans;
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 12px;
padding: 3px; padding: 3px;
}*/
.cadre {
margin-bottom:5px;
font-family: verdana, arial, helvetica, sans;
font-size: 12px;
position:relative;
} }
.cadre-fonce { .cadre-fonce {
...@@ -1044,8 +1051,6 @@ td.icone a img { ...@@ -1044,8 +1051,6 @@ td.icone a img {
color: #fff; color: #fff;
} }
.cadre-trait-couleur { .cadre-trait-couleur {
background-color: #fff; background-color: #fff;
border: 2px solid ##ENV{couleur_foncee,3874b0}; border: 2px solid ##ENV{couleur_foncee,3874b0};
...@@ -1061,7 +1066,6 @@ td.icone a img { ...@@ -1061,7 +1066,6 @@ td.icone a img {
border: 1px solid #666; border: 1px solid #666;
} }
.cadre-r div.cadre-titre { .cadre-r div.cadre-titre {
background-color: #aaa; background-color: #aaa;
border-bottom: 1px solid #666; border-bottom: 1px solid #666;
...@@ -1074,6 +1078,7 @@ td.icone a img { ...@@ -1074,6 +1078,7 @@ td.icone a img {
border-left: 1px solid #aaa; border-left: 1px solid #aaa;
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
border-right: 1px solid #fff; border-right: 1px solid #fff;
border: 1px solid #666;
} }
.cadre-e div.cadre-titre { .cadre-e div.cadre-titre {
...@@ -1082,13 +1087,10 @@ td.icone a img { ...@@ -1082,13 +1087,10 @@ td.icone a img {
color: #000; color: #000;
} }
.cadre-e-noir {
border: 1px solid #666;
}
.cadre-forum { .cadre-forum {
background-color: #fff; background-color: #fff;
border: 1px solid #aaa; border: 1px solid #aaa;
margin-bottom:0;
} }
.cadre-forum div.cadre-titre { .cadre-forum div.cadre-titre {
background-color: ##ENV{couleur_claire,edf3fe}; background-color: ##ENV{couleur_claire,edf3fe};
...@@ -1106,6 +1108,7 @@ td.icone a img { ...@@ -1106,6 +1108,7 @@ td.icone a img {
background-color: #eee; background-color: #eee;
border: 1px solid #ccc; border: 1px solid #ccc;
border-top: 0; border-top: 0;
margin-bottom:0;
} }
.cadre-thread-forum div.cadre-titre { .cadre-thread-forum div.cadre-titre {
background-color: #CCC; background-color: #CCC;
...@@ -1680,11 +1683,15 @@ a.ical { ...@@ -1680,11 +1683,15 @@ a.ical {
width: 10px; width: 10px;
} }
.bouton_depliable { display: block; .titrem {
background-image: url(#EVAL{_DIR_IMG_PACK}wrapper.php?file=deplierhaut[(#ENV{ltr}|choixsiegal{left,'',_rtl})].gif); background-repeat: no-repeat; display: block;
background-position: [(#ENV{ltr}|choixsiegal{left,left,right})] top; padding-[(#ENV{ltr}|choixsiegal{left,left,right})]: 16px; } background-position: [(#ENV{ltr}|choixsiegal{left,left,right})] top;
.bouton_depliable.hover { background-color: #eee; } padding-[(#ENV{ltr}|choixsiegal{left,left,right})]: 16px;
.bouton_depliable.deplie { display: block; background-image: url(#EVAL{_DIR_IMG_PACK}wrapper.php?file=deplierbas.gif); } 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 { display: none; }
.bloc_depliable.deplie { display: block; } .bloc_depliable.deplie { display: block; }
......
...@@ -106,7 +106,7 @@ function editer_auteurs_objet($type, $id, $flag, $cherche_auteur, $ids, $les_aut ...@@ -106,7 +106,7 @@ function editer_auteurs_objet($type, $id, $flag, $cherche_auteur, $ids, $les_aut
. $res; . $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) $res = debut_cadre_enfonce("auteur-24.gif", true, "", $bouton)
. $reponse . $reponse
. debut_block_depliable($flag === 'ajax',"auteurs$type") . debut_block_depliable($flag === 'ajax',"auteurs$type")
......
...@@ -27,12 +27,13 @@ function inc_iconifier_dist($id_objet, $id, $script, $visible=false) { ...@@ -27,12 +27,13 @@ function inc_iconifier_dist($id_objet, $id, $script, $visible=false) {
if (!$logo = $chercher_logo($id, $id_objet, 'on')) { if (!$logo = $chercher_logo($id, $id_objet, 'on')) {
$masque = indiquer_logo($texteon, $id_objet, 'on', $id, $script, $iframe); $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 { } else {
list($img, $clic) = decrire_logo($id_objet,'on',$id, 170, 170, $logo, $texteon, $script); 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 />";; $res = "<div style='text-align: center'>$masque</div><br /><br />";;
$texteoff = _T('logo_survol'); $texteoff = _T('logo_survol');
...@@ -40,16 +41,15 @@ function inc_iconifier_dist($id_objet, $id, $script, $visible=false) { ...@@ -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); 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>"; $res .= "<div style='text-align: center'>$masque</div>";
} else { } else {
$masque = indiquer_logo($texteoff, $id_objet, 'off', $id, $script, $iframe); $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;'>" . "<div class='verdana1' style='text-align: center;'>"
. $res . $res
. "</div>" . "</div>"
......
...@@ -24,12 +24,6 @@ $compteur_block = rand(1,2500)*500; // astuce idiote pour que les blocs ahah n'a ...@@ -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){ function block_parfois_visible($nom, $invite, $masque, $style='', $visible=false){
if (!$GLOBALS['browser_layer']) return ''; 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" return "\n"
. bouton_block_depliable($invite,$visible,$nom) . bouton_block_depliable($invite,$visible,$nom)
. debut_block_depliable($visible,$nom) . debut_block_depliable($visible,$nom)
...@@ -49,11 +43,12 @@ function fin_block() { ...@@ -49,11 +43,12 @@ function fin_block() {
return "<br class='nettoyeur' /></div>"; return "<br class='nettoyeur' /></div>";
} }
// $texte : texte du bouton // $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) // $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=""){ 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); $bouton_id = substr(md5($texte.microtime()),8);
$class= $deplie?" deplie":""; $class= ($deplie==true)?" deplie":(($deplie==-1)?" impliable":" replie");
if (strlen($ids)){ if (strlen($ids)){
$cible = explode(',',$ids); $cible = explode(',',$ids);
$cible = 'div#'.implode(",div#",$cible); $cible = 'div#'.implode(",div#",$cible);
...@@ -64,10 +59,11 @@ function bouton_block_depliable($texte,$deplie,$ids=""){ ...@@ -64,10 +59,11 @@ function bouton_block_depliable($texte,$deplie,$ids=""){
} }
return "<div " return "<div "
.($bouton_id?"id='$bouton_id' ":"") .($bouton_id?"id='$bouton_id' ":"")
."class='bouton_depliable$class'" ."class='titrem$class'"
." onclick=\"jQuery('$cible').toggleClass('deplie');jQuery(this).toggleClass('deplie');\"" . (($deplie==-1)?"":
" onclick=\"toggleBouton(jQuery(this),jQuery('$cible'));\""
." onmouseover=\"jQuery(this).addClass('hover');\"" ." onmouseover=\"jQuery(this).addClass('hover');\""
." onmouseout=\"jQuery(this).removeClass('hover');\"" ." onmouseout=\"jQuery(this).removeClass('hover');\"")
.">$texte</div>"; .">$texte</div>";
} }
......
...@@ -43,7 +43,7 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") { ...@@ -43,7 +43,7 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") {
$style_cadre = " style='"; $style_cadre = " style='";
if ($spip_display != 1 AND $spip_display != 4 AND strlen($icone) > 1) { if ($spip_display != 1 AND $spip_display != 4 AND strlen($icone) > 1) {
$style_gauche = "padding-$spip_lang_left: 38px;"; $style_gauche = "padding-$spip_lang_left: 38px;";
$style_cadre .= "margin-top: 14px;'"; $style_cadre .= "margin-top: 20px;'";
} else { } else {
$style_cadre .= "'"; $style_cadre .= "'";
$style_gauche = ''; $style_gauche = '';
...@@ -56,14 +56,9 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") { ...@@ -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>"; $ret = "<a id='access-$accesskey_c' href='#access-$accesskey_c' accesskey='$accesskey_c'></a>";
} else $ret =''; } else $ret ='';
if ($style == "e") { $ret .= "\n<div class='cadre cadre-$style'$style_cadre>";
$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 style='position: relative;'>"; //$ret .= "\n<div style='position: relative;'>";
if ($spip_display != 1 AND $spip_display != 4 AND strlen($icone) > 1) { if ($spip_display != 1 AND $spip_display != 4 AND strlen($icone) > 1) {
$ret .= "\n<div style='position: absolute; top: -16px; $spip_lang_left: 10px;'>"; $ret .= "\n<div style='position: absolute; top: -16px; $spip_lang_left: 10px;'>";
...@@ -79,23 +74,28 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") { ...@@ -79,23 +74,28 @@ function debut_cadre($style, $icone = "", $fonction = "", $titre = "") {
} }
if (strlen($titre) > 0) { 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>"; $ret .= "\n<h3 class='cadre-titre'>$titre</h3>";
} else { } 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 // http://doc.spip.org/@fin_cadre
function fin_cadre($style='') { 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") /*if ($style != "forum" AND $style != "thread-forum")
$ret .= "<div style='height: 5px;'></div>\n"; $ret .= "<div style='height: 5px;'></div>\n";*/
return $ret; return $ret;
} }
...@@ -1685,7 +1685,7 @@ function enfant_rub($collection){ ...@@ -1685,7 +1685,7 @@ function enfant_rub($collection){
$les_enfants = "\n<div class='enfants'>" . $les_enfants = "\n<div class='enfants'>" .
debut_cadre_sous_rub(($id_parent ? "rubrique-24.gif" : "secteur-24.gif"), true) . debut_cadre_sous_rub(($id_parent ? "rubrique-24.gif" : "secteur-24.gif"), true) .
(is_string($logo) ? $logo : '') . (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>") . (!$descriptif ? '' : "\n<div class='verdana1'>$descriptif</div>") .
(($spip_display == 4) ? '' : $les_sous_enfants) . (($spip_display == 4) ? '' : $les_sous_enfants) .
"\n<div style='clear:both;'></div>" . "\n<div style='clear:both;'></div>" .
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter