[Petal] XIncludes problem and question

Mark Holland mark at thinkfoo.com
Wed Jun 4 02:21:23 BST 2003


  Quite a while go Jean-Michel Hiver wrote:

>Let's face it, both inline CSS and inline JavaScript are pretty ugly.
>However I think that JavaScript is orders of magnitude more ugly than
>inline CSS...
>
>I don't think I'll change Petal's behavior for that.
>
>What you might want to do is export all your javascript functions in a
>'.js' file which you can import, and then use only simple javascript
>function calls inside your HTML file...
>
><zealot>Or you could avoid using JavaScript :)</zealot>
>
>
>That being said I realize that I don't really have a solution to your
>problem... can anyone think of anything? 
>
>  
>
Ach. I've found now that I really need to be able to do inline 
javascript. The cbe libraries from www.cross-browser.com I'm using seem 
to need to have the initalization code inline.

I can understand you not wanting to change petal's behaviour, but is 
there a way to hack petal to treat the contents of a block as if it were 
a structure? It would be nice to able to say:
<script petal:content="structure">
<!--
some nasty, horrible javascript ;)
//-->
</script>
so petal would recognise the structure keyword with no arguments and 
treat the contents as structure.

Yeah, I know javascript sucks and i _very_ rarely use it, however I'm 
working something really cool and I would really like to get inline js 
working under petal. I'll try and set up a demo of this little app soon 
for all to see.

On a side note, I have just finished my first all-petal website, written 
for a friend of mine. The site uses my weird Mason/Petal hackery and 
several tools using the ImageMagick libraries, so that he has full 
control over the [mainly photographic] content of his site. I have to 
say writing this site in TAL was a pleasure and I'm really happy with 
the performance of Petal. I just wish I could write TAL all day instead 
of my 9-5 job where I seem to be mainly debugging csh scripts :-/ The 
site is at www.peripatetic.co.nz.

Cheers,
Mark

--
mark at thinkfoo.com





More information about the Petal mailing list