Closed
Bug 170050
Opened 22 years ago
Closed 22 years ago
[RFE] Insert Table of Contents
Categories
(SeaMonkey :: Composer, enhancement, P5)
SeaMonkey
Composer
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.3alpha
People
(Reporter: imran.geriskovan, Assigned: glazou)
Details
(Whiteboard: fix i n hand, needs r=, needs sr=)
Attachments
(2 files, 2 obsolete files)
40.25 KB,
patch
|
Details | Diff | Splinter Review | |
39.25 KB,
patch
|
peterv
:
superreview+
|
Details | Diff | Splinter Review |
"Insert Table of Contents" menu item is needed in composer. Composer may construct a set of links for headings found in the document.
No dupe found ==> NEW
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Insert Table of Contents → [RFE] Insert Table of Contents
Updated•22 years ago
|
Severity: normal → enhancement
Assignee | ||
Comment 2•22 years ago
|
||
Easy :-) Install the Extensions PlaceHolder XPI for Composer first, and then TOCMaker 1.0 XPI from , both available from http://cascades.mozdev.org/installation.html Enjoy :-)
Assignee | ||
Comment 4•22 years ago
|
||
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P5
Whiteboard: fix i n hand, needs r=, needs sr=
Target Milestone: --- → mozilla1.3alpha
Comment 5•22 years ago
|
||
Glazman: I editing www.mozilla.org and had some JS errors when using the dialog.
Assignee | ||
Comment 6•22 years ago
|
||
Charley, I don't see any error on the JS console ; I am using a very recent build and the latest patch.
Attachment #104753 -
Attachment is obsolete: true
Assignee | ||
Comment 7•22 years ago
|
||
Comment on attachment 106900 [details] [diff] [review] new patch to resolve recent conflicts Charley, can you re-review please ?
Attachment #106900 -
Flags: review?(cmanske)
Comment 8•22 years ago
|
||
Comment on attachment 106900 [details] [diff] [review] new patch to resolve recent conflicts very cool feature!
Attachment #106900 -
Flags: review?(cmanske) → review+
Assignee | ||
Comment 9•22 years ago
|
||
Comment on attachment 106900 [details] [diff] [review] new patch to resolve recent conflicts Peterv: do you think you can sr it before monday ? Tree closes next week and we'd really like this to go in before the closure. Thanks!
Attachment #106900 -
Flags: superreview?(peterv)
Comment 10•22 years ago
|
||
Comment on attachment 106900 [details] [diff] [review] new patch to resolve recent conflicts I'll attach the patch with my comments in them.
Attachment #106900 -
Flags: superreview?(peterv) → superreview-
Comment 11•22 years ago
|
||
Assignee | ||
Comment 12•22 years ago
|
||
Comment on attachment 107873 [details] [diff] [review] Comments on the patch >>+ // we need an array to store all TOC entries we find in the document >>+ var tocArray = new Array(); > >Can't you do everything in one pass, instead of filling an array and >then looping over the items in the array? I want to avoid that because the TOC can be inserted in the middle of an element that has to be listed in the TOC. In that case, the insertion of the TOC splits the element in two but only one TOC entry should be generated. The TOC can also count the list items in the document (although it's an edge case) and since it inserts LI... I could tweak the filter but is it really worth the case? >>+ var nodeList = theDocument.documentElement.getElementsByTagName("a"); >>+ for (var j = nodeList.length-1; j >= 0; --j) { >>+ var anchor = nodeList.item(j); >>+ if (anchor.nodeName.toLowerCase() == "a" >>+ && anchor.hasAttribute("name") >>+ && anchor.hasAttribute("class") >>+ && anchor.getAttribute("class").substr(0, 6) == "mozToc") { >>+ anchor.parentNode.removeChild(anchor); >>+ } > >A tree walker would be nice here Why not. Btw, the test |anchor.nodeName.toLowerCase() == "a"| is redundant with the call to |getElementsByTagName()| above...
Assignee | ||
Comment 13•22 years ago
|
||
Assignee | ||
Updated•22 years ago
|
Attachment #106900 -
Attachment is obsolete: true
Comment 14•22 years ago
|
||
Comment on attachment 107896 [details] [diff] [review] In answer to peterv's review. +function BuildTOC(update) +{ + var classArray = node.getAttribute("class").split(" "); + for (var j = 0; j < classArray.length; j++) { ++j + var commentText = "mozToc "; + for (var j = 0; j < 6; j++) { ++j Index: ui/composer/content/editorOverlay.xul =================================================================== RCS file: /cvsroot/mozilla/editor/ui/composer/content/editorOverlay.xul,v retrieving revision 1.220 diff -u -r1.220 editorOverlay.xul --- ui/composer/content/editorOverlay.xul 12 Nov 2002 22:52:54 -0000 1.220 +++ ui/composer/content/editorOverlay.xul 2 Dec 2002 13:02:28 -0000 @@ -305,6 +305,9 @@ <menuitem id="menu_newBlankPage" label="&newBlankPageCmd.label;" accesskey="&newBlankPage.accesskey;" key="key_newBlankPage" command="cmd_newEditor"/> + <menuitem id="XXXXmenu_newEditorTemplate" + label="New from template" + oncommand="NewEditorFromTemplate()"/> Undo this change. With the lengths of the consts as const, sr=peterv.
Attachment #107896 -
Flags: superreview+
Assignee | ||
Comment 15•22 years ago
|
||
Checked in (trunk). Ô joy, ô happiness. Thanks to peterv for fast reviews.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•