Replace getElementById by shortcut for querySelector (requires IE8)

This commit is contained in:
Jakub Vrana 2018-01-11 11:55:17 +01:00
parent 67f6aea77f
commit 9cb281868f
13 changed files with 43 additions and 35 deletions

View file

@ -163,7 +163,7 @@ foreach ($engines as $engine) {
<p> <p>
<?php if (support("columns") || $TABLE == "") { ?> <?php if (support("columns") || $TABLE == "") { ?>
<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>" autocapitalize="off"> <?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
<?php if ($TABLE == "" && !$_POST) { ?><script type='text/javascript'>focus(document.getElementById('form')['name']);</script><?php } ?> <?php if ($TABLE == "" && !$_POST) { ?><script type='text/javascript'>focus(qs('#form')['name']);</script><?php } ?>
<?php echo ($engines ? "<select name='Engine' onchange='helpClose();'" . on_help("getTarget(event).value", 1) . ">" . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "</select>" : ""); ?> <?php echo ($engines ? "<select name='Engine' onchange='helpClose();'" . on_help("getTarget(event).value", 1) . ">" . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "</select>" : ""); ?>
<?php echo ($collations && !preg_match("~sqlite|mssql~", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?> <?php echo ($collations && !preg_match("~sqlite|mssql~", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">

View file

@ -66,7 +66,7 @@ echo ($_POST["add_x"] || strpos($name, "\n")
'mssql' => "ms187963.aspx", 'mssql' => "ms187963.aspx",
)) : ""); )) : "");
?> ?>
<script type='text/javascript'>focus(document.getElementById('name'));</script> <script type='text/javascript'>focus(qs('#name'));</script>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php <?php
if (DB != "") { if (DB != "") {

View file

@ -95,7 +95,7 @@ class Adminer {
<tr><th><?php echo lang('Database'); ?><td><input name="auth[db]" value="<?php echo h($_GET["db"]); ?>" autocapitalize="off"> <tr><th><?php echo lang('Database'); ?><td><input name="auth[db]" value="<?php echo h($_GET["db"]); ?>" autocapitalize="off">
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
focus(document.getElementById('username')); focus(qs('#username'));
</script> </script>
<?php <?php
echo "<p><input type='submit' value='" . lang('Login') . "'>\n"; echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
@ -413,7 +413,7 @@ focus(document.getElementById('username'));
json_row($key); json_row($key);
} }
echo ";\n"; echo ";\n";
echo "selectFieldChange(document.getElementById('form'));\n"; echo "selectFieldChange(qs('#form'));\n";
echo "</script>\n"; echo "</script>\n";
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }

View file

@ -1383,7 +1383,7 @@ function edit_form($TABLE, $fields, $row, $update) {
} }
} }
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n" echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n"
: ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n") : ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(qs('#form').getElementsByTagName('td')[1].firstChild);</script>\n")
); );
if (isset($_GET["select"])) { if (isset($_GET["select"])) {
hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"])); hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));

View file

@ -51,7 +51,7 @@ foreach (table_status('', true) as $table => $table_status) {
<div id="schema" style="height: <?php echo $top; ?>em;" onselectstart="return false;"> <div id="schema" style="height: <?php echo $top; ?>em;" onselectstart="return false;">
<script type="text/javascript"> <script type="text/javascript">
var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>}; var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
var em = document.getElementById('schema').offsetHeight / <?php echo $top; ?>; var em = qs('#schema').offsetHeight / <?php echo $top; ?>;
document.onmousemove = schemaMousemove; document.onmousemove = schemaMousemove;
document.onmouseup = function (ev) { document.onmouseup = function (ev) {
schemaMouseup(ev, '<?php echo js_escape(DB); ?>'); schemaMouseup(ev, '<?php echo js_escape(DB); ?>');

View file

@ -27,7 +27,7 @@ if (!$row) {
<form action="" method="post"> <form action="" method="post">
<p><input name="name" id="name" value="<?php echo h($row["name"]); ?>" autocapitalize="off"> <p><input name="name" id="name" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
<script type='text/javascript'>focus(document.getElementById('name'));</script> <script type='text/javascript'>focus(qs('#name'));</script>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php <?php
if ($_GET["ns"] != "") { if ($_GET["ns"] != "") {

View file

@ -338,7 +338,7 @@ function editingLengthChange(el) {
function editingLengthFocus(field) { function editingLengthFocus(field) {
var td = field.parentNode; var td = field.parentNode;
if (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) { if (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) {
var edit = document.getElementById('enum-edit'); var edit = qs('#enum-edit');
var val = field.value; var val = field.value;
edit.value = (/^'.+'$/.test(val) ? val.substr(1, val.length - 2).replace(/','/g, "\n").replace(/''/g, "'") : val); //! doesn't handle 'a'',''b' correctly edit.value = (/^'.+'$/.test(val) ? val.substr(1, val.length - 2).replace(/','/g, "\n").replace(/''/g, "'") : val); //! doesn't handle 'a'',''b' correctly
td.appendChild(edit); td.appendChild(edit);
@ -364,7 +364,7 @@ function editingLengthBlur(edit) {
* @param number * @param number
*/ */
function columnShow(checked, column) { function columnShow(checked, column) {
var trs = document.getElementById('edit-fields').getElementsByTagName('tr'); var trs = qs('#edit-fields').getElementsByTagName('tr');
for (var i=0; i < trs.length; i++) { for (var i=0; i < trs.length; i++) {
alterClass(trs[i].getElementsByTagName('td')[column], 'hidden', !checked); alterClass(trs[i].getElementsByTagName('td')[column], 'hidden', !checked);
} }
@ -374,7 +374,7 @@ function columnShow(checked, column) {
*/ */
function editingHideDefaults() { function editingHideDefaults() {
if (innerWidth < document.documentElement.scrollWidth) { if (innerWidth < document.documentElement.scrollWidth) {
document.getElementById('form')['defaults'].checked = false; qs('#form')['defaults'].checked = false;
columnShow(false, 5); columnShow(false, 5);
} }
} }
@ -385,7 +385,7 @@ function editingHideDefaults() {
function partitionByChange(el) { function partitionByChange(el) {
var partitionTable = /RANGE|LIST/.test(selectValue(el)); var partitionTable = /RANGE|LIST/.test(selectValue(el));
alterClass(el.form['partitions'], 'hidden', partitionTable || !el.selectedIndex); alterClass(el.form['partitions'], 'hidden', partitionTable || !el.selectedIndex);
alterClass(document.getElementById('partition-table'), 'hidden', !partitionTable); alterClass(qs('#partition-table'), 'hidden', !partitionTable);
helpClose(); helpClose();
} }
@ -533,7 +533,7 @@ function schemaMousemove(ev) {
var lineSet = { }; var lineSet = { };
for (var i=0; i < divs.length; i++) { for (var i=0; i < divs.length; i++) {
if (divs[i].className == 'references') { if (divs[i].className == 'references') {
var div2 = document.getElementById((/^refs/.test(divs[i].id) ? 'refd' : 'refs') + divs[i].id.substr(4)); var div2 = qs('#' + (/^refs/.test(divs[i].id) ? 'refd' : 'refs') + divs[i].id.substr(4));
var ref = (tablePos[divs[i].title] ? tablePos[divs[i].title] : [ div2.parentNode.offsetTop / em, 0 ]); var ref = (tablePos[divs[i].title] ? tablePos[divs[i].title] : [ div2.parentNode.offsetTop / em, 0 ]);
var left1 = -1; var left1 = -1;
var id = divs[i].id.replace(/^ref.(.+)-.+/, '$1'); var id = divs[i].id.replace(/^ref.(.+)-.+/, '$1');
@ -546,7 +546,7 @@ function schemaMousemove(ev) {
div2.getElementsByTagName('div')[0].style.width = -left2 + 'em'; div2.getElementsByTagName('div')[0].style.width = -left2 + 'em';
} }
if (!lineSet[id]) { if (!lineSet[id]) {
var line = document.getElementById(divs[i].id.replace(/^....(.+)-.+$/, 'refl$1')); var line = qs('#' + divs[i].id.replace(/^....(.+)-.+$/, 'refl$1'));
var top1 = top + divs[i].offsetTop / em; var top1 = top + divs[i].offsetTop / em;
var top2 = top + div2.offsetTop / em; var top2 = top + div2.offsetTop / em;
if (divs[i].parentNode != div2.parentNode) { if (divs[i].parentNode != div2.parentNode) {
@ -578,7 +578,7 @@ function schemaMouseup(ev, db) {
s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000; s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000;
} }
s = encodeURIComponent(s.substr(1)); s = encodeURIComponent(s.substr(1));
var link = document.getElementById('schema-link'); var link = qs('#schema-link');
link.href = link.href.replace(/[^=]+$/, '') + s; link.href = link.href.replace(/[^=]+$/, '') + s;
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
} }
@ -600,7 +600,7 @@ function helpMouseover(el, event, text, side) {
helpClose(); helpClose();
} else if (window.jush && (!helpIgnore || el != target)) { } else if (window.jush && (!helpIgnore || el != target)) {
helpOpen = 1; helpOpen = 1;
var help = document.getElementById('help'); var help = qs('#help');
help.innerHTML = text; help.innerHTML = text;
jush.highlight_tag([ help ]); jush.highlight_tag([ help ]);
alterClass(help, 'hidden'); alterClass(help, 'hidden');
@ -628,5 +628,5 @@ function helpMouseout(el, event) {
/** Close help /** Close help
*/ */
function helpClose() { function helpClose() {
alterClass(document.getElementById('help'), 'hidden', true); alterClass(qs('#help'), 'hidden', true);
} }

View file

@ -1,4 +1,12 @@
/** Get first element by selector
* @param string
* @return HTMLElement
*/
function qs(selector) {
return document.querySelector(selector);
}
/** Add or remove CSS class /** Add or remove CSS class
* @param HTMLElement * @param HTMLElement
* @param string * @param string
@ -15,7 +23,7 @@ function alterClass(el, className, enable) {
* @return boolean * @return boolean
*/ */
function toggle(id) { function toggle(id) {
var el = document.getElementById(id); var el = qs('#' + id);
el.className = (el.className == 'hidden' ? '' : 'hidden'); el.className = (el.className == 'hidden' ? '' : 'hidden');
return true; return true;
} }
@ -54,7 +62,7 @@ function verifyVersion(current) {
} }
}, false); }, false);
} }
document.getElementById('version').appendChild(iframe); qs('#version').appendChild(iframe);
} }
/** Get value of select /** Get value of select
@ -108,7 +116,7 @@ function trCheck(el) {
*/ */
function selectCount(id, count) { function selectCount(id, count) {
setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, ' ') + ')')); setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, ' ') + ')'));
var inputs = document.getElementById(id).parentNode.parentNode.getElementsByTagName('input'); var inputs = qs('#' + id).parentNode.parentNode.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) { for (var i = 0; i < inputs.length; i++) {
var input = inputs[i]; var input = inputs[i];
if (input.type == 'submit') { if (input.type == 'submit') {
@ -149,7 +157,7 @@ function tableCheck() {
* @param string * @param string
*/ */
function formUncheck(id) { function formUncheck(id) {
var el = document.getElementById(id); var el = qs('#' + id);
el.checked = false; el.checked = false;
trCheck(el); trCheck(el);
} }
@ -237,7 +245,7 @@ function checkboxClick(event, el) {
* @param string undefined to set parentNode to &nbsp; * @param string undefined to set parentNode to &nbsp;
*/ */
function setHtml(id, html) { function setHtml(id, html) {
var el = document.getElementById(id); var el = qs('#' + id);
if (el) { if (el) {
if (html == null) { if (html == null) {
el.parentNode.innerHTML = '&nbsp;'; el.parentNode.innerHTML = '&nbsp;';
@ -361,7 +369,7 @@ function columnMouse(el, className) {
* @param string * @param string
*/ */
function selectSearch(name) { function selectSearch(name) {
var el = document.getElementById('fieldset-search'); var el = qs('#fieldset-search');
el.className = ''; el.className = '';
var divs = el.getElementsByTagName('div'); var divs = el.getElementsByTagName('div');
for (var i=0; i < divs.length; i++) { for (var i=0; i < divs.length; i++) {
@ -514,7 +522,7 @@ function fieldChange(field) {
function ajax(url, callback, data, message) { function ajax(url, callback, data, message) {
var request = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false)); var request = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));
if (request) { if (request) {
var ajaxStatus = document.getElementById('ajaxstatus'); var ajaxStatus = qs('#ajaxstatus');
if (message) { if (message) {
ajaxStatus.innerHTML = '<div class="message">' + message + '</div>'; ajaxStatus.innerHTML = '<div class="message">' + message + '</div>';
ajaxStatus.className = ajaxStatus.className.replace(/ hidden/g, ''); ajaxStatus.className = ajaxStatus.className.replace(/ hidden/g, '');
@ -584,7 +592,7 @@ function ajaxForm(form, message, button) {
return ajax(url, function (request) { return ajax(url, function (request) {
setHtml('ajaxstatus', request.responseText); setHtml('ajaxstatus', request.responseText);
if (window.jush) { if (window.jush) {
jush.highlight_tag(document.getElementById('ajaxstatus').getElementsByTagName('code'), 0); jush.highlight_tag(qs('#ajaxstatus').getElementsByTagName('code'), 0);
} }
}, data, message); }, data, message);
} }
@ -678,7 +686,7 @@ function selectLoadMore(a, limit, loading) {
return ajax(href, function (request) { return ajax(href, function (request) {
var tbody = document.createElement('tbody'); var tbody = document.createElement('tbody');
tbody.innerHTML = request.responseText; tbody.innerHTML = request.responseText;
document.getElementById('table').appendChild(tbody); qs('#table').appendChild(tbody);
if (tbody.children.length < limit) { if (tbody.children.length < limit) {
a.parentNode.removeChild(a); a.parentNode.removeChild(a);
} else { } else {

View file

@ -40,7 +40,7 @@ page_header(($name != "" ? lang('Alter trigger') . ": " . h($name) : lang('Creat
<tr><th><?php echo lang('Type'); ?><td><?php echo html_select("Type", $trigger_options["Type"], $row["Type"]); ?> <tr><th><?php echo lang('Type'); ?><td><?php echo html_select("Type", $trigger_options["Type"], $row["Type"]); ?>
</table> </table>
<p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" maxlength="64" autocapitalize="off"> <p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" maxlength="64" autocapitalize="off">
<script type="text/javascript">document.getElementById('form')['Timing'].onchange();</script> <script type="text/javascript">qs('#form')['Timing'].onchange();</script>
<p><?php textarea("Statement", $row["Statement"]); ?> <p><?php textarea("Statement", $row["Statement"]); ?>
<p> <p>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">

View file

@ -135,7 +135,7 @@ if ($_POST) {
<tr><th><?php echo lang('Server'); ?><td><input name="host" maxlength="60" value="<?php echo h($row["host"]); ?>" autocapitalize="off"> <tr><th><?php echo lang('Server'); ?><td><input name="host" maxlength="60" value="<?php echo h($row["host"]); ?>" autocapitalize="off">
<tr><th><?php echo lang('Username'); ?><td><input name="user" maxlength="16" value="<?php echo h($row["user"]); ?>" autocapitalize="off"> <tr><th><?php echo lang('Username'); ?><td><input name="user" maxlength="16" value="<?php echo h($row["user"]); ?>" autocapitalize="off">
<tr><th><?php echo lang('Password'); ?><td><input name="pass" id="pass" value="<?php echo h($row["pass"]); ?>"> <tr><th><?php echo lang('Password'); ?><td><input name="pass" id="pass" value="<?php echo h($row["pass"]); ?>">
<?php if (!$row["hashed"]) { ?><script type="text/javascript">typePassword(document.getElementById('pass'));</script><?php } ?> <?php if (!$row["hashed"]) { ?><script type="text/javascript">typePassword(qs('#pass'));</script><?php } ?>
<?php echo checkbox("hashed", 1, $row["hashed"], lang('Hashed'), "typePassword(this.form['pass'], this.checked);"); ?> <?php echo checkbox("hashed", 1, $row["hashed"], lang('Hashed'), "typePassword(this.form['pass'], this.checked);"); ?>
</table> </table>

View file

@ -59,7 +59,7 @@ class Adminer {
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="auth[password]"> <tr><th><?php echo lang('Password'); ?><td><input type="password" name="auth[password]">
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
focus(document.getElementById('username')); focus(qs('#username'));
</script> </script>
<?php <?php
echo "<p><input type='submit' value='" . lang('Login') . "'>\n"; echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
@ -399,7 +399,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$field = idf_escape($_POST["email_field"]); $field = idf_escape($_POST["email_field"]);
$subject = $_POST["email_subject"]; $subject = $_POST["email_subject"];
$message = $_POST["email_message"]; $message = $_POST["email_message"];
preg_match_all('~\\{\\$([a-z0-9_]+)\\}~i', "$subject.$message", $matches); // allows {$name} in subject or message preg_match_all('~\\{\\$('#' + [a-z0-9_]+)\\}~i', "$subject.$message", $matches); // allows {$name} in subject or message
$rows = get_rows("SELECT DISTINCT $field" . ($matches[1] ? ", " . implode(", ", array_map('idf_escape', array_unique($matches[1]))) : "") . " FROM " . table($_GET["select"]) $rows = get_rows("SELECT DISTINCT $field" . ($matches[1] ? ", " . implode(", ", array_map('idf_escape', array_unique($matches[1]))) : "") . " FROM " . table($_GET["select"])
. " WHERE $field IS NOT NULL AND $field != ''" . " WHERE $field IS NOT NULL AND $field != ''"
. ($where ? " AND " . implode(" AND ", $where) : "") . ($where ? " AND " . implode(" AND ", $where) : "")
@ -488,7 +488,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
return "$function()"; return "$function()";
} }
$return = $value; $return = $value;
if (preg_match('~date|timestamp~', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P<p1>\\d*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\\2>\\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) { if (preg_match('~date|timestamp~', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P<p1>\\d*)', preg_replace('~(\\\\\\$('#' + [2-6]))~', '(?P<p\\2>\\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) {
$return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match); $return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match);
} }
$return = ($field["type"] == "bit" && preg_match('~^[0-9]+$~', $value) ? $return : q($return)); $return = ($field["type"] == "bit" && preg_match('~^[0-9]+$~', $value) ? $return : q($return));

View file

@ -28,7 +28,7 @@ var tablesFilterTimeout = null;
var tablesFilterValue = ''; var tablesFilterValue = '';
function tablesFilter(){ function tablesFilter(){
var value = document.getElementById('filter-field').value.toLowerCase(); var value = qs('#filter-field').value.toLowerCase();
if (value == tablesFilterValue) { if (value == tablesFilterValue) {
return; return;
} }
@ -40,7 +40,7 @@ function tablesFilter(){
if (sessionStorage) { if (sessionStorage) {
sessionStorage.setItem('adminer_tables_filter', value); sessionStorage.setItem('adminer_tables_filter', value);
} }
var tables = document.getElementById('tables').getElementsByTagName('li'); var tables = qs('#tables').getElementsByTagName('li');
for (var i = 0; i < tables.length; i++) { for (var i = 0; i < tables.length; i++) {
var a = tables[i].getElementsByTagName('a')[1]; var a = tables[i].getElementsByTagName('a')[1];
var text = tables[i].getAttribute('data-table-name'); var text = tables[i].getAttribute('data-table-name');
@ -60,10 +60,10 @@ function tablesFilterInput() {
} }
if (sessionStorage){ if (sessionStorage){
var db = document.getElementById('dbs').getElementsByTagName('select')[0]; var db = qs('#dbs').getElementsByTagName('select')[0];
db = db.options[db.selectedIndex].text; db = db.options[db.selectedIndex].text;
if (db == sessionStorage.getItem('adminer_tables_filter_db') && sessionStorage.getItem('adminer_tables_filter')){ if (db == sessionStorage.getItem('adminer_tables_filter_db') && sessionStorage.getItem('adminer_tables_filter')){
document.getElementById('filter-field').value = sessionStorage.getItem('adminer_tables_filter'); qs('#filter-field').value = sessionStorage.getItem('adminer_tables_filter');
tablesFilter(); tablesFilter();
} }
sessionStorage.setItem('adminer_tables_filter_db', db); sessionStorage.setItem('adminer_tables_filter_db', db);

View file

@ -71,7 +71,7 @@ tinyMCE.init({
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'> return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { }); tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { });
tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "'); tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');
document.getElementById('form').onsubmit = function () { qs('#form').onsubmit = function () {
tinyMCE.each(tinyMCE.editors, function (ed) { tinyMCE.each(tinyMCE.editors, function (ed) {
ed.remove(); ed.remove();
}); });