Changeset 10c92be in github


Ignore:
Timestamp:
Aug 30, 2006 3:55:55 PM (7 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
ea206d3
Parents:
107bde9
Message:

New indentation for quoted message text; HTML validity

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r949dea5 r10c92be  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42006/08/30 (thomasb) 
     5---------- 
     6- New indentation for quoted message text 
     7- Improved HTML validity 
     8 
    39 
    4102006/08/28 (estadtherr) 
  • index.php

    raade7b9 r10c92be  
    117117if ($_framed) 
    118118  { 
    119   $COMM_PATH .= '&_framed=1'; 
     119  $COMM_PATH .= '&amp;_framed=1'; 
    120120  $SESS_HIDDEN_FIELD .= "\n".'<input type="hidden" name="_framed" value="1" />'; 
    121121  } 
  • program/include/main.inc

    r107bde9 r10c92be  
    922922      $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS);         
    923923      unset($html_encode_arr['?']); 
    924       unset($html_encode_arr['&']); 
    925924      } 
    926925 
     
    934933      unset($encode_arr['<']); 
    935934      unset($encode_arr['>']); 
     935      unset($encode_arr['&']); 
    936936      } 
    937937    else if ($mode=='remove') 
  • program/steps/mail/func.inc

    r949dea5 r10c92be  
    215215      $class_name = 'junk'; 
    216216 
    217     $js_name = rep_specialchars_output($folder['id'], 'js'); 
     217    $js_name = htmlspecialchars(rep_specialchars_output($folder['id'], 'js')); 
    218218    $out .= sprintf('<li id="rcmbx%s" class="mailbox %s %s%s%s"><a href="%s&amp;_mbox=%s"'. 
    219219                    ' onclick="return %s.command(\'list\',\'%s\')"'. 
     
    272272 
    273273    $out .= sprintf('<option value="%s">%s%s</option>'."\n", 
    274                     $folder['id'], 
     274                    htmlspecialchars($folder['id']), 
    275275                    str_repeat('&nbsp;', $nestLevel*4), 
    276276                    rep_specialchars_output($foldername, 'html', 'all')); 
     
    730730    $convert_patterns[] = '/([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9]\\.[a-z]{2,5})/ie'; 
    731731    $convert_replaces[] = "rcmail_str_replacement('<a href=\"mailto:\\1\" onclick=\"return $JS_OBJECT_NAME.command(\'compose\',\'\\1\',this)\">\\1</a>', \$replace_strings)"; 
    732  
    733     $body = wordwrap(trim($body), 80); 
     732     
     733    if ($part->ctype_parameters['format'] != 'flowed') 
     734      $body = wordwrap(trim($body), 80); 
     735 
    734736    $body = preg_replace($convert_patterns, $convert_replaces, $body); 
    735737 
    736738    // split body into single lines 
    737739    $a_lines = preg_split('/\r?\n/', $body); 
     740    $quote_level = 0; 
    738741 
    739742    // colorize quoted parts 
     
    741744      { 
    742745      $line = $a_lines[$n]; 
    743  
    744       if ($line{2}=='>') 
    745         $color = 'red'; 
    746       else if ($line{1}=='>') 
    747         $color = 'green'; 
    748       else if ($line{0}=='>') 
    749         $color = 'blue'; 
    750       else 
    751         $color = FALSE; 
    752  
    753       $line = rep_specialchars_output($line, 'html', 'replace', FALSE); 
    754          
    755       if ($color) 
    756         $a_lines[$n] = sprintf('<font color="%s">%s</font>', $color, $line); 
    757       else 
    758         $a_lines[$n] = $line; 
     746      $quotation = ''; 
     747      $q = 0; 
     748       
     749      if (preg_match('/^(>+\s*)/', $line, $regs)) 
     750        { 
     751        $q = strlen(preg_replace('/\s/', '', $regs[1])); 
     752        $line = substr($line, strlen($regs[1])); 
     753 
     754        if ($q > $quote_level) 
     755          $quotation = str_repeat('<blockquote>', $q - $quote_level); 
     756        else if ($q < $quote_level) 
     757          $quotation = str_repeat("</blockquote>", $quote_level - $q); 
     758        } 
     759      else if ($quote_level > 0) 
     760        $quotation = str_repeat("</blockquote>", $quote_level); 
     761 
     762      $quote_level = $q; 
     763      $a_lines[$n] = $quotation . rep_specialchars_output($line, 'html', 'replace', FALSE); 
    759764      } 
    760765 
     
    762767    $body = preg_replace("/##string_replacement\{([0-9]+)\}##/e", "\$replace_strings[\\1]", join("\n", $a_lines)); 
    763768     
    764     return "<pre>\n".$body."\n</pre>"; 
     769    return "<div class=\"pre\">\n".$body."\n</div>"; 
    765770    } 
    766771  } 
  • skins/default/mail.css

    rfe79b1b r10c92be  
    655655} 
    656656 
    657 div.message-part pre 
     657div.message-part div.pre 
    658658{ 
    659659  margin: 0px; 
    660660  padding: 0px; 
    661 } 
    662  
     661  white-space: pre; 
     662  font-family: monospace; 
     663} 
     664 
     665div.message-part blockquote 
     666{ 
     667  color: blue; 
     668  border-left: 2px solid blue; 
     669  border-right: 2px solid blue; 
     670  background-color: #F6F6F6; 
     671  margin: 2px 0px 2px 0px; 
     672  padding: 1px 8px 1px 10px; 
     673} 
     674 
     675div.message-part blockquote blockquote 
     676{ 
     677  color: green; 
     678  border-left: 2px solid green; 
     679  border-right: 2px solid green; 
     680} 
     681 
     682div.message-part blockquote blockquote blockquote 
     683{ 
     684  color: #990000; 
     685  border-left: 2px solid #bb0000; 
     686  border-right: 2px solid #bb0000; 
     687} 
    663688 
    664689#remote-objects-message 
Note: See TracChangeset for help on using the changeset viewer.