Hello Antaues,

For being short, I'll just add that you can define methods via plugins (and 
use the Require slice in other plugins, if those methods are needed at the 
startup):
definition (in a plugin MyLib):
config.extensions.myObject = {
  myMethod1: function(...) { ... },
  myMethod2: function(...) { ... }
}
usage (after startup -- like in the fet macro):
config.extensions.myObject.myMethod1(...)
to use in a plugin (this line makes the plugin be launched after MyLib, if 
it is present):
|Requires|MyLib|

If you prefer to use MarkupPostHead anyway (which would seem strange), 
check the working approach of Plugin: jsMath [1].

Best regards,
Yakov.

[1] http://bob.mcelrath.org/tiddlyjsmath.html

вторник, 20 мая 2014 г., 15:34:17 UTC+4 пользователь okido написал:
>
> Hi Antaeus,
>
> The most basic form is:
>
>     function simpletest(){
>
>        return false;
>     };
>
> Past this code in a tiddler and tag with systemConfig, save and reload.
> Have a nice day, Okido
>
> 2014年5月18日日曜日 23時48分58秒 UTC+2 Antaeus Feldspar:
>>
>> Suppose that I have a Javascript function that I want to be available 
>> throughout the Tiddlywiki, for plugins that can use Javascript code (in 
>> this case, ForEachTiddlerPlugin) to employ.  What is the correct method to 
>> do it?
>>
>> I thought that the correct method was to add the code to MarkupPostHead. 
>>  The following was what I added there, just to test that I had that part 
>> right:
>>
>> <script type="text/javascript">
>>   function simpletest()
>>   {
>>   return false;
>>   }
>> </script>
>>
>> To test it, I also made a copy of a call to the ForEachTiddler macro that 
>> was working, and prefixed "simpletest() && " to an existing boolean 
>> expression the macro call was using.
>>
>> The result was that when I attempted to reload the Tiddlywiki, it would 
>> not load at all.  What did I do wrong?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to