Move inline event handlers to <script>
This commit is contained in:
parent
3fe0d88f98
commit
e255ba9aa4
|
@ -247,9 +247,11 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "<div><select name='where[$i][col]' onchange='this.nextSibling.nextSibling.onchange();'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, null, true) . "</select>";
|
echo "<div><select name='where[$i][col]'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, null, true) . "</select>";
|
||||||
|
echo script("qsl('select').onchange = selectAddRow;", "");
|
||||||
echo html_select("where[$i][op]", array(-1 => "") + $this->operators);
|
echo html_select("where[$i][op]", array(-1 => "") + $this->operators);
|
||||||
echo "<input type='search' name='where[$i][val]' onchange='selectAddRow.call(this);' onsearch='selectSearchSearch.call(this);'></div>\n";
|
echo "<input type='search' name='where[$i][val]'></div>";
|
||||||
|
echo script("mixin(qsl('input'), {onchange: function () { this.parentNode.firstChild.onchange(); }, onsearch: selectSearchSearch});");
|
||||||
echo "</div></fieldset>\n";
|
echo "</div></fieldset>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,12 +306,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||||
function selectEmailPrint($emailFields, $columns) {
|
function selectEmailPrint($emailFields, $columns) {
|
||||||
if ($emailFields) {
|
if ($emailFields) {
|
||||||
print_fieldset("email", lang('E-mail'), $_POST["email_append"]);
|
print_fieldset("email", lang('E-mail'), $_POST["email_append"]);
|
||||||
echo "<div onkeydown=\"return bodyKeydown(event, 'email');\">\n";
|
echo "<div>";
|
||||||
|
echo script("qsl('div').onkeydown = partialArg(bodyKeydown, 'email');");
|
||||||
echo "<p>" . lang('From') . ": <input name='email_from' value='" . h($_POST ? $_POST["email_from"] : $_COOKIE["adminer_email"]) . "'>\n";
|
echo "<p>" . lang('From') . ": <input name='email_from' value='" . h($_POST ? $_POST["email_from"] : $_COOKIE["adminer_email"]) . "'>\n";
|
||||||
echo lang('Subject') . ": <input name='email_subject' value='" . h($_POST["email_subject"]) . "'>\n";
|
echo lang('Subject') . ": <input name='email_subject' value='" . h($_POST["email_subject"]) . "'>\n";
|
||||||
echo "<p><textarea name='email_message' rows='15' cols='75'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea>\n";
|
echo "<p><textarea name='email_message' rows='15' cols='75'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea>\n";
|
||||||
echo "<p onkeydown=\"return bodyKeydown(event, 'email_append');\">" . html_select("email_addition", $columns, $_POST["email_addition"]) . "<input type='submit' name='email_append' value='" . lang('Insert') . "'>\n"; //! JavaScript
|
echo "<p>" . script("qsl('p').onkeydown = partialArg(bodyKeydown, 'email_append');", "") . html_select("email_addition", $columns, $_POST["email_addition"]) . "<input type='submit' name='email_append' value='" . lang('Insert') . "'>\n"; //! JavaScript
|
||||||
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"this.onchange = function () { }; var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el);\">";
|
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]'>" . script("qsl('input').onchange = emailFileChange;");
|
||||||
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : html_select("email_field", $emailFields));
|
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : html_select("email_field", $emailFields));
|
||||||
echo "<input type='submit' name='email' value='" . lang('Send') . "' onclick=\"return this.form['delete'].onclick();\">\n";
|
echo "<input type='submit' name='email' value='" . lang('Send') . "' onclick=\"return this.form['delete'].onclick();\">\n";
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue