Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-02-09 13:53:05

evilc
Xinha Community Member
Registered: 2005-12-18
Posts: 19

How to tell if a xinha box is still loading?

I finally got xinha to work with my app, I think the problem was mainly to do with the xinha boxes being set to display:none when starteditors was called.

I found this thread which seemed to be relevant.

I got around the problem in the end by not using startEditors and instead using the .generate() method for individual boxes.

However, this is not exactly ideal. When the box is shown, the user has to wait for xinha to convert the textarea. I would much rather init all the boxes on page load. My problem seems to be one of execution order or threads or something. I thought JS executed all stuff in order, but it seems not (Unless I put alert() statements in strategic places, which isn't viable.)

Now I tried unhiding the boxes at the start and calling startEditors, but the code seemed to fly right past the line with startEditors in and hide the boxes again before xinha had properly inited.

So... is there a way to query a xinha box and see if it has loaded?
Then I would probably want to do something like:

while (<box not finished loading>){
   //wait
}

to halt code execution until xinha has converted the textareas.

Can anyone offer any advice?

TIA

Clive

Offline

#2 2007-02-09 16:22:14

evilc
Xinha Community Member
Registered: 2005-12-18
Posts: 19

Re: How to tell if a xinha box is still loading?

bugger, I spoke too soon.
It will only work at the moment on a really slow machine, if you open the web page on a fast machine, xinha fails to work.

Please, please, does anyone know how to avoid these horrible problems?

Offline

#3 2007-02-10 14:00:50

evilc
Xinha Community Member
Registered: 2005-12-18
Posts: 19

Re: How to tell if a xinha box is still loading?

Well I sat down today and I think I cracked this nut finally.

http://www.evilc.com/xb/onXinhaLoad.html

Basically, write code to check the value of _iframeLoadDone for each editor, if any aren't true then it isn't done loading.

Offline

Board footer

Powered by FluxBB