[tw] Re: Converting script to plugin

2012-08-26 Thread whatever
Hi!
I figured out the solution to the second problem and it solved the
first problem as well. Seems all I had to do was put the code inside a
macro.

I am curious though, why did the story.findContainingTiddler(place);
throw an error? Also, I noticed that sometimes, it is used as
story.findContainingTiddler(this);. Can someone explain the reason?

w

On Aug 26, 7:13 pm, whatever  wrote:
> Hi!
>
> I made a script which outputs the result on a nested slider (1)
> floating panel. I transcluded it into the toolbar, so I have a
> pulldown menu. It works as it should. However, I want to include it
> into a plugin I'm working on. So I removed the 

[tw] Re: Converting script to plugin

2012-08-27 Thread Eric Shulman
> I am curious though, why did the story.findContainingTiddler(place);
> throw an error? Also, I noticed that sometimes, it is used as
> story.findContainingTiddler(this);. Can someone explain the reason?

'place' is the current DOM element into which wiki source content is
being rendered.  'tiddler' is the current tiddler object in which that
wiki source content is stored.  These values are passed into each
macro.handler() function, so that macros can produce suitable output.

In addition, 'place' and 'tiddler' are also defined as global
variables (i.e., window.place and window.tiddler) that are
automatically set by the TWCore.  This allows fields from these
objects to be referenced from within *evaluated parameters* in a macro
(e.g. <>).

'place' and 'tiddler' are also automatically defined by
InlineJavascriptPlugin, so that these global variables are also
available for use within inline scripting.

In contrast, 'this' is an automatic 'context variable' defined by the
browser's Javascript runtime environment, and is a reference to the
current object within the scope of the function being processed.
This is particularly important when processing an event handler (such
as onclick="...").  In the context of the handler, 'this' refers to
the object associated with the handler function (i.e., the link
element that was clicked on).

Summary:
When writing macro code (or inline Javascript code), use 'place' to
refer to the element that triggered the event processing.  When
writing embedded HTML handlers (i.e., onclick="..."), use 'this' for
the same purpose.

Note: InlineJavascriptPlugin has special handling for 'place'.
Normally, 'place' refers to the DOM element in which the script is
embedded, so that script output can be inserted in place of the script
itself.  However, when using the label="..." optional syntax to create
an onClick handler, 'place' refers to the clicked link element (i.e.,
just like the browser-internal 'this') so that you can
programmatically adjust the link element (e.g., change it's text when
it is clicked on).  In this specific use-case, you will need to refer
to 'place.parentNode' to generate and render script output (which will
follow the clickable link element).

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.



[tw] Re: Converting script to plugin

2012-08-27 Thread PMario
Hi whatever,
I did record a series of videos, that show how (and why) to convert a
TW inline script into a plugin [1]. The series is related to the
POSTagger stuff but I think it can give you a general overview.

This series can also be seen, as a HowTo use TiddlySpace as an
application plattform. ...

I hope every video makes sense on it's own but imo viewing them in
order works best :)
All 5 videos are about 40min.

have fun!
mario
PS: Feedback and suggestions are very welcome!
PPS: If you want more give feedback and consider a financial
motivation :) at
http://pmario.tiddlyspace.com/#Motivation

===

How To Create TiddlyWiki Plugins
I did create some videos at my Youtube Cahnnel, that show how to
create a TW plugin, using TiddlySpace.

The videos should be viewed in the following order.
Playlist "TW plugins and debugging":
https://www.youtube.com/watch?v=J5tq5xv0FHU&list=PL19F78517CB1EDC08&feature=view_all

HowTo: Setup a TiddlyWiki development space
http://www.youtube.com/watch?v=J5tq5xv0FHU

HowTo: Debug a TiddlyWiki plugin
http://www.youtube.com/watch?v=h3NjTLQXWRc

Info: How TidddlyWiki plugins work
http://www.youtube.com/watch?v=XEXIIs16yto

Info: Why Inline Scripts should be Plugins
http://www.youtube.com/watch?v=Hc6IPovgvbo

HowTo: convert a TiddlyWiki inline script into a plugin
http://www.youtube.com/watch?v=6u7-GdAsukw


