htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Working undo/redo


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


ilya
Novice

Jul 31, 2004, 2:03 PM

Post #1 of 19 (12550 views)
Shortcut
Working undo/redo Can't Post

I've fixed htmlarea.js to make undo/redo work. It works okay on my IE. Mozilla was not tested.
I do not understand all the code and my testing was not comprehensive so there could be some errors under IE also.
Here is the latest CVS version of htmlarea.js (v1.87) fixed up.

Here is also a diff with v1.87.

Besides undo/redo there is also 3 bugs fixed:
1. HTMLArea.replace returns newly created editor object.
2. Switching to HTML edit mode and back don't add extra "Path:" text to status bar.
3. Word cleaning routine is now invoked after paste operation and is not invoked before cut or copy (as it was before).1.


(This post was edited by ilya on Aug 1, 2004, 8:49 AM)
Attachments: htmlarea.js (75.5 KB)
  htmlarea.js.patch (4.56 KB)


fnimion
New User

Aug 10, 2004, 3:53 AM

Post #2 of 19 (12433 views)
Shortcut
Re: [ilya] Working undo/redo [In reply to] Can't Post

Hi Ilya,

First, thanks for trying to solve this Undo/redo problem.

But when I overwrite with your htmlarea.js and add the patch file I get a

....
WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files but we'll probably fail.
....

when I try to login to edit the page. Do you know what is wrong.

I run an IE6.0

Best,

F

Crazy


ilya
Novice

Aug 10, 2004, 4:16 AM

Post #3 of 19 (12432 views)
Shortcut
Re: [fnimion] Working undo/redo [In reply to] Can't Post

You should not overwrite AND add patch. Patch is for those who have modified htmlarea.js, so they cannot just overwrite it. Or for those who wish to see differences i made without making comparison by themselfs.

Warning you get means you did not se _editor_url and it have no connection to changes i made. You should define _editor_url before including htmlarea.js as it is said in reference. Probably you should read "Installation" section of reference.html that comes with HTMLArea.


lofty
Novice

Aug 31, 2004, 4:54 PM

Post #4 of 19 (12154 views)
Shortcut
Re: [ilya] Working undo/redo [In reply to] Can't Post

This worked beautifully on IE6 winxp sp2. Thank you soooo much!


Viperal
Novice

Aug 31, 2004, 7:01 PM

Post #5 of 19 (12148 views)
Shortcut
Re: [lofty] Working undo/redo [In reply to] Can't Post

To make this compatible with firefox you have to remove

var editor = this;

With is the very first step
After that it work fine with both IE and Firefox.

Nicely done. Cool


lestel
New User

Sep 6, 2004, 7:42 AM

Post #6 of 19 (12061 views)
Shortcut
Re: [Viperal] Working undo/redo [In reply to] Can't Post

hi,
can you please explain me how does it work because i haven't understand.

i must replace htmlarea.js and that's all?????
it doesn't work...

i need your help, please.

Thanks


ilya
Novice

Oct 8, 2004, 3:35 AM

Post #7 of 19 (11709 views)
Shortcut
Re: [lestel] Working undo/redo [In reply to] Can't Post

Hello
You should reply to my posts, so i'll get mail notification you need help.
As far as i know all you should do is replace htmlarea.js and that's all. Why it's not working i dont know by maybe i could help you if you would explain in more detail what "it doesn't work..." means.


demuire
Novice

Oct 13, 2004, 8:53 PM

Post #8 of 19 (11636 views)
Shortcut
Re: [ilya] Working undo/redo [In reply to] Can't Post

Hmm, I tried to just replace my htmlarea.js too, and it didn't work.

I'm getting an error that HTMLArea.I18N has no properties?


kimastergeorge
Novice

Oct 18, 2004, 7:51 PM

Post #9 of 19 (11546 views)
Shortcut
Re: [demuire] Working undo/redo [In reply to] Can't Post

How do you apply a patch?


mharrisonline
Novice

Nov 2, 2004, 11:25 PM

Post #10 of 19 (11333 views)
Shortcut
Re: [kimastergeorge] Working undo/redo [In reply to] Can't Post

Here is the above patch and fix for Mozilla, working, applied to the current release download. This is great, the undo problem has been a bug in HTMLarea for a long time, they should release new files with undo actually working.
Attachments: HTMLArea-3.0-rc1-undofixed.zip (200 KB)


kimastergeorge
Novice

Nov 3, 2004, 7:21 PM

Post #11 of 19 (11281 views)
Shortcut
Re: [mharrisonline] Working undo/redo [In reply to] Can't Post

