Hi Alex,

I agree with you, but there are several reasons to do postprocessing
in __getHtml().

I try to explain everything:

The __getHtml() method parses html dom and creates text from it. It's
very easy to add support for postprocessing here than in different
place. Here you have tag, you have attributes and styles, you have
everything parsed, so to do any modification is very simple.

Postprocessing can be optional and this is the reason I wanted to make
__getHtml() as member. The can be property for example 'useShortTags'
and postprocess will short <spans> to <b>, <u> and <i>, there can be
option 'insertEol' and postprocess will insert some '\n's to
predefined tags.

I'm tolking about this, because each CMS system needs some
postprocessing and __getHtml() is very powerful and can do this for
us.

If __getHtml() will stay as static, we need to introduce some map
parameter, that will contain the options.

So, what's your opinion :-) ?

If you want to see what I'm tolking with more detail, please look at
__getHtml() in SVN, it's very readable now and you can postprocess
very easily;-)
(look at postprocess section, it's highlighted as other sections)

- Cheers
Petr

2008/9/8 Alexander Back <[EMAIL PROTECTED]>:
> Hi Petr,
>
> Petr Kobalíček wrote:
>> Another question about HtmlArea,
>>
>> Is really needed that __getHtml() internal is static ? The rendering
>> process is now really well arranged and I'm able to add some options
>> here.
> The method was kept static, because it needn't any connections to an
> instance of the HtmlArea component. At the moment I do see no reason to
> change this. See me comments below.
>
>
>> For example there can be option to add '\n' after <p>,<li>,<ul> elements.
> The method "__getHtml" is to traverse the DOM of the HtmlArea's
> document. To add a "\n" is nothing which the method should accomplish.
> You really don't want to have any formatting chars like "\n" in your
> returned HTML code, do you? I mean, this method should deliver the
> contents of the document and these formatting chars are not part of the
> contents.
> If you want to format the HTML code to e.g. display it inside a HTML
> form element, you should implement this feature in another method.
>
>> Another one is to use short tags instead of <span style="">, ...
> Good point. However, the "character" of the "__getHtml" method is to
> return the contents of the document in a "cleaned" (without the
> browser-specific and qooxdoo-specific stuff) way. Shortening the tags is
> a kind of manipulation (for some scenarios a good one, though) which
> should reside in an own method. Maybe it's better to do such a
> post-processing in an own method which the developers can call exclusively.
> I guess it would than also be nice to have a method which returns the
> contents of the document as a document fragment which such post-process
> methods could use as input.
>
> cheers,
>   Alex
>
>>
>> This is probably question to Alex;-)
>>
>> Cheers
>> - Petr
>>
>> 2008/9/7 Petr Kobalíček <[EMAIL PROTECTED]>:
>>> Hi devs,
>>>
>>> Today I'm modified HtmlArea widget for qooxdoo 0.8. The changes are
>>> the rendering process of html that's now pretty customizable. For
>>> example it's very easy to add support for <b>, <i> and <u> tags
>>> instead of <span style=""> tag.
>>>
>>> New rendering is also able to remove this <span></span>. I'm very
>>> careful to modify something like this and I tested it.
>>>
>>> Please, if there are some problems with this modification, report it!
>>>
>>> So Alex, image bug was solved, but some problems remains:
>>> - Firefox focus ! (I don't know how to solve it)
>>> - Sometimes the B (bold), I, U and S is not correctly updated by
>>> "cursorContext" event
>>> - In firefox, I gen sometimes "[Object HTMLElement]" in htmlarea when
>>> I press ENTER
>>> - Tags in firefox (maybe other browsers) are sometimes bad (for
>>> example page starts with <br /> but there is not empty line at start
>>> of document)
>>> - What's behavior if I press two spaces, I get <span>  </span> - This
>>> is not correct in HTML, need &nbsp; ?
>>>
>>> I'm also writing RichText widget, it's HtmlArea wrapped to composize
>>> with toolbar (similar to HtmlArea Application but more powerful).
>>>
>>> I'm really wondering if HtmlArea is currently used in any project or
>>> if anybody want's to help me with this;-)
>>>
>>> Cheers
>>> - Petr
>>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> --
> Alexander Back
> Core Development::Webtechnologies
> [EMAIL PROTECTED]
> fon +49 721 91374 8047
> http://www.1und1.de
>
> 1&1 Internet AG
> Ernst-Frey-Straße 9
> 76135 Karlsruhe
>
> Amtsgericht Montabaur HRB 6484
> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas
> Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss,
> Achim Weiss
> Aufsichtsratsvorsitzender: Michael Scheeren
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to