Related Informations

tiddlywiki.org - Best Practices - 
http://tiddlywiki.org/#%5b%5bBest%20Practices%5d%5d
Mozilla Development Network - Closures:
https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Closures
Development Environment: http://dev-env.tiddlyspace.com/
NEUI-EM Theme: http://neui-em.tiddlyspace.com/
CodeMirror Editor: http://codemirror-plugins.tiddlyspace.com/
POSTagger Video: http://postagger-video.tiddlyspace.com/
POSTagger Experimental: http://postagger.tiddlyspace.com/
POSTagger plugins: http://postagger-plugins.tiddlyspace.com/

[1] http://pmario.tiddlyspace.com/#HowToCreatePlugins

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.



[tw] Re: Converting script to plugin

2012-08-27 Thread whatever
@Eric: Thanks for the explanation, it makes more sense now.
@Mario: I'll definitely have a look at those videos.

w

On 27 avg., 10:17, PMario  wrote:
> Hi whatever,
> I did record a series of videos, that show how (and why) to convert a
> TW inline script into a plugin [1]. The series is related to the
> POSTagger stuff but I think it can give you a general overview.
>
> This series can also be seen, as a HowTo use TiddlySpace as an
> application plattform. ...
>
> I hope every video makes sense on it's own but imo viewing them in
> order works best :)
> All 5 videos are about 40min.
>
> have fun!
> mario
> PS: Feedback and suggestions are very welcome!
> PPS: If you want more give feedback and consider a financial
> motivation :) athttp://pmario.tiddlyspace.com/#Motivation
>
> ===
>
> How To Create TiddlyWiki Plugins
> I did create some videos at my Youtube Cahnnel, that show how to
> create a TW plugin, using TiddlySpace.
>
> The videos should be viewed in the following order.
> Playlist "TW plugins and 
> debugging":https://www.youtube.com/watch?v=J5tq5xv0FHU&list=PL19F78517CB1EDC08&f...
>
> HowTo: Setup a TiddlyWiki development space
>    http://www.youtube.com/watch?v=J5tq5xv0FHU
>
> HowTo: Debug a TiddlyWiki plugin
>    http://www.youtube.com/watch?v=h3NjTLQXWRc
>
> Info: How TidddlyWiki plugins work
>    http://www.youtube.com/watch?v=XEXIIs16yto
>
> Info: Why Inline Scripts should be Plugins
>    http://www.youtube.com/watch?v=Hc6IPovgvbo
>
> HowTo: convert a TiddlyWiki inline script into a plugin
>    http://www.youtube.com/watch?v=6u7-GdAsukw
>
> Related Informations
>
>     tiddlywiki.org - Best Practices 
> -http://tiddlywiki.org/#%5b%5bBest%20Practices%5d%5d
>     Mozilla Development Network - 
> Closures:https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Closures
>     Development Environment:http://dev-env.tiddlyspace.com/
>     NEUI-EM Theme:http://neui-em.tiddlyspace.com/
>     CodeMirror Editor:http://codemirror-plugins.tiddlyspace.com/
>     POSTagger Video:http://postagger-video.tiddlyspace.com/
>     POSTagger Experimental:http://postagger.tiddlyspace.com/
>     POSTagger plugins:http://postagger-plugins.tiddlyspace.com/
>
> [1]http://pmario.tiddlyspace.com/#HowToCreatePlugins

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlywiki@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.



[tw] Re: Converting script to plugin

2016-05-13 Thread James Perrett

>
> Does anyone have any videos like pmario on TiddlywikiCLASSIC plugins. 
> Especially explaining difference with $,where,this variables.

I am doing some  image [img[]] replacement plugins with thumbnail and large 
image popups. Which i can do with standard html,css and java script
But when importing functions into tiddlywiki classic 2.8,1 (prince) I have 
a problem with accessing window,popup() function in my code.
I can see onmouseover=window.popup.. in the generated html but my popup 
does not popup. I have looked at Eric's ImageSizePlugin. But it does not do 
what i want and is a bit more complex than I need.

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4382864d-c288-42e8-a97c-cb5f704c7612%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.