Re: [tw] Re: How is a javascript modified to run in TW?

2015-07-21 Thread Jeremy Ruston
Hi Mat

I think there are two questions here:

* Why does TiddlyWiki disable inline JavaScript?
* How can one adapt arbitrary JavaScript libraries to work with TiddlyWiki?

The answer to the first is indeed to ensure that it is not possible to
construct a malicious wikitext tiddler that, when imported, steals personal
data. By restricting JavaScript to specially marked "JS module tiddlers" we
ensure that we can always filter out executable content.

The answer to the second question is less clearcut. The fundamental problem
is that many JavaScript libraries use a technique whereby the state of the
user interface is stored in the DOM. That doesn't work in TiddlyWiki5
because (like many modern JavaScript frameworks) it keeps state within
JavaScript objects and rebuilds the DOM on the fly as required. There's no
way to automatically convert DOM-based JavaScript code to work with
TiddlyWiki5.

So, the answer to the second question has two parts: learn JavaScript, and
learn TiddlyWiki5.

Best wishes

Jeremy.













On Tue, Jul 21, 2015 at 6:09 AM, Sylvain Naudin  wrote:

> Yep thanks for this Mario, I've bookmarked this thread to read it later.
>
> Sylvain
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/ebf7592d-378e-4e6a-ac58-f8700118ecc8%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAPKKYJbSFiGBsz5w%2BsWAEYg8UDRfg6VjUq_fYHfiAGa9FVrC5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How is a javascript modified to run in TW?

2015-07-20 Thread Felix Küppers
Hi Sylvain,

> But question is "on how to adapt scripts to work in TW".

You are correct, but in this case there is no general answer. Also, I am
not aware of a tutorial on how to write plugins... maybe something like
this exists somewhere.

-Felix

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/BLU437-SMTP27CA8441A2D77EF368DC1BCE850%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How is a javascript modified to run in TW?

2015-07-20 Thread Sylvain Naudin
OK guys ;)

But question is "on how to adapt scripts to work in TW". So if I'm wrong, 
vis.js is a JavaScrip library, and work now in TiddlyWiki. There are other 
examples sure, no ?


Cheers,
Sylvain

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e5fb35dc-720f-4582-ac58-02b05b87f62b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: How is a javascript modified to run in TW?

2015-07-20 Thread Felix Küppers
Hi guys,

I agree with all what Danielo said.

TiddlyWiki cannot be compared to a normal website where all you need to
do is just reference a javascript file and it works. As Danielo said, TW
is more like a program.

-Felix

On 07/20/2015 07:25 PM, Danielo Rodríguez wrote:
> Sorry for being so direct, but if you want a direct converter to adapt random 
> javascript to tiddlywiky maybe you should forget about using that snippet in 
> tiddlywiky. Tiddlywiky is not a website, it is an application, and as every 
> application if you want to add "code" to it you have to use its API. Could 
> you imagine someone asking for a converter to adapt random php snippets to 
> dokuwiki? The fact that tiddlywiky uses javascript does not make it different 
> from any other program. If you want to program to tiddlywiky you have to know 
> and understand how tiddlywiky works and write code specifically for it. 
>
> The place to test random javascript snippets is an html page as simple as 
> possible. 
>
> Having such "converter" will cause more damage than benefits. 
>
> In the worst case you can use the raw markup tag. 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/BLU437-SMTP1042648A1E8338C4D27B21CCE850%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.