Skip to content

Commit 2abf60f

Browse files
Remove email client button
1 parent bf04e30 commit 2abf60f

2 files changed

Lines changed: 6 additions & 21 deletions

File tree

‎layouts/shortcodes/email-aaf-request-form.html‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
</td>
3838
</tr>
3939
</table>
40-
<a id="aaf-mailto-{{ .Ordinal }}" class="btn btn-primary" href="#" role="button">
41-
Open in Email Client
42-
</a>
4340
</div>
4441
</div>
4542
</div>
@@ -53,7 +50,6 @@
5350
var output = document.getElementById('aaf-output-' + ord);
5451
var subjectEl = document.getElementById('aaf-subject-' + ord);
5552
var bodyEl = document.getElementById('aaf-body-' + ord);
56-
var mailto = document.getElementById('aaf-mailto-' + ord);
5753

5854
function getSubject() {
5955
return 'XNAT AAF account for project ' + projectInput.value.trim();
@@ -69,7 +65,6 @@
6965
if (project && org && site) {
7066
subjectEl.textContent = getSubject();
7167
bodyEl.textContent = getBody();
72-
mailto.href = 'mailto:rcc-support@uq.edu.au?subject=' + encodeURIComponent(getSubject()) + '&body=' + encodeURIComponent(getBody() + '\n');
7368
output.style.display = 'block';
7469
} else {
7570
output.style.display = 'none';

‎layouts/shortcodes/email-request-form.html‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,24 @@
1111
<th style="width:80px;">To</th>
1212
<td>rcc-support@uq.edu.au</td>
1313
<td style="width:70px; text-align:center; vertical-align:middle;">
14-
<button class="btn btn-sm btn-outline-secondary copy-field-btn" data-copy="rcc-support@uq.edu.au">Copy</button>
14+
<button class="btn btn-sm btn-outline-secondary" data-copy="rcc-support@uq.edu.au">Copy</button>
1515
</td>
1616
</tr>
1717
<tr>
1818
<th>Subject</th>
1919
<td><span id="email-subject-{{ .Ordinal }}"></span></td>
2020
<td style="width:70px; text-align:center; vertical-align:middle;">
21-
<button class="btn btn-sm btn-outline-secondary copy-field-btn" id="copy-subject-{{ .Ordinal }}">Copy</button>
21+
<button class="btn btn-sm btn-outline-secondary" id="copy-subject-{{ .Ordinal }}">Copy</button>
2222
</td>
2323
</tr>
2424
<tr>
2525
<th>Body</th>
2626
<td><span id="email-body-{{ .Ordinal }}" style="white-space:pre-line;"></span></td>
2727
<td style="width:70px; text-align:center; vertical-align:middle;">
28-
<button class="btn btn-sm btn-outline-secondary copy-field-btn" id="copy-body-{{ .Ordinal }}">Copy</button>
28+
<button class="btn btn-sm btn-outline-secondary" id="copy-body-{{ .Ordinal }}">Copy</button>
2929
</td>
3030
</tr>
3131
</table>
32-
<a id="email-link-{{ .Ordinal }}" class="btn btn-primary" href="#" role="button">
33-
Open in Email Client
34-
</a>
3532
</div>
3633
</div>
3734
</div>
@@ -43,7 +40,6 @@
4340
var output = document.getElementById('email-output-' + ord);
4441
var subjectEl = document.getElementById('email-subject-' + ord);
4542
var bodyEl = document.getElementById('email-body-' + ord);
46-
var link = document.getElementById('email-link-' + ord);
4743

4844
function getSubject() {
4945
return 'Request new XNAT project for ' + input.value.trim();
@@ -57,26 +53,20 @@
5753
if (collection) {
5854
subjectEl.textContent = getSubject();
5955
bodyEl.textContent = getBody();
60-
link.href = 'mailto:rcc-support@uq.edu.au?subject=' + encodeURIComponent(getSubject()) + '&body=' + encodeURIComponent(getBody() + '\n');
6156
output.style.display = 'block';
6257
} else {
6358
output.style.display = 'none';
6459
}
6560
});
6661

67-
function copyAndConfirm(btn, text) {
68-
navigator.clipboard.writeText(text);
69-
}
70-
7162
document.getElementById('copy-subject-' + ord).addEventListener('click', function() {
72-
copyAndConfirm(this, getSubject());
63+
navigator.clipboard.writeText(getSubject());
7364
});
7465
document.getElementById('copy-body-' + ord).addEventListener('click', function() {
75-
copyAndConfirm(this, getBody());
66+
navigator.clipboard.writeText(getBody());
7667
});
77-
7868
output.querySelector('[data-copy]').addEventListener('click', function() {
79-
copyAndConfirm(this, this.getAttribute('data-copy'));
69+
navigator.clipboard.writeText(this.getAttribute('data-copy'));
8070
});
8171
})();
8272
</script>

0 commit comments

Comments
 (0)