Closed Bug 45495 Opened 24 years ago Closed 21 years ago

gui for editing form elements

Categories

(SeaMonkey :: Composer, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.5alpha

People

(Reporter: Brade, Assigned: cmanske)

References

(Depends on 1 open bug)

Details

(Keywords: polish)

Attachments

(2 files, 40 obsolete files)

46.16 KB, patch
Details | Diff | Splinter Review
46.57 KB, patch
glazou
: review+
Details | Diff | Splinter Review
We need dialogs and related JS for editing form elements in a more gui dialog.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
adding help wanted keyword
Keywords: helpwanted
(and of course we need menuitems or other ui to insert these as well)
*** Bug 88017 has been marked as a duplicate of this bug. ***
*** Bug 90543 has been marked as a duplicate of this bug. ***
After adding a select, I noticed that the Editor had a hard time with the
<option>   tags.  I searched for this in bugzilla... Sorry for the dupe...
How would go go about inserting a <form> anyway? "Convert selection to form"?
Have I forgotton any form elements:
form, input, textarea, select, option, optgroup, label, fieldset.
I did it while editing in the HTML view
spam composer change
Component: Editor: Core → Editor: Composer
Attached patch patch the 3 files in (obsolete) — Splinter Review
Attached file new input and textarea dialogs (obsolete) —
Attached patch updated patches (obsolete) — Splinter Review
Target Milestone: Future → mozilla1.0
Attachment #49328 - Attachment is obsolete: true
Attachment #49329 - Attachment is obsolete: true
Attachment #49330 - Attachment is obsolete: true
Attached file revisions as per brade's comments (obsolete) —
Attached file image input bugfix (obsolete) —
Attached patch image input bugfix patch (obsolete) — Splinter Review
Attachment #49332 - Attachment is obsolete: true
Attachment #49579 - Attachment is obsolete: true
Attachment #49580 - Attachment is obsolete: true
Attachment #49736 - Attachment is obsolete: true
Attachment #49737 - Attachment is obsolete: true
All of this looks ok to me. Neil will be updating full patches with minor 
changes and I'll do final review then
Issues I see: 
1. I'm not sure if we really need 3 separate error
messages:
+InputNameError=You must enter a name for this type of form field.
+InputValueError=You must enter a name and value for this type of form field.
+TextAreaNameError=You must enter a name for this text area.
Maybe we can use just one message such as 
"You need a name or value for this form control."
to use for all 3 cases?
2. I'm not sure if we must do the "insert form" work as well before this is 
all checked in.
Attached file fix 5 minor issues (obsolete) —
Attachment #50079 - Attachment is obsolete: true
Here is what I'd like changed before we checkin:

** Change the strings from:
   You must enter a name for this type of form field.
to something like:
   Please enter a name for this form field.
** I think I'd like to see form fields completely collapsed/hidden rather than 
just disabled.  Charley--what do you think?
** Make "Field Value" the Image src for input type=image
   Eventually we should bring in src, alt, choose, and possibly relativize from a 
shared overlay; I would be ok on holding off on this step for now
** Remove the Image Properties... button
** Adjust More/Fewer items
   I'm leaning toward moving disabled, selected, size, length into the bottom 
portion.  Something like this:
  TYPE        TOP OPTIONS                  BOTTOM OPTIONS
  Text        Field Name (reqd)            Initial value   Disabled    ReadOnly
                                           Field Size      MaxLength   TabIndex
  Password    <same as text>

  Checkbox    Field Name (reqd)  Checked   Value           Disabled    TabIndex
  Radio       Group Name (reqd)  Checked   Value           Disabled    TabIndex

  Submit      Field Name (reqd)  Value     Disabled        TabIndex    AccessKey
  Reset       <same as submit>
  Button      <same as submit>

  File        Field Name (reqd)            Accept Types    Disabled    TabIndex
  Hidden      Field Name (reqd)            Initial Value   Disabled
  Image       Field Name (reqd)  src                       Disabled    TabIndex
              alt (include choose btn)

I hope the above is clear.
I think it'll make it smaller in the "fewer" case and be easier for novice users.

** For Textarea dialog, Rows and Columns are required
** For Textarea dialog, Wrap is not supported so it should be removed
** For Textarea dialog, I'd prefer to use more/fewer for some of these things 
rather than introducing a separate tab for default text:
     Top:  Field Name, Rows, Columns
     Bottom:  Disabled, ReadOnly, TabIndex, AccessKey, Default Text
** For Textarea dialog, try to be consistent with ordering in "more section" (for 
example, disabled comes above accesskey)

I hope the above doesn't seem too overwhelming.  I'm hoping the top portion can 
be "required" and commonly used while the "more" or bottom sections can be tucked 
away but still accessible if desired.  I'd even be ok with not offering those and 
just letting users access those things via Advanced Edit dialog.

Thanks for your work on these items!
> Have I forgotton any form elements:
> form, input, textarea, select, option, optgroup, label, fieldset.

<button> and <legend>
Wouldn't collapsing the input fields change the size of the window annoyingly?

I can add disabled, size and length to the "more" input fields.

I didn't realise that rows and columns were required for textareas.

How big do you want the default text field to be? Currently its size is automatic.
Attached file EdSelectProps.xul preview (obsolete) —
Attached file Most of brade's requests (obsolete) —
Attached patch Patches for above (obsolete) — Splinter Review
Attachment #50080 - Attachment is obsolete: true
Attachment #51224 - Attachment is obsolete: true
Attached file Includes <select> (obsolete) —
Attached patch patches for above (obsolete) — Splinter Review
Attachment #52910 - Attachment is obsolete: true
Attached file Includes <select> (obsolete) —
Attachment #53092 - Attachment is obsolete: true
Attached file Includes <select> (obsolete) —
Attached patch patches for above (obsolete) — Splinter Review
Attachment #51507 - Attachment is obsolete: true
Attachment #51849 - Attachment is obsolete: true
Attachment #51850 - Attachment is obsolete: true
Attachment #52912 - Attachment is obsolete: true
Attachment #53243 - Attachment is obsolete: true
Attachment #54656 - Attachment is obsolete: true
Forms and labels are currently invisible except in show all tags mode.
My preference would be for a 1px dotted green border, or blue for labels.
Attached file Special UI for image input (obsolete) —
Attached patch patches for above (obsolete) — Splinter Review
Depends on: 109317
Attached file Complete new UI (obsolete) —
Attachment #54661 - Attachment is obsolete: true
Attachment #55923 - Attachment is obsolete: true
Attached patch patches for above (obsolete) — Splinter Review
Attachment #54657 - Attachment is obsolete: true
Attachment #55926 - Attachment is obsolete: true
Neil: Your patch on 11/20 doesn't contain necessary changes to EdImageProps.xul.
Attached patch patches for above (obsolete) — Splinter Review
Sorry, I don't know how I remembered to diff the js and not the xul :-(
Attachment #58519 - Attachment is obsolete: true
Attachment #58363 - Attachment is obsolete: true
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Attached file Brade's tabbed form image dialog (obsolete) —
Attached patch patches for 60626 (obsolete) — Splinter Review
Attached file CManske's tabbed image dialogs (obsolete) —
Attachment #60626 - Attachment is obsolete: true
Attached patch patches for 60800 (obsolete) — Splinter Review
Attachment #60627 - Attachment is obsolete: true
Attached file Tabbed image dialogs, take 2 (obsolete) —
Attachment #60800 - Attachment is obsolete: true
Attached patch patches for 61718 (obsolete) — Splinter Review
Attachment #60801 - Attachment is obsolete: true
Blocks: 116250
Comment on attachment 61718 [details]
Tabbed image dialogs, take 2

r=cmanske
Attachment #61718 - Flags: review+
Comment on attachment 61720 [details] [diff] [review]
patches for 61718

r=cmanske
Attachment #61720 - Flags: review+
We should get this checked in soon for testing. I will put the "Form" submenu
in the Debug Menu instead of "Insert" to emphasize that it is still a "work in
progress".
Known Issues:
1. Bug 82547: Clicking on form widgets steals the mouse events so we can't 
double-click to bring up Properties dialog.
2. Caret disappears after inserting an input element, type="text"
3. We need to show an icon in page for start and end of form and/or use some other 
CSS to show the are of the page inside the form.
To move this along, I think we should first checkin the changes to the Image 
dialog (redo layout and use a new overlay file to share with form dialog),
since we will keep those changes even if we are forced to postpone the insert
form UI.

Assignee: brade → cmanske
Status: ASSIGNED → NEW
Depends on: 82547
No longer depends on: 109317
Keywords: helpwanted
Whiteboard: FIX IN HAND, need sr=
After discussing this further, we decided it's time to check this all in, but
put the "Form" submenu in the Debug menu untill all issues are resolved.
Status: NEW → ASSIGNED
> 3. We need to show an icon in page for start and end of form and/or
> use some other CSS to show the are of the page inside the form.

Most other HTML editors display some sort of border like that for empty cells.
12/14 patches checked in. Keeping bug open for further development.
Whiteboard: FIX IN HAND, need sr=
Attachment #61718 - Attachment is obsolete: true
Attachment #61720 - Attachment is obsolete: true
Attached patch patch to editor.properties (obsolete) — Splinter Review
Some of the wrong strings went in.
I missed EdDialogOverlay from my patch so there were two boxes fighting for the
flex, which was wrong, but you weren't to know that the flex was supposed to be
on the image preview box and not the advanced edit box.
Comment on attachment 65631 [details] [diff] [review]
patch to editor.properties

FormInputError
is used by EdInputProps.js, no?
Comment on attachment 65632 [details] [diff] [review]
put flex back on image preview box

I don't like it that way!
When there's no image, the groupbox flexed to the right looks unbalanced. I did
that on purpose to let it expand only when the Actual Width and Height
data are displayed.
What this fixes:
1. Includes changes to editor.properties from Neil in patch 65631
2. Changes to EdAEHTMLAttributes.js and EdHLineProps.js are replacements of 
".attributes.getNamedItem()" with new, more efficient "hasAttribute()"
3. Elimination of unnecessary groupboxes in Image properties panels for
"Location" and "Dimension". (Large amount of change is because of indentation 
changes.)
4. In EdInputProps.xul, the one grid encompassing the "MoreSection" was split
into 2 grids to solve problem of cut-off text labels in the "more" section.
Dialog now expands horizontally when "More/Fewer" is toggled, but I think that
is preferable to chopped off text.
The changes to EdImageProps.xul and EditorImageProperties.dtd include fix for
bug 114531, which adds radio buttons for the Alternate Text feature. It was 
impossible to separate without rendering the patch unapplyable.
Attachment #65631 - Attachment is obsolete: true
Comment on attachment 65656 [details] [diff] [review]
Fix for various dialog layout issues

I found an alternative to rewriting the grids: in EdDialogCommon.js instead of
using sizeToContent() use setTimeout(sizeToContent, 0)
I've noticed that I'm calling document.createTextNode in a couple of places,
should that be editorShell.editorDocument.createTextNode instead?

Also, when inserting said text node the selection moves, should I put it back on
the original element?
Just to be safe, I'd say you should always use 
editorShell.editorDocument.createTextNode.
I'm not sure if it really makes a difference in this case, but it is the 
document that you are going to insert into, so it's the right thing to do.
Neil: I tested using "setTimeout(window.sizeToContent, 0)" and it didn't seem
to help the cropped labels in the "more" section of the Input Field dialog
(EdInputProps.xul,.js).

Attached patch Fix text area inital value (obsolete) — Splinter Review
This also includes the most reliable more/fewer changes for text areas, and
some extra changes to get the CSS white-space property for text area wrap.
Comment on attachment 65631 [details] [diff] [review]
patch to editor.properties

r=cmanske
Attachment #65631 - Attachment is obsolete: false
Attachment #65631 - Flags: review+
Comment on attachment 65632 [details] [diff] [review]
put flex back on image preview box

I don't think we should do this one :)
Attachment #65632 - Attachment is obsolete: true
Comment on attachment 66101 [details] [diff] [review]
Fix text area inital value

r=cmanske
Attachment #66101 - Flags: review+
Comment on attachment 65656 [details] [diff] [review]
Fix for various dialog layout issues

r=neil@parkwaycc.co.uk
Attachment #65656 - Flags: review+
Note that layout doesn't actually appear to support align or caption-side :-)
Comment on attachment 66283 [details] [diff] [review]
Fix to use CSS caption-side in field sets

r=cmanske
Attachment #66283 - Flags: review+
Comment on attachment 65631 [details] [diff] [review]
patch to editor.properties

sr=hewitt
Attachment #65631 - Flags: superreview+
Comment on attachment 65656 [details] [diff] [review]
Fix for various dialog layout issues

sr=hewitt
Attachment #65656 - Flags: superreview+
Comment on attachment 66101 [details] [diff] [review]
Fix text area inital value

sr=hewitt
Attachment #66101 - Flags: superreview+
Comment on attachment 66283 [details] [diff] [review]
Fix to use CSS caption-side in field sets

sr=hewitt
Attachment #66283 - Flags: superreview+
Comment on attachment 65631 [details] [diff] [review]
patch to editor.properties

checked in
Attachment #65631 - Attachment is obsolete: true
Comment on attachment 65656 [details] [diff] [review]
Fix for various dialog layout issues

checked in
Attachment #65656 - Attachment is obsolete: true
Attachment #66101 - Attachment is obsolete: true
Comment on attachment 66283 [details] [diff] [review]
Fix to use CSS caption-side in field sets

checked in
Attachment #66283 - Attachment is obsolete: true
I'd suggest another color for "label" color, since we use a solid blue line
to select images and other elements.

Uggh! Frustrating problems:
1. If you insert a form, you can't place the caret before or after it, so if it's
the first thing you do, you have forced the entire page to be a form!
3. After inserting a label, a single click in the label seems to select all the
label text, so you can't place caret in there to re-edit the text.
Regarding comment 80, that is a problem for tables as well.
Kin: It's worse than the caret placement for tables problem -- that is fixed
by special code that does let you click before/after and type.
OK, so would anyone like to volunteer a label colour?
Attached patch Revised as per IRC discussion (obsolete) — Splinter Review
Attachment #71317 - Attachment is obsolete: true
changing milestone
Target Milestone: mozilla1.0.1 → mozilla1.2beta
*** Bug 145352 has been marked as a duplicate of this bug. ***
Form problem bugs 82547 and 162557 still hinder editing form elements in
Composer, but we are trying to get traction on those problems during 1.2.
Depends on: 162557
Keywords: nsbeta1
nsbeta1-, not a polish bug
Keywords: nsbeta1nsbeta1-
Keywords: polish
Attached patch Remaining issuesSplinter Review
* Styles for <form> and <label>
* Access keys
* Improved code for adding/removing containers
* More try/catch
* Fix for error in <select> dialog
* Fix for text extraction in <label> and <legend>
* Fix for typos in <fieldset> dialog
Attachment #102565 - Flags: superreview?(alecf)
Attachment #102565 - Flags: review?(cmanske)
Comment on attachment 102565 [details] [diff] [review]
Remaining issues

MrJones1_2b points out (confirmed by brade) that the selection list properties
dialog doesn't work at all without this patch.
Attachment #59497 - Attachment is obsolete: true
Attachment #59854 - Attachment is obsolete: true
Attachment #71688 - Attachment is obsolete: true
Attachment #102565 - Attachment is obsolete: true
Attachment #109104 - Flags: superreview?(alecf)
Attachment #109104 - Flags: review?(cmanske)
Attachment #102565 - Attachment is obsolete: false
Attachment #102565 - Flags: superreview?(alecf)
Attachment #102565 - Flags: review?(cmanske)
Comment on attachment 109104 [details] [diff] [review]
Fix blank text node issue and JS warnings

this seems fine, and sr=alecf as long as the reviewer is charlie or another
editor person.
Attachment #109104 - Flags: superreview?(alecf) → superreview+
Does this patch cover what the author of 
<http://www.thesitewizard.com/reviews/mozillacomposer.shtml> considers one of 
the biggest problems of Composer ? See the last section of the 
review: "Verdict".
Raising on radar. Forms should be in Composer, not in debug menu, for Mozilla 1.5.
Severity: normal → enhancement
Priority: P3 → P2
Target Milestone: mozilla1.2beta → mozilla1.5alpha
Blocks: 205083
Comment on attachment 109104 [details] [diff] [review]
Fix blank text node issue and JS warnings

r=glazman
Check that in!
Attachment #109104 - Flags: review?(cmanske) → review+
Checked in the latest patch; waiting for the inevitable fallout :-)
QA Contact: sujay → petersen
No fallout for once, I'm surprised, is my coding improving at last? ;-)
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: