Ticket #1283 (new defect)

Opened 2 months ago

Last modified 1 month ago

New-dialogs version of TableOperations is incomplete

Reported by: nicholasbs Owned by:
Priority: normal Milestone: 0.96
Component: Plugins Version: trunk
Severity: normal Keywords:
Cc:

Description

I realized today that the version of the TableOperations plugin for new-dialogs is incomplete. Most notably, the settings from its various dialogs (e.g., Table Properties) do not get applied to the table.

I've looked into the code a bit and discovered at least one of the issues: the dialog is constructed dynamically in part using the InlineStyler? module. This means that when Xinha.Dialog.translateHtml creates its reverse ID index of all elements in the document, it does not actually get all of the form elements. This in turn means that dialog.hide() does not return values for some of the input elements, making it impossible for TableOperations to properly update the attributes.

Off the top of my head, I can think of a couple of ways to fix this:

1. Hard-code the dialog HTML instead of dynamically generating it

2. Add a method that updates Xinha.Dialog's reverse ID lookup index

I'm initially in favor of doing (2) but not strongly so, and I admit I haven't spent a lot of time thinking about this/looking at the code.

Thoughts? Ray, I believe you did the initial work on this plugin a while ago, how were you planning on tackling this?

Change History

Changed 2 months ago by ray

Oh shit I didn't realize this. seems like I commited this stuff before it was even ready. sorry. No opinion either, at the moment

Changed 1 month ago by nicholasbs

Changeset r1075 is a first pass at finishing up TableOperations, but there are still some remaining issues. Most of these have to do with setting cell/row border attributes.

In particular, setting cell or row borders simply doesn't work in most cases. In FF, changes are only shown after clicking view source and then going back to WYSIWYG mode. In Safari, they never show up. The FF issue seems to stem from a redraw bug (Ray, from the comments in the code it looks like you may have been fighting with this before?). I'm not sure about the Safari bug, but it might be an issue of CSS styling on the individual TD elements overriding it, though I haven't spent a lot of time troubleshooting this.

Note that setting the border properties on the table as a whole works, and setting other properties, e.g., background color or text align, on a row or cell basis does work.

Also, I went with option (2) in that I added a function to Xinha.Dialog that takes an ID, adds it to the reverse lookup table, and then returns the ID which it maps to. This function should be used any time you dynamically add an element that needs an id/name to a dialog (particularly if you want its values to show up in the param object returned by Dialog.hide()).

Note: See TracTickets for help on using tickets.