Ticket #2561 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

AJAX Admin

Reported by: mdawaffe Assigned to: mdawaffe
Priority: normal Milestone: 2.1
Component: Administration Version: 2.0.2
Severity: normal Keywords: AJAX ajaxcat list-manipulation bg|2nd-opinion bg|has-patch
Cc:

Description

Leverage the Web 2.0 paradigm of... whatever. Slap on some AJAX for a few admin UI function to get rid of annoying page reloads.

Item deletion and dimming (class changing)

  1. Mass Edit Mode Comments (was #1810)
  2. edit.php comments (was #2552)
  3. Plugin (de)activation
  4. Custom Fields

Item addition

  1. Custom Fields
  2. Categories (Manage->Categories)
  3. Bookmarks? (Bookmarks->Manage Bookmarks)
  4. Users

Attachments

2561.diff (42.9 kB) - added by mdawaffe on 03/14/06 23:36:49.
Round 1 *FIGHT!*
2561b.diff (43.9 kB) - added by mdawaffe on 03/15/06 02:06:00.
Fixes escaping/slash issues. Supersedes 2561.diff
2561c.diff (49.0 kB) - added by mdawaffe on 03/23/06 01:25:49.
No plugins. Better everything else.
2561d.diff (51.2 kB) - added by mdawaffe on 03/23/06 04:12:28.
Fix first meta bug.
2561e.diff (51.7 kB) - added by mdawaffe on 03/23/06 04:43:42.
Fix new meta after update a different meta bug
2561f.diff (55.6 kB) - added by mdawaffe on 03/23/06 08:15:02.
fixes some bugs reported by ryan and mark
2561h.diff (58.2 kB) - added by mdawaffe on 03/27/06 19:07:16.
What happened to g? More bug fixes.
2561i.diff (59.9 kB) - added by mdawaffe on 03/28/06 02:10:26.
i18n. Some typos. Some sec fixes.
2561j.diff (59.8 kB) - added by mdawaffe on 03/29/06 00:45:00.
Almost at 1/2 alphabet! Fixes single quote problem in Custom Fields

Change History

03/13/06 02:00:10 changed by mdawaffe

I'm working on a patch for this now. I should have some code for this tomorrow that does at least a chunk of all this.

03/13/06 02:38:56 changed by ryan

Nice. Looking forward to it.

03/13/06 08:28:57 changed by westi

Looks good.

What about bringing in the AJAX multiselect delete code from #923

The changes to list-manipulation.js there should hopefully support generic multiselect delete.

03/14/06 23:36:49 changed by mdawaffe

  • attachment 2561.diff added.

Round 1 *FIGHT!*

03/14/06 23:43:56 changed by mdawaffe

2561.diff

Fixes:

All mentioned Item deletion/dimming. Better ajaxcat. Update individual custom fields.

Does Not yet:

Do any item addition (though should be fairly simple now)

Known bugs:

Update a custom field. Update it again and it won't go through AJAX. (Source of problem known, looking into best solution.)

Compatibility:

Unknown. Testing (all working) on FF 1.5.0.1/MAC 10.latest, FF 1.0.7/WinXP, IE 6.0.something/WinXP

Methodology:

"Class like" JS. Simple things: PHP sends '-1' (!current_user_can), '0' (does not exist, something broke), '1' (all is well). Complicated things: PHP sends '-1', '0' (as above), XML object with id and escaped raw HTML for inclusion into list.

03/14/06 23:46:13 changed by mdawaffe

PS: When testing (and please do!), make sure and do a hard refresh or two to clear JS cache.

03/14/06 23:50:01 changed by mdawaffe

TODO:

i18n

03/14/06 23:56:26 changed by mdawaffe

KNOWN BUGS:

Some escaping/slashes issues.

03/15/06 01:00:20 changed by mdawaffe

  • status changed from new to assigned.

westi, I'll look into it after things settle in. Also, will #923 be made less important when deletion is on the fly anyway?

03/15/06 02:06:00 changed by mdawaffe

  • attachment 2561b.diff added.

Fixes escaping/slash issues. Supersedes 2561.diff

03/15/06 02:07:14 changed by mdawaffe

2561b.diff (full patch)

FIXES:

escaping/slash issues.

03/15/06 05:03:31 changed by markjaquith

Custom fields delete through asynchronously and update once, as you said. What else should I be testing? Scrolling up it's hard to tell what is currently implemented.

03/15/06 07:10:19 changed by mdawaffe

This should currently (grouped by what chunk of code implements the feature)

Delete

  1. Posts on Manage->Posts
  2. Pages on Manage->Pages
  3. Comments on Manage->Posts: click on comments # link for a particular post
  4. Categories on Manage->Categories
  5. Comments on Manage->Comments
  6. Comments on Manage->Awaiting Moreration (Delete Just this comment)
  7. Bookmarks on Bookmarks->Manage Bookmarks

"Dim" (change the coler of)

  1. Comments when moderating through Manage->Posts: click on comments # link for a particular post
  2. Plugins when de(activating) on Plugins->Plugins

Update

  1. Individual (pre-existing) Custom Fields on Write->Post/Page

Add

  1. Categories through Write->Post/Page or Bookmarks->Add Bookmarks

At some point, this ticket should also have a patch for adding

  1. Users from Users->Authors & Users
  2. Categories from Manage->Categories
  3. New Custom Fields from Write->Post/Page
  4. Possibly Bookmarks from Bookmarks->Manage Bookmarks

03/18/06 00:22:35 changed by ryan

Maybe we should continue doing a page reload for plugin activation. Plugins can add menus and submenus when activated, and those menus won't show up if we don't refresh.

03/18/06 01:31:18 changed by mdawaffe

Good point. I wanted plugins to work here since it's annoying to go through them one by one if you have a bunch to activate/deactivate. It wouldn't be too hard to update the menus live, now that the JS is more abstracted. We'd only have to change the top level menu and the Plugins one.

Should I look into that?

Otherwise, most everything is working on my local copy. I hope to have another patch up in the next couple days that does a better job of keeping the slashes under control and that adds items besides categories as well.

03/18/06 01:39:02 changed by ryan

How about a separate patch for plugins so we can get the rest of it in and play with plugins on the side?

03/19/06 02:26:28 changed by mdawaffe

Can do.

03/23/06 01:25:49 changed by mdawaffe

  • attachment 2561c.diff added.

No plugins. Better everything else.

03/23/06 01:26:53 changed by mdawaffe

2561c.diff

Delete

  1. Posts on Manage->Posts
  2. Pages on Manage->Pages
  3. Comments on Manage->Posts: click on comments # link for a particular post
  4. Categories on Manage->Categories
  5. Comments on Manage->Comments
  6. Comments on Manage->Awaiting Moreration (Delete Just this comment)
  7. Bookmarks on Bookmarks->Manage Bookmarks
  8. Custom Fields on Write->Post/Page

"Dim" (change the coler of)

  1. Comments when moderating through Manage->Posts: click on comments # link for a particular post

Update

  1. Individual Custom Fields on Write->Post/Page

Add

  1. Categories through Write->Post/Page or Bookmarks->Add Bookmarks
  2. Categories from Manage->Categories
  3. New Custom Fields from Write->Post/Page

Does not do anything with plugins as above. Does not do user addition, which will be a little tricky with the current way users are listed.

Needs

  1. Better wp-admin.css for category UL on Write->Post/Page / Bookmarks->Add Bookmarks (fine in FF, ugly in IE).

This latest patch tested only in FF 1.0.5.1/Max OS X

03/23/06 01:31:23 changed by mdawaffe

  • keywords changed from AJAX ajaxcat list-manipulation to AJAX ajaxcat list-manipulation bg|2nd-opinion bg|has-patch.
  • version changed from 2.0.1 to 2.0.2.

I'd like to get this reviewed and altered by others and committed if appropriate. Users, plugins and potentially bookmarks can be spun off to their own tickets.

03/23/06 04:12:28 changed by mdawaffe

  • attachment 2561d.diff added.

Fix first meta bug.

03/23/06 04:43:42 changed by mdawaffe

  • attachment 2561e.diff added.

Fix new meta after update a different meta bug

03/23/06 08:15:02 changed by mdawaffe

  • attachment 2561f.diff added.

fixes some bugs reported by ryan and mark

03/27/06 19:07:16 changed by mdawaffe

  • attachment 2561h.diff added.

What happened to g? More bug fixes.

03/27/06 19:17:27 changed by mdawaffe

2561h.diff

Fixes several bugs (problems listed belew should now be fixed):

  1. Not adding new custom fields in IE.
  2. Problems deleting/custom fields in IE.
  3. class="alternate" problems.
  4. Deleting items with ' " / & in their titles
  5. AJAX calls in quick succession (e.g. dblclick) explodes
  6. Updating unchanged meta caused breakage.

General cleanup.

  1. Simplify a few functions.
  2. Should play nice now on No AJAX and on No JS.

03/28/06 02:10:26 changed by mdawaffe

  • attachment 2561i.diff added.

i18n. Some typos. Some sec fixes.

03/28/06 02:12:11 changed by mdawaffe

2561i.diff

New Stuff:

  1. i18n: needs checking.
  2. check_ajax_ref
  3. clean up a couple typos.

In serious need of cross-browser. Especially older stuff.

03/28/06 02:12:37 changed by mdawaffe

Cross-browser testing, that is.

03/28/06 02:33:37 changed by mdawaffe

Please test creating and deleting things (categories, post, custom fields...) with funny characters in their titles:

' " < & % \

Characters that might screw up any kind of escaping/encoding.

Remember to hard refresh for new JS.

03/28/06 23:36:44 changed by ryan

So far so good on Firefox 1.0.7 and 1.5.0.1.

Got the AJAX ref checking working with the secure admin plugin too.

03/28/06 23:49:34 changed by markjaquith

In IE 6.0/WinXP and FF 1.5.0.1/OS X, deletion of a Custom Field with a single quote in the key name resulted in a page refresh, and no alert confirmation. The deletion occured, however. Minor issue.

I haven't tested it all thoroughly, but initially, it seems very good! I'll try to test more later.

03/29/06 00:45:00 changed by mdawaffe

  • attachment 2561j.diff added.

Almost at 1/2 alphabet! Fixes single quote problem in Custom Fields

03/29/06 00:45:44 changed by mdawaffe

markjaquith, fixed in 2561j.diff

03/29/06 01:52:08 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [3660]) AJAX, cause you love it. Props mdawaffe. fixes #2561