You are not logged in.
(ref: Unified Backend post http://xinha.gogo.co.nz/punbb/viewtopic.php?id=205)
As mentioned elsewhere, I've been working on a "unified backend" branch to the Xinha codebase whose central goal is to route all client to server backend requests through a single entry point. The initial backend uses PHP but others could be added.
The unified_backend branch has now diverged quite a bit from the Xinha trunk. The biggest differences between the trunk and my branch are:
. the code has been reorganized and heavily hacked for formatting, comments and error messages.
. a debugging trace infrastructure has been added making tracking down problems much easier.
. the unified backend has been added and ImageManager and Linker have been hacked to use it.
. a set of server side scripts to help manage the code have been added (currently PHP and Perl).
Turn off popup blockers and you can take a look at the current development snapshot of the unified backend branch at:
http://www.formvista.com/uploaded_html/ … index.html
If you want to look at the code itself you can point your subversion client to:
svn co http://svn.xinha.python-hosting.com/bra … ed_backend xinha_ub
Because the changes are so large and the trunk and my branch are so out of sync, I'm am strongly considering forking off my branch into a separately maintained distribution possibly under another name.
I've discussed it with James (Gogo) and he doesn't have any objections. He'd like to keep Xinha backend-implementation agnostic where I'd like to move towards a more php-backend integrated approach. He suggested I post a message here to see if anyone had any thoughts.
Thanks,
-- Yermo
As some of you know, I've been working on a "unified backend" branch to the Xinha codebase whose central goal is to route all client to server backend requests through a single entry point.
When I started this effort several weeks ago I was not very up to speed on the codebase or client side javascript/dhtml development. To make my life easier I started by reorganizing all the code, adding comment headers and extensive trace and error messages.
Turn off popup blockers and you can take a look at the current development snapshot of the unified backend branch at:
http://www.formvista.com/uploaded_html/ … index.html
If you want to look at the code itself you can point your subversion client to:
svn co http://svn.xinha.python-hosting.com/bra … ed_backend xinha_ub
PLEASE DO NOT SUBMIT CHANGES TO THIS BRANCH. SEND ME PATCHES INSTEAD VIA THE FORM AT:
http://www.formvista.com/contact.html
There is a simple client-side-only demo and a modified version of James's full example which lets you pick plugins. In order to use this version you must have a command line PHP interpreter. I've only tested it under Linux and with FireFox. (It's a development snapshot). To generate the documentation you need both command line PHP and Perl 5.8. Again, I've only run this under Linux.
Before running any of the backends you must first run the quick-and-dirty Configure.php script.
See the README_DEVELOPERS.txt file for more info.
Notable changes in this version:
. The Imagemanager and Linker backends now use xinha_ub/examples as their demo directory instead of DOCUMENT_ROOT. Should be less of a security issue.
. ImageManager and Linker now use the unified backend located in xinha_ub/backends/backend.php
. There is a central config file for the backend in xinha_ub/backends/backend_conf.php.in. The corresponding backend_conf.php file is generated by the Configure.php script.
. new config parameter HTMLArea.Config.linkReplacementMode which can be set to absolute or fullyqualfied. This is used by outwardHtml() to determine how links should be rewritten. The Xinha stock behavior was to change everything to http://yoursite/absolute/link making the resulting content unportable. By setting the option to "absolute" links back to the site will be rewritten as /absolute/link.
. Linker plugin now pops up an error message window is the feedback from scan.php doesn't parse. You can also turn on server debugging trace messages in scan.php to see the output.
. loading of plugins/linker callbacks no longer go into an endless loop if there is an error in the plugin javascript files.
. on editing a link Linker will not scroll to and highlight the item being edited (if it's in the tree).
. client side debugging trace messages have been added to Linker and ImageManager (which can be turned off by commenting out the _ddtOn() calls in imagemanager.js and linker.js. These trace messages are making it childs play to see what's going on and where the problems are.
Nothing in the client side design requires that the server backend be written in PHP. The design is such that other backends could be easily plugged in this architecture. For my work, I need a PHP backend so that's what I'm focusing on.
If you have any questions, comments or feedback please either post them here or you can contact me via the form at:
I could have sworn I posted a status update on the forum yesterday, but I may have spaced it.
Anyways, I've committed a bunch of changes to the unified_backend branch. Trace messages are much faster now such that you can use the editor with all trace messages turned on. They now all go to a single popup window. I've added a preprocessing script that patches in file and line numbers into each debugging message so you can see where each message was generated.
I've put up a small demo. Make sure to turn off any popup blockers:
http://www.formvista/uploaded_html/xinh … index.html
Click on the Simple Example. To get an idea of what Xinha does for any given action, you can click the "add separator" link in the trace window and then go do something in Xinha and check the trace window again. It's a nice way to see how event propagate through the code.
I've found it extremely useful in coming up to speed on how all this works.
If you want to look at the code and you have a subversion client you can download it using:
svn co http://svn.xinha.python-hosting.com/bra … ed_backend
If you have write access I would ask that you not post patches directly to the branch. Send them to me instead using:
http://www.formvista.com/contact.html
This branch is now severely out of date with respect to the trunk. Once I finish the work I've got on my plate I'll see about merging in all those changes to bring it up to date.
On my todo list:
- the buildruntime.php script to strip out all the comments and debugging messages to create a "runtime" version of the code.
- actually do the central backend.php script that all plugins will route through (and create placeholders for other backend languages to be used). Initially I'll do Linker and SpellChecker.
- fix up the linker plugin to route all URLs through a central processor so we can avoid having fully qualified links in the content.
- fix EnterParagraphs (big job).
If you have any questions or comments please post them here or contact me using the form above. If you look at this branch I'd be curious to know what you think. My coding style tends to be really simple and verbose .. which may not be to everyone's taste.
thanks,
-- Yermo
Has there been any progress on this issue? Here's a workaround for those who need it.
I find that if I set
p {margin: 0pt}
then the editor behaves like MS Word, but when I reload with the produced html (or use the output elsewhere with the same p style), blank lines are removed.
However, if I take the produced html and replace all occurences of <p /> with <br /> before re-use it works a treat.
I'm getting there.
On my todo list:
1. unify client to server communications (next on list of todos)
2. fix up Linker plugin to go through a central URL rewriter to take care of MSIE vs FireFox issues
3. fix up EnterParagraphs. (big job) which will take care of this issue.
There's still alot of work to be done I'm afraid. I'm guessing another couple of weeks at least.
hi yermo,
please keep in mind that one day we should merge the trunk and your branch!
how will we do that?
I'm beginning to wonder that myself. ![]()
did you have a look at http://xinha.gogo.co.nz/punbb/viewtopic.php?id=163 ?
and what id your opinion about that?
- where should HTMLArea.InsertImageDialog be defined?
- should the dialog-html-code loaded on generate or when clicking the button?
I haven't gotten that far yet. I'm still getting a handle on how everything fits together.
I have, however, made some radical improvements to the trace system which now means my branch is useable even with all the trace messages turned on. (The version in SVN right now is ridiculously slow).
In addition, I've added a preprocessor that patches in file and line numbers to all debugging trace messages. It's making it wicked easy to see how everything works ... interestingly the full_example.html has a bug, it's generating everything twice since xinha_init is being called on body.onLoad and once on window.onLoad. ![]()
Actually, from the trace messages one can immediately see where Xinha is doing a tremendous amount of repetitive processing.
I've got some more hacking to do and then I'll do another commit. For anyone trying to come up to speed on how Xinha works the next commit of the unified backend branch might be a much better place to start.
For a taste of what a partial startup trace of a single Xinha editor with the Stylist and ContentMenu plugins looks like (I haven't changed the order of how anything is called ... but the line numbers in my branch don't match the trunk at all since I've moved everything around) - something to note, see how loadPlugins() keeps cloning the plugins array as it recurses? .... :
(startup) htmlarea.js:828 - loadScript(): Top with url 'http://formvista.yml.com/TESTS/xinha_ub/dialog.js' and plugin 'undefined'
(startup) htmlarea.js:828 - loadScript(): Top with url 'http://formvista.yml.com/TESTS/xinha_ub/inline-dialog.js' and plugin 'undefined'
(startup) htmlarea.js:828 - loadScript(): Top with url 'http://formvista.yml.com/TESTS/xinha_ub/popupwin.js' and plugin 'undefined'
(startup) htmlarea.js:1263 - loadStyle(): top with style 'htmlarea.css' and plugin 'undefined'
(startup) htmlarea.js:1281 - loadStyle(): appending 'http://formvista.yml.com/TESTS/xinha_ub/htmlarea.css' to document
(startup) htmlarea.js:872 - init(): top
(startup) htmlarea.js:937 - init(): calling first loadNextScript()
(startup) htmlarea.js:916 - loadNextScript(): loading 'http://formvista.yml.com/TESTS/xinha_ub/dialog.js'
(startup) htmlarea.js:916 - loadNextScript(): loading 'http://formvista.yml.com/TESTS/xinha_ub/inline-dialog.js'
(startup) simple_example.html:71 - Setting up xinha_init()
(startup) htmlarea.js:916 - loadNextScript(): loading 'http://formvista.yml.com/TESTS/xinha_ub/popupwin.js'
(startup) htmlarea.js:927 - loadNextScript(): end of list reached. Firing HTMLAreaonLoad handler which is 'undefined'
(startup) simple_example.html:76 - xinha_init called from window.onload handler for simple_example.html
(startup) simple_example.html:92 - calling HTMLArea.loadplugins()
(startup) htmlarea.js:1160 - loadPlugins(): top - cloning plugins array.
(startup) htmlarea.js:1342 - cloneObject(): top
(startup) htmlarea.js:1353 - cloneObject(): contructing an array object.
(startup) htmlarea.js:1369 - cloneObject(): copying object members.
(startup) htmlarea.js:1101 - loadPlugin(): loading plugin 'Stylist'
(startup) htmlarea.js:1132 - loadPlugin(): callback defined. Using _loadback() to load plugin
(startup) htmlarea.js:1790 - _loadback(): top with src 'http://formvista.yml.com/TESTS/xinha_ub/plugins/Stylist/stylist.js'
(startup) htmlarea.js:1812 - _loadback(): script tag to load javascript file appended to head section.
(startup) htmlarea.js:1221 - loadPlugins(): end
(startup) htmlarea.js:1160 - loadPlugins(): top - cloning plugins array.
(startup) htmlarea.js:1342 - cloneObject(): top
(startup) htmlarea.js:1353 - cloneObject(): contructing an array object.
(startup) htmlarea.js:1369 - cloneObject(): copying object members.
(startup) htmlarea.js:1101 - loadPlugin(): loading plugin 'ContextMenu'
(startup) htmlarea.js:1132 - loadPlugin(): callback defined. Using _loadback() to load plugin
(startup) htmlarea.js:1790 - _loadback(): top with src 'http://formvista.yml.com/TESTS/xinha_ub/plugins/ContextMenu/context-menu.js'
(startup) htmlarea.js:1812 - _loadback(): script tag to load javascript file appended to head section.
(startup) htmlarea.js:1221 - loadPlugins(): end
(startup) htmlarea.js:1263 - loadStyle(): top with style 'menu.css' and plugin 'ContextMenu'
(startup) htmlarea.js:1281 - loadStyle(): appending 'http://formvista.yml.com/TESTS/xinha_ub/plugins/ContextMenu/menu.css' to document
(startup) htmlarea.js:1160 - loadPlugins(): top - cloning plugins array.
(startup) htmlarea.js:1342 - cloneObject(): top
(startup) htmlarea.js:1353 - cloneObject(): contructing an array object.
(startup) htmlarea.js:1369 - cloneObject(): copying object members.
(startup) htmlarea.js:1192 - loadPlugins(): no plugins left to load
(startup) simple_example.html:76 - xinha_init called from window.onload handler for simple_example.html
(startup) simple_example.html:92 - calling HTMLArea.loadplugins()
(startup) htmlarea.js:1160 - loadPlugins(): top - cloning plugins array.
(startup) htmlarea.js:1342 - cloneObject(): top
(startup) htmlarea.js:1353 - cloneObject(): contructing an array object.
(startup) htmlarea.js:1369 - cloneObject(): copying object members.
(startup) htmlarea.js:1177 - loadPlugins(): plugin 'Stylist' was already loaded
(startup) htmlarea.js:1177 - loadPlugins(): plugin 'ContextMenu' was already loaded
(startup) htmlarea.js:1192 - loadPlugins(): no plugins left to loadIn HTMLArea.prototype._editorEvent(ev) I'm noticing that FireFox under Linux is generating an ev.keyCode value of 18 on an expose event (e.g. when you bring up the Javascript console over the Xinha window and then lower it again)
Is there a list of what the various keyCode values might be? I'm guessing this is not an ASCII 18.
I've included a crazy number of trace messages to get a handle on how Xinha works. (this is from my xinha_ub branch which I'm going to committing the latest version of shortly) .. sorry but the line numbers in my branch don't match the line numbers in the trunk at all anymore.
On expose (i.e. no key click in Xinha anywhere, just exposing the window) I'm getting the following (two events a keydown and a keypress:):
HTMLArea.prototype._editorEvent():
(TextArea1) htmlarea.js:5967 - _editorEvent(): top with event type 'keydown'
(TextArea1) htmlarea.js:6382 - _editorEvent(): bottom
(TextArea1) htmlarea.js:5967 - _editorEvent(): top with event type 'keypress'
(TextArea1) htmlarea.js:5992 - _editorEvent(): keyEvent
(TextArea1) htmlarea.js:6010 - _editorEvent(): keyEvent - invoking onKeyPress method in plugin 'EnterParagraphs'and this is at the default: case of switch(ev.which)
(TextArea1) htmlarea.js:6263 - _editorEvent(): ev.keyCode is '18' which (normal key) is '0'It then invokes alot of other code that doesn't seem necessary:
(TextArea1) htmlarea.js:6382 - _editorEvent(): bottom
(TextArea1) htmlarea.js:4488 - updateToolbar(): top
(TextArea1) htmlarea.js:4959 - getAllAncestors(): top
(TextArea1) htmlarea.js:4892 - getParentElement(): top
(TextArea1) htmlarea.js:7082 - _createRange(): top
(TextArea1) htmlarea.js:3816 - activateEditor(): top - called by ' function (sel) { this.ddt._ddt("htmlarea.js", "7082", "_createRange(): top"); if (HTMLArea.'
(TextArea1) htmlarea.js:3842 - activateEditor(): Setting contentEditable to true
(TextArea1) htmlarea.js:3849 - activateEditor(): end
(startup) htmlarea.js:1718 - _lc: top with string 'Path'
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(TextArea1) htmlarea.js:4985 - _getFirstAncestor(): top
(TextArea1) htmlarea.js:5040 - _activeElement(): top
(TextArea1) htmlarea.js:5117 - _selectionEmpty(): top
(TextArea1) htmlarea.js:5141 - _selectionEmpty(): isCollapsed
(TextArea1) htmlarea.js:5046 - _activeElement(): _selectionEmpty returned true. Returning null
(TextArea1) htmlarea.js:7082 - _createRange(): top
(TextArea1) htmlarea.js:3816 - activateEditor(): top - called by ' function (sel) { this.ddt._ddt("htmlarea.js", "7082", "_createRange(): top"); if (HTMLArea.'
(TextArea1) htmlarea.js:3842 - activateEditor(): Setting contentEditable to true
(TextArea1) htmlarea.js:3849 - activateEditor(): end
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:1907 - _makeColor(): top
(startup) htmlarea.js:1907 - _makeColor(): top
(startup) htmlarea.js:1907 - _makeColor(): top
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(TextArea1) htmlarea.js:4892 - getParentElement(): top
(TextArea1) htmlarea.js:7082 - _createRange(): top
(TextArea1) htmlarea.js:3816 - activateEditor(): top - called by ' function (sel) { this.ddt._ddt("htmlarea.js", "7082", "_createRange(): top"); if (HTMLArea.'
(TextArea1) htmlarea.js:3842 - activateEditor(): Setting contentEditable to true
(TextArea1) htmlarea.js:3849 - activateEditor(): end
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(TextArea1) htmlarea.js:4892 - getParentElement(): top
(TextArea1) htmlarea.js:7082 - _createRange(): top
(TextArea1) htmlarea.js:3816 - activateEditor(): top - called by ' function (sel) { this.ddt._ddt("htmlarea.js", "7082", "_createRange(): top"); if (HTMLArea.'
(TextArea1) htmlarea.js:3842 - activateEditor(): Setting contentEditable to true
(TextArea1) htmlarea.js:3849 - activateEditor(): end
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'active' value 'false"
(startup) htmlarea.js:2723 - setButtonStatus() : top with id 'enabled' value 'true"
(TextArea1) htmlarea.js:4364 - _undoTakeSnapshot(): top
(TextArea1) htmlarea.js:6973 - getInnerHTML(): top
(TextArea1) htmlarea.js:4803 - updateToolbar(): endYeah I would definitely suggest to look at how to break things out in browser specific files now. With Safari 2 coming I know there are going to be plenty of users on it and that alone is going to cause a support headache for all of us.
Will
The codebase seems in pretty bad shape to me. I'm still working through it trying to come up to speed. As I see it, before we undertake a large re-engineering project there are a few things that have to be accomplished:
1. set the code up so that it's maintainable. My approach is to comment everything I can, establish a trace
message architecture and standardize client/server communications. Others may have a different approach
that they would like to see.
2. create a stable release including a core set of plugins that works with MSIE and Gecko as we want it to with
all major bugs and usability problems solved. Top of my list is EnterParagraphs and relative vs. absolute
vs. fully qualified link handling.
3. create documentation to cover the plugin API and general code architecture to make it easier for newbies
like myself to come up to speed.
Once these things are done and we have the codebase under control we'll be in a much better position to break out the browser specific code. From my relatively inexperienced point of view, it seems that doing this might be tricky since there isn't a one-to-one mapping of functionality between all browsers.
In the meantime, I'm making slow progress on the unified backend branch. I'll probably commit another round of changes to it some time next week. At least for me, having trace message everywhere is making it much easier to see how the code works ... unfortunately it does make things painfully slow when all messages are turned on.
Great work Yermo. I dont think anyone will mind at all that you are fixing up the mess of htmlarea.
Thanks.
It appeared to me xinha was just adopted and had not been rewritten for performance or ease of use since htmlarea.
Definitely true. There's a tremendous amount of work to do; after about 9 months of hell work I've got a moments break so I'm working on Xinha fulltime at the moment.
Have you already seen a performance increase in your version?
Will
My focus right now is just making the code easier to work with before I start mucking with changing the client server communications.
However, it is pretty amazing how the performance degrades proportional to the number of plugins that are loaded ... but I think the trace message infrastructure will help alot in determining where optimizations can be made.
I figure it'll be at least another two weeks before I'm "finished" with the first Unified Backend release. In addition to routing everything through a single backend script I'm going to be fixing alot of bugs and improving EnterParagraphs.
Gogo,
I've committed my first round of changes to the Unified Backend branch. Mostly prep work while I come up to speed on the beast.
Being a relative newbie to serious javascript development and especially Xinha internals, I found the code completely unapproachable. From a cold start, it's quite a daunting challenge to figure out how everything fits together and in what order things happen.
htmlarea.js was and is a serious mess. I figure since it's my own experimental branch I can probably get away with hacking it to death without annoying too many people.
I find phpdoc very useful and wanted a JavaScript analogue. I found a tool called JSDoc that does a reasonable job:
So now all methods in htmlarea.js have the beginnings of JavaDoc style headers. To see what the output looks like check out:
http://www.formvista.com/uploaded_html/ … index.html
It's not perfect but it's the best I've been able to find so far. I preserved all the comments that were in the code and where I understood what was going on I added a few of my own.
(FYI: The phpdoc documentation is currently broken).
I've also ported over a debugging trace message class I call _ddt() that has served me extremely well in other large projects. This class allows you to incorporate debugging trace messages into the code and turn the message on and off on an object by object basis. So far I've only added messages to htmlarea.js; but as I work with each plugin I'll be incorporating more trace messages. I am envisioning a debug panel where you can turn debug messages on and off for each plugin but that may be getting a little too fancy.
One DDT object is used for static methods and another DDT object is built for each HTMLArea instance. In the first case trace messages go into a popup window so you can see the entire construction process as it's happening. In the second case text areas are created for the per-object trace messages.
Messages are turned on and off via called to _ddtOn() and _ddtOff(). For convenience I've bound both types of debug trace messages to additional <> buttons on the toolbar. For an example of how this works check out:
http://www.formvista.com/uploaded_html/ … index.html
and click on the simple examples link. (I have the full_example turned off.) I didn't have extra icons lying around so for the moment I just have the <> placeholders. Hover over them to see which is which. You can click on them to bring up the debug window and type into an editor. It's dirt slow but does give an idea of what's going on; invaluable if you're stuck trying to figure out why something is breaking.
I haven't tested in IE, only firefox.
You can also turn on debug messages in the new examples/simple_example.html file if you want to see how things are constructed.
I get the impression some methods are being called far more often than they need to be.
On the todo list is to create a version of a "buildruntime.php" script that will generate a runtime stripped version of the code without comments and trace messages. The general concept is to do development on the trace enabled one and then produce a runtime when one is ready to release a build.
So that I can see what version of the software I'm dealing with I've added an "svn_commit.pl" script that acts as a front end to "svn commit" and increments a counter in popups/about.html. This causes about.html to be out of date for each commit so it will always contain the current rev number, instead of being stuck at feb 19th.
I've also added a makedocs.pl script to generate the documentation. You need perl, php, phpdoc and JSDoc in order for it to work; it's a start at least.
So that users don't have to edit the paths in these scripts I've included a Configure.php script that generates all that for them. I'm also using it to fix up some permissions issues (ImageManager/demo_images). I will probably expand Configure.php quite a bit for setting up backend support.
If you have a chance to look it over, I'd be interested in what you think about the approach. (caveat, the editor I use, CRISP, is blazingly fast but flakes a bit on tab to space conversions so you may see the occassional bracket out of place. I'll fix those as I find them.)
Finally, my coding style and approach is a bit different than most and I understand comletely that all this work may not be adopted into the mainline codebase.
-- Yermo
Generally in this phase of not yet really ready for release you should use and update the nightly every now and then (using subversion, or downloading).
it's just you don't get the commit number in the about box since the about box is not updated, there doesn't seem to be a good way to mark a file to be updated on checkout the way you can, if I remember correctly, with CVS.
Ideally the about box would have the commit time of the version that was checked out and the commit number. That way you can get a sense of how old it is.
Over here, as I was mentioning, I do that using a shell script that wraps svn commit .. but that's not a good solution. i wonder if there's some feature in SVN that i'm missing.
Hi!
Is there any way I can tell which version of Xinha I am using (without using SVN)? On download page there is no info about it and I can't find "ChangeLog" file.
It would be nice to see which bugs get fixed in which versions (so the users know if it is worth upgrading to a newer version or not). I wrote a ticket about this some time ago but...
How do you cope with this? Do you upgrade every day?
Anze
In separate SVN managed projects over here I ended up having to write a shell script to patch in a new version number before the SVN commit to solve this problem.
For Xinha I don't know how Gogo wants to handle it. I'll probably copy over the svn_commit script I have to the Unified Backend branch that I'll be starting shortly; so the version number will be correct in the about box.
Hi Chris, of course any and all contributions of code, in any language are excellent
You should contact yermo on this board, he is working on a new "backend" system for plugins and will probably want some help with the ASP side of things.
Absolutely. Things over here have been extremely busy over the last two weeks, hence my being largely absent. I hope to get started on the unified backend code tomorrow or over the weekend.
2. Parsing XML is slow. eval(javascriptCodeHere) is fast. Whats the point of PHP -> XML -> Javascript instead of just PHP -> Javascript, there is no advantage gained by the XML adbstraction in this case.
I absolutely agree.
What is wrong with just making line breaks <br>'s ? Wouldnt that be a quick fix?
That was my initial opinion as well but got talked out of it by alot of voices. Basically the problem with <br>'s if you're trying to do it "right" is that they are not an enclosing tag. (i.e. there's no start and finish tag). This means you can't apply a style to it so you can't have as much control over it from stylesheets.
Ideally the content written with Xinha should be abstracted in such a way that it's presentation can be adjusted with stylesheets. (consider various monitor widths, handheld devices and the like)
So the "correct' thing is to enclose things in <p> tags.
You can get the <br> behavior under FireFox by setting the this.mozParaHandler in htmlarea.js to 'built-in' instead of 'best'. That's what I'm doing in the iCMS subsystem of my MOBIE monstrosity. It works, but it's far from ideal.
So being a stickler for "right" and realizing I've got no choice but to come up to speed alot more on this client side browser stuff I'm going to jump into EnterParagraphs and rework it to my liking. There's another thread on the subject ..
in the meantime is it possible to display a message above the "Path" status area if you are in ie, that says: "Use Shift+Enter for one line breaks" ?
How do the rest of you handle this? Its very frustrating for me, I can't imagine when we try to let our users on it...
Will
Yea, EnterParagraphs and the whole <p> vs. <br> thing is a real pain. I'm swamped with work at the moment but the next thing on my TODO list is to implement the design gogo and I came up with in where both IE and FF go through EnterParagraphs and we use style sheets for <p> tags to get the correct behavior in all cases.
For my customers, who are using Xinha, this issue has become priority #1.
Hopefully, I'll be able to start on that work next week as part of my upcoming Unified-Backend branch of Xinha.
Is there an unlink button?
Right click, remove link, if you have the ContextMenu plugin enabled.
Any ideas?
You will see this if you are using the Linker plugin and the number of files being sent back is large. In my case I tried sending back a directory structure of about 1000 files (scan.php) .. and got that warning.
Separately I do notice Mozilla/FireFox slows down after a while of running Xinha. It would be cool if the Mozilla folks added the ability to list out the threads that are currently running so one might be able to see what's going on.
My users want to be able to insert a carriage return in the wysiwyg editor (getting the effect as if a <BR/> was inserted.) Right now, when return is pressed, a new paragraph is started. I can go into textmode and tye in a <br/> and it renders correctly in wysisyg but my users are not ready to roll up their sleeves like that. Is there currently a way to insert a <br/> tag?
See the long discussion on the topic at
http://xinha.gogo.co.nz/punbb/viewtopic.php?id=58
You can turn on the "old" style <BR> support by setting
this.mozParaHandler = 'built-in'in htmlarea.js.
There is however an exception bug right now that breaks it from time to time. (last I checked).
Once I have a chance I'm going to go through Enterparagraphs and add the design suggested by gogo on setting style sheets to <p> tags to produce the single Enter produces newline effect. (Unless someone beats me to it.) That's really the most correct way of doing it.
It'll most likely be a couple of weeks before I have a chance to get to it.
plase take a look at this thicket:
http://xinha.gogo.co.nz/cgi-bin/trac.cgi/ticket/67
i wrote allready a little patch, and gogo had a better idea
(a patch for the new version from gogo hasn't been written yet i think)
Yea, my approach was just a quick hack ...
SCENARIO 1:
['/,General']
SCENARIO 2:
['/,General'],[['/,Home'],['/contact.php,Contact Us'],['/staff/,Staff'],['/links/,Links']]Yea, the way this is set up you need to add a directory name so it should be
['General,/',[ 'Home, directory_name', ['Home,/', 'Contact Us,/contact.php', ...I ran into the same problem ..
I hope that made some sense. Basically, instead of a file directory, it is a webpage directory tree. It would be easy to write scan.php to create the needed data, but I am totally lost in the Linker javascript.
Actually, I have this exact functionality working here with an older version of the Linker plugin. The content management portion of the business platform (mobie) we've developed does exactly that.
I've also got the edit case working where if it's a link in the tree it highlights it. I haven't had a chance to make my changes backwards compatible with the default linker which is why I haven't checked it in yet.
It loops through all the files you send back. In my case I'm sending files back as a single string from a modified scan.php as in:
['/,General'],
[
['/,Home'],
['/contact.php,Contact Us'],
['/staff/,Staff'],
['/links/,Links']
]So each string has the name to be displayed in the tree and the value to assign as a single string separated by a comma. It's a major kludge ...
The trick is then in makeNodes(). Each string from your array is an entry in the files[] argument.
Linker.Dialog.prototype.makeNodes = function(files, parent)
{
for(var i = 0; i < files.length; i++)
{
if(typeof files[i] == 'string')
{
// the text to display is separated from the link by a ,
// file_args[0] == string to display
// file_args[1] == string to set in the URL.
var file_args = files[i].split(',');
this.dTree.add(Linker.nxtid++,
parent,
file_args[0].replace(/^.*\//, ''),
'javascript:document.getElementsByName(\'' + this.dialog.id.href + '\')[0].value=unescape(\'' + escape(file_args[1]) + '\');document.getElementsByName(\'' + this.dialog.id.type + '\')[0].click();document.getElementsByName(\'' + this.dialog.id.href + '\')[0].focus();void(0);',
file_args[1]);
}
else
{
// this entry in files is an array, so we recurse.
var file_args = files[i][0].split(',');
var id = this.Dialog_nxtid++;
this.dTree.add(id, parent, file_args[0].replace(/^.*\//, ''), null, file_args[0]);
this.makeNodes(files[i][1], id);
}
}
}Hopefully this will help you get over the hump.
Contact me at http://www.formvista.com/contact.html if you get stuck; I can email you what I have.
-- Yermo
I do not see how/where I can turn off this plugin. Is it possible?
Thanks
in htmlarea.js line 186. Set
this.mozParaHandler = 'built-in';You can also just pass it in as a config option if you don't want to change the default.
Over here we've noticed that the 'built-in' mode has a nasty habit of eating <br>'s when there are more than one in a row ... but that might be due to our local changes. I haven't had a chance to track it down; but EnterParagraphs has problems also.
I have an idea for the logo. It happens that I am in China, and "XIN" here means "NEW", hence "XIN HA" could well be "NEW HTMLArea".
I think that's fantastic! A great play on words.
Personally I like the top one better as well, but to my eye the line descending into the H doesn't look right. It seems to me that the pictograph should be a little higher and maybe proprtionally a bit smaller so there's a nice separation similar to the separation in the bottom one.
Just my $0.02.
I would have to agree with yermo. In our case the whole purpose of using a wysiwyg editor is based on the fact that our users dont understand HTML nor do they understand the difference between a P or BR. Therefor if they hit enter they expect it to work like microsoft word (which would be a BR for us).
So I agree that there should at least be an option or a way to completely switch this.
Will
What we're focusing on now is a way to get the HTML to be "correct" (i.e. <p> blah </p>) but have the appearance to the user be what they expect. i.e. that it looks like a standard line break.
An attempt at a "best of both worlds".
Yermo wrote:Unfortunately, since there is no communication between image-manager.js and config.inc.php, the images_url in config.inc.php will still need to be set by hand if Xinha is not installed under DOCUMENT_ROOT/xinha.
Could you not do something with $PHP_SELF to work out where it's installed?
(smacks self on head with hand producing a hollow empty sound)
version 48 submitted. config.inc.php now figures out the install directory using PHP_SELF. This will at least make it work in the "default demo case". Users will still need to update the config if they want to move the directory elsewhere.
I also went ahead and changed plugin= to __plugin= and f= to __function= per your suggestions.