You are not logged in.
Lets try that reply again..
It was endless looping on me and I couldn't figure out why. It looked like every time it went to refresh that it triggered the event again
Hmm, well, I don't know. I would have expected it to fire once when the document (about:blank) is loaded. But I guess it may fire again when we do doc.close()
Verified. Removing the boolean and doing an "alert("before doc.close");" before the doc.close and another alert "after doc.close" yields endless before doc.close() alerts .. effectively endless recursion.
because essentially we have replaced the document (illustrated by the insertion into the history list) - of course whether that's an intended behaviour or a bug related to the history insertion I couldn't say.
removeEventListener should work, but you may not be able to do that from within the event listener itself as I loosly recall. So perhaps just setting the boolean is the best way around it.
There doesn't seem to be a way around it; and luckily the event only gets called twice (once on about:blank and once on doc.close() so it's not as bad as I had originally thought.)
Interesting (and a much better way of doing it BTW). I wonder if the delay is due to the src we are setting on the iframe. I have found that recently (last few months) my F/fox installs have been having trouble with local connections, they just get slower, and slower, and slower. Restart the fox and it's quick again for a while. It's not anythign to do with Xinha, this is totally without Xinha even in the picture.
I havn't been able to find any relevant bug reports about it though so I thought it was probably just me.
Hmm. No it's not just you. I've seen the same kind of thing over here but hadn't narrowed it down to the network. I just notice over time firefox gets slower and slower especially with heavy javascript use. I had thought it was because of some threads racing or some such ... but hadn't delved into it.
It was endless looping on me and I couldn't figure out why. It looked like every time it went to refresh that it triggered the event again
gogo says: .... argh, what the hell happened, I replied to this message and instead it overwrote it! Sorry about that yermo.
The code in Xinha is a nightmare to learn to understand and I actually admire people working on it - I tried to fix a bug where Xinha sometimes won't go into design mode and in a couple of hours I still couldn't understand the concept of the whole thing so I gave up.
Trace messages rock. I think I've finally fixed this bug in a way that will actually work reliably (keep fingers crossed). See my post:
http://xinha.gogo.co.nz/punbb/viewtopic.php?id=229
Once you see how the code all fits together it's not so bad ...
This was my #1 reliability issue with Xinha under FireFox ...
So I'm running into the infamous random "designMode='on'" exception. Interestingly in my case if I disabled EnterParagraphs the exception goes away. (This is with my tweaked unified backend).
So I did some googling and came across this interesting tidbit:
https://bugzilla.mozilla.org/show_bug.cgi?id=207842
At the bottom there is an intriguing suggestion:
------- Additional Comment #11 From Derek Davenport 2005-03-31 10:05 PDT [reply] -------
I've found a similar problem that may or may not be related.
On this page
http://derekdev.com/mozilla/iframenoworky.html
An iframe is created and added to the document and then has its designMode
turned on. The designMode stays on until the script stops executing, then it
turns off. Click the button to see that it is indeed off.
My workaround was this
http://derekdev.com/mozilla/iframeworky.html
The iframe turns itself on after it's loaded.
-------------------------------------------------------
So I patched HTMLArea.prototype.generate with the following:
if ( HTMLArea.is_gecko )
{
// need to get a var into the closure below.
editor.isGenerated = false;
this._iframe.addEventListener("load",
function(e)
{
if ( !editor.isGenerated )
{
editor.isGenerated = true;
editor.initIframe();
}
return true;
},
false);
}instead of using:
setTimeout(function() { editor.initIframe()}, 50);Interestingly there is quite a delay (several seconds) between the time the textarea shows up and the time the editor displays in situations where the exception would have occurred.
Kill the browser, restart it and the delay goes away for a while.
At least in my testing here, this fixes the persistent exceptions I've been getting on designMode = "on". As indicated in bugzilla this is a known bug in the gecko engine.
I don't know if it's "right" but it does seem to work at least with limited testing.
OK, I'll rephrase: not everyone has PHP.
Some have Perl, Ruby, whatever... If someone came to me and wanted Ruby on my system just to be able to develop something I would reconsider the whole thing. But then that's me.
Yea, I wouldn't either. So I make a distinction in my backend version:
1. if you just want to use the fork (a.k.a. AreaEdit) but NOT do any development on the code itself and you do NOT want to use the PHP backend, then PHP is not necessary at all. (I obviously wouldn't want it to be.)
2. if you want to work on the AreaEdit (i.e. Xinha) code itself and you want the debugging trace message line and file numbers to be correct, you will need PHP. (Or you can rewrite the script that processes the line numbers in whatever language or you can deal with the line numbers being incorrect).
3. if you want to USE the PHP backend, then you need to run Configure.php on it to set up the paths. I prefer doing it this way instead of trying to figure out the installation directory automatically. My impression is it's less error prone and using DEFINE's for those kinds of things tends to be more secure IMHO. There's nothing to say you can just edit the config file by hand instead of using Configure.
I agree, but why make it mandatory? It costs nothing to do it the way I proposed (I checked the code and it could easily be done this way) - but for some people it would mean a world of difference. And for quick fixes (when developing) that do not need debug trace it would be easier and faster to use "non-configured" code.
I haven't written the script yet but the concept for all this stuff is there are two "versions" of the code, a debug enabled version for development (if you are working on the AreaEdit (i.e. Xinha) code itself) and a stripped/optimized "runtime" version that you field to customer sites.
If you want to integrate the editor and not worry about it's internals you use the runtime version.
If you want to work on the editor itself you use the debugging (Trace enabled) version. (See comments below
Another idea: why not use JS itself to do this? You could just include debug.js if you wanted accurate trace. See this thread:
http://groups-beta.google.com/group/com … 2e673957a3
Seems kind of ugly to me. I think I prefer the preprocessor approach .. less error prone I think.
yermo wrote:anzenews wrote:The bottom line is - I agree with most points you make
It's good to hear that someone does.
I think a lot of people do - those that haven't migrated to other WYSIWYG editors yet. The code in Xinha is a nightmare to learn to understand and I actually admire people working on it - I tried to fix a bug where Xinha sometimes won't go into design mode and in a couple of hours I still couldn't understand the concept of the whole thing so I gave up.
EXACTLY!! The #1 goal for my fork of this is to make the code as self-explanatory and maintainable as possible. I personally don't like clever code. It's it's not immediatley obvious what it's doing it needs to be simplified (just IMHO).
The code still got a long way to go. The whole reason I put all the trace messages in was so that the code could tell me in excrutiating detail exactly what it was doing, what order it was doing it in and allow me to get an idea of why things aren't working.
I've also added alot of error messages. While I was at it I reorganized things to make it all easier to understand because I couldn't figure out how anything worked. I've also tried to document as much as I could. I did end up looking at each and every line of code in htmlarea.js and every plugin I've touched to get as familiar with the code as I could.
Stability is a primary issue if you use something for commercial purposes - though to be fair Xinha is a very young project and it could evolve in a stable and very useable tool. This is also the reason I am still using it. I see a lot of activity and this gives me hope that sometime the core bugs will be fixed. If they are fixed in the near future in your fork I will be glad to switch and even post bug fixes if the code is maintainable. I personally don't care if some thing is set by using panel, button, dropdown list or a popup window - as long as it works as expected.
That's my main goal. This is being used in a commercial product by companies paying real money so it has to be maintainable. The level of expertise needed to work with the code has to be lowered as well .. and I think I've made good progress towards that end (because I am by no stretch of the imagination an accomplished DOM developer.) I had tried to contract Gogo to do this work but he's too busy.
I've got marketing companies using a system I've built and the HTML editor component is absolutely critical. With the way I work, code has to accomplish two primary goals:
1. it has to be understandable/maintainable by the lowest "cost" person possible which means clear simple code and when you're using some special language construct you document that as well.
2. it has to be self-diagnosing to the maximum degree possible which means permanent trace messages and good error condition handling/reporting.
That doesn't sound like the right reason for making a unified backend. I was using HtmlArea2 and am now using Xinha without the need to make a lot of changes in my own CMS. From time to time I just take a new version an put it over the old one - and that's it. But I made a choice not to change Xinha sources - all configuration must be made externally. And of course, I only use core Xinha without PHP plugins. It is unstable enough as it is...
"You ain't seen what I've been up to yet". I'm doing something very "different" from how web apps are usually built. More on that later.
Debugger helps - but you still need trace to find the things that are timing-dependent (debugger doesn't help you there) and when getting an "It doesn't work!" call from a client (unless you are willing to teach clients how to use a debugger
). The framework could be easily adopted / changed so that the trace would be automatically saved on the server everytime something goes *really* wrong (or when the client hits some "report an error" button).
Like i"m fond of saying to people who know what that's like "get out of my head". Ayup, exactly where i"m going with it.
yermo wrote:So yea, I'm forking it. As opposed to just having a private fork, I figure I'll put it up in case it might be of use to anyone else. (I've registered AreaEdit.com for this purpose).
At least you will get more bug reports...
Anze
Cool.
I don't have as slick a setup for managing all this stuff as Gogo has. But I do have an integrated system that supports simple forums, an issue tracker and the like. That should be coming online before too long.
I'm going to be checking in the latest round of changes to Xinha Unified_backend (once I track down this nasty mozilla exception that's popping up randomly on reload in frames ... very strange).
I can confirm this problem, quite a few of our clients have commented on problems of spacing lines. They are visible in the editor, but if you switch back and forth in HTML mode they will vanish, or if you dont swith editing mode and just press "submit" the served code will be different than its viewed.
I havnt had time to look into this, why its happening and where, but its happening thats for sure. The problem is also in htmlarea, so if we are lucky and find a way to reproduse the problem maby some nice people in here can fix the problem.
Check HTMLArea.getHTMLWrapper(). It's stripping out <br>'s there in the section:
case 1: // Node.ELEMENT_NODE
case 11: // Node.DOCUMENT_FRAGMENT_NODE
case 9: // Node.DOCUMENT_NODE
...Every time you switch between source and wysiwyg view it goes through getHTMLWrapper and mucks with the html causing all kinds of headaches. (this is one of the things that messes up EnterParagraphs).
Maybe a bit late, but still - I have a few more cents to add...
The PHP configure script is not such a bad idea if it is done on the server (automatically). Otherwise some developers might have problems - as someone else said, not everybody has Linux (yet
).
The Configure script should run under windows. It just generates a few files providing the location of the PHP interpreter. FAIK it's not even needed under windows since windows launches PHP based in the file extension and not the intepreter listed at the top fo the file.
Or, even better: I haven't checked the code but the __FILE__ and __LINE__ could be done so that the JS code works even without going through configure script (but of course without outputing the correct file/line pairs).
I had thought about that, however being able to quickly turn on trace messages when there's some problem, with accurate line numbers, will make supporting this alot easier; at least for me.
As for stability / adding new features goes - I would always go with the stable approach. The only reason I migrated from HtmlArea 2 to Xinha is stability (well, apart from FireFox support). But you don't have to sacrifice one to gain the other.
Agreed but it certainly makes it more difficult. It is probably, for most applications, more important to have a very solid core of functionality.
For me the stability of the code is a primary issue, and also for everyone using Xinha for commercial purposes. I really don't want to hear clients asking "why can't I see the editing buttons?" and replying "Hmmm, that is weird...". It doesn't do any good on customer relations...
It's actually that very bug that caused me to jump into development here. I had really wanted to avoid getting into the whole DOM/javascript thing because I figured it was going to be a nightmare.
The bottom line is - I agree with most points you make
It's good to hear that someone does. ![]()
and I will certainly have a look at your code once I find some time. But I still think the everyone would benefit if you and Gogo could find a way to join projects. Community is small enough as it is. But if the goals are that different then i guess there is no choice.
My big problem is I need a very particular setup for Xinha in order for it to work with my formVista business component framework. That's the motivation behind the unified backend. Prior to that I was endlessly trying to reintegrate versions of the editor. Then there are all these nasty bugs.
I still don't understand how this kind of development can be done using a debugger. The trace setup I've built has uncovered so many bugs and frightening memory leaks it's not funny. Without a trace architectures there's no way to see how it all fits together. My $0.02 worth.
So yea, I'm forking it. As opposed to just having a private fork, I figure I'll put it up in case it might be of use to anyone else. (I've registered AreaEdit.com for this purpose).
I'll probably do one more commit to the unified backend branch of Xinha to include my fixes to EnterParagraphs (which now mostly works including breaking out of list items on double enter).
Yes thats what I would have thought, but the selection object for Gecko isn't documented, so it would probably be a matter of experimentation to get it working.
If letting it drop through to the browser works, whats wrong with that?
Dunno. Seems to work but I'm still new to all of this client side DOM javascript stuff. It seems to me to be a domain of unanticipated consequences so I figured I'd ask. ![]()
I think I've pretty much figured EnterParagraphs out. It's taken quite a while. Have you looked at that code? If they have an obfuscated Javascript contest I think we should submit it.
It doesn't handle any of the terminal conditions correctly (beginning/end of document, <a> section, <li>, etc. Erroneously generates a false (in getNodeUnder() on _fenEmptySet()) on empty text nodes and causes the left (or right) side range to get duplicated which is why you get those empty <a ..> etc at the end of documents. The coding style is so terribly indirect it's hell trying to figure out what the original author was thinking.
I was on the verge of giving up on it when I made a few breakthroughs. If it continues to go well I should have something to show later this week which also implements the styled <p> tag solution we were discussing a while ago. Getting the same thing to work for MSIE however is going to be cheap trick (put off until later).
You won't like my style and trace messages (of course), but I figure it'll be pretty easy to rip out tracing and tweak it for whatever style you'd like. It should be an improvement over what's there ...
Taken from dom_checkInsertP this should help
[code] var sel = this._getSelection();
sel.removeAllRanges();
sel.collapse(newblock,0);[/code]
that would put the cursor at offset 0 inside newblock (which is just a dom element).
Hmmm. That doesn't seem to be working for me. I'm guessing if you've got:
[code]<ul>
<li><br>
<li>
</ul>
[code]
You would tack on a new block as a nextSibling to <ul> and then collapse to that block as in something like:
[code]
<ul>
<li><br>
</li>
<p> </p>[/code]
(I haven't gotten this to work yet). I'm guessing you would have to handle this particular case separately (i.e. an empty list should probably disappear when you hit enter on an empty node .. which is what the built-in handler does ...)
What I've got working here is detecting that I'm on an empty last <li> tag and just returning without calling stopEvent to let the browser handle it ... seems to work but it's a little unclean IMHO.
I just wanted to see if anyone knows of a way to get out of a list programmatically in FireFox?
If you set config.mozParaHandler to "built-in", which passes the ENTER key onto the internal handler, FireFox correctly "gets out of" ordered and unordered lists on double enter. I presume it's a feature of the in-browser ENTER key handler.
However if you select dirty or best for mozParaHandler, the ENTER behavior is intercepted by dom_checkInsertP() or the EnterParagraphs plugin respectively.
Right now it looks like the only way to to "get out of" the list is to let FireFox process the ENTER keypress internally (i.e. by not calling _stopEvent() and letting firefox do it's thing).
Aside from letting the event propagate into the browser, is there any programmatic way to force your way out of a list? (you'll notice that you can't get out of the list by hitting ENTER twice. You have to select the list icon again which passes the command directly to the browser execCommand.)
thanks,
-- Yermo
What are the problems with HTMLArea.prototype.dom_checkInsertP()?
Why is it considered a worse alternative to EnterParagraphs?
Cool. Thanks.
So I'm fighting with EnterParagraphs. What a mess. There's some issue with range selection in terminal cases that I don't understand yet. (beginning and end of document and/or container tags ... to demonstrate clear the text out of the editor, enter the word "test", link it to something, put the cursor at the end of the now linked "test". press enter. View the source. View the horror.)
What are the problems with HTMLArea.prototype.dom_checkInsertP()?
Why is it considered a worse alternative to EnterParagraphs?
I am on this page http://www.formvista.com/uploaded_html/ … ample.html
Default and once changing plugins has the same effect.
IE 6 SP1 on XP.
error:
line: 125
char: 2
error: invalid argument
code 0
url: ... fullexample-body.php?num=1it loads the textarea with the data but doesnt convert it to xinha
Cool. I'll check it out and fix it. It'll take me a little bit because I want to finish up the EnterParagraphs stuff first.
thanks,
-- Yermo
I tested it today in IE without luck thats why I was asking. Glad to know you will take a look after you fix the much needed bad enterparagraphs
Did you download from CVS or try the sample install I have up on formvista.com?
Are you trying to run the simple_sample (it's broken right now). If so, try the full_example with just a few plugins and let me know if that works for you.
What version of IE? What OS?
Do you have script debugging installed? Any error messages to report?
thanks,
-- Yermo
<p> </p> would be the traditional way of inserting a "blank line" I think, at least around these parts, pretty sure this is what DW produces if you hit enter a bunch of times. I think that's what you are asking?
Actually, no. Do this, enter
test
on the first line of an empty document in the editor.
Press enter.
Now when you view the source you will see
<p>test</p><p>
</p>
That's clearly not correct as it should be:
<p>test</p>
In EnterParagraphs what looks like the original code would make it be:
<p>test</p><br>
but the <br> is stripped out the getHTMLWrapper.
So the questions is what should the terminal tag in a document be? (i.e. in the case of entering test by itself in a window and pressing ENTER what should the resulting HTML look like? <p>test</p>? <p>test</p><br>? something else? )
I saw one editor that always kept some tags at the very end of the document but I forget what they were .. seemed to be related to making it possible to get out of selections ...
In the nightly example build clear out all the text and html. Type in the word test and press enter. Switch to source view and you will notice:
<p>test</p><p>
</p>The second <p></p> is being generated because, under FireFox, there is a blank text node to the right of the selection which is incorrectly being wrapped in <p> tags in EnterParagraphs.prototype.processRng at the very bottom in the fragment:
roam = (pWrap || (cnt.nodeType == 11 && !cnt.firstChild)) ? editor._doc.createElement('p') : editor._doc.createDocumentFragment();
roam.appendChild(cnt);Above this snippet is a section that creates a "fill" container that has a <br> tag inserted if the range happens to be "content-less", per the comment. However, that section is completely ignored.
So, adding a simple if ahead of the code fragment above as in:
if ( fill )
roam = fill;
else
{
roam = (pWrap || (cnt.nodeType == 11 && !cnt.firstChild)) ? editor._doc.createElement('p') :
editor._doc.createDocumentFragment();
roam.appendChild(cnt);
}Gets rid of the double <p> tags on end condition (in this one case - there are unfortunately many more).
So now, at this point in the code when you repeat the test above, you have a document that looks like
ELEMENT_NODE - tag 'BODY' - 4 children
ELEMENT_NODE - tag 'P' - 1 children
TEXT_NODE contents 'test' - 0 children
TEXT_NODE contents '' - 0 children
TEXT_NODE contents ' ' - 0 children
ELEMENT_NODE - tag 'BR' - 0 children
(i.e. <p>test</p>(empty node)(empty node)<br>)However, when you switch to source view the trailing <br> is stripped out as a result of a long series of calls that eventually wind down to HTMLArea.getHTMLWrapper() where it does:
case 1: // Node.ELEMENT_NODE
case 11: // Node.DOCUMENT_FRAGMENT_NODE
case 9: // Node.DOCUMENT_NODE
{
var closed;
var i;
var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : '';
if (root_tag == 'br' && !root.nextSibling)
break;
^^^^^^^^^^^^^^^^^^^^^^^^^
...If you manually enter a <br> and switch to WYSIWYG mode the <br> element is not filtered out. It only happens when you switch from wysiwyg mode to text mode.
Is the ugly trailing <p></p> the desired behavior? That seems unlikely since the <p> tags have a tendency to stack up endlessly. (select the end of "test" and hit enter and repeat a few times then switch to text mode - but you can't select down into any of the subsequent <p> tags so their use as a blank line in this case is somewhat limited)
I've seen another editor which keeps some trailing tags at the end of the document presumably to make it easier to "get out of" selections and the like but I can't remember what the tags were.
So the question is:
What's the "right" behavior?
Should EnterParagraphs do something different on empty right hand side node other than a <br> (i.e. enter at the end of the document?)? (i.e. <p>test</p><br>)
Should it be something like <p>test</p><p> </p>?
Or just nothing (i.e. <p>test</p>)?
Any thoughts or insights would be greatly appreciated.
Thanks,
-- Yermo
does your fork work in ie?
yea. I haven't changed much with regard to the actual client side functioning of Xinha. I haven't tested IE support in a while but will get to that once I finish up fixing EnterParagraphs, which I'm working on now.
Its inpractical to have two branches where different updates are done, but aslong as we get the same updates in both branches we should be more than ok. What we need is the branches keeping track of eachother, so that we can keep track. Tracking down changes and such shouldnt be to complicated by comparing the files with WinMerge, unless as stated the coding style has changed above whitespace differences which would require some code reformatting before WinMerging.
Well, problem is htmlarea.js, if you look at it, has all kinds of jumbled definitions:
HTMLArea.xyz ..
HTMLArea.Config ..
HTMLArea.someconstant=xx
HTMLArea.prototype.xx =
Everything was all jumbled. So I reorganized the file completely.
All HTML area "constants" and regex's at the top.
All HTMLArea.Config() related method are now grouped together, as are all HTMLArea.xyz methods and all prototypes.
Net result, diff's aren't going to work too well. ![]()
Other than adding lots and lots of trace messages all over the place, I haven't made many functional changes. I've fixed a few bugs (most notably endless loop plugin loading) and added a few tweaks to Linker.
Aside from that most of the work has been in source management scripts that make my life easier. A front end to svn commit that updates the About box with the correct revision info. A preprocessor, that I agree with wreak havoc on SVN, that patches in file and line numbers into all the debugging messages. Also, there is a server side Configure script for the PHP backend. Soon there's going to be a "build_runtime.php" script that generates "clean" code with all the comments and trace messages removed.
At this point I think I'm going to fork it to focus on the things that I need. It'll be publically available so you can pick and choose any improvements to move over to Xinha. In addition I will endeavor to patch in any bugfixes or easy to move over improvements into Xinha, time permitting.
From what I've read so far, I'm kind of in the middle. One the one hand I agree with the fact that the Xinha Core should be completely independent and optimized for useage without any backend system.
Actually, I agree as well. Unfortunately to be useful for most projects as you've mentioned, some kind of backend support would be needed.
To be honest, aside from the fact that gogo and yermo have different view on some aspects, I don't see why there isn't a solution that satisfies both parties without making any compromises on the actual product itself.
In projects like this, disparate development styles can have a really detrimental effect I think. I can completely understand why someone might not want to work on "Yermofied" code. I have my own approach to projects like these that, unfortunately, seems not be to too many people's liking. If I had more time and wasn't running my own company, I'd be more willing to work in the confines of someone else's style, but I have to get this stuff done on a timetable that doesn't really afford me that luxury.
My coding philosophy is one of "software lasts" so I build it to optimize for maintenance and getting other people up to speed on it. It should be as easy to understand as humanly possible.
1. experience level of the person maintaining the code. i.e. the code should be functional but approachable by the "lowest cost" person possible (i.e. beginners).
2. when problems arise the code should be set up for "quick response" in fixing them. That's why I like trace messages vs. using a debugger. Granted it's verbose but it allows me to see what's wrong very quickly in the given context. It also allows me to hand the code off to someone who's never seen it before and they can come up to speed very quickly.
3. I like seeing things line up with regard to indenting. It's just the way I'm used to writing code and for me allows me to avoid errors and quickly see what's happening.
4. keep the coding style as close to "kindergarten" as possible. Again, for making it easy to understand. I tend to be very verbose and don't take even generally accepted shortcuts.
As you can see in comparison to the above, I consider performance , code size, svn issues, etc. to be secondary to the above. I guess this comes from the number of codebases I manage .. some of which are operational but haven't been modified in 5 years. In that context I end up approaching my own code as a beginner and without all this extra "stuff" it's very difficult to remember what I was doing at the time when some customer is screaming bloody murder and I have to respond as quickly as possible.
I think from all threads I've read it has become pretty clear that Xinha in its current form is a mess coding-wise,
which is mainly an inheritance of InteractiveTools.com,
You aint' kidding. The code that James (gogo) has written is some really good work and he's done alot to improve the codebase but it's still got a long way to go.
and in order to be able to grow it needs to be (partly) rewritten. Why not take yermo's changes (even though you don't like the coding style, it still does the same thing, yermo already indicated that optimizations are at hand), commit them to the current trunk and work from there? It has been mentioned many times that Xinha needs to be changed in order to better support plugins of ANY type, not just the unified backend.
I have a feeling my style is probably incompatible. If you have a chance, please check out the unified_backend branch and see what you think about what I've done. (tabstops set to 2)
Understand it's a work in progress, but I would be very interested to see if your reaction is more positive or negative vs. what the other voices have expressed.
But hey, that's just my opinion and it's late too, so I might change some things tomorrow, and I do really appreciate your efforts yermo, since I personally make use of PHP as well for file uploading and some other custom hacks for my CMS, keep it up!!
I appreciate you saying that.
At present, I've registered a few domains and am planning on creating a fork. I will however endeavor to submit patches to Xinha for things that are easy to move over. (e.g. the EnterParagraphs work I'm about to start).
Maybe, once the ideas I have for this codebase are better fleshed out we may merge projects back together; then again we may diverge completely.
i agree gogo on almost everything he wrote.
- i worked allready in php with debug-trace-messages... imo a real debugger is much, much comfortabler (and venkman is very nice (although kind of slow sometimes))
- personally i don't like the configure-script
- personally i don't like a commit-script - although it would really not be a problem for me using it
I couldn't find a way to get the about box version to come out right. If you have any suggestions I'm all ears.
- not everybody is using linux and commandline (yes, really *g*)
- with windows the installation will be complicated (windoof-users expect a graphical installer - not a commandline-script)
Agreed. I've considered creating a windows like installer for another PHP project I've been working on.
- the commit-script won't work with TortoiseSVN
- coding style is often a big problem, but changing a complete application to my own favour - is this really necessary?
For me it was. I had virtually no dhtml experience when I started working on this. I was endlessly getting tripped up on the function() parameter calls, some of which a dozens of lines long .. so to make it easier on me, and to have a chance to look at each line of the code I reformatted it into my style, weird it may be. I just can't stand the bsd style.
- the ddtpreproc.php does not really work in conbination with subversion
Can't argue with you there. It will create spurious changes.
i said in my first post "please no fork"... now i'm not so sure.
1. yermo won't come back to the trunk
2. gogo won't switch to yermo's branch
...so we have a fork
Yea, it looks that way.
but we should still work together:
- yermo can examine every commit to the trunk and decide if it is a important bugfix
- gogo (and the others...) can examine every commit to the branch (although for that it would be necessary to make only small commits!)
I could make it easy on you and just apply whatever bugfixes I make to the trunk according to the recommended coding style. Might be the best of both worlds.
I tend not to do well with the small commit thing. I tend to work on large pieces of code at once until I get something working, then I commit. I guess it shows that I've been "coding on my own" for a bit too long. Despite the fact that I've been coding for decades, I've been lead on every project I've been involved with. This is actually the first time I've ever tried to submit work to an existing community open source project, which is why I was concerned about coding style and approach.
So I guess the consensus is for me to run it as a fork. I haven't decided yet whether to keep it here as a branch or just manage it on one of my sites which may be easier for me. Either way I will continue to provide bug fixes and patches to the Xinha project.
Thanks for taking the time to look at my hack and slash work. The feedback is very useful and I do sincerely appreciate it.
I'm not keen on the idea of the Xinha source requiring anything other than javascript, I'm also not keen on it requiring preprocessing prior to use - the reason for this is because I like to be able to just svn update to a specific revision in my production systems.
I can understand that.
As for using these messages to "get aquainted" with the code, I dunno, maybe it's just me but I find when I'm inheriting code that it's easy enough to simply read it provided it's nicly formatted (getting code without linebreaks is an entirely different thing), tackling changes one bit at a time you soon get to know how the system works.
I've never had much luck with that approach.
As far as the unified backend goes, well, I'm in two minds - yes it's a good idea and it could be useful in some cases, but there are some problems with yermo's PHP code{1} and I don't think it addresses a method of centrally configuring the backends - which really is what I think the main advantages of "unification" would be.
Yea, work in progress. There's some ugliness there that I would, of course, clean up.
I'm not a fan of the coding style that yermo has used (particularly the brace style and the fact that he is indenting the braces, and the content of the braces to the same indent level, which is rather peculiar) and should this branch be adopted, as we don't have good history on the changes anyway, I would be changing that back to BSD style, sorry yermo, but your style is just plain weird - I've never seen anybody else do that.
Yea, that's kind of what I was concerned about. My coding style is somewhat my own.
Yermo's version also requires "configuring" per install, this is done (from INSTALL.txt) by
To set up the software to run please run Configure.php with the full path
to your command line PHP interpreter as in:/usr/local/bin/php Configure.php
which means that in it's current incarnation yermo's branch is unusable (although you could do it manually) for the implementor developer putting Xinha to use if you don't at least have a PHP interpreter, even if you won't use any php plugins.
Actually, on that front I wasn't clear. The idea is that each backend needs to be configured before use. If you're not using the PHP backend then you would not need to run the PHP configure script. The idea is that each backend would have it's own configure script to set things up.
It seems that the only thing that the configure script really does is insert some paths to the php backend - but you can trivially figure out what the URL and path to the backend is using PHP on the fly, so why bother?
Unless you're pulling it in some framework where it doesn't know what the URL is.
Aside from the code, yermo and I have differing opinions on development models, I want many developers so things can proceed rapidly at the expense of some stability, yermo wants few developers so things can remain as stable as possible at the expense of some development.
yea. that's the biggest difference I see.
To cut to the chase, I don't think that yermo is going to be happy to turn development of his branch over to the rest of us, he wants tight control over it;
Actually I don't want to pull an Interactive Tools. Not tight control. I am entirely open to working with you guys on this. It's true that I need to focus on a stability.
So what I think we should do is..
1. We incorporate the idea of the unified backend (but minus the extra cruft of the debugging messages and such - KISS should be at work here), plugins can be moved to the unified backend gradually there is no hurry provided the unified backend doesn't get in the way of regular operation.
2. We do a bit of a copy & paste job on the function header comments that yermo has written inserting them into the appropriate places in the trunk.
3. Any re-organisation that yermo has done that has significant merit can be incorporated - unfortunatly this will be tricky because of the coarse grained commits yermo has done. Only truely useful reorganisation should be considered and committed in small increments.
4. Any bugs that yermo has fixed should be similarly patched into the trunk - again tricky because of yermo's large commits
I can always patch them in in small commits adhering to the coding style recommentations.
Yermo can maintain his branch in whatever way he wants, it would be nice to see that maintained publically as a parallel branch but divergent branch of Xinha but of course that's up to him - wether he forks, publically branches, or privately branches it's all the same to me.
Cool.
{1} for example require_once('../../backends/backend_conf.php'); would be problematic - one should use require_once(dirname(__FILE__) . '/../../backends/backend_conf.php'); to be reliable across installations,
The backend assumes cwd of the plugin directory so the relative directory references work. But you're right, it's a bit ugly. There are a number of things that need to be cleaned up. Like I said, work in progress. Just looking for feedback.
yermo's use of $formVars is a bit odd (particularly how he builds this from $_POST or $_GET - why not just use $_REQUEST ?)
Old habit.
i will look at your code tomorrow.
imho gogo should make such desicions - as he is the leader of xinha....
ofcourse he shouldn't ignore our voices
yea, I talked to him before I posted about it. He doesn't have any objections to me forking it.
I think he wants to keep Xinha completely independent of backend language (i.e. no source management scripts and the like). That's a philosophical difference from the way I need to do things for my application.
Let me know what you think about my branch. It's not "finished" but it should give you a good idea of what I've been up to.
-- Yermo
please NO fork!!!
Please see the other post I just made.
I've got specific needs.
i do of course understand merging your changes into the trunk (or the other way around however you like to call it) is a very, very hard and time-consuming job.
Actually, merging the trunk changes into the branch would not be all that hard. The real question is would you folks be interested in working with a codebase that's set up the way I've set it up the branch?
If you guys don't mind working with what I've built, I would be entirely open to continuing here and not create a fork. My problem is I've got to get out of the mode of having to patch up Xinha to fit it into my framework. Every time I try to integrate a new version it takes me literally two days of mods. That was getting really old which is why I started this work in the first place.
you (or me or others) might have to look through every commit that was done since your branching.
I would be more than happy to do that work myself rather than bother anyone else with it.
Please take a look at the other message I posted and take a look at the unfiied backend branch to see what I've been up to. I don't think this is a decision that can be easily made without looking at my approach. I tend to do things a little bit differently than most (something I'm a bit concerned about becuase I don't want to force my approach on anyone .. but I do have certain specific needs that have to be met for the codebase to be useful for me)
but imho it's worth it!
1. your debugging-messages should help improving xinha - not only your fork
2. better code organisation and more comments are important for xinha too
3. imho the unified-backend is not that important, but still its a good concept
The unified backend should make it childsplay to have multiple separate backends in different languages. it essentially abstracts out the backend so we could have identical (no-reconfiguration-necessary) front end code supporting PHP, Perl, Python, ASP, etc. on the backend.
4. why php only? you (and me too) will use (and code for) the php-backend only - if others would like to use whatever-language why shouldn't they be allowed to do so? (of course they will have to rewrite the php-files...)
See the other post. The actualy backend functionality can be any language. It's more an issue of source code management scripts. To support my work, I've had to re-create a development environment (a primitive one) that does various things to the source .. configure it, generate debug file name and line numbers, pre-process "svn commit" and soon I'll include a "generate a runtime version of the code".
So in a nutshell, to /use/ Xinha in a project you don't need PHP. To work on the Xinha codebase, you do need both PHP and Perl.
please no fork
This would mean we'd have to adopt my branch as the trunk and change the way you do development.
-- Yermo
IMHO creating a fork is not a good idea. If you do that you also split developers and users in two - which slows down development considerably (on both ends, not just for Xinha).
It would probably be better if the PHP backend was developed in such way that it would still be independent of Xinha itself.
Actually as far as functionality goes, that's certainly the case right now. If anything the unified backend approach makes the client side code /more/ independent, not less.
The problem I have that makes a backend-less-version useless for me is there is no way to do any kind of configuration on the server side. Additionally, since Javascript has no __FILE__ and __LINE__ variables, I had to write a preprocessor to patch in all the file and line numbers into the debug messages.
Beyond that, the auto-generated documentation script requires both PHP and Perl command line interpreters to run.
IMHO the changes in your version should be incorporated in original Xinha (or the original Xinha should be altogether replaced by your version - whichever gives better and more maintainable code)
Please take a look at what I've done with the unified backend if you would. I've /completely/ hacked it up. Reorganized everything. (You'll want to set tabstops to 2 when looking at it.) Add bunches of files. Add a devutils directory. Basically I've changed the flavor of it pretty extensively.
At this point my branch allows me to see what's going on pretty easily. I'd say I'm pretty well up to speed on the codebase and moving forward it would be a much more manageable branch than the trunk. (IMHO the trunk is unmaintainable).
while PHP backend should be a sub-project of Xinha. I think such "official" PHP backend is a good idea - but someone else might prefer Python, Ruby or Perl backend.
Agreed and that's how it's set up now.
The real issue is what do we do in terms of an "official" development environment language? To work on the unified backend branch and make patches you must have a command line PHP installed. (there is a devutils directory that has an "svn commit" wrapper, another that processes debug messages and a soon-to-be-implemented script that generates a "runtime" version of Xinha with all debug trace messages and comments stripped.) The idea is you work on the debug version and "generate" a runtime when you're done.
Even if you were working on a python backend you would still need a PHP interpreter to work with the source. (Unless you wanted to rewrite all the source management scripts in Python, which seems silly).
I agree that original Xinha code is very difficult to understand - I have quite some experience in programming (although not in JS) and I had huge problems understanding how Xinha works. Too much legacy I suppose.
Yea, me too. Be developing since age 8. (I'm 37 now) I had a hell of a time figuring out how everything worked which is why I put in the hours to try to make it more manageable. I've never had much luck with debuggers when coming up to speed on a new codebase so I do the tracemessage infrastructure thing .. every piece of code I write always includes one. I've never understood how projects manage without one.
So yes, adding coments, verbose (and precise) error messages and debugging info is a very good idea. But another fork - please don't.
Just my 0.02 EUR.
Worth alot more these days than $0.02usd. ![]()
For my purposes, without a unified backend Xinha is worthless to me. Without trace messages and the work I've done it becomes unmaintainable for me. I've put dozens of hours into this that I don't want to lose them. The reason I decided to submit the unified backend branch was I got tired of endlessly having to patch in changes to make HTMLArea/Xinha work with my (soon to be released) formVista framework.
At this point is would be /much/ easier to merge the Xinha trunk changes into the unified backend branch. Please take a look at the branch and let me know what you think. It's not "finished" yet, but I think you need to see what I've been up to to see if you like the approach.
I'm not hell bent on forking it; actually I'd rather not. But I have specific needs that are going to be different than the general community. I don't know how to reconcile that difference.
thanks,
-- Yermo