diff options
| author | estadtherr <estadtherr@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2006-12-03 22:32:16 +0000 |
|---|---|---|
| committer | estadtherr <estadtherr@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2006-12-03 22:32:16 +0000 |
| commit | b1087e2a27346c28106efde54a4436a3b87ddd39 (patch) | |
| tree | 891eb1f8c65dc3bd7ac51417f7b5f0f4aa925610 /roundcubemail/program/js | |
| parent | cde983eb05da7485a11896aa5129844be07797d2 (diff) | |
fixed signature issues
git-svn-id: https://svn.roundcube.net/trunk@392 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
| -rw-r--r-- | roundcubemail/program/js/app.js | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index 3d4d848dc..497598016 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -1714,50 +1714,54 @@ function rcube_webmail() if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity]) { sig = this.env.signatures[this.env.identity]['text']; - if (sig.indexOf('--')!=0) - sig = '--\n'+sig; - + if (sig.indexOf('-- ')!=0) + sig = '-- \n'+sig; + p = message.lastIndexOf(sig); if (p>=0) message = message.substring(0, p-1) + message.substring(p+sig.length, message.length); } - + // add the new signature string if (this.env.signatures && this.env.signatures[id]) { sig = this.env.signatures[id]['text']; - if (sig.indexOf('--')!=0) - sig = '--\n'+sig; + if (this.env.signatures[id]['is_html']) + { + sig = this.env.signatures[id]['plain_text']; + } + if (sig.indexOf('-- ')!=0) + sig = '-- \n'+sig; message += '\n'+sig; } } else { - var eid = tinyMCE.getEditorId('_message'); - // editor is a TinyMCE_Control object - var editor = tinyMCE.getInstanceById(eid); - var msgDoc = editor.getDoc(); - var msgBody = msgDoc.body; + var eid = tinyMCE.getEditorId('_message'); + // editor is a TinyMCE_Control object + var editor = tinyMCE.getInstanceById(eid); + var msgDoc = editor.getDoc(); + var msgBody = msgDoc.body; - if (this.env.signatures && this.env.signatures[id]) + if (this.env.signatures && this.env.signatures[id]) + { + // Append the signature as a span within the body + var sigElem = msgDoc.getElementById("_rc_sig"); + if (!sigElem) { - // Append the signature as a span within the body - var sigElem = msgDoc.getElementById("_rc_sig"); - if (!sigElem) - { - sigElem = msgDoc.createElement("span"); - sigElem.setAttribute("id", "_rc_sig"); - msgBody.appendChild(sigElem); - } - if (this.env.signatures[id]['is_html']) - { - sigElem.innerHTML = this.env.signatures[id]['text']; - } - else - { - sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>'; - } + sigElem = msgDoc.createElement("span"); + sigElem.setAttribute("id", "_rc_sig"); + msgBody.appendChild(sigElem); + } + if (this.env.signatures[id]['is_html']) + { + sigElem.innerHTML = this.env.signatures[id]['text']; } + else + { + sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>'; + } + } } if (input_message) |
