[Project_owners] Manually adding things to the undo pile

Eelco van Kuik tomcat-user at planet.nl
Tue Oct 14 12:11:12 EDT 2003


Maybe this isn't important for the purpose you are using Mozilla,
but Ctrl+B is already assigned to opening the Bookmark Manager in
the (English) Mozilla browser.

I don't know what you are using this for, but if you are working 
with HTML formatted text on websites or in Mozilla, 
maybe this link will be useful for you as well: 

http://www.interactivetools.com/products/htmlarea/

Regards,

:Eelco
NeedleSearch

> -----Original Message-----
> From: project_owners-bounces at mozdev.org 
> [mailto:project_owners-bounces at mozdev.org] On Behalf Of David Murray
> Sent: dinsdag 14 oktober 2003 10:58
> To: Mozdev Project Owners List
> Subject: [Project_owners] Manually adding things to the undo pile
> 
> 
> I've got a textbox, all nice and happy, as textboxes usually are. 
> Undo/Redo works fine on it. However, I've got it so that if you press 
> Ctrl+B, it calls a function that adds <b></b> tags around 
> whatever text 
> is selected. It works all fine, except as soon as the 
> function runs, it 
> clears out all the undo memory. It seems that settling textbox.value 
> wipes resets the undo pile.
> 
> I can't find any ways to preserve the undo history if you change the 
> value in a textbox via Javascript. I was looking at 
> http://www.xulplanet.com/references/xpcomref/group_Clipboardan
dSelection.html#Transactions 
to see if the Transaction Manager thing would work, but I can't even get

it to start.

tManager = 
Components.classes["@mozilla.org/transactionmanager;1"].createInstance(Q
ueryInterface(Components.interfaces.nsITransaction));

Doing that just generates a NS_NOINTERFACE error (on Mozilla 1.4.1 
anyway). I'm well and truly out of ideas. I thought this'd be a common 
problem for XUL stuff but I can't find anything on the Internet about 
preserving the undo pile while changing textbox values through 
Javascript. Has anyone managed to successfully do this?

David.
http://deepestsender.mozdev.org


_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners



More information about the Project_owners mailing list