summaryrefslogtreecommitdiffstats
path: root/template/en/default/attachment/createformcontents.html.tmpl
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-02-21 19:59:53 +0100
committerGitHub <noreply@github.com>2018-02-21 19:59:53 +0100
commitd435e0a5b0e07c145f929457313d8d7738f42b14 (patch)
tree7ed248a0637b8fcf09380658ad731a0a79cbe600 /template/en/default/attachment/createformcontents.html.tmpl
parentc0d4e47a7b543ab406eeee414ae9baf228b43ce4 (diff)
downloadbugzilla-d435e0a5b0e07c145f929457313d8d7738f42b14.tar.gz
bugzilla-d435e0a5b0e07c145f929457313d8d7738f42b14.tar.xz
Bug 1439797 - Enable reporting-only CSP by default
Diffstat (limited to 'template/en/default/attachment/createformcontents.html.tmpl')
-rw-r--r--template/en/default/attachment/createformcontents.html.tmpl17
1 files changed, 13 insertions, 4 deletions
diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl
index dc861b7a6..41a02a913 100644
--- a/template/en/default/attachment/createformcontents.html.tmpl
+++ b/template/en/default/attachment/createformcontents.html.tmpl
@@ -21,13 +21,22 @@
# Marc Schumann <wurblzap@gmail.com>
#%]
+<script [% script_nonce FILTER none %]>
+ document.addEventListener("DOMContentLoaded", function (event) {
+ document.querySelector("#attachment_data_controller").addEventListener(
+ "click", function (event) {
+ TUI_toggle_class('attachment_text_field');
+ TUI_toggle_class('attachment_data');
+ });
+ });
+</script>
+
<tr class="attachment_data">
<th><label for="data">File</label>:</th>
<td>
<em>Enter the path to the file on your computer</em> (or
- <a id="attachment_data_controller" href="javascript:TUI_toggle_class('attachment_text_field');
- javascript:TUI_toggle_class('attachment_data')"
- >paste text as attachment</a>).<br>
+ <a id="attachment_data_controller">
+ paste text as attachment</a>).<br>
<input type="file" id="data" name="data" size="50">
</td>
</tr>
@@ -58,7 +67,7 @@
<input type="checkbox" id="ispatch" name="ispatch" value="1">
<label for="ispatch">patch</label><br><br>
[%# Reset this whenever the page loads so that the JS state is up to date %]
- <script [% csp_nonce FILTER none %]>
+ <script [% script_nonce FILTER none %]>
$(function() {
$("#file").on("change", function() {
DataFieldHandler();