Open Bug 16255 Opened 25 years ago Updated 12 years ago

allow class assignment to elements : CSS in Composer step 4


(SeaMonkey :: Composer, enhancement)

Not set


(Not tracked)


(Reporter: webmas7, Unassigned)


(Depends on 1 open bug, )


(Keywords: helpwanted, Whiteboard: composer++)


(1 file, 3 obsolete files)

The editor needs to be able to let a person select a "box" or some content and
apply a class to it, by right clicking on it and selecting from the menu.

Also, if you could somehow make it easy to add in <div> and <span> exactly
where you want them, that would be cool too.

Thanks. Keep up the good work!

Yeah, and ID support too of course.

Whether boxes should be split into spans implicitly or explicitly is an
important question.  If implicitly, you could apply a class to a selection.  If
not, you'd need some concept of box selection, which the editor doesn't
currently have (I think).  Perhaps it should just take the smallest box that
surrounds the selection.
This isn't in our feature list for the first release, but it's a great
suggestion.  Ben Goodger <> is working on some style editing
UI.  I don't know how far he's gotten yet.  Adding Ben to the cc list, and
Closed: 25 years ago
Resolution: --- → REMIND
It might be worthwhile pointing out that spans and divs are hard to support
fully in this sort of editor, since they are invisible.  Easy editing mode might
however use some sort of marker for start and end of divs and spans (generated

A page DOM editor (bug #14527) and page source editor (bug #14526) would handle
these more easily, and they could be added as mode tabs to the existing tabbed
layout at the bottom.
We aren't going to have source and node editing done for 5.0 unless someone
outside NS does it. Given that, the best solution I can think of is to make
<span> and <div> tags visible with an image icon, just as we do for named
anchors. Thus the user can click on the image and edit it's properties via
Ben's "Advance Edit" dialog. To make this complete, it would be simple to add
an "Insert Span/Div" item to the insert menu. It would behave just like the
Insert Link action when there is a selection, which is to insert the span or
div tag as a parent (or "around") of the selection. When that insert item
is triggered, we would simply bring up the existing Advanced Edit dialog
so user could add any HTML, CSS, and JS attributes to the <span> or <div> tag.
Sounds good.
*** Bug 15000 has been marked as a duplicate of this bug. ***
Whiteboard: [HELP WANTED]
Perfect candiate task for somebody who wants to contribute.  Marking HELP
Help wanted bugs should be reopened and assigned to, else
some queries might miss them.
actually, this needs to be reopened and left in the future bucket
Resolution: REMIND → ---
Summary: [feature] editor should provide UI for assigning CSS class to a node → [CSS] editor should provide UI for assigning CSS class to a node
Target Milestone: M20 → Future
Keywords: helpwanted
Whiteboard: [HELP WANTED]
Assignee: cmanske → glazman
This is a RFE for the 4th step in the CSSization of Composer [1].
Its purpose is the addition of a UI mechanism allowing user to view/assign/remove
class to the selected element(s). I think it is quite easy to do.

I also think that it makes more sense to add 4th step before the 3rd (manipulation
of embedded stylesheets) from a user's point of view.


Accepting Bug :-) (does not mean I'm going to work on it right now tho)
Component: Editor: Core → Editor: Composer
Summary: [CSS] editor should provide UI for assigning CSS class to a node → [RFE] allow class assignment to elements : CSS in Composer step 4
*** Bug 104772 has been marked as a duplicate of this bug. ***
*** Bug 119108 has been marked as a duplicate of this bug. ***
Comment on attachment 56707 [details] [diff] [review]
work-in-progress code #1

r=cmanske on all editor code
Attached patch work-in-progress code #2 (obsolete) — Splinter Review
Final patch should be available for review tomorrow.
Still cleanup to do on the one I am attaching here.
Attachment #56707 - Attachment is obsolete: true
Attached patch patch v1.0 (obsolete) — Splinter Review
patch ready for reviews...
Attachment #69252 - Attachment is obsolete: true
there should be a try/catch or if so no error is thrown here if menuItem isn't
+              menuItem = document.createElement("menuitem");
+              menuItem.setAttribute("type",  "checkbox");

Charley should review the menu enable/disable stuff; I think there is a function
to use.
Comment on attachment 69645 [details] [diff] [review]
patch v1.0

Kathy is right, you should use	SetElementEnabled(element, doEnable) when you
have the element. That and other useful helpers are in editorUtilities.js
The rest of the UI stuff looks good, though I wish you'd not put "{" at end of
a line. We prefer 
if (foo)
removing myself from the cc list
Summary: [RFE] allow class assignment to elements : CSS in Composer step 4 → allow class assignment to elements : CSS in Composer step 4
Comment on attachment 69645 [details] [diff] [review]
patch v1.0

back in my top priority list. working on it.
Attachment #69645 - Attachment is obsolete: true
Product: Browser → Seamonkey
Are you still working on this ?
Priority: P1 → --
QA Contact: sujay → composer
Target Milestone: Future → ---
Assignee: daniel → nobody
You need to log in before you can comment on or make changes to this bug.