diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-08-26 07:55:24 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-08-26 07:55:24 +0200 |
commit | 9263f397e701f25af395e8cdee48c87ee3327157 (patch) | |
tree | cc7f6b6beef8947090a108701ca34316a5c8edb8 /template/en/default/attachment | |
parent | 23b94e8410d90e9e15584d3a9220b6bb214f4220 (diff) | |
parent | d57aefa118802606ea7cc424aaa62173be9eec41 (diff) | |
download | bugzilla-9263f397e701f25af395e8cdee48c87ee3327157.tar.gz bugzilla-9263f397e701f25af395e8cdee48c87ee3327157.tar.xz |
Merge remote-tracking branch 'bmo/mojo'
Diffstat (limited to 'template/en/default/attachment')
-rw-r--r-- | template/en/default/attachment/create.html.tmpl | 10 | ||||
-rw-r--r-- | template/en/default/attachment/createformcontents.html.tmpl | 116 |
2 files changed, 49 insertions, 77 deletions
diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index 7006448d3..2727a225c 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -39,18 +39,10 @@ doc_section = "attachments.html" %] -<script [% script_nonce FILTER none %]> -<!-- -TUI_hide_default('attachment_text_field'); ---> -</script> - [%# BMO hook for displaying MozReview message %] [% Hook.process('before_form') %] -<form name="entryform" method="post" action="attachment.cgi" - enctype="multipart/form-data" - onsubmit="return validateAttachmentForm(this)"> +<form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data"> <input type="hidden" name="bugid" value="[% bug.bug_id %]"> <input type="hidden" name="action" value="insert"> <input type="hidden" name="token" value="[% token FILTER html %]"> diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl index efb24e3e9..dd1c51563 100644 --- a/template/en/default/attachment/createformcontents.html.tmpl +++ b/template/en/default/attachment/createformcontents.html.tmpl @@ -19,45 +19,47 @@ # Joel Peshkin <bugreport@peshkin.net> # Erik Stambaugh <erik@dasbistro.com> # Marc Schumann <wurblzap@gmail.com> + # Kohei Yoshino <kohei.yoshino@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> +<tr id="att-selector"> + <th class="required"><label for="att-file">File</label>:</th> <td> - <em>Enter the path to the file on your computer</em> (or - <a id="attachment_data_controller"> - paste text as attachment</a>).<br> - <input type="file" id="data" name="data" size="50" aria-errormessage="data-error" aria-invalid="false"> - <div id="data-error" class="warning" aria-live="assertive"><div> - </td> -</tr> -<tr class="attachment_text_field"> - <th><label for="attach_text">File</label>:</th> - <td> - <em>Paste the text to be added as an attachment</em> (or - <a id="attachment_text_field_controller" href="javascript:TUI_toggle_class('attachment_text_field'); - javascript:TUI_toggle_class('attachment_data')" - >attach a file</a>).<br> - <textarea id="attach_text" name="attach_text" cols="80" rows="15" - onkeyup="TextFieldHandler()" onblur="TextFieldHandler()"></textarea> + <input hidden id="att-file" type="file" name="data" size="50"> + <input id="att-filename" type="hidden" name="filename"> + <section id="att-dropbox"> + <header> + <span class="icon" aria-hidden="true"></span> + <span><label id="att-browse-label" tabindex="0" role="button">Browse a file</label>, + drag & drop it, or paste text/link/image below.</span> + </header> + <div> + <textarea hidden id="att-data" name="data_base64" + aria-errormessage="data-error" aria-invalid="false"></textarea> + <textarea id="att-textarea" name="attach_text" cols="80" rows="10" + aria-label="Paste the text, link or image to be added as an attachment"></textarea> + <div hidden id="att-preview"> + <figure role="img" aria-labelledby="att-preview-name" itemscope itemtype="http://schema.org/MediaObject"> + <meta itemprop="encodingFormat"> + <pre itemprop="text"></pre> + <img src="" alt="" itemprop="image"> + <figcaption id="att-preview-name" itemprop="name"></figcaption> + <span class="icon" aria-hidden="true"></span> + </figure> + <span id="att-remove-button" tabindex="0" role="button" aria-label="Remove attachment"> + <span class="icon" aria-hidden="true"></span> + </span> + </div> + </div> + </section> + <div id="att-error-message" class="warning" aria-live="assertive"></div> </td> </tr> <tr> - <th class="required"><label for="description">Description</label>:</th> + <th class="required"><label for="att-description">Description</label>:</th> <td> <em>Describe the attachment briefly.</em><br> - <input type="text" id="description" name="description" class="required" - size="60" maxlength="200"> + <input id="att-description" class="required" type="text" name="description" size="60" maxlength="200"> </td> </tr> <tr[% ' class="expert_fields"' UNLESS bug.id %]> @@ -65,43 +67,21 @@ <td> <em>If the attachment is a patch, check the box below.</em><br> [% Hook.process("patch_notes") %] - <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 [% script_nonce FILTER none %]> - $(function() { - $("#data").on("change", function() { - DataFieldHandler(); - // Fire event to keep take-bug in sync. - $("#ispatch").change(); - }); - $("#ispatch").on("change", function() { - setContentTypeDisabledState(this.form); - var takebug = $("#takebug"); - if (takebug.is(":visible") && takebug.data("take-if-patch") && $("#ispatch").prop("checked")) { - $("#takebug").prop("checked", true); - } - }).change(); - }); - </script> - - <em>Otherwise, choose a method for determining the content type.</em><br> - <input type="radio" id="autodetect" - name="contenttypemethod" value="autodetect" checked="checked"> - <label for="autodetect">auto-detect</label><br> - <input type="radio" id="list" - name="contenttypemethod" value="list"> - <label for="list">select from list</label>: - <select name="contenttypeselection" id="contenttypeselection" - onchange="this.form.contenttypemethod[1].checked = true;"> - [% PROCESS content_types %] - </select><br> - <input type="radio" id="manual" - name="contenttypemethod" value="manual"> - <label for="manual">enter manually</label>: - <input type="text" name="contenttypeentry" id="contenttypeentry" - size="30" maxlength="200" - onchange="if (this.value) this.form.contenttypemethod[2].checked = true;"> + <input id="att-ispatch" type="checkbox" name="ispatch"> + <label for="att-ispatch">patch</label><br><br> + <div id="att-type-outer"> + <em>Otherwise, choose a method for determining the content type.</em> + <div> + <input id="att-type-list" type="radio" name="contenttypemethod" value="list" checked> + <label for="att-type-list">select from list</label>: + <select id="att-type-select" name="contenttypeselection">[% PROCESS content_types %]</select> + </div> + <div> + <input id="att-type-manual" type="radio" name="contenttypemethod" value="manual"> + <label for="att-type-manual">enter manually</label>: + <input id="att-type-input" type="text" name="contenttypeentry" size="30" maxlength="200"> + </div> + </div> </td> </tr> <tr[% ' class="expert_fields"' UNLESS bug.id %]> |