On Tue, 2011-08-23 at 21:40 +0200, Dieter Adriaenssens wrote:
2011/8/23 Rouslan Placella rouslan@placella.com:
Hi there,
I think that there is a problem with the current implementation of the PMA_ajaxShowMessage() function. The issue is that it has a fixed 5sec timeout. For error messages I think that it's too little, but for info messages it's way too much. I remember someone already mentioning here on the list this exact problem (though can't remember who or when).
I wrote a patch [1] that increases the ajax message timeout to 10s and offers the users the possibility to dismiss any ajax message. With this patch applied, the user is shown a tooltip when hovering a notification, which lets him/her know that by clicking on the notification, it will be removed. However this tooltip is hidden when the user hovers over a link or a button, since by clicking one of those the user will actually follow the link rather than dismissing the notification (which I think would be the expected behaviour).
I'd like to merge this commit to master branch, so please let me know what you think.
I like the idea of clicking away a message, but maybe the timeout value can be an optional parameter when showing a message. For an error message this could be indefinite (10 sec is even to short to inspect an (SQL) error message), while for others the timeout value can be much shorter (f.e. 2-3 seconds for notifying that a record was removed/inserted)
I did a bit more work on the ajax messages and now it is possible to have some messages ('Loading...', errors, etc) that don't disappear. And any message except 'Loading...' can be dismissed by clicking on it.
The relevant code is in the ajax_message branch in my git repo [1], in particular commits dd566ec76c0e182, d39db8e3b604743 and 6dbab1fb38a97d3.
Unless someone has any objections I will merge with master some time soon.
@Dieter: timeout was already an optional parameter to the PMA_ajaxShowMessage() function, but I guess that not many developers use it, now I just added the "indefinite" option to it.
Rouslan
[1]: http://repo.or.cz/w/phpmyadmin/roccivic.git/shortlog/refs/heads/ajax_message