RFE #1433382 visulal feat. request for left bar

This commit is contained in:
Sebastian Mendel
2006-02-20 13:29:06 +00:00
parent 6e2ee9e001
commit 3d83605027
3 changed files with 117 additions and 31 deletions

View File

@@ -13,6 +13,8 @@ $Source$
- RFE #1434196 More significant digits in /status
- replaced number_format() with PMA_formatNumber()
- coding standards
* js/querywindow.js, css/phpmyadmin.css.php:
- RFE #1433382 visulal feat. request for left bar
2006-02-19 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php: re-establish previous error reporting mode

View File

@@ -692,6 +692,20 @@ li#li_flush_privileges {
<?php
} // end styles 2.7.1
if ( $_SESSION['PMA_Theme']->checkVersion( '2.9' ) ) {
?>
/********************/
/* NEW in PMA 2.9 */
/********************/
<?php if ( $GLOBALS['cfg']['BrowseMarkerColor'] ) { ?>
div#left_tableList li.marked {
background-color: <?php echo $GLOBALS['cfg']['BrowseMarkerColor']; ?>;
}
<?php } ?>
<?php
} // end styles 2.9
$_SESSION['PMA_Theme']->loadCss( $_REQUEST['js_frame'] );
?>

View File

@@ -11,13 +11,15 @@ function setDb( new_db ) {
// db has changed
//alert( new_db + '(' + new_db.length + ') : ' + db );
db = new_db;
if ( window.frames[0].document.getElementById( db ) == null ) {
if ( window.frames[0].document.getElementById(new_db) == null ) {
// db is unknown, reload complete left frame
refreshLeft();
} else {
unmarkDbTable(db);
markDbTable(new_db);
}
db = new_db;
// TODO: add code to expand db in lightview mode
// refresh querywindow
@@ -38,7 +40,8 @@ function setTable( new_table ) {
table = new_table;
if ( window.frames[0].document.getElementById( db + '.' + table ) == null ) {
if ( window.frames[0].document.getElementById( db + '.' + table ) == null
&& table != '' ) {
// table is unknown, reload complete left frame
refreshLeft();
@@ -75,6 +78,69 @@ function refreshLeft() {
);
}
/**
* adds class to element
*/
function addClass(element, classname)
{
if (element != null) {
element.className += ' ' + classname;
//alert('set class: ' + classname + ', now: ' + element.className);
}
}
/**
* removes class from element
*/
function removeClass(element, classname)
{
if (element != null) {
element.className = element.className.replace(' ' + classname, '');
// if there is no other class anem there is no leading space
element.className = element.className.replace(classname, '');
//alert('removed class: ' + classname + ', now: ' + element.className);
}
}
function unmarkDbTable(db, table)
{
var element_reference = window.frames[0].document.getElementById(db);
if (element_reference != null) {
//alert('remove from: ' + db);
removeClass(element_reference.parentNode, 'marked');
}
element_reference = window.frames[0].document.getElementById(db + '.' + table);
if (element_reference != null) {
//alert('remove from: ' + db + '.' + table);
removeClass(element_reference.parentNode, 'marked');
}
}
function markDbTable(db, table)
{
var element_reference = window.frames[0].document.getElementById(db);
if (element_reference != null) {
addClass(element_reference.parentNode, 'marked');
// scrolldown
element_reference.focus();
// opera marks the text, we dont want this ...
element_reference.blur();
}
element_reference = window.frames[0].document.getElementById(db + '.' + table);
if (element_reference != null) {
addClass(element_reference.parentNode, 'marked');
// scrolldown
element_reference.focus();
// opera marks the text, we dont want this ...
element_reference.blur();
}
// return to main frame ...
window.frames[1].focus();
}
/**
* sets current selected server, table and db (called from libraries/footer.inc.php)
*/
@@ -89,9 +155,10 @@ function setAll( new_lang, new_collation_connection, new_server, new_db, new_tab
collation_connection = new_collation_connection;
lang = new_lang;
refreshLeft();
}
else if ( new_db != db || new_table != table ) {
} else if ( new_db != db || new_table != table ) {
// save new db and table
var old_db = db;
var old_table = table;
db = new_db;
table = new_table;
@@ -99,6 +166,9 @@ function setAll( new_lang, new_collation_connection, new_server, new_db, new_tab
&& window.frames[0].document.getElementById( db + '.' + table ) == null ) {
// table or db is unknown, reload complete left frame
refreshLeft();
} else {
unmarkDbTable(old_db, old_table);
markDbTable(db, table);
}
// TODO: add code to expand db in lightview mode
@@ -128,7 +198,7 @@ function reload_querywindow( db, table, sql_query ) {
function focus_querywindow( sql_query ) {
if ( querywindow && !querywindow.closed && querywindow.location) {
var querywindow = querywindow;
//var querywindow = querywindow;
if ( querywindow.document.querywindow.querydisplay_tab != 'sql' ) {
querywindow.document.querywindow.querydisplay_tab.value = "sql";
querywindow.document.querywindow.query_history_latest.value = sql_query;