Would it be easier to get around Kid with Mochikit's addLoadEvent()?
So in your master.kid you'd have the following section:
<script type="text/javascript">
addLoadEvent(roundedcorners);
</script>
I know this doesn't solve the actual problem, but it does work around
it and should make things work. :)
Lee
On 12/19/05, Jared Kuolt <[EMAIL PROTECTED]> wrote:
>
> What version are you running, btw?
>
> I'm running latest svn, which has kid 0.8 as far as I can recall. If
> you're running TG 0.8a4 (0.8a5 is latest) or older you have Kid 0.7. I
> don't know if that's the problem or not, but I'll keep looking into
> this.
>
> On 12/19/05, Rune Hansen <[EMAIL PROTECTED]> wrote:
> > Hi Jared,
> > I do appreciate that you are spending time to investigate this.
> > master.kid
> > <body
> > py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'"
> > onLoad="roundedcorners();">
> >
> > Server is restarted.
> >
> > View source of welcome.kid:
> > <BODY>
> > <DIV
> > STYLE="width:300px;margin:1em;background-color:#CCC"
> > ID="rounded">
> >
> > No sign of the onLoad statement.
> >
> > This is of course no big deal, I can live without the rounded corners but
> > it's irritating nevertheless.
> >
> > regards
> > /rune
> >
> >
> >
> >
> > On 19. des. 2005, at 21.58, Jared Kuolt wrote:
> >
> >
> > Try this one again, just remember to restart your application. Kid
> > doesn't recompile the templates when the master.kid (or any extended
> > template) is changed.
> >
> > <body
> > py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'"
> > onLoad="roundedcorners();">
> >
> > On 12/19/05, Rune Hansen <[EMAIL PROTECTED]> wrote:
> >
> >
> > On 19. des. 2005, at 18.07, Jared Kuolt wrote:
> >
> >
> > I haven't worked much with mochikit, but at first glance, you're
> > calling roundedcorners() before the element appears. Try putting that
> > method in the onLoad of the body.
> >
> > <body onLoad="roundedcorners();">
> >
> >
> > Hi Jared, that was supposed to be my next question.
> > It does absolutely not matter how I set up master.kid/welcome.kid - onLoad
> > never shows in the <body when viewing source
> >
> > master.kid:
> > <body onLoad="roundedcorners();">
> > <body
> > py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'">
> > <body
> > py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'"
> > onLoad="roundedcorners();">
> > <body
> > py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'"
> > py:attrs="onLoad='roundedcorners();'">
> >
> > No DIce(!)
> >
> > master.kid-> all of the above + <body onLoad="roundedcorners();"> in
> > welcome.kid
> >
> > Still No Dice(!) (sorry 'bout the Charles Bronsonisms...I've just watched a
> > Simpson episode).
> >
> > Now, serving the file static with cherrypy works(not surprisingly).
> > So, removing KID from the equation solves the problem. This seems to be a
> > trend for me, removing KID I mean.
> >
> > I hope some KID experts out there can tell me what to do to make this work.
> >
> > regards
> > /rune
> >
> >
> >
> >
> >
> > On 12/19/05, Rune Hansen <[EMAIL PROTECTED]> wrote:
> > This might belong on the Mochikit mailinglist, but I thought I'd better ask
> > here first.
> > The simplest of KID templates and mochikit:
> >
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > <html xmlns="http://www.w3.org/1999/xhtml"
> > xmlns:py="http://purl.org/kid/ns#"
> > py:extends="'master.kid'">
> >
> > <head>
> > <meta content="text/html; charset=UTF-8" http-equiv="content-type"
> > py:replace="''"/>
> > <title>Welcome to TurboGears</title>
> >
> > <script language="JavaScript">
> > var roundedcorners = function() {
> > roundElement("rounded",{corners:"all"});
> > }
> > roundedcorners();
> > </script>
> > </head>
> >
> > <body>
> > <div id="rounded"
> > style="width:300px;margin:1em;border:1px solid black;">
> > Hello
> > </div>
> > </body>
> > </html>
> >
> > This is a stripped down welcome.kid(The master.kid includes MochiKit.js)
> >
> > I get:
> > TypeError - Null value
> > http://tg.scanmine.com:8080/tg_js/MochiKit.js line 3687
> >
> > Is this KID playing havoc or is it MochiKit? Or, more likely, is it me?
> >
> > regards
> > /rune
> >
> >
> > ---------------------------------------------------------------------
> >
> > Behind the firewall, nobody can hear you scream...
> >
> >
> >
> >
> > --
> > [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> >
> > Behind the firewall, nobody can hear you scream...
> >
> >
> >
> >
> > --
> > [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> >
> > Behind the firewall, nobody can hear you scream...
> >
>
>
> --
> [EMAIL PROTECTED]
>