Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#10561 closed enhancement (fixed)

[patch][cla] Split ColorPalette into ColorPalette and _PaletteMixin

Reported by: youngho Owned by: bill
Priority: high Milestone: 1.5
Component: Dijit Version: 1.4.0
Keywords: ColorPalette Cc: Jared Jurkiewicz, Adam Peller
Blocked By: Blocking:

Description (last modified by bill)

I hope to split ColorPalette into ColorPalette and dijit._PaletteMixin.

The _PaletteMixin is useful for some palette widget in editor plugins like table, smiley, insertEntity plugins etc...

Attachments (2)

colorPalette.patch (12.7 KB) - added by youngho 10 years ago.
_PaletteMixin.js (10.8 KB) - added by youngho 10 years ago.

Download all attachments as: .zip

Change History (16)

Changed 10 years ago by youngho

Attachment: colorPalette.patch added

Changed 10 years ago by youngho

Attachment: _PaletteMixin.js added

comment:1 Changed 10 years ago by bill

Description: modified (diff)
Summary: [patch][cla] Split ColorPalette into ColorPalette and _PalelleMixin[patch][cla] Split ColorPalette into ColorPalette and _PaletteMixin

Hi youngho, thanks for the patch, looks interesting. It looks like dojox.editor.plugins.EntityPalette has a lot cut-and-pasted code from ColorPalette.js.

Could you supply the patches for the editor plugins (at least insertEntity) to use _PaletteMixin? Then we could confirm the value of the mixin.

comment:2 Changed 10 years ago by youngho

Hello bill,

I attached #10563 for insertEntity plugin. I tested it with FF and IE8, Chrome, Safari(Windows). and looks like some css adjust need for entity table.

I works well but I could not tested other IE version.

comment:3 Changed 10 years ago by Adam Peller

Cc: Jared Jurkiewicz Adam Peller added

comment:4 Changed 10 years ago by bill

Milestone: tbd1.5
Owner: set to bill
Status: newassigned

Great, I'll check it in.

comment:5 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [21098]) Split palette code out of ColorPalette, into _PaletteMixin, so that it can be used by the SmileyPalette and EntityPalette code too.

Patch from Youngho Cho (thanks!), CLA on file, plus changes from me.

The big changes are:

  • Use <table> rather than absolutely positioned <div> and <span> nodes so that the entities palette will layout correctly regardless of the browser font size. Sizing of <table> cells to line up with underlying ColorPalette image achieved via CSS rather than hardcoded value in JS (_paletteDims).
  • Each palette (DOMNode) cell has an associated JS object implementing the dijit.Dye interface

Fixes #10561 !strict.

comment:6 Changed 10 years ago by bill

(In [21099]) Test that ColorPalette? <table> still lines up w/underlying palette image in quirks mode, refs #10561.

comment:7 Changed 10 years ago by bill

(In [21105]) Update test as per previous change to ColorPalette, since dijitPaletteHover no longer applied on focus. Refs #10561.

comment:8 Changed 10 years ago by bill

(In [21127]) Add CSS for palette to counteract possible user style settings on <table>, <td>, etc., as seen in I18N demo.

Refs #10561, patch from youngho again, thanks!

comment:9 Changed 10 years ago by bill

(In [21503]) Fix left/right arrow key in RTL mode, refs #10561.

comment:10 Changed 9 years ago by bill

(In [21745]) Fix a11y issues in high contrast mode:

  • color swatches not visible
  • focus border not visible on FF

Refs #10561.

comment:11 Changed 9 years ago by bill

(In [21746]) Removed the background color embedded into the ColorPalette image swatch file (not the swatches themselves, but the white area behind the swatches.

It's good for two reasons:

  • better contrast in high-contrast mode, particularly with seeing the focus border. Since high contrast mode only has two colors, if we "hardcode" the background to white and the focus border is also [near] white it's no good. Also improved seeing the non-focus border around each color.
  • ability (in normal, non-high-contrast mode) for themes to pick any background color for the ColorPalette. The default is still white.

Refs #10561.

comment:12 Changed 9 years ago by bill

(In [21758]) Focus on click. Refs #10561 !strict.

comment:13 Changed 9 years ago by bill

(In [21760]) When refocusing a ColorPalette, go to last focused cell, same as tree, rather than upper left hand corner. Refs #10561 !strict.

comment:14 Changed 9 years ago by bill

(In [21785]) Use 8-bit PNG's not 24-bit, to save space and to work correctly on IE6. Refs #10561.

Note: See TracTickets for help on using tickets.