Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
New Add-on. Editor is loading... popup for V2



Luis
Veteran

Mar 11, 2004, 1:53 AM


Views: 43672
New Add-on. Editor is loading... popup for V2

Hi guys. Long time since I don't post any new addition.

I've received several requests for this mod, so I decided to post it here in a new thread for everybody's benefit.

It's the Editor is loading... indicator that some of you have already seen working in my site.

Just search for this fragment of code in editor.js

function editor_setmode(objname, mode) {
var config = document.all[objname].config;
var editor_obj = document.all["_" +objname + "_editor"];


// wait until document is fully loaded
if (document.readyState != 'complete') {
setTimeout(function() { editor_setmode(objname,mode) }, 25);
return;
}


// define different editors

and replace it with the code in the attached file (EditorLoading.txt). Put the attached image in your images dir, and that's all.

Be well.


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


(This post was edited by Luis on Mar 11, 2004, 1:59 AM)
Attachments: status.gif (2.21 KB)
  EditorLoading.txt (1.71 KB)


eleutheria
Novice

Mar 16, 2004, 11:00 AM


Views: 43577
Re: [Luis] New Add-on. Editor is loading... popup for V2

Hi Luis,

I am using many of your additions already, they are fantastic. Thank you for your excellent work!

But I am having a problem with this one. For some reason the progress bar doesn't close by itself. HTMLarea will finish loading, but the popup only disappears when I click in the browser window (IE6).

[Edit] I just noticed that this occurs only when HTMLArea opens with existing content. The progress bar closes fine when creating a blank textarea.

Any thoughts?

Thanks again!


(This post was edited by eleutheria on Mar 16, 2004, 11:30 AM)


Luis
Veteran

Mar 16, 2004, 11:45 AM


Views: 43573
Re: [eleutheria] New Add-on. Editor is loading... popup for V2

Hi eleutheria:

Try increasing the delay time in the last else statement until you get it to close. Try an average amount of text of when doing it. The problem is; if the amount of text is to big, then it tries to load before the editor is fully loaded and it gets lost when the editor does.

else if(document.all[objname].value){
setTimeout(function() { editor_setmode(objname,mode);
window.focus();}, 1000);
return;

I'm trying to make the editor calculates the size of the the text to load autonatically, but in the meantime you need to set it up in a trial and error basis.


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


eleutheria
Novice

Mar 16, 2004, 2:27 PM


Views: 43562
Re: [Luis] New Add-on. Editor is loading... popup for V2

Hi Luis,

Thanks for the suggestion. I've tried various delays but it doesn't fix the problem. I see that the text is delayed, but it makes no difference to the popup.

I don't really understand how it works (my knowledge of javascript extremely basic), and it isn't most important, but I hope there is something I can do to make it work.


Luis
Veteran

Mar 16, 2004, 3:35 PM


Views: 43558
Re: [eleutheria] New Add-on. Editor is loading... popup for V2

Hi eleutheria:

It should work without any problem. Here is an example with a huge article pre-loaded.
http://webstationone.com/test/htmlarea/index2.html

It's a 10 pages Word document with 1000 miliseconds (1 sec) of delay.

Greetings


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


mmcw
User

Mar 17, 2004, 11:49 AM


Views: 43524
Re: [Luis] New Add-on. Editor is loading... popup for V2

Can it be used for V3 also!

Michel


Robert-t
Novice

Mar 17, 2004, 1:55 PM


Views: 43520
Re: [Luis] New Add-on. Editor is loading... popup for V2

Hi Luis

I have the same problem.

where in this code can I put your code.?

// don't execute more than 3 times a second (eg: too soon after last execution)
if (this.tooSoon == 1 && runDelay >= 0) { this.queue = 1; return; } // queue all but urgent events
this.tooSoon = 1;
setTimeout(function(){
this.tooSoon = 0;
if (this.queue) { editor_event(objname,-1); };
this.queue = 0;
}, 333); // 1/3 second



Luis
Veteran

Mar 17, 2004, 6:12 PM


Views: 43509
Re: [Robert-t] New Add-on. Editor is loading... popup for V2

This code has nothing to do with my mod. Instructions are clear in the first post of this page.

Greetings


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


Robert-t
Novice

Mar 18, 2004, 8:12 PM


Views: 43447
Re: [Luis] New Add-on. Editor is loading... popup for V2

HI Luis

Where in editor.js code should I put your code

else if(document.all[objname].value){
setTimeout(function() { editor_setmode(objname,mode);
window.focus();}, 1000);
return;


??????


Luis
Veteran

Mar 18, 2004, 10:55 PM


Views: 43445
Re: [Robert-t] New Add-on. Editor is loading... popup for V2

Replace this fragment of code (Where ???Where you find it in your own editor.) with the code in the attachment in post#1

function editor_setmode(objname, mode) {
var config = document.all[objname].config;
var editor_obj = document.all["_" +objname + "_editor"];


// wait until document is fully loaded
if (document.readyState != 'complete') {
setTimeout(function() { editor_setmode(objname,mode) }, 25);
return;
}


// define different editors


The code you mention is just a part of the whole code and it's worthless without the rest.


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


(This post was edited by Luis on Mar 18, 2004, 10:59 PM)


nash
New User

Feb 9, 2005, 10:28 PM


Views: 42321
Re: [Luis] New Add-on. Editor is loading... popup for V2


In Reply To
Hi eleutheria:

It should work without any problem. Here is an example with a huge article pre-loaded.
http://webstationone.com/test/htmlarea/index2.html

It's a 10 pages Word document with 1000 miliseconds (1 sec) of delay.

Greetings





hello luis -

even your own preloader - does not closes at all - when i clicked in the text editor area - then your preloader diappeared - it is kinda confusing - you know -



cheers!

nash