diff --git a/adminer/create.inc.php b/adminer/create.inc.php index dc099216..88c0e059 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -157,7 +157,7 @@ foreach ($engines as $engine) { : " autocapitalize="off"> - "(" . lang('engine') . ")") + $engines, $row["Engine"]) : ""); ?> +" . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "" : ""); ?> "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?> diff --git a/adminer/db.inc.php b/adminer/db.inc.php index c5e4c873..d3b9d263 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -114,17 +114,17 @@ if ($adminer->homepage()) { echo "\n"; if (!information_schema(DB)) { - $vacuum = " "; - $optimize = " "; + $vacuum = " "; + $optimize = " "; echo "
" . lang('Selected') . "
" . ($jush == "sqlite" ? $vacuum : ($jush == "pgsql" ? $vacuum . $optimize - : ($jush == "sql" ? " " . $optimize - . " " - . " " + : ($jush == "sql" ? " " . $optimize + . " " + . " " : ""))) - . (support("table") ? " " : "") - . "\n"; + . (support("table") ? " " : "") + . "\n"; $databases = (support("scheme") ? schemas() : $adminer->databases()); if (count($databases) != 1 && $jush != "sqlite") { $db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB)); diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index edadec9a..3b283700 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -236,7 +236,8 @@ username.form['auth[driver]'].onchange(); $select[""] = array(); foreach ($select as $key => $val) { $val = $_GET["columns"][$key]; - echo "
" . html_select("columns[$i][fun]", array(-1 => "") + $fun_group, $val["fun"], ($key !== "" ? "" : " this.nextSibling.nextSibling.onchange();")); + echo "
"; echo "(" . select_input(" name='columns[$i][col]' onchange='" . ($key !== "" ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";'", $columns, $val["col"]) . ")
\n"; $i++; } diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 32b35a47..bb22c20e 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -469,10 +469,10 @@ function doc_link($path) { } /** Return events to display help on mouse over -* @param string -* @param bool +* @param string JS expression +* @param bool JS expression * @return string */ -function on_help($command, $right = 0) { - return " onmouseover=\"helpMouseover(this, '" . js_escape($command) . "', $right);\" onmouseout='helpMouseout();'"; +function on_help($command, $side = 0) { + return " onmouseover='helpMouseover(getTarget(event), " . h($command) . ", $side);' onmouseout='helpMouseout();'"; } diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0f9a7ba4..920756d4 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -800,7 +800,7 @@ function input($field, $value, $function) { $onchange = ($first ? " onchange=\"var f = this.form['function[" . h(js_escape(bracket_escape($field["field"]))) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : ""); $attrs .= $onchange; echo (count($functions) > 1 - ? html_select("function[$name]", $functions, $function === null || in_array($function, $functions) || isset($functions[$function]) ? $function : "", "functionChange(this);") + ? "" : nbsp(reset($functions)) ) . ''; $input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table diff --git a/adminer/static/editing.js b/adminer/static/editing.js index da11bdd0..6ed4e717 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -615,8 +615,15 @@ function schemaMouseup(ev, db) { var helpOpen; -function helpMouseover(el, text, right) { - if (window.jush) { +/** Display help +* @param HTMLElement +* @param string +* @param bool display on left side (otherwise on top) +*/ +function helpMouseover(el, text, side) { + if (!text) { + helpClose(); + } else if (window.jush) { helpOpen = 1; var help = document.getElementById('help'); help.innerHTML = text; @@ -627,11 +634,13 @@ function helpMouseover(el, text, right) { top += parent.offsetTop; left += parent.offsetLeft; } while (parent = parent.offsetParent); - help.style.top = (top - (right ? (help.offsetHeight - el.offsetHeight) / 2 : help.offsetHeight)) + 'px'; - help.style.left = (left + (right ? el.offsetWidth : (el.offsetWidth - help.offsetWidth) / 2)) + 'px'; + help.style.top = (top - (side ? (help.offsetHeight - el.offsetHeight) / 2 : help.offsetHeight)) + 'px'; + help.style.left = (left - (side ? help.offsetWidth : (help.offsetWidth - el.offsetWidth) / 2)) + 'px'; } } +/** Close help after timeout +*/ function helpMouseout() { helpOpen = 0; setTimeout(function () { @@ -641,6 +650,8 @@ function helpMouseout() { }, 200); } +/** Close help +*/ function helpClose() { alterClass(document.getElementById('help'), 'hidden', true); } diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 03800a21..3e8c0683 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -351,7 +351,7 @@ function isCtrl(event) { /** Return event target * @param Event -* @return HtmlElement +* @return HTMLElement */ function getTarget(event) { return event.target || event.srcElement; @@ -429,6 +429,7 @@ function functionChange(select) { } else if (input.origMaxLength >= 0) { input.maxLength = input.origMaxLength; } + helpClose(); } diff --git a/externals/jush b/externals/jush index 85b6e1e9..7df46998 160000 --- a/externals/jush +++ b/externals/jush @@ -1 +1 @@ -Subproject commit 85b6e1e9734eb01ebf4364d7f4ffdd18a8545d4d +Subproject commit 7df46998eca7ae1fd56f6ec48d7bf08dea09127d