Forum closed. New forum available at http://community.wymeditor.org/

Implementation document

Discuss features, code, contributions, ideas, suggestions, ...
For bugs, patches and feature requests, please post on the Trac:
http://trac.wymeditor.org/

Implementation document

Postby Hibou57 on Fri Feb 02, 2007 3:27 pm

Dear all of you :)

I'm very happy to try this WYSIWYM editor : the only usable one in the world I think... all others beeing based on Java, which is heavy, heavy, heavy :( So many thanks for this one just using JavaScript :) (although it is still a bit slow on my Pentium 133 :roll: ).

I would like to use it as an XML editor for my XML document format (I mean not only using it as an XHTML editor), and thus, would like to make some customisations, like allowing some predefined tags for used in my document format, and allowing edition of attributes (the latter is very important).

I have a look at the code, modifying a few dirty things to try to add a « truc » tag (a dummy name in french). But I failed to get good results.

So now, I'm looking for a document which will describe the implementation, in order to understand it (I don't like guessing how an application works, by just reading the code, this is a very-very bad practice).

Does such a document exist ? And where can I find it ?

By the way, there's another question : do you know a way to record a file on hard drive using JavaScript ? It seem obvious this is normaly not possible for security reasons, but perhaps there's a workaround in some circumstance ? (any way, if I can transform WYMEditor in a full XML editor, I will be motivated for writing a custom local HTTP server which will be able to handle a save-on-disk request... this will be a good solution I think)

Many thanks :)
User avatar
Hibou57
 
Posts: 3
Joined: Fri Feb 02, 2007 3:16 pm

Re: Implementation document

Postby jfh on Fri Feb 02, 2007 11:02 pm

Hibou57 wrote:Dear all of you :)

I'm very happy to try this WYSIWYM editor : the only usable one in the world I think... all others beeing based on Java, which is heavy, heavy, heavy :( So many thanks for this one just using JavaScript :) (although it is still a bit slow on my Pentium 133 :roll: ).

You're welcome :).

Hibou57 wrote:I would like to use it as an XML editor for my XML document format (I mean not only using it as an XHTML editor), and thus, would like to make some customisations, like allowing some predefined tags for used in my document format, and allowing edition of attributes (the latter is very important).

I have a look at the code, modifying a few dirty things to try to add a « truc » tag (a dummy name in french). But I failed to get good results.

So now, I'm looking for a document which will describe the implementation, in order to understand it (I don't like guessing how an application works, by just reading the code, this is a very-very bad practice).

Does such a document exist ? And where can I find it ?

WYMeditor is a XHTML editor. XHTML is XML. You can manipulate XHTML and generate XML with XSLT.

But if you really need a XML editor, WYMeditor isn't for you.

Hibou57 wrote:By the way, there's another question : do you know a way to record a file on hard drive using JavaScript ? It seem obvious this is normaly not possible for security reasons, but perhaps there's a workaround in some circumstance ? (any way, if I can transform WYMEditor in a full XML editor, I will be motivated for writing a custom local HTTP server which will be able to handle a save-on-disk request... this will be a good solution I think)

AFAIK, you can't write to the disk with JavaScript.

HTH,
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Re: Implementation document

Postby Hibou57 on Sun Feb 04, 2007 12:42 am

Bonsoir, and a great Merci for your answer

jfh wrote:WYMeditor is a XHTML editor. XHTML is XML. You can manipulate XHTML and generate XML with XSLT.

Yes, I know, but with softwares I prefer the smallest and the shortest (XSLT is to be used at a later stage).

jfh wrote:But if you really need a XML editor, WYMeditor isn't for you.

Dear jfh, don't under-estimate your software ;)

Think about the following : editing XML can be done with a simple texte editor. Editing XML is for some parts like coding, and for some other parts it is like text editing. Code editing comes with tags and attributes. Text editing comes with data content between tags. The trouble is that with a simple text editor, if you use automatic line-wrapping, then it apply to tags en attributes. This behaviour is not very convenient.

So I was just looking for something which will handle differently tags and content between tags : tags with no line-wrapping, and content with line-wrapping and automatic indentation, in respect to the document hierarchie.

That's all I was looking for.

A better idea is of course to use hierachical boxes instead of indentation (this is somewhat similar in facts).

And your application can do that. I was to build an application for Windows, but I can't wast my time for the moment (and not rich enough to buy software), beceause I have to go on working with some documents (latter, I wish). So may be an adaptation of your applications may help me.

