Please consider adding a weight property to allow custom ordering of icons.

For example, I want to add a custom ed_code icon just after the ed_block icon with hook_quicktags_insert().

Comments

Bèr Kessels’s picture

Nice feature. I doubt it is very hard to code. Will reconsider this if someone can make a patch. (Or if I find time to make one).

Bèr

naudefj’s picture

Status: Active » Needs review
StatusFileSize
new2.06 KB

Here is a patch, please review.

Bèr Kessels’s picture

The usort breaks the assiciative arrays. PLease use uasort instead.

Bèr Kessels’s picture

Status: Needs review » Needs work
naudefj’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new2.06 KB

Updated patch attached.

naudefj’s picture

Ping Bèr.

pfaocle’s picture

This patch seems to work fine for me, looks good. Just a note that if applied, other modules which implement hook_quicktags_insert or hook_quicktags_alter (such as bbcode.module) will need to provide a weight, too.

tcblack’s picture

StatusFileSize
new3.07 KB

This additional patch provides similar weighting to the quicktagsplus contribution (as of just now only in cvs). The original module weighting ends with 60, this module begins at 70 and counts upwards with a few minor jumps.

tcblack’s picture

After testing for a week, both patches (quicktags, quicktagsplus) appear to work for me.
I'll wait for Bèr to commit these to head since It doesn't appear that a patch has been made yet for the bbcode module. I suspect one will have to be made and tested there before this one is truly RTBC.

Bèr Kessels’s picture

Thanks for you review. I don't have immediate time available for a commit, but hope to get it done before my (badly needed) holidays, otherwise it will be commited somewhere in 2 to 3 weeks.

tcblack’s picture

I've created a matching patch for BBcode and posted it there (http://drupal.org/node/208059) in order to help any future compatibility issues along.

Bèr Kessels’s picture

Committed to the HEAD on the Drupal-5 branch.
Doc at http://webschuur.com/node/628 updated to explain the hook wih the new integer.

Bèr Kessels’s picture

Status: Reviewed & tested by the community » Fixed
jmai’s picture

I tried the latest code for 5.x-2.x and i get a blank page. I compared the committed files of quicktags.module commited on January 13th 1.21.4.1 with 1.22. It seems to be commit is at the wrong location for 5.x-2.x. b/c it doesn't have the 'undefined import stylesheet' fixed commited on January 8 which is causing the blank page. This is also true for 5.x-3.x. Tell me if i'm wrong.

Bèr Kessels’s picture

Can you post a new bug issue about hat stylesheet import?

jmai’s picture

@Ber Kessels: The bug issue was already created #198326 with the code fix on comment #2. There was also the issue #208894 which is also very useful that I thought was suppose to be commited too.

tcblack’s picture

I created the 5--3 branch specifically to get that stylesheet fix out there since it was causing problems. I just downloaded 5.x-3.x and line 124 has the corrected code.

I do notice that the weight ordering is not included. I thought it had been committed to head but it was committed to 5--2 instead.
My reason for creating the new dev branch was specifically because the weight feature was new.

Bèr: I'm still learning CVS does this merely need to be committed to 5--3 to fix?

exuberance+lack of experience=oops.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.