You are not logged in.
I had a need in formVista to put a Xinha editor in an unselected jQuery.UI tab. The unselected tab is in a hidden div which confuses Xinha to no end. I seem to have it working. In the hope that it'll save someone else some time, I've written up a short summary of what I did:
Hi!
First off I use an older version of xinha, and for the most part it is great. I appreciate everyone who helps contribute and develop.
I am wondering though... there still is no official release. It seems like with each nightly build the package size gets larger and larger, and the app itself adds new plugins, new graphics, new skins, new bells and whistles.
It seems like rather than adding all this stuff, it would make more sense to get a good, solid, bugfree, basic official release, then worry about adding continual bells and whistles later?
Thoughts?
EDITED TO ADD:
i know for a lot of people like me, having a lightweight, bugfree editor is as important as having one with a cutting edge look or packed with functionality.
This is one of the big reasons I ended up forking Xinha.
Current version is 0.4.1. I'll be putting together a 0.4.2 build with alot of bug fixes soon.
Development on areaedit is /alot/ slower than on Xinha. I'm only fixing bugs in a very core set of plugins. The primary focus in on maintainability and getting what's there to work ... improving comments, adding debug messages, adding much better error messages, catching and handling more exceptions, etc. ... as such maybe it should be called the boring fork of Xinha. My focus is on PHP as a backend language; if you use another language some work will need to be done but it's not prohibitive.
In Xinha, if you remove most of the plugins Xinha becomes alot more stable. Stylist caused me alot of problems so I don't use it. EnterParagraphs is a disaster. (change mozParaHandler in htmlarea.js to "built-in" to get much better behavior).
Excellent work getting the first release out the door Yermo, I'll have a play in a bit
Thanks. If you have a chance, please check out the code and let me know if you think it's easier to follow than the mainline Xinha code.
(post to http://www.formvista.com/forum.html ...)
thanks,
-- Yermo
A little off topic. Several people asked me to let them know when my AreaEdit fork (originally known as the unified backend branch of Xinha) would be available.
It's now been packaged up and is available for download from:
Chances are you will want to use Xinha instead of AreaEdit. Xinha is more actively developed, has vastly more features, appeals to a wider audience, has more developers and will progress more rapidly than AreaEdit ever will. Also , where Xinha is backend agnostic, AreaEdit very much favors PHP and the sample distribution I've put together assumes PHP is available.
There are many bugfixes and features in Xinha that have not made it into AreaEdit.
Having said all that, if you are trying to come up to speed on the Xinha internals, AreaEdit may provide for a nice starting point before jumping into the Xinha code itself. AreaEdit is better commented and does have a tracing system that will show you how all the pieces fit together. Alot of stability bugs (esp under FireFox) have been fixed and error messages are improved in many cases. At least for me, AreaEdit is much easier to debug than the Xinha code.
If you have any questions, comments or suggestions you can reply to this post or, preferably, post in the formVista discussion forum at:
http://www.formvista.com/forum.html
Thanks,
-- Yermo
If you have any questions, comments or patches about draglist please post them to the formvista forum at
http://www.formvista.com/forum.html
It'll make it alot easier on me to keep track of things.
Thanks!
-- Yermo
Hey Yermo, great work. Ive been looking for such an example myself several times and this hit the spot. Last time I saw a drag'n'drop which accually works was in the Statistics software Livestats, which has a similar feature.
Thumbs up for this one,
Cool. Thanks. I had been planning to release this for quite some time (over a year now). The request from Gogo just pushed me enough to get it done.
I want to find the time to do what I call "draggrid". Same idea, except along the lines of a grid or photogallery. It's a bit more tricky to do.
-- Yermoi
Looks nice, not quite what I was looking for but I might be able to do a bit of hacking to it
. For reording Xinha toolbars though it looks like just the thing (cept we will be using it horizontally
)
Ok. I've packaged what I have. It's now available for download at:
http://www.formvista.com/otherprojects/draglist.html
If you use it please let me know what you think and any suggestions on improvements. The code leaves a bit to be desired.
Looks nice, not quite what I was looking for but I might be able to do a bit of hacking to it
. For reording Xinha toolbars though it looks like just the thing (cept we will be using it horizontally
)
The underlying dom-drag.js file:
http://youngpup.net/2001/domdrag
provides a nice interface to drag and drop. The draglist.js file itself is based on work from:
http://blog.simon-cozens.org/6785.html
I'm packaging up what I have and will make a post once it's avialable.
wow, nice script!
what licence is it?
Something essentially free. Creative Commons Attribution sound good? The underlying dom-drag library uses that license which I think states that you just have to give me/my company some credit in the headers and you cant' claim you wrote it but otherwise are free to do with it what you want.
I'll package it up as a download once I get a chance. Maybe tomorrow.
you da man yermo
![]()
Ok, I've ripped the code out of formVista and packaged it up well enough that it runs outside of the framework.
Let me know if this is what you were looking for:
http://www.formvista.com/uploaded_html/demos/draglist
Each item in the list is a <div> that is given a unique id which was to be an integer. The values are the order. On submit the new order of the items in the list is queried and the value fields are updated before submission.
If this is what you're looking for I'll package up a download for you. It's been quite a while since I've looked at this code.
you da man yermo
I'm going to put up a sample of what it does so you can look at it. Am packaging it up right now.
This isn't immediatly related to Xinha (but might be in V2 for sorting toolbar groups), I'm looking for an example of a DHTML (Javascript) interface for sorting a list of items by dragging an item and dropping it into another position in the list.
Has anybody seen anything like that? The only dragging stuff I can seem to find is for dragging layers around to arbitrary positions, rather than dragging static page elements into alternate locations.
I have a complete implementation that I put together a while ago that I can give you. I just need to package it up for you. I call it draglist.
Have you checked out O'reilly's Dynamic HTML the Definitive Reference book? Without it I would never have been able to come up to speed on this stuff. It's a very good reference that details all the differences between NS, DOM and IE on an interface by interface basis ..
Nope, never had a book on JS or DHTML or anything, google is my best friend
You are a braver man than I. ![]()
For it to work for me I'd have to recreate EnterParagraphs for MSIE to do the same thing.
I suspect that you have no chance of doing that. IE's selection and range interfaces are pretty lack lustre as I remember. Even without any documentation for Gecko's selection object it's easier to work with than IE.
Yea, that's kind of what I am afraid of.
Maybe the answer is to try to map CNTRL-ENTER onto EnterParagraphs and in the MSIE case try to switch the ENTER behavior to CNTRL-ENTER and visa versa ... anyone who really wants <p> tags is probably advanced enough to learn how to hit CNTRL-ENTER .. whereas users who really just want a line break are probably not advanced enough to know anything about the underyling markup.
(Have you checked out O'reilly's Dynamic HTML the Definitive Reference book? Without it I would never have been able to come up to speed on this stuff. It's a very good reference that details all the differences between NS, DOM and IE on an interface by interface basis ...)
At this point I've given up on the EnterParagraphs plugin for the time being. I just don't have enough time to fix it for every case; but I will go back to it at some point. I'd really like MSIE and Gecko to generate the same HTML.
Don't forget the reason for EP (and dom_checkInsertP) in the first place isn't just to get Moz and IE to produce the same code, it's to get Moz to produce code that's usefully manipulable with CSS
Yea, I agree. But in order to be useful I need to have onENTER appear to the enduser as if it were just a linebreak as we had discussed. (using stylesheet entries). Without that my users will cry foul.
For it to work for me I'd have to recreate EnterParagraphs for MSIE to do the same thing. I'm afraid I don't have the time for it right now. I've already spent much longer coming up to speed on this codebase than I had planned for.
I'll have to tell my users to use FireFox, which in my case I can get away with for the moment. I will have to address this at some point before too long; primarily because my business partner really wants to control things from stylesheets (our paying users could care less.)
Enterparagraphs was such a painful piece of code to work through. At least I got it to the point where it's almost working. It should be easier for someone to pick up and run with the version of unified_backend than the trunk. I put alot of work in trying to make the code more understandable, at least for me.
If that changes with AreaEdit (from what I've seen you're on good way - shame about the writing style but I can adopt to that)
<laugh> Yea, old habits.
I will just check the sources and fix anything that bothers me (and send bug fixes of course
).
It's not plugins that worry me - none of them are essential to me - but the core should be as robust as possible.
Yea, that's the goal.
At this point I've given up on the EnterParagraphs plugin for the time being. I just don't have enough time to fix it for every case; but I will go back to it at some point. I'd really like MSIE and Gecko to generate the same HTML. For now I'm telling my users to just use FireFox; for the moment I'm in a position to do that but that won't last for too long.
Let us know when sources are stable enough to start checking them out for real.
Wilco.
For that matter how does the panel code work. Is that a race condition as well? Does the iframe.src get loaded "in the background"?
What part of the panel code in particular? When you set .src on an iframe/image/script whatever it's done asynchronously, yes (well, as far as I know).
I was looking at it cross-eyed. Disregard.
http://www.unix.org.ua/orelly/web/jscript/ch10_07.html
So yes, I think the point must be moot and the current code must stop executing before the event can fire.
Good find. So for the moment this should work ok in the browsers we're using. I wonder how much code out there assumes this behavior? I would guess quite a bit.
nice!
we should get the onload-stuff for the iframe into the trunk!
Gogo has identified a race condition in the code I put together. It works but right now it looks like there may be a potential problem.
I haven't seen any problems with it in all my testing over here but I agree there's an issue that will have to looked into. Right now it's not clear why the code is working as well as it is.
I'm not sure, but I think you have a race condition in your new code, currently I believe the sequence is...
1. create iframe
2. set iframe.src
3. ... some stuff
4. add onload event to iframewhat happens if the iframe finishes loading while step 3 is happening? You might think it simply a matter of moving the event attachment prior to the iframe src, but that could mean that the initIframe is attempted before the rest of generate is finished?
I've done some testing. Based on the way the code reads you would expect it to be a race condition but no matter how much code I put between the iframe.src = and the addEventListener (in terms of a loop printing out messages to another window for example) I can't get it to fail. (This is in firefox. I haven't tested it yet in MSIE although my initial tests worked each time).
It seems like either there's some side-effect of how the multithreading works that the onLoad event is cached somehow .. might be a side-effect of how addEventListener works. I'll have to test it without debugging messages, but if anything you would expect the trace messages to slow everything down allowing the race condition to occur.
There's something I don't understand.
But it clearly works, at least in these test cases. I agree it's not "right" yet. We'd have to do some re-engineering to make it "right".
We'll have to keep an eye on it to see if any reports of brokenness arise.
I wonder if we even need to set the src in the first place. If we droped that then the iframe would perhaps be ready to go as soon as we create it and we could then go straight into initIframe from the tail of generate, no need for timeouts or events.
I guess mish must have put it there for some reason though, so perhaps it just doesn't work without some src.
Hmm. If I read the mozilla bug report right then we have to have some contents in the iframe before being able to set designMode on but I may have misread that; something about a body tag being necessary.
I'll have to experiment with it to see.
Is there any reason why we can't move the iframe.src = ... down to after adding the event because you're right, it looks like a race condition.
For that matter how does the panel code work. Is that a race condition as well? Does the iframe.src get loaded "in the background"?
Hmmmm.
I'm not sure, but I think you have a race condition in your new code, currently I believe the sequence is...
1. create iframe
2. set iframe.src
3. ... some stuff
4. add onload event to iframewhat happens if the iframe finishes loading while step 3 is happening? You might think it simply a matter of moving the event attachment prior to the iframe src, but that could mean that the initIframe is attempted before the rest of generate is finished?
I do believe you have a point there ...
Yermo wrote:What other bugs are you seeing that you want addressed? (Other than EnterParagraphs stuff)?
I was trying to use Xinha for entering articles. Besides having titles (h1 and h2 tags) and normal text I also wanted to have "framed text" - quotations for example. Basically divs with class="quotation" css. It was impossible to do that without getting some weird results from time to time. It is quite some time ago so I don't know what I have tried, but I did spend quite some time on this problem and I know I have tried Stylist plugin. I ended up using h4 tag for quotations and setting an appropriate CSS to display it as I wish - not the most elegant solution but at least it works (I hope - since the project has been put on hold I have no feedback if there are any problems using it).
Hmm. By default the EnterParagraphs plugin is turned on which will mess things up pretty badly. Do a search for mozParaHandler and set to "built-in". You might notice less weird behavior. (Actually in my fork I've fallen back to making the default "built-in" which means the browser's internal handler will dictate the behavior on enter key press. Getting EnterParagraphs to work in all cases is going to be a ridiculous amount of work.
Aside from that the only thing I can think of is some mishandling in HTMLArea.getHTMLWrapper() which does do some search and replacing.
I also haven't had too much luck with the stylist plugin but I haven't played with it much.
Yermo wrote:anzenews wrote:I don't know if I'm making any sense, it's too early in the morning for me. %-)
AnzeI think we're both thinking the same way. We both clearly have important customers that need to be supported and are running into the same problems.
Exactly.
I could use Xinha on many more CMS input forms but I choose normal text without HTML whenever possible - because I don't want something that sometimes doesn't work.
Anze
Yea, I built a set of discussion forum components for my framework and ended up making them plain text as well for the same reason.
However, with these recent fixes I'm probably going to try enabling the editor to see how it goes.
I should have an installable AreaEdit package put together before too long ... although allergy season here on the US east coast is making things go a bit slowly.
I've committed the latest batch of changes to the unified backend branch which you can check out using svn:
svn co http://svn.xinha.python-hosting.com/branches/unified_backend xinha_ubThe most notable fix in this version is the workaround for the FireFox designMode="on" exception that has been plaguing this codebase for some time.
https://bugzilla.mozilla.org/show_bug.cgi?id=207842
and discussed in this thread:
http://xinha.gogo.co.nz/punbb/viewtopic.php?id=229
In addition I've put alot of work into EnterParagraphs to try to tame it a bit. The code should be alot more readable and may make for a better starting point for someone working on it than the original. I've fixed several bugs having to do with terminal cases (beginning and end of document/selection) which should largely eliminate the <a href="..."></a> problems we've been setting.
It's by far not all the way there yet but it does seem to be "better", at least in the cases I've tested. I have lists partially supported, but there are still many cases where they fail.
Getting EnterParagraphs to work correctly in all cases is going to be a tremendous amount of work and it'll largely be useless if similar support in MSIE doesn't work identically so for the moment I've defaulted mozParaHandler to built-in in this branch.
This version of the unified backend branch should work in MSIE now. Couple of oops's on my part was the reason it wasn't.
Check out a live example at:
http://www.formvista.com/uploaded_html/ … index.html
If you have any questions, comments, criticisms, flames, please post them here or you can contact me directly at:
Yermo wrote:Trace messages rock. I think I've finally fixed this bug in a way that will actually work reliably (keep fingers crossed).
...
This was my #1 reliability issue with Xinha under FireFox ...Great!
I have a few others though and I'm sure that new bugs will surface in time - but it's nice to see some reliability issues solved. By the way, Xinha would benefit from hints on this solution too...
Already been working with Gogo on it.
http://xinha.gogo.co.nz/punbb/viewtopic … 1579#p1579
What other bugs are you seeing that you want addressed? (Other than EnterParagraphs stuff)?
Another thing: it would be nice to have an option for clients to send bug reports (with trace) to the developer. This way if something goes wrong the client only clicks "Send trace to server" and this is it
Yes, for the debugging enabled version of AreaEdit (if the trace window is turned on) I'm hoping to make something like this happen. What complicates things is that you don't know what state the browser is in .. depending on the particular bug things can get tricky.
- the developer can (hopefully) solve the problem without trying to reproduce a bug on his own computer. Some bugs are timing-related and difficult to reproduce. Of course, the trace should be sent for the things that have already happened - the system should keep last N messages and rotate them and when client hits "send to server" the messages should be sent.
Actually I would prefer seeing the entire trace from the beginning when the editor was started ... so what I would probably want to do is give clients a way, as part of a customer support call, a way to turn on the "debugging version" which pops up the trace. Let them reproduce it that way and then send the report.
In our experience, when tracking down the weirdest of errors this kind of tracing tends to work best interactively. Having customer just send random traces with a few messages probably won't help much (at least for me). I also find that I am most successful in tracking these things down when I can walk a customer through the specifics of a test so I can get a good trace.
BTW, if I have my way there will be no more timing problems in this codebase. I'm in the process of getting rid of all the setTimeout() calls I can.
I don't know if I'm making any sense, it's too early in the morning for me. %-)
Anze
I think we're both thinking the same way. We both clearly have important customers that need to be supported and are running into the same problems.