Opened 5 years ago

Closed 5 years ago

#6988 closed enhancement (fixed)

Add sorting to gallery items

Reported by: AaronCampbell Owned by: ryan
Priority: normal Milestone: 2.6
Component: Administration Version:
Severity: normal Keywords: has-patch needs-testing blessed
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 5 years ago.
6988.002.diff (2.9 KB) - added by AaronCampbell 5 years ago.
6988.003.diff (163.0 KB) - added by AaronCampbell 5 years ago.
6988.004.diff (529 bytes) - added by AaronCampbell 5 years ago.
gallery-script-loader-bump.diff (721 bytes) - added by nbachiyski 5 years ago.

Download all attachments as: .zip

Change History (23)

  • Keywords has-patch needs-testing added

I uploaded the patch, works on my trunk install.

comment:2   ryan5 years ago

  • Owner changed from anonymous to ryan

comment:3   matt5 years ago

  • Keywords blessed added
  • Milestone changed from 2.5.2 to 2.6

+1

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   ryan5 years ago

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

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   ryan5 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.

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   ryan5 years ago

Replace the current one.

Related: #7007

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

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
  • Resolution set to fixed
  • Status changed from new to closed

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

  • 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

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

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

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

  • 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.

  • 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.