Announcement

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

#1 2005-10-27 17:17:31

djhenry
Xinha Community Member
From: Raleigh, NC
Registered: 2005-10-27
Posts: 12

hide and unhide xinha textarea

I am playing with some new features for my site.  One thing I would like to do is be able to hide xinha textareas until they are needed.

my test bed is here:
http://test.cipm.info/snipits/javascrip … hatest.cfm

I haven't tried with any other browsers but in Firefox I get errors from xinha when I hide and then show xinha and try to use it.  Here is how to repeat my problem.
go to the url listed above
click the first link to show the textarea
click the second link to load xinha on the textarea
change the text (or not, doesn't matter really)
click on the first link again to hide the text
click on the first link again to show the text again
try to change text, use bold, italics, underline, etc.

if you click the toggle HTML source button twice, everything works fine again.  Whats going on here and where would I start looking to fix it?

Thanks for your time to look at this!

~David

Offline

#2 2005-10-31 10:53:48

djhenry
Xinha Community Member
From: Raleigh, NC
Registered: 2005-10-27
Posts: 12

Re: hide and unhide xinha textarea

Ahhh, this seems to be a firefox related problem.  IE seems ok with hiding and unhiding xinha.  Any thoughts?

Offline

#3 2005-10-31 11:29:11

djhenry
Xinha Community Member
From: Raleigh, NC
Registered: 2005-10-27
Posts: 12

Re: hide and unhide xinha textarea

In firefox, once I have caused the browser to "freek out"  it will return to normal operation if the html source is toggled on and then back off.  Is there a way to do this with javascript commands from the page whenever the textarea is made visible again so that firefox users are not left scratching their heads at [Exception..."Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED)... errors?

Offline

#4 2005-11-01 09:29:23

djhenry
Xinha Community Member
From: Raleigh, NC
Registered: 2005-10-27
Posts: 12

Re: hide and unhide xinha textarea

Alrighty, I figured out a hack to fix the problem. To make the editor unhide and work properly in firefox, run the setMode('wysiwg'); command on your editor just after displaying it.  I will update my testbed code to show anyone else that is interested.

Look for me on the IRC chan if you wanna ask questions smile

Offline

#5 2005-11-03 02:14:27

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: hide and unhide xinha textarea

When you change style related to Xinha in Gecko (eg set display:none on some ancestor, change position, visibility etc) you should deactivateEditor() before doing it, this works around bugs in gecko.


James Sleeman

Offline

#6 2005-11-04 14:32:57

nikoB
New member
From: Vienna
Registered: 2005-11-04
Posts: 2
Website

Re: hide and unhide xinha textarea

We are using xinha in our cms and I let it hide/unhide when needed. basically I have a div with the content stored, when you click on it, i generate the textarea dynamically and load xinha afterwards. It works really good in gecko, but some versions of ie just cant get the hang of it (sometimes xinha just does not load, sometimes it works, sometimes ie crashes)

I wrote some destroy functions so it would work at all (see http://dev.corinis.org/corinis/browser/ … ls.js#l636 and below)

You can try it out on http://demo.corinis.com/

Maybe someone knows why ie is behaving so weird.

Offline

#7 2005-11-04 15:06:35

nikoB
New member
From: Vienna
Registered: 2005-11-04
Posts: 2
Website

Re: hide and unhide xinha textarea

ok seems i found out what was going wrong: you need xp -sp2 then it works correct in ie. It seems sp1 ie is just too unstable for this kind of javascript magic.

Offline

#8 2005-11-15 10:49:42

djhenry
Xinha Community Member
From: Raleigh, NC
Registered: 2005-10-27
Posts: 12

Re: hide and unhide xinha textarea

(Note:  I have recently updated to the most current Xinha code version.)
I have changed this process in a few different ways.  How *should* I be going about this:

request to server
server responds with html page put together by server side script
browser begins executing javascript
::so far so good::
browser builds page, reads stylesheet
textarea is placed inside a div tag that has the following style from CSS
.hoverPopup
{
    display:none;
    margin: 0px 20px 0px 20px;
    PADDING-RIGHT: 5px;
    border: groove black;
    PADDING-LEFT: 5px;
    FONT-WEIGHT: normal;
    FONT-SIZE: 8pt;
    Z-INDEX: 1000;
    LEFT: 0px;
    VISIBILITY: hidden;
    PADDING-BOTTOM: 5px;
    PADDING-TOP: 5px;
    POSITION: absolute;
    TOP: 0px;
    background-color:ffffff;
}
onload javascript executed (xinha_init from the example)
page is done rendering
click on a link in the page changes the div holding the textarea from display:none to display:block
xinha shows up but doesn't work quite right


An alternative method is to change the style in the CSS to have display:block as the page loads and then set the display:none with a button later.  In that case, xinha works properly but the user has to push a button to hide the editors that I want hidden from the start. 

If I try to put the script to set the display:none in the code that happens when the page loads, it seems to do it before xinha is done doing its thing and causes the same problem as when it was set from the start with the style sheet.


??At what point should I use deactivateEditor()??

Last edited by djhenry (2005-11-15 10:51:59)

Offline

#9 2005-12-05 16:59:07

Wolfgang
Xinha Community Member
Registered: 2005-11-26
Posts: 13

Re: hide and unhide xinha textarea

Seems we have the same "problem":
http://xinha.gogo.co.nz/punbb/viewtopic.php?id=483

Offline

#10 2005-12-09 12:15:40

djhenry
Xinha Community Member
From: Raleigh, NC
Registered: 2005-10-27
Posts: 12

Re: hide and unhide xinha textarea

I am getting close to a solution.  I'll make a detailed write up with examples once I get it right.

Offline

Board footer

Powered by FluxBB