Re: [tw] Re: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-02-06 Thread Jimmy Armand
Oh. nice solution. Will try this one too.

Thanks!

On Thursday, 29 January 2015 13:38:51 UTC-5, BJ wrote:
>
> you are looking for
>
> exports.htmlUnsafeElements = "script".split(",");
>
> but I think it would be better to include a couple of macros to switch 
> scripting on and off:
>
> create a tiddler (any name will do) and set the type to "application/json"
> add field "module-type" with value "macro"
>
> and insert in it
>
> (function(){
>
> /*jslint node: true, browser: true */
> /*global $tw: false */
> "use strict";
>
> /*
> Information about this macro
> */
> exports.name = "enablescript";
>
> exports.params = [
> ];
>
> /*
> Run the macro
> */
> exports.run = function() {
>   $tw.config.htmlUnsafeElements = "";
> return "";
> };
> })();
>
>
>
> then another tiddler with the type to "application/json"
> add field "module-type" with value "macro"
>
> (function(){
> /*jslint node: true, browser: true */
> /*global $tw: false */
>
> /*
> Information about this macro
> returns value of key in a data json tiddler
> note that macros are not connected with the refresh mechanism -use with 
> caution.
> */exports.name = "disablescript";
> exports.params = [
>
> ];
>
> /*
> Run the macro
> */
> exports.run = function() {
> $tw.config.htmlUnsafeElements = "script".split(",");
> return "";
> }
> })();
>
>
>
> then use in a tiddler like this
>
> <>
> 
> alert("Hooray");
> 
> <>
> 
> alert("Hooray2");
> 
>
> cheers
>
> BJ
> On Thursday, January 29, 2015 at 11:18:18 AM UTC-6, Jimmy Armand wrote:
>>
>> Sorry but I'm not sure to understand what you mean. Is it that there's a 
>> parameter named script that will help me do what I want? Because in the 
>> config.js, there's no "script" configuration to be found.
>>
>> On Wednesday, 28 January 2015 19:12:02 UTC-5, Tobias Beer wrote:
>>>
>>> It's not hard to find. If you search the source tree for "script" 
>>>> (including quotes) you'll see this in *config.js*...
>>>>
>>>
>>> Thanks for the pointers.
>>>
>>

-- 
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: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-02-06 Thread Jimmy Armand
Thanks Will try this today

On Thursday, 29 January 2015 15:12:01 UTC-5, Tobias Beer wrote:
>
> While having no plans of using this (yet),
> however, seeing how that cat is out of the box anyhow,
> here's a single *script* macro to toggle 

[tw] Re: Why is my ButtonWidget does not talk my variable???

2015-02-06 Thread Jimmy Armand
lol. No it is not a secret. I'm glad if I can help. Here's how I managed to 
make it work:

  <$select field='selected-template' class="medium-width padding">
  <$list filter="GCNETTemplate ACCESSTemplate COGETemplate">
  <>
  
  
  <$set name="mytemplate" value={{!!selected-template}}>
  <$list filter="[]">
  <$button message="tm-new-tiddler" param={{!!title}} 
class="w8-button l-blue inline left-margin">Create 
<>
  
  

see ya!

On Wednesday, 4 February 2015 01:03:08 UTC-5, RichShumaker wrote:
>
> I agree with Stephan, do tell.
>
> Rich Shumaker
>

-- 
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: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-01-29 Thread Jimmy Armand
Sorry but I'm not sure to understand what you mean. Is it that there's a 
parameter named script that will help me do what I want? Because in the 
config.js, there's no "script" configuration to be found.

On Wednesday, 28 January 2015 19:12:02 UTC-5, Tobias Beer wrote:
>
> It's not hard to find. If you search the source tree for "script" 
>> (including quotes) you'll see this in *config.js*...
>>
>
> Thanks for the pointers.
>

-- 
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: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-01-29 Thread Jimmy Armand
That would be great. Thanks

