diff --git a/.gitmodules b/.gitmodules index 9b4770cb..ae3f414d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "JsShrink"] path = externals/JsShrink url = git://github.com/vrana/JsShrink.git +[submodule "CodeMirror2"] + path = externals/CodeMirror2 + url = git://github.com/marijnh/CodeMirror2.git diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index f39ea46b..7240bb8c 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -4,9 +4,10 @@ * @param string * @param mixed array("key" => "link=desc", "key2" => array("link", "desc")), null for nothing, false for driver only, true for driver and server * @param string used after colon in title and heading, will be HTML escaped +* @param string printed in * @return null */ -function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { +function page_header($title, $error = "", $breadcrumb = array(), $title2 = "", $head = "") { global $LANG, $adminer, $connection, $drivers; header("Content-Type: text/html; charset=utf-8"); if ($adminer->headers()) { @@ -38,6 +39,7 @@ var noResponse = ''; + onkeydown="bodyKeydown(event);" onload="bodyLoad('server_info, 0, 3) : ""); ?>');"> \n"); +textarea("query", $q, 20, 80, "query"); +echo ($_POST ? "" : "\n"); echo "

" . (ini_bool("file_uploads") ? lang('File upload') . ': (< ' . ini_get("upload_max_filesize") . 'B)' // ignore post_max_size because it is for all form fields together and bytes computing would be necessary : lang('File uploads are disabled.') @@ -212,3 +215,11 @@ if ($history) { ?> + + + + diff --git a/adminer/static/default.css b/adminer/static/default.css index 2b9a468b..a5c6f696 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -62,6 +62,8 @@ input[type=image] { vertical-align: middle; } .rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; } .rtl #lang, .rtl #menu { left: auto; right: 0; } +.CodeMirror { border: 1px inset #777; } + @media print { #lang, #menu { display: none; } #content { margin-left: 1em; } diff --git a/changes.txt b/changes.txt index 393d079a..75d81c99 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ Adminer 3.4.0-dev: Print current time next to executed SQL queries +Highlight code in textarea by CodeMirror Link to original table in EXPLAIN of SELECT * FROM table t Replace JSMin by better JavaScript minifier Ukrainian translation diff --git a/compile.php b/compile.php index 78a7a430..cc3ccac4 100644 --- a/compile.php +++ b/compile.php @@ -265,6 +265,7 @@ foreach (array("adminer", "editor") as $project) { $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico|loader\\.gif)~', '', $file); $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file); $file = str_replace("'../externals/jush/'", "location.protocol + '//www.adminer.org/static/'", $file); + $file = str_replace('"../externals/CodeMirror2"', '($_SERVER["HTTPS"] ? "https" : "http") . "://www.adminer.org/static/CodeMirror2"', $file); $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file); $file = php_shrink($file); diff --git a/externals/CodeMirror2 b/externals/CodeMirror2 new file mode 160000 index 00000000..8feb48b3 --- /dev/null +++ b/externals/CodeMirror2 @@ -0,0 +1 @@ +Subproject commit 8feb48b37c3678a102b2de41e24f0f43bee86f50