Changeset dd792e8 in github


Ignore:
Timestamp:
Dec 3, 2006 5:32:16 PM (6 years ago)
Author:
svncommit <devs@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
056515e
Parents:
733c78f
Message:

fixed signature issues

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r733c78f rdd792e8  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42006/12/03 (estadtherr) 
     5---------- 
     6- Added fix to convert HTML signatures for plain text messages 
     7- Fixed signature delimeter character to be standard (Bug #1484035) 
     8 
    39 
    4102006/12/01 (thomasb) 
  • program/js/app.js

    rb190970 rdd792e8  
    17151715        { 
    17161716        sig = this.env.signatures[this.env.identity]['text']; 
    1717         if (sig.indexOf('--')!=0) 
    1718           sig = '--\n'+sig; 
    1719    
     1717        if (sig.indexOf('-- ')!=0) 
     1718          sig = '-- \n'+sig; 
     1719 
    17201720        p = message.lastIndexOf(sig); 
    17211721        if (p>=0) 
    17221722          message = message.substring(0, p-1) + message.substring(p+sig.length, message.length); 
    17231723        } 
    1724    
     1724 
    17251725      // add the new signature string 
    17261726      if (this.env.signatures && this.env.signatures[id]) 
    17271727        { 
    17281728        sig = this.env.signatures[id]['text']; 
    1729         if (sig.indexOf('--')!=0) 
    1730           sig = '--\n'+sig; 
     1729        if (this.env.signatures[id]['is_html']) 
     1730          { 
     1731          sig = this.env.signatures[id]['plain_text']; 
     1732          } 
     1733        if (sig.indexOf('-- ')!=0) 
     1734          sig = '-- \n'+sig; 
    17311735        message += '\n'+sig; 
    17321736        } 
     
    17341738    else 
    17351739      { 
    1736         var eid = tinyMCE.getEditorId('_message'); 
    1737         // editor is a TinyMCE_Control object 
    1738         var editor = tinyMCE.getInstanceById(eid); 
    1739         var msgDoc = editor.getDoc(); 
    1740         var msgBody = msgDoc.body; 
    1741  
    1742         if (this.env.signatures && this.env.signatures[id]) 
     1740      var eid = tinyMCE.getEditorId('_message'); 
     1741      // editor is a TinyMCE_Control object 
     1742      var editor = tinyMCE.getInstanceById(eid); 
     1743      var msgDoc = editor.getDoc(); 
     1744      var msgBody = msgDoc.body; 
     1745 
     1746      if (this.env.signatures && this.env.signatures[id]) 
     1747        { 
     1748        // Append the signature as a span within the body 
     1749        var sigElem = msgDoc.getElementById("_rc_sig"); 
     1750        if (!sigElem) 
    17431751          { 
    1744           // Append the signature as a span within the body 
    1745           var sigElem = msgDoc.getElementById("_rc_sig"); 
    1746           if (!sigElem) 
    1747             { 
    1748             sigElem = msgDoc.createElement("span"); 
    1749             sigElem.setAttribute("id", "_rc_sig"); 
    1750             msgBody.appendChild(sigElem); 
    1751             } 
    1752           if (this.env.signatures[id]['is_html']) 
    1753             { 
    1754             sigElem.innerHTML = this.env.signatures[id]['text']; 
    1755             } 
    1756           else 
    1757             { 
    1758             sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>'; 
    1759             } 
     1752          sigElem = msgDoc.createElement("span"); 
     1753          sigElem.setAttribute("id", "_rc_sig"); 
     1754          msgBody.appendChild(sigElem); 
    17601755          } 
     1756        if (this.env.signatures[id]['is_html']) 
     1757          { 
     1758          sigElem.innerHTML = this.env.signatures[id]['text']; 
     1759          } 
     1760        else 
     1761          { 
     1762          sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>'; 
     1763          } 
     1764        } 
    17611765      } 
    17621766 
  • program/lib/html2text.inc

    r40ed9be rdd792e8  
    165165        "strtoupper(\"\n\n\\1\n\n\")",          // H1 - H3 
    166166        "ucwords(\"\n\n\\1\n\n\")",             // H4 - H6 
    167         "\n\n\t",                               // <P> 
     167        "\n",                                   // <P> 
    168168        "\n",                                   // <br> 
    169169        'strtoupper("\\1")',                    // <b> 
     
    233233     */ 
    234234    var $_link_list = array(); 
     235     
     236    /** 
     237     * Boolean flag, true if a table of link URLs should be listed after the text. 
     238     *  
     239     * @var boolean $_do_links 
     240     * @access private 
     241     * @see html2text() 
     242     */ 
     243    var $_do_links = true; 
    235244 
    236245    /** 
     
    243252     *  @param string $source HTML content 
    244253     *  @param boolean $from_file Indicates $source is a file to pull content from 
    245      *  @access public 
    246      *  @return void 
    247      */ 
    248     function html2text( $source = '', $from_file = false ) 
     254     *  @param boolean $do_link_table indicate whether a table of link URLs is desired 
     255     *  @access public 
     256     *  @return void 
     257     */ 
     258    function html2text( $source = '', $from_file = false, $do_link_table = true ) 
    249259    { 
    250260        if ( !empty($source) ) { 
     
    252262        } 
    253263        $this->set_base_url(); 
     264        $this->_do_links = $produce_link_table; 
    254265    } 
    255266 
     
    410421    function _build_link_list($link, $display) 
    411422      { 
     423      if (! $this->_do_links) return $display; 
     424 
    412425      $link_lc = strtolower($link); 
    413426       
  • program/steps/mail/compose.inc

    r03ac213 rdd792e8  
    2121 
    2222require_once('Mail/mimeDecode.php'); 
     23require_once('lib/html2text.inc'); 
    2324 
    2425// define constants for message compose mode 
     
    297298        $a_signatures[$identity_id]['text'] = $sql_arr['signature']; 
    298299        $a_signatures[$identity_id]['is_html'] = ($sql_arr['html_signature'] == 1) ? true : false; 
     300        if ($a_signatures[$identity_id]['is_html']) 
     301          { 
     302            $h2t = new html2text($a_signatures[$identity_id]['text'], false, false); 
     303            $plainTextPart = $h2t->get_text(); 
     304            $a_signatures[$identity_id]['plain_text'] = trim($plainTextPart); 
     305          } 
    299306        } 
    300307 
  • program/steps/settings/edit_identity.inc

    r740e9ec rdd792e8  
    5757                                    "theme_advanced_toolbar_align : 'left'," . 
    5858                                    "theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr'," . 
    59                                     "theme_advanced_buttons2 : 'link,unlink,forecolor,fontselect,fontsizeselect'," . 
     59                                    "theme_advanced_buttons2 : 'link,unlink,code,forecolor,fontselect,fontsizeselect'," . 
    6060                                    "theme_advanced_buttons3 : '' });"); 
    6161 
Note: See TracChangeset for help on using the changeset viewer.