diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index b21ea41f..2fbaf36a 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -247,9 +247,11 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 $i++; } } - echo "
"; + echo "
"; + echo script("qsl('select').onchange = selectAddRow;", ""); echo html_select("where[$i][op]", array(-1 => "") + $this->operators); - echo "
\n"; + echo "
"; + echo script("mixin(qsl('input'), {onchange: function () { this.parentNode.firstChild.onchange(); }, onsearch: selectSearchSearch});"); echo "\n"; } @@ -304,12 +306,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 function selectEmailPrint($emailFields, $columns) { if ($emailFields) { print_fieldset("email", lang('E-mail'), $_POST["email_append"]); - echo "
\n"; + echo "
"; + echo script("qsl('div').onkeydown = partialArg(bodyKeydown, 'email');"); echo "

" . lang('From') . ": \n"; echo lang('Subject') . ": \n"; echo "

\n"; - echo "

" . html_select("email_addition", $columns, $_POST["email_addition"]) . "\n"; //! JavaScript - echo "

" . lang('Attachments') . ": "; + echo "

" . script("qsl('p').onkeydown = partialArg(bodyKeydown, 'email_append');", "") . html_select("email_addition", $columns, $_POST["email_addition"]) . "\n"; //! JavaScript + echo "

" . lang('Attachments') . ": " . script("qsl('input').onchange = emailFileChange;"); echo "

" . (count($emailFields) == 1 ? '' : html_select("email_field", $emailFields)); echo "\n"; echo "

\n"; diff --git a/editor/static/editing.js b/editor/static/editing.js index 7d69c01d..2de3212d 100644 --- a/editor/static/editing.js +++ b/editor/static/editing.js @@ -39,3 +39,13 @@ function whisper(url) { }); } } + +/** Add new attachment field +* @this HTMLInputElement +*/ +function emailFileChange() { + this.onchange = function () { }; + var el = this.cloneNode(true); + el.value = ''; + this.parentNode.appendChild(el); +}