On Wednesday, 28 January 2015 11:25:39 UTC-5, Jeremy Ruston wrote:
>
> TiddlyWiki is designed to block JavaScript in wiki text content to make 
> sure that it is safe to share wiki text content. It's necessary so that we 
> can explore multi-user server configurations and federation. If the act of 
> viewing content authored by someone else causes executable JS code to run 
> then it becomes possible for a malicious actor to, for example, craft a 
> message that actually contains code to steal or delete your personal 
> information.
>
> So, in TW5, there is a strict distinction between wiki text tiddlers 
> (text/vnd.tiddlywiki) and JavaScript module tiddlers (type text/javascript, 
> and with a module-type field). That allows us to filter content from other 
> sources to ensure that we don't allow executable code.
>
> Obviously, these aren't concerns for many users who are working privately. 
> We can serve their needs with a plugin that explicitly enables inline 
> JavaScript, but it's not something that will ever be supported directly by 
> the core.
>
> Best wishes
>
> Jeremy.
>
>
>
>
> On Wed, Jan 28, 2015 at 4:15 PM, Jimmy Armand  > wrote:
>
>> Yeah but I think that this method is not really nice since I want to put 
>> the javascript in a tiddler (text/vnd.tiddlywiki)
>>
>>
>> On Wednesday, 28 January 2015 06:44:47 UTC-5, Stephan Hradek wrote:
>>>
>>> Go to tiddlywiki.com
>>>
>>> Create a New Tiddler
>>>
>>> Paste this into the tiddler:
>>>
>>> 
>>> alert("Hooray");
>>> 
>>>
>>> Set the type to "text/html"
>>>
>>> Finish editing
>>>
>>> Hooray!
>>>
>>>  -- 
>> 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+...@googlegroups.com .
>> To post to this group, send email to tiddl...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/tiddlywiki.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Jeremy Ruston
> mailto:jeremy...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-01-28 Thread Jimmy Armand
It make sens. Thanks!

On Wednesday, 28 January 2015 11:25:39 UTC-5, Jeremy Ruston wrote:
>
> TiddlyWiki is designed to block JavaScript in wiki text content to make 
> sure that it is safe to share wiki text content. It's necessary so that we 
> can explore multi-user server configurations and federation. If the act of 
> viewing content authored by someone else causes executable JS code to run 
> then it becomes possible for a malicious actor to, for example, craft a 
> message that actually contains code to steal or delete your personal 
> information.
>
> So, in TW5, there is a strict distinction between wiki text tiddlers 
> (text/vnd.tiddlywiki) and JavaScript module tiddlers (type text/javascript, 
> and with a module-type field). That allows us to filter content from other 
> sources to ensure that we don't allow executable code.
>
> Obviously, these aren't concerns for many users who are working privately. 
> We can serve their needs with a plugin that explicitly enables inline 
> JavaScript, but it's not something that will ever be supported directly by 
> the core.
>
> Best wishes
>
> Jeremy.
>
>
>
>
> On Wed, Jan 28, 2015 at 4:15 PM, Jimmy Armand  > wrote:
>
>> Yeah but I think that this method is not really nice since I want to put 
>> the javascript in a tiddler (text/vnd.tiddlywiki)
>>
>>
>> On Wednesday, 28 January 2015 06:44:47 UTC-5, Stephan Hradek wrote:
>>>
>>> Go to tiddlywiki.com
>>>
>>> Create a New Tiddler
>>>
>>> Paste this into the tiddler:
>>>
>>> 
>>> alert("Hooray");
>>> 
>>>
>>> Set the type to "text/html"
>>>
>>> Finish editing
>>>
>>> Hooray!
>>>
>>>  -- 
>> 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+...@googlegroups.com .
>> To post to this group, send email to tiddl...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/tiddlywiki.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Jeremy Ruston
> mailto:jeremy...@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.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-01-28 Thread Jimmy Armand
Yeah but I think that this method is not really nice since I want to put 
the javascript in a tiddler (text/vnd.tiddlywiki)

On Wednesday, 28 January 2015 06:44:47 UTC-5, Stephan Hradek wrote:
>
> Go to tiddlywiki.com
>
> Create a New Tiddler
>
> Paste this into the tiddler:
>
> 
> alert("Hooray");
> 
>
> Set the type to "text/html"
>
> Finish editing
>
> Hooray!
>
>

-- 
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: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-01-28 Thread Jimmy Armand
In fact what would be nice is to be able to import javascript directly in 
the tiddler, like we can do with the  tags. With css it's 
easy: Create a tiddler put your css et voilĂ 

The same would have been nice (a major nice to have IMO) to have

On Tuesday, 27 January 2015 14:43:24 UTC-5, PMario wrote:
>
> Hi Jimmy, 
>
> TiddlyWiki 5 doesn't use jQuery anymore. 
>
> script tags in the tiddler source are not executed, due to security 
> restrictions. 
>
> The tw2/source tree is only there to test the TWclassic build procedure. 
>
> Can you explain, what you want to achieve?
>
> -mario
>

-- 
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: Why is my ButtonWidget does not talk my variable???

2015-01-27 Thread Jimmy Armand
I figured it out.

thanks