I think there is a way to do what I want with your application. The only trouble is to make it an application for local usage (i.e. not a web application).

I have nothing to loose in trying :P

jfh wrote:AFAIK, you can't write to the disk with JavaScript.


Yes, but a simple HTTP localhost server handling this kind of request will probably be no more than about 500 lines of codes.

While reading your code, I've noticed a lot of very interesting things about JavaScript. Until now, I always though it was impossible to manipulate te caret with JavaScript.... but the code seems to do that.

There are also interesting things about the differece between some browser.

Some features of JavaScript are not in the docs I have. Where did you get all of this ? I would be interested in having this too :)
User avatar
Hibou57
 
Posts: 3
Joined: Fri Feb 02, 2007 3:16 pm

Postby jfh on Sun Feb 04, 2007 7:52 pm

It's amazing. I didn't thought WYMeditor could be used that way.
That's the beauty of Free Software, isn't it? :)

About saving files: I know it's possible to save files locally with XUL, so I guess you don't need an HTTP server.

About WYMeditor JS code: Google is your friend.
I've found MS relative documentation here, and Mozilla there.

Good luck,
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Postby Hibou57 on Mon Feb 05, 2007 4:05 pm

Hello Jfh,

jfh wrote:That's the beauty of Free Software, isn't it? :)

Do you mean OpenSource of free of charge ?

Are you to open a big interresting question ? :)

OpenSource is absolutly the best, sure. But Free of charge is not always possible.... as long as the baker will not accept to make free-of-charge bred.

Does this highlight the need of a new economic paradigm ? Hum, hum.... sure you guess I will answer « yes » to this.

But unfortunatly, for the time beeing, the world is what it is.

Any way, you welcome, in returns, to use my free online Arabic course, whenever you like. :)

jfh wrote:About WYMeditor JS code: Google is your friend.
I've found MS relative documentation here, and Mozilla there.


Forgive me, I was not to disturb you... this is just that I prefer humans before robots :D

There is a third big party in the world of web browsers : Opera. Although it is not OpenSource, it is still very well documented, and very well design (the best to me, far better than both MS-IE's and Mozilla's). Perhaps this other resource will be worth to you too : DHTML with Opera browsers


jfh wrote:Good luck,

Thank you.

I will not meet you before a long time.

About this stuff : there will be free steps.
1) Rewriting of the code, preserving the actuel implementation (i.e. adding of comments in code, splitting of some functions for better expressiveness). This is the only step I'm sure to complete.
2) Adapatation too XML editing (not sure it will be completed, but probably).
3) Some other adaptions for local mahcine usage (not sure).

I will post your a message here when the first step will be ended. Perhaps you will be interessting in it.

Bonne continuation en attendant, et à je ne sais quand :D

P.S. J'aime bien ton site
User avatar
Hibou57
 
Posts: 3
Joined: Fri Feb 02, 2007 3:16 pm

Postby jfh on Mon Feb 05, 2007 4:30 pm

Hibou57 wrote:Hello Jfh,
Do you mean OpenSource of free of charge ?
Are you to open a big interresting question ? :)
OpenSource is absolutly the best, sure. But Free of charge is not always possible.... as long as the baker will not accept to make free-of-charge bred.
Does this highlight the need of a new economic paradigm ? Hum, hum.... sure you guess I will answer « yes » to this.
But unfortunatly, for the time beeing, the world is what it is.

I was meaning Free Software, not open source or free of charge. Free software is a matter of liberty, not price.

Hibou57 wrote:Any way, you welcome, in returns, to use my free online Arabic course, whenever you like. :)

Thanks.

Hibou57 wrote:Forgive me, I was not to disturb you... this is just that I prefer humans before robots :D

No problem. I was just answering your question. I'm not a JavaScript guru. Most hacks in WYMeditor come from web resources, and I often use search engines like Google to find them.

Hibou57 wrote:Perhaps this other resource will be worth to you too : DHTML with Opera browsers

Thanks. BTW, next WYMeditor version will be compatible with Opera.

Hibou57 wrote:I will post your a message here when the first step will be ended. Perhaps you will be interessting in it.

Great!

Hibou57 wrote:Bonne continuation en attendant, et à je ne sais quand :D
P.S. J'aime bien ton site

Merci, c'est sympa! A bientôt. ;)
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests