[Petal] <![CDATA[ ... ]]> and HTML Elements

Fergal Daly fergal at esatclear.ie
Tue Nov 9 11:30:11 GMT 2004


On Tue, Nov 09, 2004 at 11:20:39AM +0000, Chris Croome wrote:
> Hi
> 
> On Tue 09-Nov-2004 at 11:12:47AM +0000, Fergal Daly wrote:
> > 
> > What are these scripts that can't be put in a .js file anyway?
> 
> In MKDoc 1.8 there is a javascript WYSIWYG editor and it's
> referenced like this:
> 
>     <!-- This loads the WYSIWYG editor for the HTML Component -->
>     <script 
>       type="text/javascript" 
>       src="/.resources/xeditor.js"
>     ></script>
>     <script 
>       type="text/javascript" 
>       petal:condition="true: self; 
>                        true: self/components --html"
>     >
>       // call this at body.onload:
>       function init() {
>         use_lang ('${self/language}');
>         <?for name="element self/components --html"?>
>         make_wysiwyg ('${element/block_name}');
>         <?end?>
>       }
>     </script>
> 
> This works fine, it's a combination of an external file and also
> some petal generated js that can't go in an external fail (as far as
> I can see...).
> 
> As I said that works fine and isn't a problem... (though it's a bit
> ugly...). 

It's also compatible with both XHTML and HTML because the final script
output tags don't contain any bad characters and there's no need for <!--
escaping.

So I really should have asked for the scripts that started the discussion
because apparently they can't go in a .js but they do need <!--. At a guess,
I'd say they could be chopped up with the functions going into a .js file
and the calls to those functions coming from the HTML, exactly as in MKDoc
and hopefully those calls will not invloce any bad characters,

F


More information about the Petal mailing list