Project:quicktags
Version:master
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

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

#2

Status:active» needs review

Here is a patch, please review.

AttachmentSize
quicktags.patch.txt 2.06 KB

#3

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

#4

Status:needs review» needs work

#5

Status:needs work» reviewed & tested by the community

Updated patch attached.

AttachmentSize
quicktags.patch_0.txt 2.06 KB

#6

Ping Bèr.

#7

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.

#8

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.

AttachmentSize
quicktagsplus.module.iconweight.patch 3.07 KB

#9

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.

#10

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.

#11

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.

#13

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.

#14

Status:reviewed & tested by the community» fixed

#15

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.

#16

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

#17

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

#18

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.

#19

Status:fixed» closed (fixed)

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