[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-12 Thread Eric Shulman
The value of 'place' is correct *during* the processing of the script.../script block.  However, once that script has been completed, the value of place is no longer in scope. Now - please bare with me here... I'm trying to get my head around the scoping issues I'm seeing.  Going back to

[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-12 Thread Eric Shulman
errata: .. a completely different variable, that does point to the 'containing tiddler' as described by the plugin documentation. Should read: .. a completely different variable, that does NOT point to the 'containing tiddler' as described by the plugin documentation. -e

[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-12 Thread Ruzz
Eric - I'm really not trying to test your patience... I'm just trying to understand. Before I wade in below, I came up with a simple test to prove your theory - I can confirm that your place is fine and works as expected, thus: script alert(story.findContainingTiddler(place).id); // always

[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-12 Thread Eric Shulman
html   span class=button onclick=MyFunction()Click Me/span /html script function MyFunction() {   alert(Clicked!); } InlineJavascriptPlugin directly supports creation of 'onclick' handlers without resorting to HTML to create a link that invokes a separately defined function. Thus, the

[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-12 Thread Ruzz
On Nov 11, 1:14 am, Eric Shulman [EMAIL PROTECTED] wrote: In MyTiddler, I have: Because InlineJavascriptPlugin invokes uses eval() to invoke javascript 'on-the-fly', any function declared via an inline script is only available within the scope of that call to eval().  However, you can

[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-12 Thread Eric Shulman
use an explicitly-scoped function declaration to add your functions to the global window object, which allows them to persist even after the eval() processing has completed. Thanks Eric - that's enabled me to get a lot further.  However, now I'm having a little problem with... access

[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-12 Thread Ruzz
On Nov 12, 12:21 pm, Eric Shulman [EMAIL PROTECTED] wrote: use an explicitly-scoped function declaration to add your functions to the global window object, which allows them to persist even after the eval() processing has completed. Thanks Eric - that's enabled me to get a lot

[tw] Re: InlineJavascriptPlugin wiring up event handlers

2008-11-10 Thread Eric Shulman
In MyTiddler, I have: Because InlineJavascriptPlugin invokes uses eval() to invoke javascript 'on-the-fly', any function declared via an inline script is only available within the scope of that call to eval(). However, you can use an explicitly-scoped function declaration to add your functions