Zeile 16: |
Zeile 16: |
| var suffix = document.getElementById('emailsuffix'+i); | | var suffix = document.getElementById('emailsuffix'+i); |
| var text = document.getElementById('emailtext'+i); | | var text = document.getElementById('emailtext'+i); |
| + | var subject = document.getElementById('emailsubject'+i); |
| + | var body = document.getElementById('emailbody'+i); |
| | | |
| if(typeof(user) != 'undefined' && user !== null && typeof(host) != 'undefined' && host !== null && typeof(suffix) != 'undefined' && suffix !== null) | | if(typeof(user) != 'undefined' && user !== null && typeof(host) != 'undefined' && host !== null && typeof(suffix) != 'undefined' && suffix !== null) |
Zeile 25: |
Zeile 27: |
| { | | { |
| link = text.innerHTML.replace(/^\s+|\s+$/g,''); | | link = text.innerHTML.replace(/^\s+|\s+$/g,''); |
| + | } |
| + | |
| + | if((typeof(subject) != 'undefined' && subject !== null) || (typeof(body) != 'undefined' && body !== null)) |
| + | { |
| + | if((subject !== null) && (body !== null)) |
| + | { |
| + | addr += '?&subject=' + encodeURIComponent(subject.innerHTML.replace(/^\s+|\s+$/g,'')) + '&body=' + encodeURIComponent(body.innerHTML.replace(/^\s+|\s+$/g,'')); |
| + | } |
| + | else if(subject !== null) |
| + | { |
| + | addr += '?&subject=' + encodeURIComponent(subject.innerHTML.replace(/^\s+|\s+$/g,'')); |
| + | } |
| + | else if(body !== null) |
| + | { |
| + | addr += '?&body=' + encodeURIComponent(body.innerHTML.replace(/^\s+|\s+$/g,'')); |
| + | } |
| } | | } |
| email.innerHTML = '<a href="mailto:' + addr + '">' + link + '</a>'; | | email.innerHTML = '<a href="mailto:' + addr + '">' + link + '</a>'; |