Hi All,
Over the last couple of weeks, I made a few changes for my GSoC project and I have published the changes at my fork of the phpMyAdmin repository [0]. The changes have been made on the Server Privileges (server_privileges.php) and Database Operations (db_operations.php) pages, along with the corresponding JavaScript files and some library files. Also, I have re-factored (some) JavaScript functions from functions.js and common.js and removed a few inline JavaScript calls and replaced them with jQuery scripts.
It would be great if I could get some feedback on how my code is building up, and also some testing to ensure that the changes I'm making don't work in just my narrow workbench setup. :) The documentation/comments may be inadequate, as most of the work is still in progress and is subject to change over the next few weeks, but anybody who's read jQuery code before, should understand what's happening. Kindly spend some time testing out the following (Smiles and Thank Yous guaranteed for those who help! ;) ) :
* Server Privileges: ** Reload/Flush Privileges ** Add a new user (known bug: When adding a user after the first one, the "Create User" button makes the Ajax call and creates a user, but does not automatically close the dialog) ** Revoke User ** Export Privileges
* Database Operations: ** Rename Database ** Copy Database ** Change Database Charset
* Inline JavaScript calls removed/JS functions refactored: ** Drop Database (db_structure.php). (removed inline calls to confirmLinkDropDB() ). ** Truncate, Drop Table (db_structure.php) ** Drop Column, Add Primary Key (tbl_structure.php) ** markAllRows() and unmarkAllRows() ** addClass() and removeClass() ** setCheckboxes() ** setSelectOptions() ** confirmLink() (Now using $.PMA_confirm() instead. All calls to this function have yet to be replaced, work in progress)
All suggesstions and improvements to code are welcome! :)
P.S: My blog host has again been moving servers, and hence, my blog is unreachable/down for almost 5 days now. I will switch to a paid hosting service as soon as I receive the initial GSoC payment. I'm sorry for the downtime.
-------------------------------------------------------------------- [0] - http://repo.or.cz/w/phpmyadmin/ninadsp.git --------------------------------------------------------------------
Ninad S. Pundalik Twitter: @ni_nad | Identica : @ninad | http://ninadpundalik.co.cc/blog GPG Key Fingerprint: 2DF7 B856 C75E C9F9 0504 C0EF D456 1946 7C45 2C69
Ninad Pundalik a écrit :
Hi All,
Over the last couple of weeks, I made a few changes for my GSoC project and I have published the changes at my fork of the phpMyAdmin repository [0]. The changes have been made on the Server Privileges (server_privileges.php) and Database Operations (db_operations.php) pages, along with the corresponding JavaScript files and some library files. Also, I have re-factored (some) JavaScript functions from functions.js and common.js and removed a few inline JavaScript calls and replaced them with jQuery scripts.
It would be great if I could get some feedback on how my code is building up, and also some testing to ensure that the changes I'm making don't work in just my narrow workbench setup. :) The documentation/comments may be inadequate, as most of the work is still in progress and is subject to change over the next few weeks, but anybody who's read jQuery code before, should understand what's happening. Kindly spend some time testing out the following (Smiles and Thank Yous guaranteed for those who help! ;) ) :
- Server Privileges:
** Reload/Flush Privileges ** Add a new user (known bug: When adding a user after the first one, the "Create User" button makes the Ajax call and creates a user, but does not automatically close the dialog) ** Revoke User ** Export Privileges
- Database Operations:
** Rename Database ** Copy Database ** Change Database Charset
- Inline JavaScript calls removed/JS functions refactored:
** Drop Database (db_structure.php). (removed inline calls to confirmLinkDropDB() ). ** Truncate, Drop Table (db_structure.php) ** Drop Column, Add Primary Key (tbl_structure.php) ** markAllRows() and unmarkAllRows() ** addClass() and removeClass() ** setCheckboxes() ** setSelectOptions() ** confirmLink() (Now using $.PMA_confirm() instead. All calls to this function have yet to be replaced, work in progress)
All suggesstions and improvements to code are welcome! :)
Hi Ninad,
First a general advice about message strings: please use gettext. See http://wiki.phpmyadmin.net/pma/Devel:Gettext_for_developers and js/messages.php.
Testing "Add a new user", indeed the dialog is not closed but shouldn't the new user appear in the list of users after creation?
Also I get
Notice in ./libraries/common.lib.php#2891 Undefined index: is_header_sent
Backtrace ./server_privileges.php#1037: PMA_ajaxResponse( object, boolean 1, )
Warning in ./libraries/common.lib.php#2892 Cannot modify header information - headers already sent by (output started at /root/pma-git/phpmyadmin/libraries/common.lib.php:990)
Backtrace ./libraries/common.lib.php#2892: header(string Content-Type: application/json) ./server_privileges.php#1037: PMA_ajaxResponse( object, boolean 1,
On 21/06/2010, Marc Delisle marc@infomarc.info wrote:
First a general advice about message strings: please use gettext. See http://wiki.phpmyadmin.net/pma/Devel:Gettext_for_developers and js/messages.php.
Coincidentally, I was reading this page today and going through js/message.php today. I will make use of the PMA_messages[] array for the message strings.
Testing "Add a new user", indeed the dialog is not closed but shouldn't the new user appear in the list of users after creation?
Also I get
Notice in ./libraries/common.lib.php#2891 Undefined index: is_header_sent
Backtrace ./server_privileges.php#1037: PMA_ajaxResponse( object, boolean 1, )
Warning in ./libraries/common.lib.php#2892 Cannot modify header information - headers already sent by (output started at /root/pma-git/phpmyadmin/libraries/common.lib.php:990)
Backtrace ./libraries/common.lib.php#2892: header(string Content-Type: application/json) ./server_privileges.php#1037: PMA_ajaxResponse( object, boolean 1,
I think I've understood my mistake, will correct it. Also, will check the issues on the database operations page for renaming. Will post back here after I've made those changes and pushed them to the repository.
Thanx! :)
Hi Marc,
<snip> On 21 June 2010 22:24, Marc Delisle marc@infomarc.info wrote:
Hi Ninad,
First a general advice about message strings: please use gettext. See http://wiki.phpmyadmin.net/pma/Devel:Gettext_for_developers and js/messages.php.
</snip> I am now using gettext strings for all notifications. However, I am not having any results when I try to use message strings from js/messages.php for the text to be used on jQueryUI dialog buttons. It seems that it will take only a string while creating an associative array of button text and the callback functions to be called when a button is clicked. The jQueryUI bug tracker and forums do not have any solution to this issue either.
<snip>
Testing "Add a new user", indeed the dialog is not closed but shouldn't the new user appear in the list of users after creation?
</snip> Working on this.
<snip>
Also I get Notice in ./libraries/common.lib.php#2891 Undefined index: is_header_sent
</snip> Fixed.
Ninad S. Pundalik
Ninad Pundalik a écrit :
Hi Marc,
(...)
I am now using gettext strings for all notifications. However, I am not having any results when I try to use message strings from js/messages.php for the text to be used on jQueryUI dialog buttons. It seems that it will take only a string while creating an associative array of button text and the callback functions to be called when a button is clicked. The jQueryUI bug tracker and forums do not have any solution to this issue either.
Ninad,
In general we are calling Javascript files using a .js extension to benefit from caching but on a least one occasion (js/messages.php) the file is preprocessed by PHP before Javascript.
Maybe you could name the file js/server_privileges.js.php and put directly your gettext strings in there. Look how js/messages.php is working.
On 28 June 2010 19:06, Marc Delisle marc@infomarc.info wrote:
Maybe you could name the file js/server_privileges.js.php and put directly your gettext strings in there. Look how js/messages.php is working.
That is what I would have done if there was no better solution, but it would have to be done atleast 2-3 different files. However, I looked harder and found a solution on the jQueryUI forums itself. [0] and [1] are pretty much the same thing, and a better approach to what I was trying to do, to define the options array for buttons seperately and then pass it to $().dialog(). We can continue using the PMA_messages[] array with this solution. I'm making the necessary changes to the code and changing the buttons now.
-------------------------------- [0] - http://forum.jquery.com/topic/dialog-buttons-questions [1] - http://forum.jquery.com/topic/localize-dialog-button-names -------------------------------
Ninad S. Pundalik Twitter: @ni_nad | Identica : @ninad | http://ninadpundalik.co.cc/blog GPG Key Fingerprint: 2DF7 B856 C75E C9F9 0504 C0EF D456 1946 7C45 2C69
Hi
Dne Mon, 21 Jun 2010 10:43:23 +0530 Ninad Pundalik ninadsp16289@gmail.com napsal(a):
P.S: My blog host has again been moving servers, and hence, my blog is unreachable/down for almost 5 days now. I will switch to a paid hosting service as soon as I receive the initial GSoC payment. I'm sorry for the downtime.
There is lot of free services which have reasonable reliability, eg. blogspot.com
Hi,
Seems to me like you're making good progress.
On 6/21/2010 1:13 AM, Ninad Pundalik wrote:
Hi All,
It would be great if I could get some feedback on how my code is building up, and also some testing to ensure that the changes I'm making don't work in just my narrow workbench setup.
- Server Privileges:
** Reload/Flush Privileges ** Add a new user (known bug: When adding a user after the first one, the "Create User" button makes the Ajax call and creates a user, but does not automatically close the dialog)
It's a small thing, but when I go to the Privileges tab and click the "Add a new user" link, the page immediately says "Loading" -- which is good -- but it's made to be the top thing on the page where I'll never see it unless looking for it. I'd much rather see that type of feedback closer to the Add a new user button or as a graphic superimposed over the entire page. Either way, I feel the "Loading" at the top of the page (above even the server name) is too obscure for users to notice.
Actually that location for feedback occurs with the reload privileges link, too; at 1240x768 screen resolution I don't even see the messages, all I see is the rest of the content shift up and down (because I've scrolled down the page a bit).
Also "Add a new user" seems broken on the demo server[1] ("currently running Git revision 06a7736 from master branch"), when I click the link, the right frame never finishes loading. I see the textboxes for creating a user for a fraction of a second before the page goes white.
** Revoke User ** Export Privileges
- Database Operations:
** Rename Database
After renaming a database, I first get the very alarming prompt asking if I wish to DROP my database (yes, the full text is "CREATE DATABASE...and then DROP DATABASE foo" but as a user all I see is that I'm dropping it). I think that can be a more friendly prompt.
Once I agree to that, I get stuck in "Reload Database" (No, Yes) -- if I hit "Yes" that same dialog is presented, if I press No the database is renamed but both frames act as if I'm still in the old database. (again "currently running Git revision 06a7736 from master branch").
[snip]
P.S: My blog host has again been moving servers, and hence, my blog is unreachable/down for almost 5 days now. I will switch to a paid hosting service as soon as I receive the initial GSoC payment. I'm sorry for the downtime.
You could look at wordpress.com; Michal's blogspot.com suggestion was good too as I know people who use both.
[0] - http://repo.or.cz/w/phpmyadmin/ninadsp.git
~isaac
Hi Isaac,
<snip>
It's a small thing, but when I go to the Privileges tab and click the "Add a new user" link, the page immediately says "Loading" -- which is good -- but it's made to be the top thing on the page where I'll never see it unless looking for it. I'd much rather see that type of feedback closer to the Add a new user button or as a graphic superimposed over the entire page. Either way, I feel the "Loading" at the top of the page (above even the server name) is too obscure for users to notice.
</snip> My idea for this is to use a division like GMail does, by setting a fixed position to the division which shows the messages. I am yet to edit the CSS files to that effect, as I haven't read any documentation on the theming in phpMyAdmin. I'll put it on a high priority and complete it. As for the graphic, I'll add it too for notifications about Ajax requests being processed. It would not make sense to show the graphic if an error/success message is being shown. Should a gif from Ajaxload [0] be alright?
<snip>
Also "Add a new user" seems broken on the demo server[1] ("currently running Git revision 06a7736 from master branch"), when I click the link, the right frame never finishes loading. I see the textboxes for creating a user for a fraction of a second before the page goes white.
</snip> I'll test it on the demo server and figure out the issue. I suspect that a document.write() call is conflicting somewhere with jQuery.
<snip>
After renaming a database, I first get the very alarming prompt asking if I wish to DROP my database (yes, the full text is "CREATE DATABASE...and then DROP DATABASE foo" but as a user all I see is that I'm dropping it). I think that can be a more friendly prompt.
Once I agree to that, I get stuck in "Reload Database" (No, Yes) -- if I hit "Yes" that same dialog is presented, if I press No the database is renamed but both frames act as if I'm still in the old database. (again "currently running Git revision 06a7736 from master branch").
</snip> There was a context issue in setting the db variable which I'd forgotten about. Fixed it.
<snip>
You could look at wordpress.com; Michal's blogspot.com suggestion was good too as I know people who use both.
</snip> My blog is a self hosted Wordpress setup, and I've used both the services. My blog is up now. Thank you for the suggestions :)
----------------------------------------- [0] - http://ajaxload.info ----------------------------------------
Ninad S. Pundalik Twitter: @ni_nad | Identica : @ninad | http://ninadpundalik.co.cc/blog GPG Key Fingerprint: 2DF7 B856 C75E C9F9 0504 C0EF D456 1946 7C45 2C69
2010/6/28 Ninad Pundalik ninadsp16289@gmail.com:
<snip> > Also "Add a new user" seems broken on the demo server[1] ("currently > running Git revision 06a7736 from master branch"), when I click the > link, the right frame never finishes loading. I see the textboxes for > creating a user for a fraction of a second before the page goes white. </snip> I'll test it on the demo server and figure out the issue. I suspect that a document.write() call is conflicting somewhere with jQuery.
Try to avoid using document.write() and use DOM manipulation methods instead. XHTML documents should not use it.
Hi,
On 6/28/2010 8:53 AM, Ninad Pundalik wrote:
Hi Isaac,
<snip> > It's a small thing, but when I go to the Privileges tab and click the > "Add a new user" link, the page immediately says "Loading" -- which is > good -- but it's made to be the top thing on the page where I'll never > see it unless looking for it. I'd much rather see that type of feedback > closer to the Add a new user button or as a graphic superimposed over > the entire page. Either way, I feel the "Loading" at the top of the page > (above even the server name) is too obscure for users to notice. </snip> My idea for this is to use a division like GMail does, by setting a fixed position to the division which shows the messages. I am yet to edit the CSS files to that effect, as I haven't read any documentation on the theming in phpMyAdmin. I'll put it on a high priority and complete it. As for the graphic, I'll add it too for notifications about Ajax requests being processed. It would not make sense to show the graphic if an error/success message is being shown. Should a gif from Ajaxload [0] be alright?
Yes, I see what you've done with the improved yellow Loading tag at the top of the window which is better. I do like some of the icons on Ajaxload, too, but whether the feedback should be the text label at the top or the graphic overlaid (or both) isn't for me to decide or dictate.
[0] - http://ajaxload.info
Regards, ~isaac