]> git.joonet.de Git - adminer.git/commitdiff
Disable spell checking in SQL textareas
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 26 Apr 2010 16:22:24 +0000 (16:22 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 26 Apr 2010 16:22:24 +0000 (16:22 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1498 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/event.inc.php
adminer/include/functions.inc.php
adminer/procedure.inc.php
adminer/sql.inc.php
adminer/trigger.inc.php
adminer/view.inc.php
changes.txt
todo.txt

index 3556b4c4d8f1b29e5f8c182d3af82765818ce89b..807adc5dd541d6d8552e3bc4e0725e704d054961 100644 (file)
@@ -45,7 +45,7 @@ if ($_POST) {
 <tr><th><?php echo lang('Comment'); ?><td><input name="EVENT_COMMENT" value="<?php echo h($row["EVENT_COMMENT"]); ?>" maxlength="64">
 <tr><th>&nbsp;<td><?php echo checkbox("ON_COMPLETION", "PRESERVE", $row["ON_COMPLETION"] == "PRESERVE", lang('On completion preserve')); ?>
 </table>
-<p><textarea name="EVENT_DEFINITION" rows="10" cols="80" style="width: 98%;"><?php echo h($row["EVENT_DEFINITION"]); ?></textarea>
+<p><?php textarea("EVENT_DEFINITION", $row["EVENT_DEFINITION"]); ?>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 <input type="submit" value="<?php echo lang('Save'); ?>">
index 0068c10146bfe9e990f5a4684c4ec0a4c6693026..46482b0111756f5a7e47ff1c6dea379fb4fc6661 100644 (file)
@@ -116,6 +116,21 @@ function html_select($name, $options, $value = "", $onchange = true) {
        return $return;
 }
 
+/** Print SQL <textarea> tag
+* @param string
+* @param int
+* @param int
+* @param string
+* @return null
+*/
+function textarea($name, $value, $rows = 10, $cols = 80) {
+       echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false'>" . h($value) . "</textarea>"; // spellcheck - not valid before HTML5
+}
+
+
+
+// other functions
+
 /** Get INI boolean value
 * @param string
 * @return bool
index fa583c1b32fd17d43cd64bf5d0057a142944ffc1..bd03fd71fdfaf84f4bea6e84f0abbe83950be7bc 100644 (file)
@@ -48,7 +48,7 @@ if (isset($_GET["function"])) {
 }
 ?>
 </table>
-<p><textarea name="definition" rows="10" cols="80" style="width: 98%;"><?php echo h($row["definition"]); ?></textarea>
+<p><?php textarea("definition", $row["definition"]); ?>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 <?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
index d3abdeff3f7f78f7b9ee148dfbed30c4cf1d48ce..c8b1232cb6216db9fc63a182a19301aff5e8687a 100644 (file)
@@ -129,15 +129,15 @@ if (!$error && $_POST) {
 ?>
 
 <form action="" method="post" enctype="multipart/form-data">
-<p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php
+<p><?php
 $q = $_GET["sql"]; // overwrite $q from if ($_POST) to save memory
 if ($_POST) {
        $q = $_POST["query"];
 } elseif ($_GET["history"] != "") {
        $q = $history[$_GET["history"]];
 }
-echo h($q);
-?></textarea>
+textarea("query", $q, 20);
+?>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 <input type="submit" value="<?php echo lang('Execute'); ?>">
index c2df0ab6c24ab582032f4ebb34c8013f4701c040..3855758a61699570d965a8f2cf921b3c24276160 100644 (file)
@@ -34,7 +34,7 @@ if ($_POST) {
 <tr><th><?php echo lang('Event'); ?><td><?php echo html_select("Event", $trigger_event, $row["Event"], "this.form['Timing'].onchange();"); ?>
 <tr><th><?php echo lang('Type'); ?><td><?php echo html_select("Type", $trigger_options["Type"], $row["Type"]); ?>
 </table>
-<p><textarea name="Statement" rows="10" cols="80" style="width: 98%;"><?php echo h($row["Statement"]); ?></textarea>
+<p><?php textarea("Statement", $row["Statement"]); ?>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 <?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
index 95c805fea9080bf5fb26b9c3c7d6606e069ef8aa..30f053207a8e4266dd2db061bf5345dc281a1e2f 100644 (file)
@@ -25,7 +25,7 @@ if ($_POST) {
 ?>
 
 <form action="" method="post">
-<p><textarea name="select" rows="10" cols="80" style="width: 98%;"><?php echo h($row["select"]); ?></textarea>
+<p><?php textarea("select", $row["select"]); ?>
 <p>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 <?php if ($dropped) { // old view was dropped but new wasn't created ?><input type="hidden" name="dropped" value="1"><?php } ?>
index f0c71a35259d0d9ddda972cde4fed57fbe74e02c..4d0ef62f50b1623dfd25a7102f01878a593684a1 100644 (file)
@@ -6,6 +6,8 @@ Show number of tables in server overview
 Operator LIKE %%
 Remember export parameters in cookie
 Allow semicolon as CSV separator
+Autofocus username in login form
+Disable spellchecking in SQL textareas
 Japanese translation
 Defer table information in database overview to JavaScript (performance)
 Big tables optimizations (performance)
index 437140a2a2f95de69135aedd69e7f69ddf14ecbc..b054f82a09b9768fcc4e0fa8b89cc8fe20ea9e5c 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -1,7 +1,6 @@
 Transactions in export
 Create view and routine options
 Variables editation, especially timezone
-Disable spell checking in SQL textareas - spellcheck="false"
 Accept Tab in SQL textareas, Ctrl+Enter to send form
 Highlight SQL textarea, then display query inside textarea in select - may use external CodePress
 Blob download and image display in edit form (important for Editor with hidden fields in select)
@@ -11,6 +10,7 @@ Export by GET parameters
 Only first part of big BZ2 export is readable
 Auto-refresh processlist (thanks to Jan Garaj)
 Show pagination above and under the table in select
+? Filter by value in row under <thead> in select
 ? Column and table names auto-completition in SQL textarea
 ? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query, $connection->result and $connection->quote can save ~ 3 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
 ? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB
@@ -30,6 +30,7 @@ SQLite:
 CSV import - ON DUPLICATE KEY UPDATE
 Export - triggers, CREATE DATABASE
 Delimiter in export and SQL command
+Backward keys in Editor
 
 PostgreSQL:
 Users - SELECT * FROM pg_user