fixed JavaScript malfunction in querybox textarea with Opera
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2005-10-04 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||||
|
* libraries/functions.js, libraries/sql_query_form.lib.php:
|
||||||
|
fixed JavaScript malfunction in querybox textarea with Opera
|
||||||
|
|
||||||
2005-10-03 Marc Delisle <lem9@users.sourceforge.net>
|
2005-10-03 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* server_privileges.php: support for Execute_priv
|
* server_privileges.php: support for Execute_priv
|
||||||
|
|
||||||
|
@@ -1,5 +1,37 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var sql_box_locked lock for the sqlbox textarea in the querybox/querywindow
|
||||||
|
*/
|
||||||
|
var sql_box_locked = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array holds elements which content should only selected once
|
||||||
|
*/
|
||||||
|
var only_once_elements = new Array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* selects the content of a given object, f.e. a textarea
|
||||||
|
*
|
||||||
|
* @param object element element of which the content will be selected
|
||||||
|
* @param var lock variable which holds the lock for this element
|
||||||
|
* or true, if no lock exists
|
||||||
|
* @param boolean only_once if true this is only done once
|
||||||
|
* f.e. only on first focus
|
||||||
|
*/
|
||||||
|
function selectContent( element, lock, only_once ) {
|
||||||
|
if ( only_once && only_once_elements[element.name] ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
only_once_elements[element.name] = true;
|
||||||
|
|
||||||
|
if ( lock ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
element.select();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays an confirmation box before to submit a "DROP DATABASE" query.
|
* Displays an confirmation box before to submit a "DROP DATABASE" query.
|
||||||
@@ -822,6 +854,7 @@ function insertValueQuery() {
|
|||||||
var myListBox = document.sqlform.dummy;
|
var myListBox = document.sqlform.dummy;
|
||||||
|
|
||||||
if(myListBox.options.length > 0) {
|
if(myListBox.options.length > 0) {
|
||||||
|
sql_box_locked = true;
|
||||||
var chaineAj = "";
|
var chaineAj = "";
|
||||||
var NbSelect = 0;
|
var NbSelect = 0;
|
||||||
for(var i=0; i<myListBox.options.length; i++) {
|
for(var i=0; i<myListBox.options.length; i++) {
|
||||||
@@ -850,6 +883,7 @@ function insertValueQuery() {
|
|||||||
} else {
|
} else {
|
||||||
myQuery.value += chaineAj;
|
myQuery.value += chaineAj;
|
||||||
}
|
}
|
||||||
|
sql_box_locked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -188,9 +188,7 @@ function PMA_sqlQueryFormInsert( $query = '', $is_querywindow = false ) {
|
|||||||
|
|
||||||
// enable auto select text in textarea
|
// enable auto select text in textarea
|
||||||
if ( $GLOBALS['cfg']['TextareaAutoSelect'] ) {
|
if ( $GLOBALS['cfg']['TextareaAutoSelect'] ) {
|
||||||
$auto_sel = ' onfocus="if (typeof(document.layers) == \'undefined\' || '
|
$auto_sel = ' onfocus="selectContent( this, sql_box_locked, true )"';
|
||||||
.' typeof(textarea_selected) == \'undefined\') {textarea_selected '
|
|
||||||
.'= 1; this.form.elements[\'sql_query\'].select();}"';
|
|
||||||
} else {
|
} else {
|
||||||
$auto_sel = '';
|
$auto_sel = '';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user