Skip to content
Extraits de code Groupes Projets
Valider 6d6a46ce rédigé par renato's avatar renato
Parcourir les fichiers

conform to xhtml strict; replace target attribute by javascript code

when possible the js code is inline to avoid enumerating all anchors for just few known links to be opened in a new window
parent e5723bc1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -157,7 +157,7 @@ function help_body($aide, $html, $lang_aide='') { ...@@ -157,7 +157,7 @@ function help_body($aide, $html, $lang_aide='') {
</div></center> </div></center>
<div style="position:absolute; bottom: 10px; right:20px; <div style="position:absolute; bottom: 10px; right:20px;
font-size: 12px; ">'. font-size: 12px; ">'.
preg_replace(",<a ,i", "<a target='_new' ",_T('info_copyright_doc')). preg_replace(",<a ,i", "<a class='target_blank' ",_T('info_copyright_doc')).
'</div>'; '</div>';
} }
...@@ -174,7 +174,18 @@ function help_body($aide, $html, $lang_aide='') { ...@@ -174,7 +174,18 @@ function help_body($aide, $html, $lang_aide='') {
generer_url_ecrire('aide_index', "img=$img", false, true); generer_url_ecrire('aide_index', "img=$img", false, true);
$suite = substr($suite, $p + strlen($r[0])); $suite = substr($suite, $p + strlen($r[0]));
} }
echo '<script type="text/javascript"><!--
jQuery(function(){
jQuery("a.target_blank").click(function(){
window.open(this.href);
return false;
});
});
//--></script>
';
echo _STYLE_AIDE_BODY, "</head>\n"; echo _STYLE_AIDE_BODY, "</head>\n";
echo '<body bgcolor="#FFFFFF" text="#000000" topmargin="24" leftmargin="24" marginwidth="24" marginheight="24"'; echo '<body bgcolor="#FFFFFF" text="#000000" topmargin="24" leftmargin="24" marginwidth="24" marginheight="24"';
...@@ -198,7 +209,7 @@ function help_body($aide, $html, $lang_aide='') { ...@@ -198,7 +209,7 @@ function help_body($aide, $html, $lang_aide='') {
$html = justifier($html . $suite ); $html = justifier($html . $suite );
// Remplacer les liens externes par des liens ouvrants (a cause des frames) // Remplacer les liens externes par des liens ouvrants (a cause des frames)
$html = ereg_replace('<a href="(http://[^"]+)"([^>]*)>', '<a href="\\1"\\2 target="_blank">', $html); $html = ereg_replace('<a href="(http://[^"]+)"([^>]*)>', '<a href="\\1"\\2 class="target_blank">', $html);
echo $html, '</body>'; echo $html, '</body>';
} }
...@@ -297,12 +308,20 @@ var curr_article; ...@@ -297,12 +308,20 @@ var curr_article;
// http://doc.spip.org/@activer_article // http://doc.spip.org/@activer_article
function activer_article(id) { function activer_article(id) {
if (curr_article) if (curr_article)
document.getElementById(curr_article).className = "article-inactif"; jQuery("#"+curr_article).removeClass("article-actif").addClass("article-inactif");
if (id) { if (id) {
document.getElementById(id).className = "article-actif"; jQuery("#"+id).removeClass("article-inactif").addClass("article-actif");
curr_article = id; curr_article = id;
} }
} }
jQuery(function(){
jQuery("a.target_droite").click(function(){
window.open(this.href,"droite");
return false;
});
});
//--></script> //--></script>
', ',
$GLOBALS['browser_layer'], $GLOBALS['browser_layer'],
...@@ -408,9 +427,9 @@ function article($titre, $lien, $statut = "redac") { ...@@ -408,9 +427,9 @@ function article($titre, $lien, $statut = "redac") {
else { else {
$class = "article-inactif"; $class = "article-inactif";
} }
$texte[$ligne] .= "<a class='$class' id='$id' $texte[$ligne] .= "<a class='$class target_droite' id='$id'
href='" . generer_url_ecrire("aide_index", "aide=$lien&frame=body&var_lang=$spip_lang", false, true) . href='" . generer_url_ecrire("aide_index", "aide=$lien&frame=body&var_lang=$spip_lang", false, true) .
"' target='droite' onclick=\"activer_article('$id');return true;\">$titre</a><br style='clear:both;' />\n"; "' onclick=\"activer_article('$id');return true;\">$titre</a><br style='clear:both;' />\n";
} }
} }
...@@ -468,6 +487,8 @@ else { ...@@ -468,6 +487,8 @@ else {
header("Content-Type: text/html; charset=utf-8"); header("Content-Type: text/html; charset=utf-8");
echo _DOCTYPE_AIDE, html_lang_attributes(); echo _DOCTYPE_AIDE, html_lang_attributes();
echo "<head><title>", _T('info_aide_en_ligne'), "</title>\n"; echo "<head><title>", _T('info_aide_en_ligne'), "</title>\n";
include_spip("inc/filtres");
echo f_jQuery("");
if ($frame == 'menu') if ($frame == 'menu')
help_menu($aide, $html, $lang); help_menu($aide, $html, $lang);
......
...@@ -35,6 +35,17 @@ function exec_brouteur_frame_dist() { ...@@ -35,6 +35,17 @@ function exec_brouteur_frame_dist() {
. "' />\n" . "' />\n"
. envoi_link(_T('info_mon_site_spip')) . envoi_link(_T('info_mon_site_spip'))
. pipeline('header_prive', $head) . pipeline('header_prive', $head)
. '<script type="text/javascript"><!--
jQuery(function(){
jQuery("a.iframe").click(function(){
window.open(this.href,"iframe"+this.rel);
return false;
});
});
//--></script>
'
. "</head>\n<body>"; . "</head>\n<body>";
if ($spip_ecran == "large") { if ($spip_ecran == "large") {
...@@ -128,14 +139,14 @@ onmouseover=\"changeclass(this, 'brouteur_rubrique_on');\" ...@@ -128,14 +139,14 @@ onmouseover=\"changeclass(this, 'brouteur_rubrique_on');\"
onmouseout=\"changeclass(this, 'brouteur_rubrique');\">"; onmouseout=\"changeclass(this, 'brouteur_rubrique');\">";
if ($id_parent == '0') { if ($id_parent == '0') {
echo "\n<div style='", frame_background_image("secteur-24.gif"), ";'><a href='", generer_url_ecrire('brouteur_frame', "rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui"), "' target='iframe", ($frame+1), "'>", echo "\n<div style='", frame_background_image("secteur-24.gif"), ";'><a href='", generer_url_ecrire('brouteur_frame', "rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui"), "' class='iframe' rel='", ($frame+1), "'>",
$titre, $titre,
"</a></div>"; "</a></div>";
} }
else { else {
if ($frame+1 < $nb_col) if ($frame+1 < $nb_col)
echo "\n<div style='", echo "\n<div style='",
frame_background_image("rubrique-24.gif"), ";'><a href='", generer_url_ecrire('brouteur_frame', "rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui"), "' target='iframe", frame_background_image("rubrique-24.gif"), ";'><a href='", generer_url_ecrire('brouteur_frame', "rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui"), "' class='iframe' rel='",
($frame+1), ($frame+1),
"'>$titre</a></div>"; "'>$titre</a></div>";
else echo "\n<div style='", else echo "\n<div style='",
...@@ -197,7 +208,7 @@ onmouseout=\"changeclass(this, 'brouteur_rubrique');\">"; ...@@ -197,7 +208,7 @@ onmouseout=\"changeclass(this, 'brouteur_rubrique');\">";
if ($cpt['n']) { if ($cpt['n']) {
echo "\n<div ", http_style_background('article-24.gif', "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"), echo "\n<div ", http_style_background('article-24.gif', "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"),
"><b class='verdana2'><a href='", generer_url_ecrire('brouteur_frame', "special=redac&frame=".($frame+1)."&effacer_suivant=oui"), "' target='iframe",($frame+1),"'>", "><b class='verdana2'><a href='", generer_url_ecrire('brouteur_frame', "special=redac&frame=".($frame+1)."&effacer_suivant=oui"), "' class='iframe' rel='",($frame+1),"'>",
_T("info_cours_edition"),"</a></b></div>"; _T("info_cours_edition"),"</a></b></div>";
} }
...@@ -206,7 +217,7 @@ onmouseout=\"changeclass(this, 'brouteur_rubrique');\">"; ...@@ -206,7 +217,7 @@ onmouseout=\"changeclass(this, 'brouteur_rubrique');\">";
$cpt = spip_fetch_array(spip_query("SELECT COUNT(*) AS n FROM spip_breves WHERE statut = 'prop'")); $cpt = spip_fetch_array(spip_query("SELECT COUNT(*) AS n FROM spip_breves WHERE statut = 'prop'"));
if ($cpt['n']) if ($cpt['n'])
echo "\n<div ", http_style_background('article-24.gif', "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"), echo "\n<div ", http_style_background('article-24.gif', "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"),
"><b class='verdana2'><a href='", generer_url_ecrire('brouteur_frame', "special=valider&frame=".($frame+1)."&effacer_suivant=oui"), "' target='iframe", "><b class='verdana2'><a href='", generer_url_ecrire('brouteur_frame', "special=valider&frame=".($frame+1)."&effacer_suivant=oui"), "' class='iframe' rel='",
($frame+1)."'>", ($frame+1)."'>",
_T("info_articles_proposes"), _T("info_articles_proposes"),
" / "._T("info_breves_valider")."</a></b></div>"; " / "._T("info_breves_valider")."</a></b></div>";
......
...@@ -21,7 +21,7 @@ function inc_aider_dist($aide='') { ...@@ -21,7 +21,7 @@ function inc_aider_dist($aide='') {
if (!$aide OR $spip_display == 4) return; if (!$aide OR $spip_display == 4) return;
$t = _T('titre_image_aide'); $t = _T('titre_image_aide');
return "\n&nbsp;&nbsp;<a target='spip_aide' class='aide'\nhref='" return "\n&nbsp;&nbsp;<a class='aide'\nhref='"
. generer_url_ecrire("aide_index", "aide=$aide&var_lang=$spip_lang") . generer_url_ecrire("aide_index", "aide=$aide&var_lang=$spip_lang")
. "'\nonclick=\"javascript:window.open(this.href," . "'\nonclick=\"javascript:window.open(this.href,"
. "'spip_aide', " . "'spip_aide', "
...@@ -39,4 +39,4 @@ function inc_aider_dist($aide='') { ...@@ -39,4 +39,4 @@ function inc_aider_dist($aide='') {
function aide_lang_dir($spip_lang,$spip_lang_rtl) { function aide_lang_dir($spip_lang,$spip_lang_rtl) {
return ($spip_lang<>'he') ? $spip_lang_rtl : ''; return ($spip_lang<>'he') ? $spip_lang_rtl : '';
} }
?> ?>
\ No newline at end of file
...@@ -79,7 +79,7 @@ function definir_barre_boutons() { ...@@ -79,7 +79,7 @@ function definir_barre_boutons() {
$urlAide= generer_url_ecrire('aide_index')."&amp;var_lang=$spip_lang"; $urlAide= generer_url_ecrire('aide_index')."&amp;var_lang=$spip_lang";
$boutons_admin['aide_index']= $boutons_admin['aide_index']=
new Bouton('aide-48'.$spip_lang_rtl.'.png', 'icone_aide_ligne', new Bouton('aide-48'.$spip_lang_rtl.'.png', 'icone_aide_ligne',
$urlAide, null, "javascript:window.open('$urlAide', 'aide_spip', 'scrollbars=yes,resizable=yes,width=740,height=580');", 'aide_spip'); $urlAide, null, "javascript:window.open('$urlAide', 'spip_aide', 'scrollbars=yes,resizable=yes,width=740,height=580');", 'aide_spip');
$boutons_admin['visiter']= $boutons_admin['visiter']=
new Bouton("visiter-48$spip_lang_rtl.png", 'icone_visiter_site', new Bouton("visiter-48$spip_lang_rtl.png", 'icone_visiter_site',
...@@ -388,7 +388,7 @@ function icone_bandeau_principal($texte, $lien, $fond, $rubrique_icone = "vide", ...@@ -388,7 +388,7 @@ function icone_bandeau_principal($texte, $lien, $fond, $rubrique_icone = "vide",
$class_select = ($sous_rubrique_icone == $sous_rubrique) ? " class='selection'" : ''; $class_select = ($sous_rubrique_icone == $sous_rubrique) ? " class='selection'" : '';
if (eregi("^javascript:",$lien)) { if (eregi("^javascript:",$lien)) {
$a_href = "\nonclick=\"$lien; return false;\" href='$lien_noscript' target='spip_aide'"; $a_href = "\nonclick=\"$lien; return false;\" href='$lien_noscript' ";
} }
else { else {
$a_href = "\nhref=\"$lien\""; $a_href = "\nhref=\"$lien\"";
......
...@@ -197,14 +197,14 @@ function info_copyright() { ...@@ -197,14 +197,14 @@ function info_copyright() {
if ($svn_revision = version_svn_courante(_DIR_RACINE)) { if ($svn_revision = version_svn_courante(_DIR_RACINE)) {
$version .= ' ' . (($svn_revision < 0) ? 'SVN ':'') $version .= ' ' . (($svn_revision < 0) ? 'SVN ':'')
. "[<a href='http://trac.rezo.net/trac/spip/changeset/" . "[<a href='http://trac.rezo.net/trac/spip/changeset/"
. abs($svn_revision) . "' target='_blank'>" . abs($svn_revision) . "' onclick=\"window.open(this.href); return false;\">"
. abs($svn_revision) . "</a>]"; . abs($svn_revision) . "</a>]";
} }
return _T('info_copyright', return _T('info_copyright',
array('spip' => "<b>SPIP $version</b> ", array('spip' => "<b>SPIP $version</b> ",
'lien_gpl' => 'lien_gpl' =>
"<a href='". generer_url_ecrire("aide_index", "aide=licence&var_lang=$spip_lang") . "' target='spip_aide' onclick=\"javascript:window.open(this.href, 'aide_spip', 'scrollbars=yes,resizable=yes,width=740,height=580'); return false;\">" . _T('info_copyright_gpl')."</a>")); "<a href='". generer_url_ecrire("aide_index", "aide=licence&var_lang=$spip_lang") . "' onclick=\"window.open(this.href, 'spip_aide', 'scrollbars=yes,resizable=yes,width=740,height=580'); return false;\">" . _T('info_copyright_gpl')."</a>"));
} }
......
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