Hi,
The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code: - ajax request in navigation.js - ajax response in navigation.php - ajax trigger in header.inc.php (the triggering is done by adding <script> tag to call js function in the navigation frame, any better way?)
[0] http://demo.phpmyadmin.net/gsoc-aris/
Cheers,
-- Aris Feryanto
On 10 Mei 2011, at 23:49, Marc Delisle marc@infomarc.info wrote:
Aris Feryanto a écrit :
Hi,
I've just got some comments from the feature tracker [0]:
===================================== The only problem I see is that each time I go to a new table, (within the same database) the left column refreshes. Is this to repopulate that list????
(...)
=====================================
I'll try to use ajax to refresh the drop-down list. It would be more convenient if users can still interact with the recent list (in case the user wrongly select the recent table), while the main frame is still loading.
Other comments and suggestions are welcome.
Indeed this is a valid objection to navigation panel reload, and Ajax is promising.
-- Marc Delisle http://infomarc.info
Le 2011-05-13 16:06, Aris Feryanto a écrit :
Hi,
The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code: - ajax request in navigation.js - ajax response in navigation.php - ajax trigger in header.inc.php (the triggering is done by adding
<script> tag to call js function in the navigation frame, any better way?)
Hi Aris, How about this?
diff --git a/js/functions.js b/js/functions.js index 572c857..50fd6f8 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2276,5 +2276,9 @@ $(document).ready(function() { } });
+ $('#update_recent_tables').ready(function() { + window.parent.frame_navigation.PMA_reloadRecentTable(); + }); + }) // end of $(document).ready()
diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 05d272e..4036f86 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -21,9 +21,7 @@ require_once './libraries/RecentTable.class.php'; function PMA_addRecentTable($db, $table) { $tmp_result = RecentTable::getInstance()->add($db, $table); if ($tmp_result === true) { - echo '<script type="text/javascript">' . - 'window.parent.frame_navigation.PMA_reloadRecentTable();' . - '</script>'; + echo '<span class="hide" id="update_recent_tables"></span>'; } else { $error = $tmp_result; $error->display();
Hi Marc,
On 14 Mei 2011, at 18:39, Marc Delisle marc@infomarc.info wrote:
Le 2011-05-13 16:06, Aris Feryanto a écrit :
Hi,
The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code: - ajax request in navigation.js - ajax response in navigation.php - ajax trigger in header.inc.php (the triggering is done by adding
<script> tag to call js function in the navigation frame, any better way?)
Hi Aris, How about this?
diff --git a/js/functions.js b/js/functions.js index 572c857..50fd6f8 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2276,5 +2276,9 @@ $(document).ready(function() { } });
$('#update_recent_tables').ready(function() {
window.parent.frame_navigation.PMA_reloadRecentTable();
});
}) // end of $(document).ready()
diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 05d272e..4036f86 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -21,9 +21,7 @@ require_once './libraries/RecentTable.class.php'; function PMA_addRecentTable($db, $table) { $tmp_result = RecentTable::getInstance()->add($db, $table); if ($tmp_result === true) {
echo '<script type="text/javascript">' .
'window.parent.frame_navigation.PMA_reloadRecentTable();' .
'</script>';
} else { $error = $tmp_result; $error->display();echo '<span class="hide" id="update_recent_tables"></span>';
This works. But, I'm thinking that we should add a function to register javascript for a certain page, shouldn't we? The registered script will be buffered for output, for example, near the bottom of the page. The function will look like this:
PMA_registerScript ( $scriptString );
Since, IMO, the code will be clearer and easier to understand than separated code in both the php and the js.
-- Aris Feryanto
Le 2011-05-14 23:07, Aris Feryanto a écrit :
Hi Marc,
On 14 Mei 2011, at 18:39, Marc Delisle marc@infomarc.info wrote:
Le 2011-05-13 16:06, Aris Feryanto a écrit :
Hi,
The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code: - ajax request in navigation.js - ajax response in navigation.php - ajax trigger in header.inc.php (the triggering is done by adding <script> tag to call js function in the navigation frame, any better way?)
Hi Aris, How about this?
diff --git a/js/functions.js b/js/functions.js index 572c857..50fd6f8 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2276,5 +2276,9 @@ $(document).ready(function() { } });
$('#update_recent_tables').ready(function() { +
window.parent.frame_navigation.PMA_reloadRecentTable(); + }); + }) // end of $(document).ready()
diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 05d272e..4036f86 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -21,9 +21,7 @@ require_once './libraries/RecentTable.class.php'; function PMA_addRecentTable($db, $table) { $tmp_result = RecentTable::getInstance()->add($db, $table); if ($tmp_result === true) { - echo '<script type="text/javascript">' . - 'window.parent.frame_navigation.PMA_reloadRecentTable();' . - '</script>'; + echo '<span class="hide" id="update_recent_tables"></span>'; } else { $error = $tmp_result; $error->display();
This works. But, I'm thinking that we should add a function to register javascript for a certain page, shouldn't we? The registered script will be buffered for output, for example, near the bottom of the page. The function will look like this:
PMA_registerScript ( $scriptString );
We want to avoid using inline Javascript if possible because we want to benefit from caching these files at the browser level. Also, we want to use jQuery if possible, instead of pure Javascript.
Since, IMO, the code will be clearer and easier to understand than separated code in both the php and the js.
In this particular case, code has to be both in PHP and Javascript because you want to refresh the drop-down only if $tmp_result is true.
On 15 Mei 2011, at 18:25, Marc Delisle marc@infomarc.info wrote:
Le 2011-05-14 23:07, Aris Feryanto a écrit :
Hi Marc,
On 14 Mei 2011, at 18:39, Marc Delisle marc@infomarc.info wrote:
Le 2011-05-13 16:06, Aris Feryanto a écrit :
Hi,
The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code: - ajax request in navigation.js - ajax response in navigation.php - ajax trigger in header.inc.php (the triggering is done by adding <script> tag to call js function in the navigation frame, any better way?)
Hi Aris, How about this?
diff --git a/js/functions.js b/js/functions.js index 572c857..50fd6f8 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2276,5 +2276,9 @@ $(document).ready(function() { } });
$('#update_recent_tables').ready(function() { +
window.parent.frame_navigation.PMA_reloadRecentTable(); + }); + }) // end of $(document).ready()
diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 05d272e..4036f86 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -21,9 +21,7 @@ require_once './libraries/RecentTable.class.php'; function PMA_addRecentTable($db, $table) { $tmp_result = RecentTable::getInstance()->add($db, $table); if ($tmp_result === true) { - echo '<script type="text/javascript">' . - 'window.parent.frame_navigation.PMA_reloadRecentTable();' . - '</script>'; + echo '<span class="hide" id="update_recent_tables"></span>'; } else { $error = $tmp_result; $error->display();
This works. But, I'm thinking that we should add a function to register javascript for a certain page, shouldn't we? The registered script will be buffered for output, for example, near the bottom of the page. The function will look like this:
PMA_registerScript ( $scriptString );
We want to avoid using inline Javascript if possible because we want to benefit from caching these files at the browser level. Also, we want to use jQuery if possible, instead of pure Javascript.
Ok.
Since, IMO, the code will be clearer and easier to understand than separated code in both the php and the js.
In this particular case, code has to be both in PHP and Javascript because you want to refresh the drop-down only if $tmp_result is true.
I understand that the code must be separated in php n javascript. What I mean is if the javascript is registered from php code, the php code will be more readable, since the whole code for triggering reload is in the php file.
But, if the case is to avoid inline javascript, the it is ok.
-- Aris Feryanto
On Fri, May 13, 2011 at 10:06 PM, Aris Feryanto aris_feryanto@yahoo.com wrote:
Hi, The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code:
- ajax request in navigation.js
- ajax response in navigation.php
- ajax trigger in header.inc.php (the triggering is done by adding <script>
tag to call js function in the navigation frame, any better way?) [0] http://demo.phpmyadmin.net/gsoc-aris/ Cheers, -- Aris Feryanto
What if, instead of a 'recently used tables drop down list' there would be a bunch of icons that allow (ajax request-)sorting of tables/databases by different criterias such as: - most recently used - most commonly used - table/db size
Similar to chromes omnibar that suggests addresses that are most commonly used, this seems somehow more intuitive than a drop down list.
On 10 Mei 2011, at 23:49, Marc Delisle marc@infomarc.info wrote:
Aris Feryanto a écrit :
Hi,
I've just got some comments from the feature tracker [0]:
===================================== The only problem I see is that each time I go to a new table, (within the same database) the left column refreshes. Is this to repopulate that list????
(...)
=====================================
I'll try to use ajax to refresh the drop-down list. It would be more convenient if users can still interact with the recent list (in case the user wrongly select the recent table), while the main frame is still loading.
Other comments and suggestions are welcome.
Indeed this is a valid objection to navigation panel reload, and Ajax is promising.
-- Marc Delisle http://infomarc.info
Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
On 15 Mei 2011, at 16:17, Tyron Madlener tyronx@gmail.com wrote:
On Fri, May 13, 2011 at 10:06 PM, Aris Feryanto aris_feryanto@yahoo.com wrote:
Hi, The recently used tables is now using ajax. I've just pushed to my repo, so the demo [0] will be available in an hour later. Comment and suggestion are welcome, mainly regarding the ajax-related code:
- ajax request in navigation.js
- ajax response in navigation.php
- ajax trigger in header.inc.php (the triggering is done by adding <script>
tag to call js function in the navigation frame, any better way?) [0] http://demo.phpmyadmin.net/gsoc-aris/ Cheers, -- Aris Feryanto
What if, instead of a 'recently used tables drop down list' there would be a bunch of icons that allow (ajax request-)sorting of tables/databases by different criterias such as:
- most recently used
- most commonly used
- table/db size
I think we can add sorting criteria in settings page. But, IMO, list is still more intuitive than using icons.
Similar to chromes omnibar that suggests addresses that are most commonly used, this seems somehow more intuitive than a drop down list.
So, users must type table's name in order to jump to a table? I think this is not convenient, since users may have table names with same prefix.
-- Aris Feryanto