From 059a1bf669edb904052384dcb12be5d2d7555415 Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Fri, 16 Mar 2007 11:16:11 +0000 Subject: [PATCH] modifs sur class='spip', voir le msg sur spip-core --- dist/spip_style.css | 17 +++-------------- ecrire/inc/texte.php | 39 +++++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dist/spip_style.css b/dist/spip_style.css index 0772c0c326..baaebfa1de 100644 --- a/dist/spip_style.css +++ b/dist/spip_style.css @@ -5,16 +5,8 @@ /* Raccourcis typographiques de SPIP */ -i.spip {} -strong.spip {} -hr.spip {} - .spip_puce { list-style-position: outside; } -ul.spip {} -ol.spip {} -li.spip {} - h3.spip { text-align: center; margin-top: 2em; @@ -23,23 +15,20 @@ h3.spip { font-weight: bold; } /* Paragraphes, citations, code et poesie */ -p.spip {} -p.spip_note {} - blockquote.spip, .spip_serif { font-family: Georgia, Times, serif; } -blockquote.spip { +blockquote.spip { margin: 1em; padding-left: 1em; padding-right: 1em; border: 1px dotted; } -div.spip_poesie { +.spip_poesie { margin: 1em; padding-left: 1em; border-left: 1px solid; font-family: Garamond, Georgia, Times, serif; } -div.spip_poesie div { text-indent: -60px; margin-left: 60px; } +.spip_poesie div { text-indent: -60px; margin-left: 60px; } .spip_code, .spip_cadre { font-family: monospace; font-style: normal; font-size: 1.2em; } .spip_cadre { width: 99%; border: 1px inset; } diff --git a/ecrire/inc/texte.php b/ecrire/inc/texte.php index f79fffb976..54ae0d3b3e 100644 --- a/ecrire/inc/texte.php +++ b/ecrire/inc/texte.php @@ -926,7 +926,7 @@ function traiter_tableau($bloc) { $html = "<tr class=\"$class\">" . $ligne . "</tr>\n".$html; } - return "\n\n<table class=\"spip\"$summary>\n" + return "\n\n<table".$GLOBALS['class_spip_plus'].$summary.">\n" . $debut_table . "<tbody>\n" . $html @@ -940,6 +940,7 @@ function traiter_tableau($bloc) { // // http://doc.spip.org/@traiter_listes function traiter_listes ($texte) { + global $class_spip; $parags = preg_split(",\n[[:space:]]*\n,S", $texte); $texte =''; @@ -986,11 +987,11 @@ function traiter_listes ($texte) { while ($niveau < $profond) { if ($niveau == 0) $ajout .= "\n\n"; $niveau ++; - $ajout .= "<$type class=\"spip\">"; + $ajout .= "<$type$class_spip>"; $pile_type[$niveau] = "</$type>"; } - $ajout .= "<li class=\"spip\">"; + $ajout .= "<li$class_spip>"; $pile_li[$profond] = "</li>"; } else { @@ -1108,6 +1109,8 @@ function traiter_modeles($texte, $doublons=false, $echap='') { // // http://doc.spip.org/@paragrapher function paragrapher($letexte, $forcer=true) { + global $class_spip; + $letexte = trim($letexte); if (!strlen($letexte)) return ''; @@ -1140,8 +1143,8 @@ function paragrapher($letexte, $forcer=true) { $letexte = preg_replace(',<p\s[^>]*></p>\s*,iS', '', $letexte); - // Renommer les paragraphes normaux avec class="spip" - $letexte = str_replace('<p >', '<p class="spip">', + // Renommer les paragraphes normaux + $letexte = str_replace('<p >', '<p$class_spip>', $letexte); } @@ -1230,6 +1233,7 @@ function traiter_raccourcis($letexte) { global $debut_intertitre, $fin_intertitre, $ligne_horizontale, $url_glossaire_externe; global $debut_italique, $fin_italique; global $debut_gras, $fin_gras; + global $class_spip, $class_spip_plus; global $compt_note; global $marqueur_notes; global $ouvre_ref; @@ -1248,13 +1252,18 @@ function traiter_raccourcis($letexte) { // Verifier les variables de personnalisation if (!$tester_variables++) { - tester_variable('debut_intertitre', "\n<h3 class=\"spip\">"); - tester_variable('fin_intertitre', "</h3>\n"); - tester_variable('debut_italique', '<i class="spip">'); + // class_spip : savoir si on veut class="spip" sur p, i, strong & listes + // class_spip_plus : class="spip" sur les h3, hr, quote, tables... + // la difference c'est que des css specifiques existent pour les seconds + tester_variable('class_spip', ''); /*' class="spip"'*/ + tester_variable('class_spip_plus', ' class="spip"'); + tester_variable('debut_italique', "<i$class_spip>"); tester_variable('fin_italique', '</i>'); - tester_variable('debut_gras', '<strong class="spip">'); + tester_variable('debut_gras', "<strong$class_spip>"); tester_variable('fin_gras', '</strong>'); - tester_variable('ligne_horizontale', "\n<hr class=\"spip\" />\n"); + tester_variable('debut_intertitre', "\n<h3$class_spip_plus>"); + tester_variable('fin_intertitre', "</h3>\n"); + tester_variable('ligne_horizontale', "\n<hr$class_spip_plus />\n"); tester_variable('ouvre_ref', ' ['); tester_variable('ferme_ref', ']'); tester_variable('ouvre_note', '['); @@ -1272,7 +1281,7 @@ function traiter_raccourcis($letexte) { foreach ($regs as $reg) { $lecode = preg_replace(",\r\n?,S", "\n", $reg[2]); $lecode = preg_replace("/\n[\s]*\n/", "\n \n",$lecode); - $lecode = "<div class=\"spip_poesie\">\n<div>".preg_replace("/\n+/", "</div>\n<div>", trim($lecode))."</div>\n</div>\n\n"; + $lecode = "<blockquote class=\"spip_poesie\">\n<div>".preg_replace("/\n+/", "</div>\n<div>", trim($lecode))."</div>\n</blockquote>\n\n"; $letexte = str_replace($reg[0], $lecode, $letexte); } } @@ -1490,7 +1499,7 @@ function traiter_raccourcis($letexte) { /* 10 */ $fin_italique, /* 11 */ "<p>", /* 12 */ "<p>", - /* 13 */ "<blockquote class=\"spip\"><p>", + /* 13 */ "<blockquote$class_spip_plus><p>", /* 14 */ "</blockquote><p>", /* 15 */ "" ); @@ -1517,8 +1526,10 @@ function traiter_raccourcis($letexte) { // http://doc.spip.org/@traiter_les_notes function traiter_les_notes($mes_notes) { $mes_notes = propre('<p>'.$mes_notes); - $mes_notes = str_replace( - '<p class="spip">', '<p class="spip_note">', $mes_notes); + + if ($GLOBALS['class_spip']) + $mes_notes = str_replace('<p class="spip">', '<p class="spip_note">', $mes_notes); + $GLOBALS['les_notes'] .= $mes_notes; } -- GitLab