Closed Bug 163898 Opened 23 years ago Closed 23 years ago

Feature request for Insert text Command for Editor Embedding

Categories

(Core :: DOM: Editor, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.2final

People

(Reporter: depman1, Assigned: cmanske)

References

Details

(Keywords: topembed+, Whiteboard: [FIX IN HAND] need a=)

Attachments

(1 file)

Add an InsertText() method in nsICommandManager or nsICommandParams interface. Or add insertText command option in nsICommandManager->DoCommand(). This would allow text to be easily inserted in editor context for text operations.
changed qa contact to depstein
Assignee: kin → mjudge
QA Contact: sujay → depstein
OS: Windows NT → All
Hardware: PC → All
Blocks: edembed
*** Bug 171762 has been marked as a duplicate of this bug. ***
I need this implemented asap to use with some editorshell removal work, so I'll take this bug.
Assignee: mjudge → cmanske
Keywords: nsbeta1
Target Milestone: --- → mozilla1.2final
It seemed logical to also implement insertHTML while I was at it. This uses "doCommandParams": set the text to insert in the "TEXT" param value for "cmd_insertPlaintext" and set the HTML source in the "HTML" param value for "cmd_insertHTML"
Status: NEW → ASSIGNED
Keywords: patch, review
Whiteboard: [FIX IN HAND] need r=,sr=
Keywords: topembed+
Comment on attachment 103534 [details] [diff] [review] InsertPlaintext and InsertHTML commands v1 marking it reviewed. I think you should change the "TEXT" and "HTML" to "state_data" for each. keeps in the same design as most of the other attribute calls. "state_attribute" We will most likely be having more of these insert type commands in the future so maybe a generice "state_data" would be better.
Attachment #103534 - Flags: review+
Ok, I can see having generic param identifiers. I'll use "state_data" and "state_attribute"
Whiteboard: [FIX IN HAND] need r=,sr= → [FIX IN HAND] need sr=
+NS_IMETHODIMP +nsInsertPlaintextCommand::DoCommand(const char *aCommandName, nsISupports *refCon) +{ + return NS_OK; +} and +NS_IMETHODIMP +nsInsertHTMLCommand::DoCommand(const char *aCommandName, nsISupports *refCon) +{ + return NS_OK; +} Return NS_ERROR_NOT_IMPLEMENTED from the old-style DoCommands. When these commands are documented, we need to say if they replace the current selection. Is there a bug for commmands to get the contents/selection as text/html?
Comment on attachment 103534 [details] [diff] [review] InsertPlaintext and InsertHTML commands v1 sr=sfraser with mike's and my changes
Attachment #103534 - Flags: superreview+
Ok, NS_ERROR_NOT_IMPLEMENTED used as requested. No, I don't know of any other RFEs for new commands. Good idea!
Whiteboard: [FIX IN HAND] need sr= → [FIX IN HAND] need a=
checked into 1.3a trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: depstein → dsirnapalli
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: