[tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Tobias Beer


 I'll be honest. I don't understand the full significance of modules or how 
 to do them. Is a module just a tiddler with the type set to javascript and 
 the module type set to macro? The advantage of that over tagging a tiddler 
 $:/tags/RawMarkup isn't obvious to me.


A module is what makes TiddlyWiki tick, it's a functional bit of the 
clockwork, a gear, a spring, a handle, a winder... so there are different 
module-types that serve different purposes. A macro serves the purpose of 
providing a wikitext macro that works just like any other macro to the 
user. However, he
would not have been able to construct that macro using wikitext-only. So, 
there sometimes is a need to create a javascript macro to do the heavy 
lifting... which might just be a lot less heavy than trying to do the same 
thing using wikitext-only.

I notice in the size routine that you use a number of $tw.wiki.whatever and 
 $tw.utils.something. I assume those are functions defined deep in 
 TiddlyWiki's core. Is there existing documentation for those that I haven't 
 found yet?


yes, those are core functions, here of the *wiki* object or the *utils* 
namespace, either provide useful accessors to the underlying processes, 
*utils* help you work with all things tiddly and *wiki* gives you the 
basics of filtering and then writing to tiddlers, things like that. So, 
there are different collections of codebits, all of which you can explore 
in your browser's console by starting to type *$tw*... or in the GitHub 
repo. Some things are more complicated, other's are really straight 
forward, like many filters for example.

Best wishes, Tobias.

-- 
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.


[tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread 'Stephen Kimmel' via TiddlyWiki



 But yes, you are absolutely right, if the core of TiddlyWiki were to 
 change,
 it would be an awful endeavour to fix starting this bookmarklet based on 
 that url encoded nastiness it is.
 Actually, a bookmarklet should be provided with a version in the title.


I use that particular script of yours a lot so I'll be sorry if they decide 
to close that backdoor. I consider the bookmarklet answer to be inferior 
since that binds the use to a particular machine and installation. I use 
multiple computers, home. office, traveling laptop, etc. Rather than 
install the bookmarklet on multiple machines, some where I don't have the 
rights, my preference is to have the routine as part of the wiki. Then it 
is available wherever the wiki is available.
 

 I'm not sure, though, that you answered Mat's question: 

 How do I integrate a javascript into TW?


 I think I mentioned: *modules*

 At least, that seems to be the official answer.
 Although, I would personally prefer something else.
 But I do understand that it's a safe choice.


I'll be honest. I don't understand the full significance of modules or how 
to do them. Is a module just a tiddler with the type set to javascript and 
the module type set to macro? The advantage of that over tagging a tiddler 
$:/tags/RawMarkup isn't obvious to me.

I notice in the size routine that you use a number of $tw.wiki.whatever and 
$tw.utils.something. I assume those are functions defined deep in 
TiddlyWiki's core. Is there existing documentation for those that I haven't 
found yet?

-- 
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.


Re: [tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Alex Hough
Presumably the Javascript style used by Mr Ruston is worthy of attention of
JS aficionados?

I'd feel good if the JS I was learning was  pointing towards TW and
JermStyle scripting. I've done some coding in the past, but only with great
help from Eric, Tobias and FND. I didn't pick up on the principals behind
the design, partially because to appreciate it would required a strong
background in development and computer science.

Alex

On 21 January 2015 at 15:09, Tobias Beer beertob...@gmail.com wrote:

 Could there be a learning group decicated to upskilling people who might
 be able to use a macro into people who can begin to learn JS in the TW way?


 This is why the dev group should be a github repo... one that doesn't
 (necessarily) have any content but is rather a place to post issues and
 discuss / edit code... which might eventually be part of that repo as best
 practice. Some TiddlyWiki would nice to showcase these things in the right
 context.

 Best wishes, Tobias.

 --
 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.


-- 
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.


Re: [tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Astrid Elocson
 There are coding conventions in TW which to the beginner JS  programmer 
may find puzzling. For example in Tobias' example plugin we have a line 
which says tid = tid

The actual line is:

*tid = tid || GettingStarted*

That's conceptually similar to the less puzzling line:

*tid = tid + 1*

which causes *tid* to be set to its own previous value + 1.

In Tobias's example, the *||* symbol means or else, and the line causes 
*tid* to be set to either its current value, or else (if *tid* isn't 
currently set to anything) to *GettingStarted*. This is a common idiom 
for supplying a default value for a parameter in JavaScript.

Tobias's example doesn't actually need to use the word *var* (which 
introduces a new variable), because *tid* has already been declared (as a 
parameter).

– æ

-- 
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.


Re: [tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Alex Hough
wise words Tobias,

answers some of the questions I think about. put it in TB5?


Alex

On 21 January 2015 at 11:01, Tobias Beer beertob...@gmail.com wrote:

 Hi Mat,


 I found this little treasure of javascripts: JavaScript Kit - Free
 JavaScripts http://www.javascriptkit.com/cutpastejava.shtml

 BTW, that site also links to a site on DHTML.


 It looks a bit like a dusty treasure from the dark ages,
 refering to concepts from back then...
 which, of course are still usable today, like an ax is. ^^

 What I mean is, DHTML is from a time
 when people thought it was good to write code this way...

 a href=# onclick=var x=2;callMyFunction(); style=color:AliceBlue
 click/a

 ...which is pure evil,
 throwing all the different aspects of a program
 into one bucket where eventually
 you never find the right spot
 ...or manage to manage that code, ever again.

 ...which makes me wonder, just how do I integrate a javascript into TW?

 I find very little info on tw .com on this, probably Modules
 http://tiddlywiki.com/prerelease/#Modules is the most informative one,
 which is not much.


 yes, writing things like modules: http://tiddlywiki.com/dev

 however, the task of TiddlyWiki(.com) cannot be to teach you JavaScript
 you will have to do that yourself
 please don't start with a site like the above, one with snippets from
 the 90ies
 better google javascript tutorial or learn javascript, etc... or some
 specific topic
 or take a look at: http://www.w3schools.com/js

 an even more fruitful endeavour would possibly be
 to start using node.js and all the bells and whistles

 You create a tiddler and set the type to XXX. You must surround the code
 with YYY and ZZZ. And for the core to execute it you must make sure that...


 you can start experiminenting with:
 Basic Javascript Macro @ tb5
 http://tb5.tiddlyspot.com/#Basic%20Javascript%20Macro


 And if it is not a direct procedure, is there any way to tell how tricky
 it would be?


 it's JavaScript development and can get as tricky as I want to create
 something like this TiddlyWiki thing

 If anyone is kind enough to answer, please note I'm not a programmer so
 I'd really appreciate the dummies version.


 There really is no dummies version.
 There only is that process that you either (dare) start or you don't.
 Which means: you always start (feeling) as a dummy.


 Is this something we can use in TW?

 Actually, other than JavaScript, HTML and CSS what is directly applicable
 in TW?


 Most importantly:

- Go about it differently!

 Don't ask:

- What could I possibly do?

 Ask:

- What do I want to do?
- Why do I want to do that?
   - be clear about your goals
   - ask that five times over to get to the heart of your motives
- What steps need to be taken?
   - compartmentalize and modularize
   - you'll never do it all at once
- Will I need help with any of it?
   - Where? From Whom?
- What is the next step?
   - and the next step

 There is no universal guidebook to any of that.
 You need to walk every little step along the way... yourself.
 Sometimes, you have a mentor to ask and reply,
 sometimes you have awesome tutorials that help you learn,
 some of which ask you to pay a buck: https://www.codeschool.com

 I know jQuery is basically JavaScript so this should work, right? Other
 languages?


 jQuery is not a language, it's a framework, a library, an abstraction
 layer wrapped around the language that is JavaScript. So far, I have yet to
 see someone use it in TW5. This process would start with properly making
 the library available in TW5
 https://groups.google.com/forum/#!searchin/tiddlywikidev/jquery$20tw5/tiddlywikidev/zT9fXP-iE2o/eNyy90i_QHoJ
 .

 There are different kinds of abstractions that facilitate working with
 JavaScript. A totally different approach would be CoffeeScript
 http://coffeescript.org/.

 All of this does not matter so much, at all. What matters is that you find
 a goal and then take on that challenge and adventure of figuring out how to
 make it work. It will be a slow process, it will require lots of learning,
 you will make abundant mistakes — coding always comes with nasty bugs and
 stumbling blocks — you will discard mountains of superfluous and redundant,
 if not false stuff, go ahead a step and back two. I sure encourage anyone
 to join the dancers... but the most important thing is to swing those
 limbs, not to read swinging for dummies ...unless that actually helps you
 do just that. ^^

 Best wishes, Tobias.

 --
 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.


-- 
You received this message because you are 

[tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Tobias Beer
Hi Mat,
 

 I found this little treasure of javascripts: JavaScript Kit - Free 
 JavaScripts http://www.javascriptkit.com/cutpastejava.shtml

BTW, that site also links to a site on DHTML. 


It looks a bit like a dusty treasure from the dark ages,
refering to concepts from back then...
which, of course are still usable today, like an ax is. ^^

What I mean is, DHTML is from a time
when people thought it was good to write code this way...

a href=# onclick=var x=2;callMyFunction(); style=color:AliceBlue
click/a

...which is pure evil,
throwing all the different aspects of a program
into one bucket where eventually
you never find the right spot
...or manage to manage that code, ever again.

...which makes me wonder, just how do I integrate a javascript into TW?

I find very little info on tw .com on this, probably Modules 
 http://tiddlywiki.com/prerelease/#Modules is the most informative one, 
 which is not much. 

 
yes, writing things like modules: http://tiddlywiki.com/dev

however, the task of TiddlyWiki(.com) cannot be to teach you JavaScript
you will have to do that yourself
please don't start with a site like the above, one with snippets from the 
90ies
better google javascript tutorial or learn javascript, etc... or some 
specific topic
or take a look at: http://www.w3schools.com/js

an even more fruitful endeavour would possibly be
to start using node.js and all the bells and whistles

You create a tiddler and set the type to XXX. You must surround the code 
 with YYY and ZZZ. And for the core to execute it you must make sure that...

 
you can start experiminenting with:
Basic Javascript Macro @ tb5 
http://tb5.tiddlyspot.com/#Basic%20Javascript%20Macro
 

 And if it is not a direct procedure, is there any way to tell how tricky 
 it would be?


it's JavaScript development and can get as tricky as I want to create 
something like this TiddlyWiki thing

If anyone is kind enough to answer, please note I'm not a programmer so I'd 
 really appreciate the dummies version.


There really is no dummies version.
There only is that process that you either (dare) start or you don't.
Which means: you always start (feeling) as a dummy.
 

 Is this something we can use in TW? 

Actually, other than JavaScript, HTML and CSS what is directly applicable 
 in TW?


Most importantly:

   - Go about it differently!

Don't ask:

   - What could I possibly do?

Ask:

   - What do I want to do?
   - Why do I want to do that?
  - be clear about your goals
  - ask that five times over to get to the heart of your motives
   - What steps need to be taken?
  - compartmentalize and modularize
  - you'll never do it all at once
   - Will I need help with any of it?
  - Where? From Whom?
   - What is the next step?
  - and the next step
   
There is no universal guidebook to any of that.
You need to walk every little step along the way... yourself.
Sometimes, you have a mentor to ask and reply,
sometimes you have awesome tutorials that help you learn,
some of which ask you to pay a buck: https://www.codeschool.com

I know jQuery is basically JavaScript so this should work, right? Other 
 languages?


jQuery is not a language, it's a framework, a library, an abstraction layer 
wrapped around the language that is JavaScript. So far, I have yet to see 
someone use it in TW5. This process would start with properly making the 
library available in TW5 
https://groups.google.com/forum/#!searchin/tiddlywikidev/jquery$20tw5/tiddlywikidev/zT9fXP-iE2o/eNyy90i_QHoJ
.

There are different kinds of abstractions that facilitate working with 
JavaScript. A totally different approach would be CoffeeScript 
http://coffeescript.org/.

All of this does not matter so much, at all. What matters is that you find 
a goal and then take on that challenge and adventure of figuring out how to 
make it work. It will be a slow process, it will require lots of learning, 
you will make abundant mistakes — coding always comes with nasty bugs and 
stumbling blocks — you will discard mountains of superfluous and redundant, 
if not false stuff, go ahead a step and back two. I sure encourage anyone 
to join the dancers... but the most important thing is to swing those 
limbs, not to read swinging for dummies ...unless that actually helps you 
do just that. ^^

Best wishes, Tobias.

-- 
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.


[tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread 'Stephen Kimmel' via TiddlyWiki



 a href=# onclick=var x=2;callMyFunction(); style=color:AliceBlue
 click/a

 ...which is pure evil,
 throwing all the different aspects of a program
 into one bucket where eventually
 you never find the right spot
 ...or manage to manage that code, ever again.


From the gentleman who brought this bit of code:

a 
 href=javascript:void((function()%7Bvar%20e%3D%22%5B!is%5Bshadow%5D!is%5Bsystem%5D%5D%22%2Ct%3Dprompt(%22Please%20define%20a%20filter...%22%2Ce)%3Be%3Dt%7C%7Ce%3Bvar%20n%3D%5B%5D%3B%24tw.utils.each(%24tw.wiki.filterTiddlers(e)%2Cfunction(e)%7Bvar%20t%3D0%2Cr%3D%24tw.wiki.getTiddler(e)%3Bn.push(%7Btitle%3Ae%2Csize%3A%24tw.wiki.getTiddlerAsJson(e).length.toString()%2Cfields%3AObject.keys(r.fields).length%2Ctype%3Ar.fields%5B%22type%22%5D%7C%7C%22%22%7D)%7D)%3Bn.sort(function(e%2Ct)%7Breturn%20t.size-e.size%7D)%3Bvar%20r%3D%22%22%3B%24tw.utils.each(n%2Cfunction(e)%7Br%2B%3De.size%2B%22%20%5B%5B%22%2Be.title%2B%22%5D%5D%2C%20%22%2Be.fields%2B%22%20fields%22%2B(e.type%3F%22%2C%20%22%2Be.type%3A%22%22)%2B%22%5Cn%22%7D)%3Bvar%20i%3D%22%24%3A%2FStoryList%22%2Cs%3D%22%24%3A%2Ftemp%2Ftiddler-sizes%22%2Co%3D%24tw.wiki.getTiddlerList(i)%3B%24tw.wiki.addTiddler(new%20%24tw.Tiddler(%7Btitle%3As%2Ctext%3A'%22%22%22%5Cn'%2Br%2B'%22%22%22'%7D))%3Bif(o.indexOf(s)%3D%3D%3D-1)%7Bo.unshift(s)%7D%24tw.wiki.addTiddler(new%20%24tw.Tiddler(%7Btitle%3Ai%7D%2C%24tw.wiki.getTiddler(i)%2C%7Blist%3Ao%7D))%3Bconsole.log(r)%7D)())%3B
  
 title=Bookmark me!tiddler sizes/a


in 
http://tbdemo.tiddlyspot.com/#Draft%20of%20%27Console%20Log%20Of%20Tiddler%20Sizes%27

I'm not sure, though, that you answered Mat's question: How do I integrate 
a javascript into TW?

Only some non-TW javascripts can be incorporated in TW at all. Nothing 
requiring a modification of the body element such as body 
onload=dynAnimation8() will work. Nothing that uses a OnClick= like 
input type=button value=  1   onClick=head1() will work because 
TW with its security concerns strips away the OnClick. Nothing that 
requires the script to be located at a specific location such as 
immediately after a textarea will work. Javascripts that can be completely 
contained in the head/head section and interact with named elements or 
windows components may work. Javascripts that can be completely self 
contained like Tobias' Console Log Of Tiddler Sizes may work.

Scripts that are stored in the head/head section can be handled in TW 
by giving the tiddler the tag $:/tags/RawMarkup 

You can invoke a javascript by using the same trick Tobias used in the bit 
of code above by entering a href=javascript:head1()Click here for 
javascript head1/a. You can use this, sometimes, to get around the 
OnClick restriction.

If a task is possible using TW systems and components, then do it that way. 
If you're going to play with Javascripts and TW, then do lot's of backups. 



 

-- 
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.


Re: [tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Tobias Beer


 answers some of the questions I think about. put it in TB5?


http://tb5.tiddlyspot.com/#Code-101

Best wishes, Tobias. 

-- 
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.


Re: [tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Tobias Beer


 Could there be a learning group decicated to upskilling people who might 
 be able to use a macro into people who can begin to learn JS in the TW way?


This is why the dev group should be a github repo... one that doesn't 
(necessarily) have any content but is rather a place to post issues and 
discuss / edit code... which might eventually be part of that repo as best 
practice. Some TiddlyWiki would nice to showcase these things in the right 
context.

Best wishes, Tobias.

-- 
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.


Re: [tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Alex Hough
I think we are approaching the barrier between keen user and developer.
Keen user would like a the learning curve associated with using TW to
develop in a similarly pleasant manner onto the foothills of Javascript so
that Keen User can begin to become more of a developer.

I think Tobias has addressed this: sadly its not as simple as Keen User
would like. Some of the design decision associated with TW makes an
ordinary Javascript course having little value.

There are coding conventions in TW which to the beginner JS  programmer may
find puzzling. For example in Tobias' example plugin we have a line which
says tid = tid

var tid = tid


I think there is a demand for learning JS in the TW way for Keen Users --
I'd include myself in this. Could there be a learning group decicated to
upskilling people who might be able to use a macro into people who can
begin to learn JS in the TW way?

best wishes

Alex

On 21 January 2015 at 14:32, Tobias Beer beertob...@gmail.com wrote:

 From the gentleman who brought this bit of code:


 There's a mild difference.
 This thing is not designed to run in the context of a page.
 It's intended for a browser to just run it.

 But yes, you are absolutely right, if the core of TiddlyWiki were to
 change,
 it would be an awful endeavour to fix starting this bookmarklet based on
 that url encoded nastiness it is.
 Actually, a bookmarklet should be provided with a version in the title.

 I'm not sure, though, that you answered Mat's question:

 How do I integrate a javascript into TW?


 I think I mentioned: *modules*

 At least, that seems to be the official answer.
 Although, I would personally prefer something else.
 But I do understand that it's a safe choice.

 Nothing requiring a modification of the body element such as body
 onload=dynAnimation8() will work.


 There shouldn't be code that requires you to do that and if there is, it's
 from the dark ages.


 Nothing that uses a OnClick= like input type=button value=  1  
 onClick=head1() will work because TW with its security concerns strips
 away the OnClick.


 Same thing, it's simply no longer how you bind functions to events
 ...unless you want to keep doing it that way,
 which will not be supported in TiddlyWiki, by default.


 Nothing that requires the script to be located at a specific location

 such as immediately after a textarea will work.


 You an write code that does just that, only you will have to wrap it in a
 module
 and figure out the appropriate way to bind it to that textarea.


 JavaScripts that can be completely contained in the head/head section
 and interact with named elements or windows components may work.

 Scripts that are stored in the head/head section can be handled in TW
 by giving the tiddler the tag $:/tags/RawMarkup


 including a 3rd party library @ dev5
 http://dev5.tiddlyspot.com/#including%20a%203rd%20party%20library

 Javascripts that can be completely self contained like Tobias' Console Log
 Of Tiddler Sizes may work.


 It's actually not so self-contained in that it relies upon core functions
 of TiddlyWiki to actually do its thing.


 You can invoke a javascript by using the same trick Tobias used in the
 bit of code above by entering a href=javascript:head1()Click here
 for javascript head1/a. You can use this, sometimes, to get around the
 OnClick restriction.


 It looks like this won't be available for too long...

 https://github.com/Jermolene/TiddlyWiki5/issues/1350

 I sure hope that this ticket will be implemented in a way that you do get
 an option to activate it.


 If a task is possible using TW systems and components, then do it that
 way.

 If you're going to play with Javascripts and TW, then do lot's of backups.


 ...and use your browser console, a decent text-editor, version control,
 etc...

 Best wishes, Tobias.

 --
 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.


-- 
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.


[tw] Re: Free JavaScripts site! - how install?

2015-01-21 Thread Tobias Beer


 From the gentleman who brought this bit of code:


There's a mild difference.
This thing is not designed to run in the context of a page.
It's intended for a browser to just run it.

But yes, you are absolutely right, if the core of TiddlyWiki were to change,
it would be an awful endeavour to fix starting this bookmarklet based on 
that url encoded nastiness it is.
Actually, a bookmarklet should be provided with a version in the title.

I'm not sure, though, that you answered Mat's question: 

How do I integrate a javascript into TW?


I think I mentioned: *modules*

At least, that seems to be the official answer.
Although, I would personally prefer something else.
But I do understand that it's a safe choice.

Nothing requiring a modification of the body element such as body 
 onload=dynAnimation8() will work.


There shouldn't be code that requires you to do that and if there is, it's 
from the dark ages.
 

 Nothing that uses a OnClick= like input type=button value=  1   
 onClick=head1() will work because TW with its security concerns strips 
 away the OnClick.


Same thing, it's simply no longer how you bind functions to events
...unless you want to keep doing it that way,
which will not be supported in TiddlyWiki, by default.
 

 Nothing that requires the script to be located at a specific location 

such as immediately after a textarea will work.


You an write code that does just that, only you will have to wrap it in a 
module
and figure out the appropriate way to bind it to that textarea.
 

 JavaScripts that can be completely contained in the head/head section 
 and interact with named elements or windows components may work.

Scripts that are stored in the head/head section can be handled in TW 
 by giving the tiddler the tag $:/tags/RawMarkup 


including a 3rd party library @ dev5 
http://dev5.tiddlyspot.com/#including%20a%203rd%20party%20library

Javascripts that can be completely self contained like Tobias' Console Log 
 Of Tiddler Sizes may work.


It's actually not so self-contained in that it relies upon core functions 
of TiddlyWiki to actually do its thing.
 

 You can invoke a javascript by using the same trick Tobias used in the bit 
 of code above by entering a href=javascript:head1()Click here for 
 javascript head1/a. You can use this, sometimes, to get around the 
 OnClick restriction.


It looks like this won't be available for too long...

https://github.com/Jermolene/TiddlyWiki5/issues/1350

I sure hope that this ticket will be implemented in a way that you do get 
an option to activate it.
 

 If a task is possible using TW systems and components, then do it that way.
  

If you're going to play with Javascripts and TW, then do lot's of backups. 


...and use your browser console, a decent text-editor, version control, 
etc...

Best wishes, Tobias.

-- 
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.