Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?



markulius99
Novice

Apr 28, 2004, 2:28 PM


Views: 41135
Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?

Hi everyone, Hi Luis:

From a previous post I asked you more detailed info about the WordCleaner. If you have a chance please check my post again....

This is a new question ...Is there any way to verify that a loaded file had changed in order to save only when required?

1) I load a file.

2) If you click the X button I have a function that asks you whether you want to save your changes or not. Obviously because I don't compare any content it will show the Save File window even if I didn't modify anything.

3) I guess you already thought about that because you have a ed_save_blur.gif icon

4) Any way to compare the actual content with the loaded content?

Thanks

MARKULIUS


Luis
Veteran

Apr 28, 2004, 9:10 PM


Views: 41122
Re: [markulius99] Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?

Hi markulius99:

This is already built-in in editor.js

search for:
// insert by lvn : check editor changes
this.checkChanges = 0;

and make it:
this.checkChanges = 1;

Regarding your other question, I'm sorry I couldn' answer before:

This is how the spell-checker function works:
  1. Copies the contents of HTMLArea.
  2. Opens Ms-Word and one invisible Word document.
  3. Pastes the copied contents into that Word document
  4. Perfoms the spellcheck using Word's internal spell-checker.
  5. When it finishes, copies the contents of the Word document and paste them back into HTMLArea.


As you see, it's exactly the same as copying and pasting a spell-checked Word Document, therefore all the style are now modified into Word's styles with all its corresponding garbage-code. When it returns to HTMLArea, functions cleanHTML(unclean) and myclean(editdoc) do their job, removing all the code that is set up to be removed in those functions.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea


grojas
New User

Sep 20, 2004, 4:57 PM


Views: 40923
Re: [Luis] Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?

Hi Luis and all:
I found a small bug with the spell checker, it works fine but when the spell checker finishes checking and I return to HTML area all my <DIV> tags are changed to <P> tags. Can you please help me with this? I appreciate all your help.

Thank You


Luis
Veteran

Sep 20, 2004, 9:18 PM


Views: 40917
Re: [grojas] Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?

Hi grojas:

It's not a bug (I hope). I think it's this line in function myclean(editdoc):

oTags = editdoc.all.tags("DIV"); if (oTags != null) {for (var i = oTags.length - 1; i >= 0; i--) {oTags.outerHTML = oTags.innerHTML;}}


Try commenting it out.

Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea


grojas
New User

Sep 21, 2004, 8:14 AM


Views: 40912
Re: [Luis] Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?

Hi Luis: Thank you for your quick response... I already commented out this line but I keep on having the same problem. I'm attaching my editor file in this reply and probably if you are so kind and have some time can take a look at it. Thank you in advance. Regards Geovanny
Attachments: editor.js (126 KB)


Sara
Novice

Jan 21, 2005, 2:59 PM


Views: 40706
Re: [Luis] Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?

this.checkChanges = 1 works too well, it prompt also when clicking "save" button.... How can I disable it when submitting the form?

/Sara


Luis
Veteran

Jan 21, 2005, 3:51 PM


Views: 40702
Re: [Sara] Hi Luis..is there any way to verify that a loaded file had changed in order to save only when required?

Hi Sara:

It might vary depending how you are submitting the form and how your config options are set up. If you don't mind, give an address where I can see your textareas page or attach it here to figure out what you need to do.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea