Dotclear

Changeset 2225:7d94f2597021


Ignore:
Timestamp:
10/03/13 10:56:45 (11 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Open outgoing links in new window and append "new window" to title attribute only if javascript is enabled
Closes #1586

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • admin/_charte.php

    r2160 r2225  
    4242          dotclear.img_menu_on = 'images/menu_on.png'; 
    4343          dotclear.img_menu_off = 'images/menu_off.png'; 
     44          dotclear.msg.new_window = 'nouvelle fenêtre'; 
    4445     //]]> 
    4546     </script> 
     
    332333                         </p> 
    333334                    <h3 id="prevnext">Navigation contextuelle</h3> 
    334                          <p><a title="Titre du lien (nouvelle fenêtre)" onclick="window.open(this.href);return false;" href="http://fr.dotclear.org/blog" class="onblog_link">Lien vers le blog <img alt="" src="images/outgoing-blue.png" /></a></p> 
     335                         <p><a title="Titre du lien" href="http://fr.dotclear.org/blog" class="onblog_link outgoing">Lien vers le blog <img alt="" src="images/outgoing-blue.png" /></a></p> 
    335336                         <p class="nav_prevnext"><a title="Titre de l'élément précédente" href="post.php?id=4145">«&nbsp;Élément précédent</a> | <a title="Titre de l'élément suivant" href="#">Élément suivant&nbsp;»</a></p> 
    336337 
  • admin/index.php

    r2166 r2225  
    148148               foreach ($feed->items as $item) 
    149149               { 
    150                     $dt = isset($item->link) ? '<a href="'.$item->link.'" title="'.$item->title.' ('.__('new window').')">'. 
     150                    $dt = isset($item->link) ? '<a href="'.$item->link.'" class="outgoing" title="'.$item->title.'">'. 
    151151                         $item->title.' <img src="images/outgoing-blue.png" alt="" /></a>' : $item->title; 
    152152                
     
    179179      
    180180          foreach ($__resources['doc'] as $k => $v) { 
    181                $doc_links .= '<li><a href="'.$v.'" title="'.$k.' ('.__('new window').')">'.$k. 
     181               $doc_links .= '<li><a class="outgoing" href="'.$v.'" title="'.$k.'">'.$k. 
    182182               ' <img src="images/outgoing-blue.png" alt="" /></a></li>'; 
    183183          } 
  • admin/js/common.js

    r2201 r2225  
    240240}; 
    241241 
     242 
    242243/* Dotclear common object 
    243244-------------------------------------------------------- */ 
     
    403404               $('#footer a[href!="help.php"]').attr('title', $('#footer a[href!="help.php"]').attr('title') + this.data ); 
    404405          } 
     406     }); 
     407 
     408     // manage outgoing links 
     409     $('.outgoing').each(function() { 
     410          $(this).prop('title',$(this).attr('title')+' ('+dotclear.msg.new_window+')'); 
     411     }).click(function(e) { 
     412          e.preventDefault(); 
     413          window.open($(this).attr('href')); 
    405414     }); 
    406415 
  • admin/post.php

    r2181 r2225  
    420420 
    421421if ($post_id && $post->post_status == 1) { 
    422      echo '<p><a class="onblog_link" href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>'; 
     422     echo '<p><a class="onblog_link outgoing" href="'.$post->getURL().'" title="'.$post_title.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>'; 
    423423} 
    424424if ($post_id) 
  • admin/style/default.css

    r2224 r2225  
    14501450          text-align: center; 
    14511451          } 
     1452        .no-js .outgoing img { 
     1453                display: none; 
     1454        } 
    14521455     #dashboard-boxes .box { 
    14531456          padding: 10px; 
  • inc/admin/lib.dc.page.php

    r2202 r2225  
    136136          '<form action="index.php" method="post" id="top-info-blog">'. 
    137137          $blog_box. 
    138           '<p><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site'). 
    139           ' ('.__('new window').')'.'">'.__('Go to site').'<img src="images/outgoing.png" alt="" /></a>'. 
     138          '<p><a href="'.$core->blog->url.'" class="outgoing" title="'.__('Go to site'). 
     139          '">'.__('Go to site').'<img src="images/outgoing.png" alt="" /></a>'. 
    140140          '</p></form>'. 
    141141          '<ul id="top-info-user">'. 
     
    583583          self::jsVar('dotclear.msg.help', 
    584584               __('Need help?')). 
     585          self::jsVar('dotclear.msg.new_window', 
     586               __('new window')). 
    585587          self::jsVar('dotclear.msg.help_hide', 
    586588               __('Hide')). 
  • plugins/pages/page.php

    r2166 r2225  
    356356 
    357357if ($post_id && $post->post_status == 1) { 
    358      echo '<p><a class="onblog_link" href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this page on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>'; 
     358     echo '<p><a class="onblog_link outgoing" href="'.$post->getURL().'" title="'.$post_title.'">'.__('Go to this page on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>'; 
    359359} 
    360360 
Note: See TracChangeset for help on using the changeset viewer.

Sites map