Announcement

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

#1 2005-04-27 09:21:56

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Multiple Xinha in firefox doesnt load - quick oldie fix

I noticed after using the Nightly build that two instances of Xinha doesnt work in my Firefox, meaning that the second instance is none selectable. You could however flip from html to source and back and it works.

I also see that the latest edition of Xinha has edited the way of creating the Xinhas with the new HTMLArea.startEditors function, and not having the setTimeout for extra editors.

The quick fix, atleast for me is :

Ive loaded two instances like this :

      xinha_editors = xinha_editors ? xinha_editors :
      [
        'cms_ingress',
        'cms'
      ];

I replaced this :

HTMLArea.startEditors(xinha_editors);

With this :

        setTimeout(function() {
          xinha_editors.cms_ingress.generate();
        }, 100);

        setTimeout(function() {
          xinha_editors.cms.generate();
        }, 300);

And it all works again, the first timeOut is probably not needed, but it doesnt really matter in my opinion if it goes an extra second to initialize the editor. Adding some code to the HTMLArea.startEditors would just need to to set the >1 editors with timeouts and it should be solved.

Offline

#2 2005-05-02 11:54:57

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

This is not a good solution for our case (I know its the way we used on other editors and since xinha didnt need it was one of the reasons we liked xinha).  In our case we load different versions of my_config.js throughout our site dynamically and they apply to pages that sometimes have multiple editors and other times do not, and also the editor names are generated on their respective pages.  Im sure we could write a function to count the editors and set multiple timeouts etc, but since this was working before we should go back to the older method.

Anyone know when this changed?

Thanks,
Will

Offline

#3 2005-05-02 12:08:51

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

...please help me to reproduce this bug.
i'm using full_example.html with Number of Editors "3"
and i can use all three...


Niko

Offline

#4 2005-05-02 14:36:07

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

If you are using firefox just go to:

http://xinha.gogo.co.nz/xinha-nightly/e … ample.html

use more then 1 editor.

go to the first editor and hit enter after " Nunc sit amet metus in tortor semper mattis." so it creates a new bullet.
now in the other editors you cannot edit the text.

(this is a bug that almost every other wysiwyg editor had when loading text/graphics into multiple editors for editing.  Xinha never had this problem before).

Offline

#5 2005-05-02 16:33:30

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

To create this bug you need to use Firefox, the bug doesnt appear in IE where you can add as many editors you want, so if you Niko has tested with IE thats why.

Offline

#6 2005-05-03 01:38:06

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

...this only happens with the stylist-plugin!
so it seems to be a bug in there!

can you confirm this?

edit: yes, only in firefox

Last edited by niko (2005-05-03 01:38:23)


Niko

Offline

#7 2005-05-03 02:56:24

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

thats not it.  my system doesnt have that plugin and i tried removing some plugins and it worked but not others.  theres some sort of combination happening but it seems to be related to loading plugins at least...

Last edited by willeffects (2005-05-03 03:10:34)

Offline

#8 2005-05-03 03:22:50

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

'ContextMenu',
       'FullScreen',
       'SpellChecker',
       'FindReplace',
       'TableOperations'

fails

'FullScreen',
       'SpellChecker',
       'FindReplace',
       'TableOperations'

fails

'TableOperations'

works

'FindReplace',
       'TableOperations'


fails


'FindReplace'


fails

fails

'ContextMenu',
       'FullScreen',
       'SpellChecker',
       'TableOperations'

fails


   'SpellChecker',
       'FindReplace',
       'TableOperations'

fails

Offline

#9 2005-05-03 11:39:14

paulb
Xinha Community Member
Registered: 2005-04-27
Posts: 12

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

The timeout thing worked for me (but only if the delay between editor loads is at least 300ms) - but does anyone know why this works?  What are the causes of this problem?

Offline

#10 2005-05-03 12:24:35

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

the timeout is no solution at all.
on faster computers it won't work anymore - and it is just a workaround.


Niko

Offline

#11 2005-05-04 01:30:22

willeffects
Xinha Authority
Registered: 2005-03-19
Posts: 130

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

Cant we go back to the old method of loading?  Why did it get switched?

Offline

#12 2005-05-06 11:37:39

Chuck
Xinha Community Member
Registered: 2005-02-25
Posts: 29

Re: Multiple Xinha in firefox doesnt load - quick oldie fix

Trying to generalize that timeout method to apply it to all textareas in the page (a bit like replaceAll used to do), I stumbled upon this strange bug

CODE : 

                for (var i = 0; i<xinha_editors.length;i++) {
                    alert("*"+xinha_editors[i]);
                }

                xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

                for (var editor in xinha_editors){
                    alert(editor);
                }

ENDCODE

This spits out "*firstfield" then "*secondfield" but the second alert loop only outputs "firstfield" and second field is never showed. I thought my foreach loop was messed but it's about the same code as used in makeEditors

Any ideas of what might be going on?

I'd like to get this working because our client really liked the utils found in the "nightly build" example (context menu, image resizer etc.).

By the way, I just updated my SVN version before testing this so my xinha code is up to date...

Offline

Board footer

Powered by FluxBB