On Tuesday, 27 January 2015 14:05:45 UTC-5, Jimmy Armand wrote:
>
> So I was assuming that GCNETTemplate 1, ACCESSTemplate 1 or COGETemplate 
> 1 would have been created base on my selection. But instead I have a 
> template based on the default template titled: New Tiddler
>
> On Tuesday, 27 January 2015 13:57:22 UTC-5, Alberto Molina wrote:
>>
>> Hi Jimmy,
>>
>>  the button keeps creating new Tiddlers instead of using my existing ones
>>
>>
>> I don't understand. What do you want to achieve? Your button says: 
>> "Create a new tiddler (based on a template) each time you hit the button". 
>> If that's not the intended behaviour, what are you expecting to get?
>>
>> Regards, 
>>
>> Alberto
>>
>>  
>>
>

-- 
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: Why is my ButtonWidget does not talk my variable???

2015-01-27 Thread Jimmy Armand
So I was assuming that GCNETTemplate 1, ACCESSTemplate 1 or COGETemplate 1 
would have been created base on my selection. But instead I have a template 
based on the default template titled: New Tiddler

On Tuesday, 27 January 2015 13:57:22 UTC-5, Alberto Molina wrote:
>
> Hi Jimmy,
>
>  the button keeps creating new Tiddlers instead of using my existing ones
>
>
> I don't understand. What do you want to achieve? Your button says: "Create 
> a new tiddler (based on a template) each time you hit the button". If 
> that's not the intended behaviour, what are you expecting to get?
>
> Regards, 
>
> Alberto
>
>  
>

-- 
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: Why is my ButtonWidget does not talk my variable???

2015-01-27 Thread Jimmy Armand
Sorry for not being clear.
What I want to do is having all templates listed in a select widget. Based 
on the selection made, when I push the button, the corresponding templates 
(tiddler) is created. A bit like the task example but since I have many 
Templates to choose from, I put them in a select box instead of having one 
button per template.

On Tuesday, 27 January 2015 13:57:22 UTC-5, Alberto Molina wrote:
>
> Hi Jimmy,
>
>  the button keeps creating new Tiddlers instead of using my existing ones
>
>
> I don't understand. What do you want to achieve? Your button says: "Create 
> a new tiddler (based on a template) each time you hit the button". If 
> that's not the intended behaviour, what are you expecting to get?
>
> Regards, 
>
> Alberto
>
>  
>

-- 
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] Why is my ButtonWidget does not talk my variable???

2015-01-27 Thread Jimmy Armand
Hi all!
Another question !

I have the following select wich works since I can see the result:

<$select field='selected-template'>
  <$list filter="GCNETTemplate ACCESSTemplate COGETemplate">
<>
  


<$set name="mytemplate" value={{!!selected-template}}>
  ''Result: ''<>
  <$list filter="[]">
<$button message="tm-new-tiddler" param=<> 
class="button">Create <>
  



But obviously, something's wrong because the button keeps creating new 
Tiddlers instead of using my existing ones. Please Help!!!

Thanks

-- 
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: Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-01-27 Thread Jimmy Armand
K. Thx. I will go with the Editable-Tables

On Tuesday, 27 January 2015 09:52:53 UTC-5, Stephen Kimmel wrote:
>
> Jimmy,
>
> The $Macrocall is the main pathway to a complex javascript. When I did my 
> marathoning tiddler, I used a number of different ways of creating tables 
> using the $macrocall javascripts. One approach was to have each cell make 
> the $macrocall passing the appropriate parameters to the javascript. The 
> other approach was to have a single $macrocall in the destination tiddler 
> where I wanted the table and have the javascript create the table as its 
> output. There are weaknesses to both approaches and I'm certain that there 
> are more elegant ways of accomplishing that.
>
> One possibility you might want to consider using, depending on just what 
> you want to accomplish, is Danielo's Editable-Tables. In that approach, 
> each line of the table refers to a separate tiddler and each cell is a 
> field stored in that tiddler. I use the editable-tables a lot.
>

-- 
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] Simple Javascript insertion in tiddlers (text/vnd.tiddlywiki)

2015-01-27 Thread Jimmy Armand
Hi,
I've been playing with tiddly wiki for about a week now and let me say that 
it is really great!

But something simple I want to do but I cannot manage to find how to do it: 
Insert Javascript into a tiddler. What I want to do is use jquery datatable 
on a table I've created. First, I've put the "datatable.js" into the
...tw2\source\tiddlywiki\jquery folder (don't know if it should be there 
tough...) and what I would like to do is put the following code:


$(document).ready(function() {
$(table).DataTable();
} );


somewhere so all my tables gets the "datatable touch". From what I 
understand, you cannot do that with macros since macros cannot modify the 
DOM. Am I right?

So, what is the easiest way to acheive that without playing into tiddlywiki 
core?

Thanks!

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