WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#6988 closed enhancement (fixed)

Add sorting to gallery items

Reported by: AaronCampbell Owned by: ryan
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch needs-testing blessed
Focuses: Cc:

Description

The idea is to integrate the functionality that my Reorder Gallery plugin offers into core as per Matt Mullenweg's suggestion over at my blog.

It should be rather easy, I'll try to get a patch up real soon. Hopefully Matt will stop by and let me know what version he'd like to integrate it into.

Attachments (5)

6988.001.diff (2.0 KB) - added by AaronCampbell 6 years ago.
6988.002.diff (2.9 KB) - added by AaronCampbell 6 years ago.
6988.003.diff (163.0 KB) - added by AaronCampbell 6 years ago.
6988.004.diff (529 bytes) - added by AaronCampbell 6 years ago.
gallery-script-loader-bump.diff (721 bytes) - added by nbachiyski 6 years ago.

Download all attachments as: .zip

Change History (23)

AaronCampbell6 years ago

comment:1 AaronCampbell6 years ago

  • Keywords has-patch needs-testing added

I uploaded the patch, works on my trunk install.

comment:2 ryan6 years ago

  • Owner changed from anonymous to ryan

comment:3 matt6 years ago

  • Keywords blessed added
  • Milestone changed from 2.5.2 to 2.6

+1

AaronCampbell6 years ago

comment:4 AaronCampbell6 years ago

The 002 diff is to be used instead of 001. It's 001 with the missing entry in script-loader for gallery.js (aliased as "admin-gallery").

comment:5 ryan6 years ago

This adds an interface.js requirement. We're trying to eliminate interface requirements. Can jQuery UI be used instead?

comment:6 AaronCampbell6 years ago

I'm sure it could, it was set up to mimic wp-admin/js/widgets.js which does the widget sorting. I'll take a look at jQuery UI in the next day or two and convert it.

comment:7 ryan6 years ago

Yeah, widgets admin needs to be ported to jQuery UI. jQuery UI wasn't up to the task when 2.5 was released, but the latest jQuery UI beta might work.

comment:8 AaronCampbell6 years ago

To use the jquery ui sortables, we need the ui.sortable file (duh), but we also have to add the latest jquery.js from trunk. Should I ADD it (tag it as jquery125), or replace the current one with it?

comment:9 ryan6 years ago

Replace the current one.

comment:10 ryan6 years ago

Related: #7007

comment:11 AaronCampbell6 years ago

003 is the newest update.

  1. It updates to the latest wp-includes/js/jquery/jquery.js from trunk (1.2.5 built from revision 5652)
  2. It updates to the latest wp-includes/js/jquery/ui.core.js from trunk (built from revision 5652)
  3. It adds wp-includes/js/jquery/ui.sortable.js (built from revision 5652)
  4. It adds wp-admin/js/gallery.js (the new version that uses UI)
  5. Adds the new stuff to script loader
  6. Adds in the new "menu_order" field
  7. Updates colors-fresh and colors-classic to use the same .sorthelper class for the widgets and the gallery.
  8. Updates media.css to add the "move" cursor to the elements

AaronCampbell6 years ago

comment:12 AaronCampbell6 years ago

My wikiformatting didn't work so great on that last post (left of a leading space before all my list items), so here it is:

Regarding 003:

  1. It updates to the latest wp-includes/js/jquery/jquery.js from trunk (1.2.5 built from revision 5652)
  2. It updates to the latest wp-includes/js/jquery/ui.core.js from trunk (built from revision 5652)
  3. It adds wp-includes/js/jquery/ui.sortable.js (built from revision 5652)
  4. It adds wp-admin/js/gallery.js (the new version that uses UI)
  5. Adds the new stuff to script loader 1. Adds in the new "menu_order" field
  6. Updates colors-fresh and colors-classic to use the same .sorthelper class for the widgets and the gallery.
  7. Updates media.css to add the "move" cursor to the elements

comment:13 ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [7974]) Add sorting to gallery. Props AaronCampbell. fixes #6988

comment:14 azaozz6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Seems to be broken now. Error in FB:

sort.instance is undefined
http://site.com/wp26/wp-admin/js/gallery.js?ver=20080520
Line 13

AaronCampbell6 years ago

comment:15 AaronCampbell6 years ago

6988.004.diff fixes it for me. Seems they changed something in how it works.

comment:16 ryan6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [8259]) Gallery sort fix from AaronCampbell. fixes #6988

comment:17 nbachiyski6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Version in script-loader.php has to be bumped.

We should be extra careful about that in the future, because if Gears is in use, disabling the browser cache doesn't help.

comment:18 ryan6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [8262]) Bump version for gallery. Props nbachiyski. fixes #6988

Note: See TracTickets for help on using tickets.