From ad415feb09cb1463a1f6fc9e3b335972a7c67e4b Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Wed, 8 Jan 2014 22:45:11 +0530 Subject: [PATCH 1/7] Remove redundant code and simplify: auto-expand/highlight Signed-off-by: Atul Pratap Singh --- js/navigation.js | 64 ++++++++++++------------------------------------ 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index 9132cd4453..23479ce850 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -475,46 +475,12 @@ function PMA_showCurrentNavigation() .children('li.viewContainer'); if ($tableContainer.length > 0) { - var $expander = $tableContainer - .children('div:first') - .children('a.expander'); - - if (! $expander.hasClass('loaded')) { - loadChildNodes($expander, function (data) { - highlightTableOrView($tableContainer, $viewContainer, table); - }); - } else { - highlightTableOrView($tableContainer, $viewContainer, table); - } + highlightTableOrView($tableContainer, table, 'table'); } else if ($viewContainer.length > 0) { - highlightView($viewContainer, table); + highlightTableOrView($viewContainer, table, 'view'); } else { // no containers, highlight the item - var $tableOrView = findLoadedItem($container, table, null, true); - if ($tableOrView){ - scrollToView($tableOrView, false); - } - } - } - - function highlightTableOrView($tableContainer, $viewContainer, table) - { - if (isItemInContainer($tableContainer, table, 'table')) { - var $expander = $tableContainer - .children('div:first') - .children('a.expander'); - if ($expander.find('img').is('.ic_b_plus')) { - expandTreeNode($expander); - } - var $table = findLoadedItem( - $tableContainer.children('div.list_container'), - table, 'table', true - ); - if ($table) { - scrollToView($table, false); - } - } else if ($viewContainer.length > 0) { - highlightView($viewContainer, table); + highlightTableOrView($dbItem, table, null); } } @@ -531,29 +497,29 @@ function PMA_showCurrentNavigation() return found; } - function highlightView($viewContainer, view) { - var $expander = $viewContainer + function highlightTableOrView($container, item, clazz) { + var $expander = $container .children('div:first') .children('a.expander'); if (! $expander.hasClass('loaded') || $expander.find('img').is('.ic_b_plus') ) { expandTreeNode($expander, function () { - var $view = findLoadedItem( - $viewContainer.children('div.list_container'), - view, 'view', true + var $item = findLoadedItem( + $container.children('div.list_container'), + item, clazz, true ); - if ($view) { - scrollToView($view, false); + if ($item) { + scrollToView($item, false); } }); } else { - var $view = findLoadedItem( - $viewContainer.children('div.list_container'), - view, 'view', true + var $item = findLoadedItem( + $container.children('div.list_container'), + item, clazz, true ); - if ($view) { - scrollToView($view, false); + if ($item) { + scrollToView($item, false); } } } From ced333e8b06adf32041f724a19236a60529a1407 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 8 Jan 2014 11:05:45 +0100 Subject: [PATCH 2/7] Translated using Weblate (English (United Kingdom)) Currently translated at 99.3% (2730 of 2749) --- po/en_GB.po | 99 ++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/po/en_GB.po b/po/en_GB.po index 361ddb75b5..d9dbbb2729 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -6,10 +6,10 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.1.3-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-12-27 10:57-0500\n" -"PO-Revision-Date: 2013-12-23 17:06+0200\n" -"Last-Translator: a1a1a1 a1a1a1a \n" -"Language-Team: English (United Kingdom) \n" +"PO-Revision-Date: 2014-01-08 11:05+0200\n" +"Last-Translator: Lakshmanan M \n" +"Language-Team: English (United Kingdom) " +"\n" "Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -410,7 +410,6 @@ msgid "Database Log" msgstr "Database Log" #: error_report.php:33 -#, fuzzy msgid "" "An error has been detected and an error report has been automatically " "submitted based on your settings." @@ -424,7 +423,6 @@ msgid "You may want to refresh the page." msgstr "You may want to refresh the page." #: error_report.php:45 -#, fuzzy msgid "" "An error has been detected and an error report has been generated but failed " "to be sent." @@ -434,15 +432,15 @@ msgstr "" #: error_report.php:50 error_report.php:77 msgid "If you experience any problems please submit a bug report manually." -msgstr "" +msgstr "If you experience any problems please submit a bug report manually." #: error_report.php:63 error_report.php:72 msgid "Thank you for submitting this report." -msgstr "" +msgstr "Thank you for submitting this report." #: error_report.php:74 msgid "Unfortunately the submission failed." -msgstr "" +msgstr "Unfortunately the submission failed." #: export.php:171 msgid "Bad type!" @@ -2000,39 +1998,39 @@ msgid "Create view" msgstr "Create view" #: js/messages.php:408 -#, fuzzy #| msgid "Server port" msgid "Send Error Report" -msgstr "Server port" +msgstr "Send Error Report" #: js/messages.php:409 msgid "Submit Error Report" -msgstr "" +msgstr "Submit Error Report" #: js/messages.php:411 -#, fuzzy #| msgid "An error has occured while loading the navigation tree" msgid "" "A fatal JavaScript error has occurred. Would you like to send an error " "report?" -msgstr "An error has occurred while loading the navigation tree" +msgstr "" +"A fatal JavaScript error has occurred. Would you like to send an error " +"report?" #: js/messages.php:413 -#, fuzzy #| msgid "Change settings" msgid "Change Report Settings" -msgstr "Change settings" +msgstr "Change Report Settings" #: js/messages.php:414 -#, fuzzy #| msgid "Show open tables" msgid "Show Report Details" -msgstr "Show open tables" +msgstr "Show Report Details" #: js/messages.php:417 msgid "" "Your export is incomplete, due to a low execution time limit at the PHP level" msgstr "" +"Your export is incomplete, due to a low execution time limit at the PHP " +"level" #. l10n: Display text for calendar close link #: js/messages.php:438 @@ -4153,15 +4151,15 @@ msgstr "Closed" #: libraries/config.values.php:118 msgid "Ask before sending error reports" -msgstr "" +msgstr "Ask before sending error reports" #: libraries/config.values.php:119 msgid "Always send error reports" -msgstr "" +msgstr "Always send error reports" #: libraries/config.values.php:120 msgid "Never send error reports" -msgstr "" +msgstr "Never send error reports" #: libraries/config.values.php:149 #: libraries/plugins/export/ExportHtmlword.class.php:69 @@ -6519,7 +6517,6 @@ msgid "Version check" msgstr "Version check" #: libraries/config/messages.inc.php:531 -#, fuzzy #| msgid "" #| "The url of the proxy to be used when retrieving the information about the " #| "latest version of phpMyAdmin. You need this if the server where " @@ -6532,13 +6529,13 @@ msgid "" "the internet. The format is: \"hostname:portnumber\"" msgstr "" "The url of the proxy to be used when retrieving the information about the " -"latest version of phpMyAdmin. You need this if the server where phpMyAdmin " -"is installed does not have direct access to the internet. The format is: " -"\"hostname:portnumber\"" +"latest version of phpMyAdmin or when submitting error reports. You need this " +"if the server where phpMyAdmin is installed does not have direct access to " +"the internet. The format is: \"hostname:portnumber\"" #: libraries/config/messages.inc.php:532 msgid "Proxy url" -msgstr "" +msgstr "Proxy url" #: libraries/config/messages.inc.php:533 msgid "" @@ -6551,20 +6548,18 @@ msgstr "" "will be performed. No other types of authentication are currently supported." #: libraries/config/messages.inc.php:534 -#, fuzzy #| msgid "Username" msgid "Proxy username" -msgstr "Username" +msgstr "Proxy username" #: libraries/config/messages.inc.php:535 msgid "The password for authenticating with the proxy" msgstr "The password for authenticating with the proxy" #: libraries/config/messages.inc.php:536 -#, fuzzy #| msgid "Password" msgid "Proxy password" -msgstr "Password" +msgstr "Proxy password" #: libraries/config/messages.inc.php:538 msgid "" @@ -6596,13 +6591,12 @@ msgstr "Private key for reCaptcha" #: libraries/config/messages.inc.php:545 msgid "Choose the default action when sending error reports" -msgstr "" +msgstr "Choose the default action when sending error reports" #: libraries/config/messages.inc.php:546 -#, fuzzy #| msgid "Server port" msgid "Send error reports" -msgstr "Server port" +msgstr "Send error reports" #: libraries/config/setup.forms.php:41 msgid "Config authentication" @@ -6989,6 +6983,8 @@ msgid "" "Skip this number of queries (for SQL) or lines (for other formats), starting " "from the first one:" msgstr "" +"Skip this number of queries (for SQL) or lines (for other formats), starting " +"from the first one:" #: libraries/display_import.lib.php:342 msgid "Format-Specific Options:" @@ -7386,20 +7382,23 @@ msgid "" "as well as information about relevant configuration settings to send to the " "phpMyAdmin team to help us in debugging the problem." msgstr "" +"phpMyAdmin has encountered an error. We have collected data about this error " +"as well as information about relevant configuration settings to send to the " +"phpMyAdmin team to help us in debugging the problem." #: libraries/error_report.lib.php:286 msgid "You may examine the data in the error report:" -msgstr "" +msgstr "You may examine the data in the error report:" #: libraries/error_report.lib.php:293 msgid "Please explain the steps that lead to the error:" -msgstr "" +msgstr "Please explain the steps that lead to the error:" #: libraries/error_report.lib.php:301 #, fuzzy #| msgid "Automatically create versions" msgid "Automatically send report next time" -msgstr "Automatically create versions" +msgstr "Automatically send report next time" #: libraries/import.lib.php:190 libraries/insert_edit.lib.php:122 #: libraries/rte/rte_routines.lib.php:1466 libraries/sql.lib.php:1641 @@ -7809,7 +7808,7 @@ msgstr "phpMyAdmin documentation" #, fuzzy #| msgid "Reload navigation frame" msgid "Reload navigation panel" -msgstr "Reload navigation frame" +msgstr "Reload navigation panel" #: libraries/navigation/NavigationTree.class.php:720 #, php-format @@ -7826,20 +7825,20 @@ msgstr "" #, fuzzy #| msgid "filter databases by name" msgid "Filter databases by name or regex" -msgstr "filter databases by name" +msgstr "Filter databases by name or regex" #: libraries/navigation/NavigationTree.class.php:1047 #: libraries/navigation/NavigationTree.class.php:1081 #, fuzzy #| msgid "Clear Fast Filter" msgid "Clear fast filter" -msgstr "Clear Fast Filter" +msgstr "Clear fast filter" #: libraries/navigation/NavigationTree.class.php:1080 #, fuzzy #| msgid "filter items by name" msgid "Filter by name or regex" -msgstr "Filter tables by name" +msgstr "Filter by name or regex" #. l10n: The word "Node" must not be translated here #: libraries/navigation/NodeFactory.class.php:41 @@ -7867,13 +7866,13 @@ msgstr "New" #, fuzzy #| msgid "Database export options" msgid "Database operations" -msgstr "Database export options" +msgstr "Database operations" #: libraries/navigation/Nodes/Node_Database.class.php:318 #, fuzzy #| msgid "Show hint" msgid "Show hidden items" -msgstr "Show hint" +msgstr "Show hidden items" #: libraries/navigation/Nodes/Node_Database_Container.class.php:31 msgctxt "Create new database" @@ -7914,7 +7913,7 @@ msgstr "New" #, fuzzy #| msgid "Procedures" msgid "Procedure" -msgstr "Procedures" +msgstr "Procedure" #: libraries/navigation/Nodes/Node_Procedure_Container.class.php:26 #: libraries/navigation/Nodes/Node_Procedure_Container.class.php:27 @@ -9255,37 +9254,37 @@ msgstr "Generate Password:" #, fuzzy #| msgid "Replication status" msgid "Replication started successfully." -msgstr "Replication status" +msgstr "Replication started successfully." #: libraries/replication_gui.lib.php:909 #, fuzzy #| msgid "Master replication" msgid "Error starting replication." -msgstr "Master replication" +msgstr "Error starting replication." #: libraries/replication_gui.lib.php:913 #, fuzzy #| msgid "Chart generated successfully." msgid "Replication stopped successfully." -msgstr "Chart generated successfully." +msgstr "Replication stopped successfully." #: libraries/replication_gui.lib.php:914 #, fuzzy #| msgid "Master replication" msgid "Error stopping replication." -msgstr "Master replication" +msgstr "Error stopping replication." #: libraries/replication_gui.lib.php:918 #, fuzzy #| msgid "Replication status" msgid "Replication resetting successfully." -msgstr "Replication status" +msgstr "Replication resetting successfully." #: libraries/replication_gui.lib.php:919 #, fuzzy #| msgid "Master replication" msgid "Error resetting replication." -msgstr "Master replication" +msgstr "Error resetting replication." #: libraries/replication_gui.lib.php:923 msgid "Success." @@ -9295,7 +9294,7 @@ msgstr "" #, fuzzy #| msgid "Error" msgid "Error." -msgstr "Error" +msgstr "Error." #: libraries/replication_gui.lib.php:966 msgid "Unknown error" From 8e42fce59582232a4c082b29093125f7ab53dc2a Mon Sep 17 00:00:00 2001 From: Gyeongsu Han Date: Wed, 8 Jan 2014 17:10:30 +0100 Subject: [PATCH 3/7] Translated using Weblate (Korean) Currently translated at 70.8% (1949 of 2749) --- po/ko.po | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/po/ko.po b/po/ko.po index d5e061e8a2..d768a5d0cc 100644 --- a/po/ko.po +++ b/po/ko.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.1.3-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-12-27 10:57-0500\n" -"PO-Revision-Date: 2013-12-05 12:51+0200\n" -"Last-Translator: Alfred Woo \n" +"PO-Revision-Date: 2014-01-08 17:10+0200\n" +"Last-Translator: Gyeongsu Han \n" "Language-Team: Korean \n" "Language: ko\n" "MIME-Version: 1.0\n" @@ -1675,7 +1675,7 @@ msgstr "%d 값 추가" #: js/messages.php:277 msgid "" "Note: If the file contains multiple tables, they will be combined into one." -msgstr "참고: 파일에 여러 테이블이 포함되어 있다면, 하나로 결합됩니다" +msgstr "참고: 파일에 여러 테이블이 포함되어 있다면, 하나로 결합됩니다." #: js/messages.php:280 msgid "Hide query box" @@ -12698,10 +12698,9 @@ msgid "Try to revert erroneous fields to their default values" msgstr "" #: setup/lib/form_processing.lib.php:53 -#, fuzzy #| msgid "Ignore" msgid "Ignore errors" -msgstr "무시" +msgstr "오류 무시" #: setup/lib/form_processing.lib.php:55 msgid "Show form" From b21a11ab1a2effddb36e87f1c271b041da17eddb Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 8 Jan 2014 09:55:46 +0100 Subject: [PATCH 4/7] Translated using Weblate (Tamil) Currently translated at 15.2% (418 of 2749) --- po/ta.po | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/po/ta.po b/po/ta.po index 7ad6ff09db..60e2b15479 100644 --- a/po/ta.po +++ b/po/ta.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.1.3-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-12-27 10:57-0500\n" -"PO-Revision-Date: 2013-11-26 10:02+0200\n" +"PO-Revision-Date: 2014-01-08 09:55+0200\n" "Last-Translator: Lakshmanan M \n" "Language-Team: Tamil \n" "Language: ta\n" @@ -416,25 +416,29 @@ msgstr "" #: error_report.php:37 error_report.php:54 error_report.php:65 #: error_report.php:81 msgid "You may want to refresh the page." -msgstr "" +msgstr "நீங்கள் பக்கம் புதுப்பிக்க வேண்டும்." #: error_report.php:45 msgid "" "An error has been detected and an error report has been generated but failed " "to be sent." msgstr "" +"ஒரு பிழை கண்டறியப்பட்டது மற்றும் பிழை அறிக்கை உருவாக்கப்பட்டுள்ளது ஆனால் " +"அனுப்பப்பட வேண்டும் தோல்வியடைந்தது." #: error_report.php:50 error_report.php:77 msgid "If you experience any problems please submit a bug report manually." msgstr "" +"நீங்கள் ஏதேனும் பிரச்சினைகளை எதிர்கொண்டால் கைமுறையாக ஒரு பிழை அறிக்கையை " +"சமர்ப்பிக்கவும்." #: error_report.php:63 error_report.php:72 msgid "Thank you for submitting this report." -msgstr "" +msgstr "இந்த அறிக்கை சமர்ப்பிக்கும் நன்றி." #: error_report.php:74 msgid "Unfortunately the submission failed." -msgstr "" +msgstr "துரதிருஷ்டவசமாக சமர்பிப்பு தோல்வியுற்றது." #: export.php:171 msgid "Bad type!" From 4ad48947f7ddbf6f001c696b719c47d21072de60 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 9 Jan 2014 06:39:40 -0500 Subject: [PATCH 5/7] Refactor: new PMA_getDescriptionAndTitle() Signed-off-by: Marc Delisle --- libraries/browse_foreigners.lib.php | 74 +++++++++++++++-------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/libraries/browse_foreigners.lib.php b/libraries/browse_foreigners.lib.php index 3a305040f8..abd02c88d4 100644 --- a/libraries/browse_foreigners.lib.php +++ b/libraries/browse_foreigners.lib.php @@ -112,49 +112,21 @@ function PMA_getHtmlForRelationalFieldSelection($db, $table, $field, $foreignDat // keynames and descriptions for the left section, // sorted by keynames $leftKeyname = $keys[$indexByKeyname]; - $leftDescription = $descriptions[$indexByKeyname]; + list( + $leftDescription, + $leftDescriptionTitle + ) = PMA_getDescriptionAndTitle($descriptions[$indexByKeyname]); // keynames and descriptions for the right section, // sorted by descriptions $rightKeyname = $keys[$indexByDescription]; - $rightDescription = $descriptions[$indexByDescription]; + list( + $rightDescription, + $rightDescriptionTitle + ) = PMA_getDescriptionAndTitle($descriptions[$indexByDescription]); $indexByDescription++; - $pmaString = $GLOBALS['PMA_String']; - $limitChars = $GLOBALS['cfg']['LimitChars']; - if ($pmaString->strlen($rightDescription) <= $limitChars) { - $rightDescription = htmlspecialchars( - $rightDescription - ); - $rightDescriptionTitle = ''; - } else { - $rightDescriptionTitle = htmlspecialchars( - $rightDescription - ); - $rightDescription = htmlspecialchars( - $pmaString->substr( - $rightDescription, 0, $limitChars - ) - . '...' - ); - } - if ($pmaString->strlen($leftDescription) <= $limitChars) { - $leftDescription = htmlspecialchars( - $leftDescription - ); - $leftDescriptionTitle = ''; - } else { - $leftDescriptionTitle = htmlspecialchars( - $leftDescription - ); - $leftDescription = htmlspecialchars( - $pmaString->substr( - $leftDescription, 0, $limitChars - ) . '...' - ); - } - if (! empty($data)) { $rightKeynameIsSelected = $rightKeyname == $data; $leftKeynameIsSelected = $leftKeyname == $data; @@ -196,6 +168,36 @@ function PMA_getHtmlForRelationalFieldSelection($db, $table, $field, $foreignDat return $output; } +/** + * Get the description (possibly truncated) and the title + * + * @param string $description the keyname's description + * + * @return array the new description and title + */ +function PMA_getDescriptionAndTitle($description) +{ + $pmaString = $GLOBALS['PMA_String']; + $limitChars = $GLOBALS['cfg']['LimitChars']; + if ($pmaString->strlen($description) <= $limitChars) { + $description = htmlspecialchars( + $description + ); + $descriptionTitle = ''; + } else { + $descriptionTitle = htmlspecialchars( + $description + ); + $description = htmlspecialchars( + $pmaString->substr( + $description, 0, $limitChars + ) + . '...' + ); + } + return array($description, $descriptionTitle); +} + /** * Function to get html for each column element * From eef7c3ddba79a106dac369b4bcf006b57cf750a2 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Thu, 9 Jan 2014 21:00:23 +0530 Subject: [PATCH 6/7] Rewrite simply and generalize table/view part and fix bug#4219 Signed-off-by: Atul Pratap Singh --- js/navigation.js | 75 +++++++++++++++---- .../Nodes/Node_Table_Container.class.php | 2 +- .../Nodes/Node_View_Container.class.php | 2 +- 3 files changed, 61 insertions(+), 18 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index 23479ce850..f66bc4008e 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -467,34 +467,77 @@ function PMA_showCurrentNavigation() function loadAndHighlightTableOrView($dbItem, table) { var $container = $dbItem.children('div.list_container'); - var $tableContainer = $container - .children('ul') - .children('li.tableContainer'); - var $viewContainer = $container - .children('ul') - .children('li.viewContainer'); - - if ($tableContainer.length > 0) { - highlightTableOrView($tableContainer, table, 'table'); - } else if ($viewContainer.length > 0) { - highlightTableOrView($viewContainer, table, 'view'); + var $expander; + var $whichItem = isItemInContainer($container, table, 'li.table, li.view'); + //If item already there in some container + if ($whichItem) { + //get the relevant container while may also be a subcontainer + var $relatedContainer = $whichItem.closest('li.subContainer').length + ? $whichItem.closest('li.subContainer') + : $dbItem; + $whichItem = findLoadedItem( + $relatedContainer.children('div.list_container'), + table, null, true + ); + //Show directly + showTableOrView($whichItem, $relatedContainer.children('div:first').children('a.expander')); + //else if item not there, try loading once } else { - // no containers, highlight the item - highlightTableOrView($dbItem, table, null); + var $sub_containers = $dbItem.find('.subContainer'); + //If there are subContainers i.e. tableContainer or viewContainer + if($sub_containers.length > 0) { + var $containers = new Array(); + $sub_containers.each(function (index) { + $containers[index] = $(this); + $expander = $containers[index] + .children('div:first') + .children('a.expander'); + collapseTreeNode($expander); + loadAndShowTableOrView($expander, $containers[index], table); + }); + // else if no subContainers + } else { + $expander = $dbItem + .children('div:first') + .children('a.expander'); + collapseTreeNode($expander); + loadAndShowTableOrView($expander, $dbItem, table); + } } } + function loadAndShowTableOrView($expander, $relatedContainer, table) { + loadChildNodes($expander, function (data) { + var $whichItem = findLoadedItem( + $relatedContainer.children('div.list_container'), + table, null, true + ); + if ($whichItem) { + showTableOrView($whichItem, $expander); + } + }); + } + + function showTableOrView($whichItem, $expander) { + expandTreeNode($expander, function (data) { + if ($whichItem) { + scrollToView($whichItem, false); + } + }); + } + function isItemInContainer($container, name, clazz) { - $items = $container.find('li.' + clazz); + var $whichItem = null; + $items = $container.find(clazz); var found = false; $items.each(function () { if ($(this).children('a').text() == name) { - found = true; + $whichItem = $(this); return false; } }); - return found; + return $whichItem; } function highlightTableOrView($container, item, clazz) { diff --git a/libraries/navigation/Nodes/Node_Table_Container.class.php b/libraries/navigation/Nodes/Node_Table_Container.class.php index 7a4ece3d18..4c4ef20e09 100644 --- a/libraries/navigation/Nodes/Node_Table_Container.class.php +++ b/libraries/navigation/Nodes/Node_Table_Container.class.php @@ -40,7 +40,7 @@ class Node_Table_Container extends Node ); } $this->real_name = 'tables'; - $this->classes = 'tableContainer'; + $this->classes = 'tableContainer subContainer'; $new_label = _pgettext('Create new table', 'New'); $new = PMA_NodeFactory::getInstance('Node', $new_label); diff --git a/libraries/navigation/Nodes/Node_View_Container.class.php b/libraries/navigation/Nodes/Node_View_Container.class.php index 6eb26d4f8b..775c5500c3 100644 --- a/libraries/navigation/Nodes/Node_View_Container.class.php +++ b/libraries/navigation/Nodes/Node_View_Container.class.php @@ -39,7 +39,7 @@ class Node_View_Container extends Node $GLOBALS['cfg']['NavigationTreeTableLevel'] ); } - $this->classes = 'viewContainer'; + $this->classes = 'viewContainer subContainer'; $this->real_name = 'views'; $new_label = _pgettext('Create new view', 'New'); From 0577539109711aea474efcf35449edad8fafc1d8 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Thu, 9 Jan 2014 21:01:19 +0530 Subject: [PATCH 7/7] Remove redundant function and rename variable: auto-expand table/view Signed-off-by: Atul Pratap Singh --- js/navigation.js | 41 +++++++---------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index f66bc4008e..dcaca295c3 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -465,10 +465,10 @@ function PMA_showCurrentNavigation() return ret; } - function loadAndHighlightTableOrView($dbItem, table) { + function loadAndHighlightTableOrView($dbItem, itemName) { var $container = $dbItem.children('div.list_container'); var $expander; - var $whichItem = isItemInContainer($container, table, 'li.table, li.view'); + var $whichItem = isItemInContainer($container, itemName, 'li.table, li.view'); //If item already there in some container if ($whichItem) { //get the relevant container while may also be a subcontainer @@ -477,7 +477,7 @@ function PMA_showCurrentNavigation() : $dbItem; $whichItem = findLoadedItem( $relatedContainer.children('div.list_container'), - table, null, true + itemName, null, true ); //Show directly showTableOrView($whichItem, $relatedContainer.children('div:first').children('a.expander')); @@ -493,7 +493,7 @@ function PMA_showCurrentNavigation() .children('div:first') .children('a.expander'); collapseTreeNode($expander); - loadAndShowTableOrView($expander, $containers[index], table); + loadAndShowTableOrView($expander, $containers[index], itemName); }); // else if no subContainers } else { @@ -501,16 +501,16 @@ function PMA_showCurrentNavigation() .children('div:first') .children('a.expander'); collapseTreeNode($expander); - loadAndShowTableOrView($expander, $dbItem, table); + loadAndShowTableOrView($expander, $dbItem, itemName); } } } - function loadAndShowTableOrView($expander, $relatedContainer, table) { + function loadAndShowTableOrView($expander, $relatedContainer, itemName) { loadChildNodes($expander, function (data) { var $whichItem = findLoadedItem( $relatedContainer.children('div.list_container'), - table, null, true + itemName, null, true ); if ($whichItem) { showTableOrView($whichItem, $expander); @@ -539,33 +539,6 @@ function PMA_showCurrentNavigation() }); return $whichItem; } - - function highlightTableOrView($container, item, clazz) { - var $expander = $container - .children('div:first') - .children('a.expander'); - if (! $expander.hasClass('loaded') || - $expander.find('img').is('.ic_b_plus') - ) { - expandTreeNode($expander, function () { - var $item = findLoadedItem( - $container.children('div.list_container'), - item, clazz, true - ); - if ($item) { - scrollToView($item, false); - } - }); - } else { - var $item = findLoadedItem( - $container.children('div.list_container'), - item, clazz, true - ); - if ($item) { - scrollToView($item, false); - } - } - } } /**