(type)
| 146 | } |
| 147 | |
| 148 | getEmailText(type) { |
| 149 | let text; |
| 150 | let html; |
| 151 | if (this.emailTextElement.tagName.toLowerCase() === 'textarea') { |
| 152 | text = this.emailTextElement.value; |
| 153 | } else { // html element |
| 154 | if (type === 'text') { |
| 155 | this.emailTextElement.focus(); |
| 156 | const sel = this.emailTextElement.ownerDocument.defaultView.getSelection(); |
| 157 | sel.selectAllChildren(this.emailTextElement); |
| 158 | text = sel.toString(); |
| 159 | sel.removeAllRanges(); |
| 160 | } else { |
| 161 | html = this.emailTextElement.innerHTML; |
| 162 | html = html.replace(/\n/g, ''); // remove new lines |
| 163 | text = html; |
| 164 | } |
| 165 | } |
| 166 | return text; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Is called after encryption and injects ciphertext and recipient |
no outgoing calls
no test coverage detected