The branch, master has been updated
via 0305c10f91768606b68dd184e3c61bc6d36591db (commit)
via 4330ee3fd431f488263cb9a86fdb1f72fd4f9b8a (commit)
via 29ccdfc1ff9a44206d9705161f2f7c6ce41a7ea4 (commit)
from 318dc4b650cc487fbcf6c1b444f4b05b4a0de1c5 (commit)
- Log -----------------------------------------------------------------
commit 0305c10f91768606b68dd184e3c61bc6d36591db
Author: Michal Čihař <mcihar(a)novell.com>
Date: Tue Jul 20 14:19:46 2010 +0200
rfe #3016457 [interface] Define tab order in SQL form to allow easier tab navigation.
commit 4330ee3fd431f488263cb9a86fdb1f72fd4f9b8a
Author: Michal Čihař <mcihar(a)novell.com>
Date: Tue Jul 20 14:15:00 2010 +0200
Whitespace cleanup.
commit 29ccdfc1ff9a44206d9705161f2f7c6ce41a7ea4
Author: Michal Čihař <mcihar(a)novell.com>
Date: Tue Jul 20 14:14:44 2010 +0200
Focus SQL query area after dom is ready.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 2 +
js/functions.js | 185 +++++++++++++++++++-------------------
libraries/sql_query_form.lib.php | 22 ++---
3 files changed, 103 insertions(+), 106 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f19f496..45b5aa4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -89,6 +89,8 @@ $Id$
(fixed for Privileges and Change password)
- [core] RecodingEngine now accepts none as valid option.
+ [core] Dropped AllowAnywhereRecoding configuration variable.
+- rfe #3016457 [interface] Define tab order in SQL form to allow easier tab
+ navigation.
3.3.6.0 (not yet released)
diff --git a/js/functions.js b/js/functions.js
index f03b9e3..e5d8363 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -194,7 +194,7 @@ function confirmQuery(theForm1, sqlQuery1)
* Displays a confirmation box before disabling the BLOB repository for a given database.
* This function is called while clicking links
*
- * @param object the database
+ * @param object the database
*
* @return boolean whether to disable the repository or not
*/
@@ -282,10 +282,10 @@ function checkSqlQuery(theForm)
// Global variable row_class is set to even
var row_class = 'even';
-/**
+/**
* Generates a row dynamically in the differences table displaying
-* the complete statistics of difference in table like number of
-* rows to be updated, number of rows to be inserted, number of
+* the complete statistics of difference in table like number of
+* rows to be updated, number of rows to be inserted, number of
* columns to be added, number of columns to be removed, etc.
*
* @param index index of matching table
@@ -294,17 +294,17 @@ var row_class = 'even';
* @param remove_size number of columns to be removed
* @param insert_index number of indexes to be inserted
* @param remove_index number of indexes to be removed
-* @param img_obj image object
+* @param img_obj image object
* @param table_name name of the table
*/
function showDetails(i, update_size, insert_size, remove_size, insert_index, remove_index, img_obj, table_name)
-{
+{
// The path of the image is split to facilitate comparison
- var relative_path = (img_obj.src).split("themes/");
-
+ var relative_path = (img_obj.src).split("themes/");
+
// The image source is changed when the showDetails function is called.
- if (relative_path[1] == 'original/img/new_data_hovered.jpg') {
+ if (relative_path[1] == 'original/img/new_data_hovered.jpg') {
img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg";
img_obj.alt = PMA_messages['strClickToUnselect']; //only for IE browser
} else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') {
@@ -313,76 +313,76 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
} else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') {
img_obj.src = "./themes/original/img/new_struct_hovered.jpg";
img_obj.alt = PMA_messages['strClickToSelect'];
- } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') {
+ } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') {
img_obj.src = "./themes/original/img/new_data_hovered.jpg";
img_obj.alt = PMA_messages['strClickToSelect'];
- }
-
- var div = document.getElementById("list");
- var table = div.getElementsByTagName("table")[0];
+ }
+
+ var div = document.getElementById("list");
+ var table = div.getElementsByTagName("table")[0];
var table_body = table.getElementsByTagName("tbody")[0];
-
+
//Global variable row_class is being used
if (row_class == 'even') {
row_class = 'odd';
} else {
- row_class = 'even';
+ row_class = 'even';
}
- // If the red or green button against a table name is pressed then append a new row to show the details of differences of this table.
- if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) {
-
- var newRow = document.createElement("tr");
+ // If the red or green button against a table name is pressed then append a new row to show the details of differences of this table.
+ if ((relative_path[1] != 'original/img/new_struct_selected_hovered.jpg') && (relative_path[1] != 'original/img/new_data_selected_hovered.jpg')) {
+
+ var newRow = document.createElement("tr");
newRow.setAttribute("class", row_class);
- newRow.className = row_class;
- // Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array
+ newRow.className = row_class;
+ // Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array
newRow.setAttribute("id" , i);
-
+
var table_name_cell = document.createElement("td");
table_name_cell.align = "center";
table_name_cell.innerHTML = table_name ;
-
+
newRow.appendChild(table_name_cell);
-
+
var create_table = document.createElement("td");
create_table.align = "center";
-
+
var add_cols = document.createElement("td");
add_cols.align = "center";
-
+
var remove_cols = document.createElement("td");
remove_cols.align = "center";
-
+
var alter_cols = document.createElement("td");
alter_cols.align = "center";
-
+
var add_index = document.createElement("td");
add_index.align = "center";
-
+
var delete_index = document.createElement("td");
delete_index.align = "center";
-
+
var update_rows = document.createElement("td");
update_rows.align = "center";
-
+
var insert_rows = document.createElement("td");
insert_rows.align = "center";
-
+
var tick_image = document.createElement("img");
- tick_image.src = "./themes/original/img/s_success.png";
+ tick_image.src = "./themes/original/img/s_success.png";
if (update_size == '' && insert_size == '' && remove_size == '') {
/**
- This is the case when the table needs to be created in target database.
+ This is the case when the table needs to be created in target database.
*/
create_table.appendChild(tick_image);
add_cols.innerHTML = "--";
- remove_cols.innerHTML = "--";
+ remove_cols.innerHTML = "--";
alter_cols.innerHTML = "--";
delete_index.innerHTML = "--";
add_index.innerHTML = "--";
update_rows.innerHTML = "--";
insert_rows.innerHTML = "--";
-
+
newRow.appendChild(create_table);
newRow.appendChild(add_cols);
newRow.appendChild(remove_cols);
@@ -391,43 +391,43 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
newRow.appendChild(add_index);
newRow.appendChild(update_rows);
newRow.appendChild(insert_rows);
-
+
} else if (update_size == '' && remove_size == '') {
/**
- This is the case when data difference is displayed in the
- table which is present in source but absent from target database
+ This is the case when data difference is displayed in the
+ table which is present in source but absent from target database
*/
create_table.innerHTML = "--";
add_cols.innerHTML = "--";
- remove_cols.innerHTML = "--";
+ remove_cols.innerHTML = "--";
alter_cols.innerHTML = "--";
add_index.innerHTML = "--";
delete_index.innerHTML = "--";
update_rows.innerHTML = "--";
insert_rows.innerHTML = insert_size;
-
+
newRow.appendChild(create_table);
newRow.appendChild(add_cols);
newRow.appendChild(remove_cols);
newRow.appendChild(alter_cols);
- newRow.appendChild(delete_index);
+ newRow.appendChild(delete_index);
newRow.appendChild(add_index);
newRow.appendChild(update_rows);
newRow.appendChild(insert_rows);
-
+
} else if (remove_size == '') {
/**
- This is the case when data difference between matching_tables is displayed.
+ This is the case when data difference between matching_tables is displayed.
*/
create_table.innerHTML = "--";
add_cols.innerHTML = "--";
- remove_cols.innerHTML = "--";
+ remove_cols.innerHTML = "--";
alter_cols.innerHTML = "--";
add_index.innerHTML = "--";
delete_index.innerHTML = "--";
update_rows.innerHTML = update_size;
insert_rows.innerHTML = insert_size;
-
+
newRow.appendChild(create_table);
newRow.appendChild(add_cols);
newRow.appendChild(remove_cols);
@@ -436,41 +436,41 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
newRow.appendChild(add_index);
newRow.appendChild(update_rows);
newRow.appendChild(insert_rows);
-
+
} else {
/**
This is the case when structure difference between matching_tables id displayed
*/
create_table.innerHTML = "--";
add_cols.innerHTML = insert_size;
- remove_cols.innerHTML = remove_size;
+ remove_cols.innerHTML = remove_size;
alter_cols.innerHTML = update_size;
delete_index.innerHTML = remove_index;
add_index.innerHTML = insert_index;
update_rows.innerHTML = "--";
insert_rows.innerHTML = "--";
-
+
newRow.appendChild(create_table);
newRow.appendChild(add_cols);
newRow.appendChild(remove_cols);
- newRow.appendChild(alter_cols);
+ newRow.appendChild(alter_cols);
newRow.appendChild(delete_index);
newRow.appendChild(add_index);
newRow.appendChild(update_rows);
newRow.appendChild(insert_rows);
}
table_body.appendChild(newRow);
-
+
} else if ((relative_path[1] != 'original/img/new_struct_hovered.jpg') && (relative_path[1] != 'original/img/new_data_hovered.jpg')) {
//The case when the row showing the details need to be removed from the table i.e. the difference button is deselected now.
var table_rows = table_body.getElementsByTagName("tr");
var j;
var index = 0;
- for (j=0; j < table_rows.length; j++)
- {
- if (table_rows[j].id == i) {
+ for (j=0; j < table_rows.length; j++)
+ {
+ if (table_rows[j].id == i) {
index = j;
- table_rows[j].parentNode.removeChild(table_rows[j]);
+ table_rows[j].parentNode.removeChild(table_rows[j]);
}
}
//The table row css is being adjusted. Class "odd" for odd rows and "even" for even rows should be maintained.
@@ -481,11 +481,11 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
table_rows[index].setAttribute("class","odd"); // for Mozilla firefox
table_rows[index].className = "odd"; // for IE browser
} else {
- table_rows[index].setAttribute("class","even"); // for Mozilla firefox
- table_rows[index].className = "even"; // for IE browser
+ table_rows[index].setAttribute("class","even"); // for Mozilla firefox
+ table_rows[index].className = "even"; // for IE browser
}
- }
- }
+ }
+ }
}
/**
@@ -494,35 +494,35 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
* @param img_obj the image object whose source needs to be changed
*
*/
-
+
function change_Image(img_obj)
{
- var relative_path = (img_obj.src).split("themes/");
-
- if (relative_path[1] == 'original/img/new_data.jpg') {
- img_obj.src = "./themes/original/img/new_data_hovered.jpg";
+ var relative_path = (img_obj.src).split("themes/");
+
+ if (relative_path[1] == 'original/img/new_data.jpg') {
+ img_obj.src = "./themes/original/img/new_data_hovered.jpg";
} else if (relative_path[1] == 'original/img/new_struct.jpg') {
img_obj.src = "./themes/original/img/new_struct_hovered.jpg";
} else if (relative_path[1] == 'original/img/new_struct_hovered.jpg') {
img_obj.src = "./themes/original/img/new_struct.jpg";
- } else if (relative_path[1] == 'original/img/new_data_hovered.jpg') {
- img_obj.src = "./themes/original/img/new_data.jpg";
- } else if (relative_path[1] == 'original/img/new_data_selected.jpg') {
- img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg";
- } else if(relative_path[1] == 'original/img/new_struct_selected.jpg') {
- img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg";
- } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') {
- img_obj.src = "./themes/original/img/new_struct_selected.jpg";
- } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') {
- img_obj.src = "./themes/original/img/new_data_selected.jpg";
+ } else if (relative_path[1] == 'original/img/new_data_hovered.jpg') {
+ img_obj.src = "./themes/original/img/new_data.jpg";
+ } else if (relative_path[1] == 'original/img/new_data_selected.jpg') {
+ img_obj.src = "./themes/original/img/new_data_selected_hovered.jpg";
+ } else if(relative_path[1] == 'original/img/new_struct_selected.jpg') {
+ img_obj.src = "./themes/original/img/new_struct_selected_hovered.jpg";
+ } else if (relative_path[1] == 'original/img/new_struct_selected_hovered.jpg') {
+ img_obj.src = "./themes/original/img/new_struct_selected.jpg";
+ } else if (relative_path[1] == 'original/img/new_data_selected_hovered.jpg') {
+ img_obj.src = "./themes/original/img/new_data_selected.jpg";
}
}
/**
- * Generates the URL containing the list of selected table ids for synchronization and
- * a variable checked for confirmation of deleting previous rows from target tables
+ * Generates the URL containing the list of selected table ids for synchronization and
+ * a variable checked for confirmation of deleting previous rows from target tables
*
- * @param token the token generated for each PMA form
+ * @param token the token generated for each PMA form
*
*/
@@ -536,15 +536,15 @@ function ApplySelectedChanges(token)
var x = table_rows.length;
var i;
/**
- Append the token at the beginning of the query string followed by
- Table_ids that shows that "Apply Selected Changes" button is pressed
+ Append the token at the beginning of the query string followed by
+ Table_ids that shows that "Apply Selected Changes" button is pressed
*/
var append_string = "?token="+token+"&Table_ids="+1;
for(i=0; i<x; i++){
- append_string += "&";
- append_string += i+"="+table_rows[i].id;
+ append_string += "&";
+ append_string += i+"="+table_rows[i].id;
}
-
+
// Getting the value of checkbox delete_rows
var checkbox = document.getElementById("delete_rows");
if (checkbox.checked){
@@ -552,13 +552,13 @@ function ApplySelectedChanges(token)
} else {
append_string += "&checked=false";
}
- //Appending the token and list of table ids in the URL
+ //Appending the token and list of table ids in the URL
location.href += token;
location.href += append_string;
}
-/**
-* Displays error message if any text field
+/**
+* Displays error message if any text field
* is left empty other than port field.
*
* @param string the form name
@@ -567,7 +567,7 @@ function ApplySelectedChanges(token)
* @return boolean whether the form field is empty or not
*/
function validateConnection(form_name, form_obj)
-{
+{
var check = true;
var src_hostfilled = true;
var trg_hostfilled = true;
@@ -602,7 +602,7 @@ function validateConnection(form_name, form_obj)
}
return check;
}
-
+
/**
* Check if a form's element is empty
* should be
@@ -1637,8 +1637,8 @@ function pdfPaperSize(format, axis) {
/**
* for playing media from the BLOB repository
*
- * @param var
- * @param var url_params main purpose is to pass the token
+ * @param var
+ * @param var url_params main purpose is to pass the token
* @param var bs_ref BLOB repository reference
* @param var m_type type of BLOB repository media
* @param var w_width width of popup window
@@ -1690,12 +1690,12 @@ function requestMIMETypeChange(db, table, reference, current_mime_type)
*/
function changeMIMEType(db, table, reference, mime_type)
{
- // specify url and parameters for jQuery POST
+ // specify url and parameters for jQuery POST
var mime_chg_url = 'bs_change_mime_type.php';
var params = { bs_db: db, bs_table: table, bs_reference: reference, bs_new_mime_type: mime_type };
// jQuery POST
- jQuery.post(mime_chg_url, params);
+ jQuery.post(mime_chg_url, params);
}
/**
@@ -1725,5 +1725,6 @@ $(document).ready(function(){
insertQuery(evt.target.id);
return false;
});
+ $('#sqlquery').focus();
});
diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php
index a29f227..68574cb 100644
--- a/libraries/sql_query_form.lib.php
+++ b/libraries/sql_query_form.lib.php
@@ -290,7 +290,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
echo '<legend>' . $legend . '</legend>' . "\n";
echo '<div id="queryfieldscontainer">' . "\n";
echo '<div id="' . $sqlquerycontainer_id . '">' . "\n"
- .'<textarea name="sql_query" id="sqlquery"'
+ .'<textarea tabindex="100" name="sql_query" id="sqlquery"'
.' cols="' . $GLOBALS['cfg']['TextareaCols'] . '"'
.' rows="' . $height . '"'
.' dir="' . $GLOBALS['text_dir'] . '"'
@@ -305,12 +305,6 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
}
echo '</div>' . "\n";
- echo '<script type="text/javascript">' . "\n"
- .'//<![CDATA[' . "\n"
- .'document.getElementById("sqlquery").focus();' . "\n"
- .'//]]>' . "\n"
- .'</script>' . "\n";
-
if (count($fields_list)) {
echo '<div id="tablefieldscontainer">' . "\n"
.'<label>' . __('Columns') . '</label>' . "\n"
@@ -349,16 +343,16 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
<div class="formelement">
<label for="bkm_label">
<?php echo __('Bookmark this SQL query'); ?>:</label>
- <input type="text" name="bkm_label" id="bkm_label" value="" />
+ <input type="text" name="bkm_label" id="bkm_label" tabindex="110" value="" />
</div>
<div class="formelement">
- <input type="checkbox" name="bkm_all_users" id="id_bkm_all_users"
+ <input type="checkbox" name="bkm_all_users" tabindex="111" id="id_bkm_all_users"
value="true" />
<label for="id_bkm_all_users">
<?php echo __('Let every user access this bookmark'); ?></label>
</div>
<div class="formelement">
- <input type="checkbox" name="bkm_replace" id="id_bkm_replace"
+ <input type="checkbox" name="bkm_replace" tabindex="112" id="id_bkm_replace"
value="true" />
<label for="id_bkm_replace">
<?php echo __('Replace existing bookmark of same name'); ?></label>
@@ -377,7 +371,7 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
?>
<script type="text/javascript">
//<![CDATA[
- document.writeln(' <input type="checkbox" name="LockFromUpdate" value="1" id="checkbox_lock" /> <label for="checkbox_lock"><?php echo __('Do not overwrite this query from outside the window'); ?></label> ');
+ document.writeln(' <input type="checkbox" name="LockFromUpdate" value="1" tabindex="120" id="checkbox_lock" /> <label for="checkbox_lock"><?php echo __('Do not overwrite this query from outside the window'); ?></label> ');
//]]>
</script>
<?php
@@ -386,17 +380,17 @@ function PMA_sqlQueryFormInsert($query = '', $is_querywindow = false, $delimiter
echo '<div class="formelement">' . "\n";
echo '<label for="id_sql_delimiter">[ ' . __('Delimiter')
.'</label>' . "\n";
- echo '<input type="text" name="sql_delimiter" size="3" '
+ echo '<input type="text" name="sql_delimiter" tabindex="131" size="3" '
.'value="' . $delimiter . '" '
.'id="id_sql_delimiter" /> ]' . "\n";
echo '<input type="checkbox" name="show_query" value="1" '
- .'id="checkbox_show_query" checked="checked" />' . "\n"
+ .'id="checkbox_show_query" tabindex="132" checked="checked" />' . "\n"
.'<label for="checkbox_show_query">' . __(' Show this query here again ')
.'</label>' . "\n";
echo '</div>' . "\n";
- echo '<input type="submit" name="SQL" value="' . __('Go') . '" />'
+ echo '<input type="submit" name="SQL" tabindex="200" value="' . __('Go') . '" />'
."\n";
echo '<div class="clearfloat"></div>' . "\n";
echo '</fieldset>' . "\n";
hooks/post-receive
--
phpMyAdmin