Well, for me, the "fix" really doesn't work, I don't know about you. I can only undo one action (after that one undo, it doesn't have any impact), and redoing is impossible.


mharrisonline
Novice

Nov 3, 2004, 9:48 PM

Post #12 of 19 (11278 views)
Shortcut
Re: [kimastergeorge] Working undo/redo [In reply to] Can't Post

I wonder why it didn't work for you. Maybe it's a browser or OS related issue, I'm running XP Home SP2.

Undo and redo both seem to perfectly for me when I test it in IE6 and Netscape 7.1, although in IE sometimes if I click undo too fast it ignores some of the clicks. At first when that happened I thought it wasn't working at all, but when I stopped clicking like crazy it worked fine. I didn't notice that issue in Netscape.

On both browsers I deleted two lines of text, typed something new, and colored the background of some text further down the page. I tried this three times for each browser, and each time I was able to undo back to the original example text, and redo back to my final edit. I then tried this in several different examples, and it always seemed to work fine.


kimastergeorge
Novice

Nov 3, 2004, 9:58 PM

Post #13 of 19 (11274 views)
Shortcut
Re: [mharrisonline] Working undo/redo [In reply to] Can't Post

I guess it's probably my setup of HTMLArea. I have at least 12 plugins applied to it. I tried with both Firefox and IE (6.0 w/ XP Pro SP2) and it didn't work. I'm going to try with the "core" example; maybe that'll work.

EDIT: Oh yes you're right, I must have a plugin that is incompatible. I'll have to figure out which one that is.


(This post was edited by kimastergeorge on Nov 3, 2004, 10:06 PM)


mharrisonline
Novice

Nov 3, 2004, 10:35 PM

Post #14 of 19 (11270 views)
Shortcut
Re: [kimastergeorge] Working undo/redo [In reply to] Can't Post

I just went through every example in what I uploaded, you're right. It works every time with the core editor, but the more plugins there are the greater the chance that it doesn't work everytime. It works exactly as you described when I try it with the fully loaded example. Of course, before, it didn't work at all for me in IE, so I guess one undo is better than nothing.


(This post was edited by mharrisonline on Nov 3, 2004, 10:35 PM)


kimastergeorge
Novice

Nov 3, 2004, 10:41 PM

Post #15 of 19 (11265 views)
Shortcut
Re: [mharrisonline] Working undo/redo [In reply to] Can't Post

With a little bit of trial and error, I found that the plugin that made a difference was FullPage. It interferes with a lot of plugins for some reason (but it is standard). Could someone with an in-depth knowledge of the FullPage plugin make a FullPage compatible Undo/Redo button?

EDIT: I just discovered that without the FullPage plugin, this patch shows a warning every second or so (because of its constant checking on the content of the textarea). Why? It uses getInnerHTML, which in turn references an object "by ID/NAME in the global scope".


(This post was edited by kimastergeorge on Nov 3, 2004, 10:55 PM)


mharrisonline
Novice

Nov 4, 2004, 12:34 AM

Post #16 of 19 (11262 views)
Shortcut
Re: [kimastergeorge] Working undo/redo [In reply to] Can't Post

How is this for strange- It just allows one undo and no redo on the spellchecker example, but when I launch the 2 areas example I first get two error messages on line 45 character 46 that editor is undefined, but then everything works great, the undo and redo work as well as with the core example. The 2 areas example has table operations, CSS, and spell check plugins. Maybe the javascript error helps it...

I didn't see the warning you mentioned though. Was that in IE?


kimastergeorge
Novice

Nov 4, 2004, 6:13 PM

Post #17 of 19 (11212 views)
Shortcut
Re: [mharrisonline] Working undo/redo [In reply to] Can't Post

It was with Firefox, in the Javascript console (a warning). I'm using the newest CVS build, by the way.


ilya
Novice

Dec 25, 2004, 10:54 PM

Post #18 of 19 (10149 views)
Shortcut
Re: [Viperal] Working undo/redo [In reply to] Can't Post

It is a coincidence it works.
Default configuration suggests using editor attribute of global object to contain reference to htmlarea object. Thats why removing realy necessary definition goes unnoticed.
In case you use more than one HTMLArea on one page you'll have problems.


ilya
Novice

Dec 26, 2004, 2:30 AM

Post #19 of 19 (10114 views)
Shortcut
Re: [ilya] Working undo/redo [In reply to] Can't Post

Here is diff with most recent CVS version 1.95.
It does not work under Mozilla and i cannot understand why.

If you wish to help please report what your Mozilla says after you hit undo.

Here is also 1.95 htmlarea.js with patch applied.
Attachments: htmlarea.js.patch (3.86 KB)
  htmlarea.js (78.9 KB)

 
 
 


Search for (options)