[twdev] [TW5] Is anyone able to turn jscolor into a plugin?

2014-04-07 Thread Stephan Hradek
Hi!

As FireFox does not (seem to) have a colorpicker for (for example the) 
color fields of tiddlers, I searched a bit and found 
jscolorhttp://jscolor.comwhich I think is really useful.

My problem in converting it is that I have no idea:

a) where to patch/modify code so that jscolor.color( MyInputElement ) is 
executed to bind the picker to the input element
or
b) where to put a loop over document.querySelector( 'input[type=color]' ) 
so that all displayed color fields get the picker
and
c) How to include and access the required pictures

There is als Flexi http://www.daviddurman.com/flexi-color-picker which 
is just half in size (4.3kb) but does not require any external binaries. 
But this does not seem to attach to any input fields so here I have no idea 
at all how to make good use of that.

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


[twdev] Re: [TW5] Is anyone able to turn jscolor into a plugin?

2014-04-07 Thread Stephan Hradek
The nightly FF won't run on my old OS X :(

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


Re: [twdev] Feature request for $:/core/modules/widgets/fieldmangler.js with code

2014-04-07 Thread Arlen Beiler
Hi guys, just checking in to see how everything is going. I'd love to see
these two bits in 5.0.9, but if there is other things you are waiting on,
that's fine. Also, the newtiddler bit answers everything in skeeve's plugin
without needing a separate tiddler for the skeleton. I'm also adding a
couple more things for tw5.com or the system namespace via comments. For
that matter, why don't we just use the .tid format for the html tiddler
store? It seems like it would work great and shouldn't be hard to change
over. I'm sure it'd break every tiddlywiki and its neighbor, unless the
upgrade mechanism allows for that already. Actually, it shouldn't break
anything.

Just some thoughts. --Arlen


On Mon, Mar 31, 2014 at 1:44 PM, Arlen Beiler arlen...@gmail.com wrote:

 Hi Everyone,
 I closed that one and then opened a new pull request:
 https://github.com/Jermolene/TiddlyWiki5/pull/510. I think I understood
 what you wanted. Is there anything I am missing?
  --Arlen




 On Wed, Mar 26, 2014 at 6:08 PM, Jeremy Ruston jeremy.rus...@gmail.comwrote:

 Hi Arlen

 I'll reply on the pull request you created:

 https://github.com/Jermolene/TiddlyWiki5/pull/503

  Best wishes

 Jeremy



 On Mon, Mar 24, 2014 at 8:44 PM, Arlen Beiler arlen...@gmail.com wrote:

 Alright, how's this?

 this.createText  = this.getAttribute(create,false);
 // Process create param
 if(this.createText) {
   var createTiddler =
 $tw.wiki.deserializeTiddlers(application/x-tiddler,this.createText);
   createTiddler[0]['title'] = this.mangleTitle;
   if(!this.wiki.tiddlerExists(this.mangleTitle))
 this.wiki.addTiddler(createTiddler[0]);
 }




 On Mon, Mar 24, 2014 at 10:26 AM, Arlen Beiler arlen...@gmail.comwrote:

 Hi Jeremy,
 Would the syntax use line breaks? Or were you thinking about all on one
 line? How do line breaks work with wikitext like that?

 --Arlen


 On Thu, Mar 20, 2014 at 1:16 PM, Jeremy Ruston jeremy.rus...@gmail.com
  wrote:

 Hi Arlen

 Good stuff. My intention is to do something very similar but for the
 literal tiddler syntax to resemble a .tid file:

 title: myTitle
 tags: one two three
 text: This is the text

 I was primarily thinking about using the syntax with the new tiddler
 message, but it's a good idea to support it on the fieldmangler widget as
 well.

  Best wishes

 Jeremy





 On Thu, Mar 20, 2014 at 1:22 PM, Arlen Beiler arlen...@gmail.comwrote:

 Hi Everyone,
 Here is the result of my latest endeavor. This adds a create
 parameter to the fieldmangler widget which creates the tiddler specified 
 in
 tiddler with the fields in create. This allows temp tiddlers to be
 initialized with state data without needing a button click. Notice that 
 it
 only creates it if it doesn't exist.

 this.mangleTitle = ... ; //Insert after this line in execute()
 this.createText  = this.getAttribute(create,false);
 if(typeof(this.createText) === string) {
   try{ this.createText = JSON.parse(this.createText); }
   catch (e) { console.error(e); this.createText = false; }
   console.log(this.createText);
   if(this.createText){
 this.createText['title'] = this.mangleTitle;
 if(!this.wiki.tiddlerExists(this.mangleTitle))
   this.wiki.addTiddler(this.createText);
   }
 }

 And here is a tiddler that uses it. This tiddler creates a button
 that toggles the story river between centered and normal. Centered is
 default.

  \define createStateTiddler()
 { text: $(default)$ , tags: $:/tags/stylesheet }
 \end
 \define state-1-css()

 \end
 \define state-2-css()
 @media (min-width: 770px) { .story-river { margin: 0 auto; }
 .sidebar-header { left: 50%; right: 0; padding-left: 413px; } }
 \end
 $set name=default value=state-2-css 
 span title=Toggle width/sidebar
  $fieldmangler tiddler=$:/temp/toggle-centered
 create=createStateTiddler
 $reveal type=match state=$:/temp/toggle-centered
 text=state-1-css default=$(default)$
 $button message=tw-add-tag param=$:/tags/stylesheet
 set=$:/temp/toggle-centered setTo=state-2-css  class=btn-invisible
 centered-toggle-1{{$:/_images/right-arrow-button}}/$button
 /$reveal$reveal type=match state=$:/temp/toggle-centered
 text=state-2-css
 $button message=tw-add-tag param=$:/tags/stylesheet
 set=$:/temp/toggle-centered setTo=state-1-css class=btn-invisible
 centered-toggle-2{{$:/_images/left-arrow-button}}/$button
 /$reveal/$fieldmangler
 /span
 /$set

 If you don't have the corresponding images for the buttons, just
 remove the btn-invisible class from the buttons. I'm putting this out as 
 a
 feature request (a hackability request?).

 I haven't changed the buttons yet, so that is how they were working
 before I did this. I had to click the button once to create the tiddler,
 and then a second time to finally see something happen. This way, 
 whatever
 way I initialize it I see the effect on start up.

 Is this something that could be added to the core? Note that
 create, as I wrote it, must be valid JSON and the title gets 
 overwritten
 if it is there. Enjoy!

 --Arlen

 --
 You 

Re: [twdev] Feature request for $:/core/modules/widgets/fieldmangler.js with code

2014-04-07 Thread Danielo Rodríguez
Hello Arlen 

Could you explain a little bit what are you talking about? Some of your 
sentences makes me curious about the bits you talk about. But since you have 
commented here and in github I'm a bit lost. Are those things to be implemented 
in the next TW5 release? 

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


Re: [twdev] Feature request for $:/core/modules/widgets/fieldmangler.js with code

2014-04-07 Thread Jeremy Ruston
Hi Arlen

 I'd love to see these two bits in 5.0.9, but if there is other things you
are waiting on, that's fine

Apologies, I've been tied up for the last few days with the saner-filters
branch where I'm working on improving filter performance.

 For that matter, why don't we just use the .tid format for the html
tiddler store? It seems like it would work great and shouldn't be hard to
change over. I'm sure it'd break every tiddlywiki and its neighbor, unless
the upgrade mechanism allows for that already. Actually, it shouldn't break
anything.

At the moment the tiddler store in TiddlyWiki HTML files is in the same
format as TiddlyWiki Classic, which is definitely only a provisional
decision.

Any change will be driven primarily by the desire to make the tiddler data
easier to extract and parse for external tooling.

Best wishes

Jeremy





On Mon, Apr 7, 2014 at 2:13 PM, Arlen Beiler arlen...@gmail.com wrote:

 Hi guys, just checking in to see how everything is going. I'd love to see
 these two bits in 5.0.9, but if there is other things you are waiting on,
 that's fine. Also, the newtiddler bit answers everything in skeeve's plugin
 without needing a separate tiddler for the skeleton. I'm also adding a
 couple more things for tw5.com or the system namespace via comments. For
 that matter, why don't we just use the .tid format for the html tiddler
 store? It seems like it would work great and shouldn't be hard to change
 over. I'm sure it'd break every tiddlywiki and its neighbor, unless the
 upgrade mechanism allows for that already. Actually, it shouldn't break
 anything.

 Just some thoughts. --Arlen


 On Mon, Mar 31, 2014 at 1:44 PM, Arlen Beiler arlen...@gmail.com wrote:

 Hi Everyone,
 I closed that one and then opened a new pull request:
 https://github.com/Jermolene/TiddlyWiki5/pull/510. I think I understood
 what you wanted. Is there anything I am missing?
  --Arlen




 On Wed, Mar 26, 2014 at 6:08 PM, Jeremy Ruston 
 jeremy.rus...@gmail.comwrote:

 Hi Arlen

 I'll reply on the pull request you created:

 https://github.com/Jermolene/TiddlyWiki5/pull/503

  Best wishes

 Jeremy



 On Mon, Mar 24, 2014 at 8:44 PM, Arlen Beiler arlen...@gmail.comwrote:

 Alright, how's this?

 this.createText  = this.getAttribute(create,false);
 // Process create param
 if(this.createText) {
   var createTiddler =
 $tw.wiki.deserializeTiddlers(application/x-tiddler,this.createText);
   createTiddler[0]['title'] = this.mangleTitle;
   if(!this.wiki.tiddlerExists(this.mangleTitle))
 this.wiki.addTiddler(createTiddler[0]);
 }




 On Mon, Mar 24, 2014 at 10:26 AM, Arlen Beiler arlen...@gmail.comwrote:

 Hi Jeremy,
 Would the syntax use line breaks? Or were you thinking about all on
 one line? How do line breaks work with wikitext like that?

 --Arlen


 On Thu, Mar 20, 2014 at 1:16 PM, Jeremy Ruston 
 jeremy.rus...@gmail.com wrote:

 Hi Arlen

 Good stuff. My intention is to do something very similar but for the
 literal tiddler syntax to resemble a .tid file:

 title: myTitle
 tags: one two three
 text: This is the text

 I was primarily thinking about using the syntax with the new tiddler
 message, but it's a good idea to support it on the fieldmangler widget as
 well.

  Best wishes

 Jeremy





 On Thu, Mar 20, 2014 at 1:22 PM, Arlen Beiler arlen...@gmail.comwrote:

 Hi Everyone,
 Here is the result of my latest endeavor. This adds a create
 parameter to the fieldmangler widget which creates the tiddler 
 specified in
 tiddler with the fields in create. This allows temp tiddlers to be
 initialized with state data without needing a button click. Notice that 
 it
 only creates it if it doesn't exist.

 this.mangleTitle = ... ; //Insert after this line in execute()
 this.createText  = this.getAttribute(create,false);
 if(typeof(this.createText) === string) {
   try{ this.createText = JSON.parse(this.createText); }
   catch (e) { console.error(e); this.createText = false; }
   console.log(this.createText);
   if(this.createText){
 this.createText['title'] = this.mangleTitle;
 if(!this.wiki.tiddlerExists(this.mangleTitle))
   this.wiki.addTiddler(this.createText);
   }
 }

 And here is a tiddler that uses it. This tiddler creates a button
 that toggles the story river between centered and normal. Centered is
 default.

  \define createStateTiddler()
 { text: $(default)$ , tags: $:/tags/stylesheet }
 \end
 \define state-1-css()

 \end
 \define state-2-css()
 @media (min-width: 770px) { .story-river { margin: 0 auto; }
 .sidebar-header { left: 50%; right: 0; padding-left: 413px; } }
 \end
 $set name=default value=state-2-css 
 span title=Toggle width/sidebar
  $fieldmangler tiddler=$:/temp/toggle-centered
 create=createStateTiddler
 $reveal type=match state=$:/temp/toggle-centered
 text=state-1-css default=$(default)$
 $button message=tw-add-tag param=$:/tags/stylesheet
 set=$:/temp/toggle-centered setTo=state-2-css  
 class=btn-invisible
 centered-toggle-1{{$:/_images/right-arrow-button}}/$button
 

Re: [twdev] [tw5] drag n drop plugins and tiddlyweb/tank

2014-04-07 Thread Jeremy Ruston
Hi Chris

 This is because it is trying to save to a bag that does not exist: default.
The tiddler appears to be assigned this bag when it is dropped (or maybe it
gets it from the origin?)

Ah, yes, sounds like the plugin is coming in with a bag field, and TW5 is
blindly accepting it. I guess we should remove the bag field on import so
that the same processing would occur as with a manually newly created
tiddler?

 getting it as JSON results in JSON which is _not_ the expected structure
of JSON tiddler, it is the object structure with a single key of tiddlers
and sub object of a few tiddlers

The JSON structure you see is the correct format for the body of a TW5
plugin (which is just a bunch of tiddlers packed into one as a blob of
JSON).

If a tiddler has the type application/json does TiddlyWeb serve the text
field directly as the JSON representation, rather than serialising the
tiddler as normal? That's a bit unexpected if so. Is there a way I can
retrieve the ordinary serialized JSON representation?

Best wishes

Jeremy.









On Mon, Apr 7, 2014 at 6:35 PM, chris.d...@gmail.com wrote:



 Someone is experimenting with importing plugins into a TW5 hosted on
 Tank[1] and having some difficulties. I've tried to replicate their
 experience and am also having difficulties (but I'm not sure they
 are the same).

 There are at least two different issues:

 1. When dragging a plugin[2] from its origin into the tank-hosted
tw5 there is a 409 conflict trying to save the tiddler. This is
because it is trying to save to a bag that does not exist:
default. The tiddler appears to be assigned this bag when it is
dropped (or maybe it gets it from the origin?).

If I change the bag field the tiddler does save:

https://tank.peermore.com/bags/cjdtw5/tiddlers/%24%3A%
 2Fplugins%2Fskeeve%2Flistselect.txt

 2. However, since the tiddler has a type of application/json,
getting it as JSON results in JSON which is _not_ the expected
structure of JSON tiddler, it is the object structure with a
single key of tiddlers and sub object of a few tiddlers:

https://tank.peermore.com/bags/cjdtw5/tiddlers/%24%3A%
 2Fplugins%2Fskeeve%2Flistselect.json

This means that the adaptor mechanism ends up with a tiddler
which has undefined text and other fields.

 Presumably a bit more manipulation is required in a couple different
 places in the stack.

 I'm not posting this as an issue as it is not clear what part of the
 stack should be held responsible.


 [1] https://tank.peermore.com/

 [2] The sample plugin is
 http://tiddlystuff.tiddlyspot.com/#%24%3A%2Fplugins%2Fskeeve%2Flistselect
 --
 Chris Dent   http://burningchrome.com/
 [...]

 --
 You received this message because you are subscribed to the Google Groups
 TiddlyWikiDev group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to tiddlywikidev+unsubscr...@googlegroups.com.
 To post to this group, send email to tiddlywikidev@googlegroups.com.
 Visit this group at http://groups.google.com/group/tiddlywikidev.
 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 
TiddlyWikiDev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] [tw5] drag n drop plugins and tiddlyweb/tank

2014-04-07 Thread chris . dent

On Mon, 7 Apr 2014, Jeremy Ruston wrote:


This is because it is trying to save to a bag that does not exist: default.
The tiddler appears to be assigned this bag when it is dropped (or maybe it
gets it from the origin?)


Ah, yes, sounds like the plugin is coming in with a bag field, and TW5 is
blindly accepting it. I guess we should remove the bag field on import so
that the same processing would occur as with a manually newly created
tiddler?


Yes, I just tried simply removing the contents of the bag field
rather than setting it to an appropriate bag and the right thing
happened. So I would guess killing that field on drag would be the
right way to go.


If a tiddler has the type application/json does TiddlyWeb serve the text
field directly as the JSON representation, rather than serialising the
tiddler as normal? That's a bit unexpected if so. Is there a way I can
retrieve the ordinary serialized JSON representation?


The results that are happening is because of two things:

The tiddler is being PUT with content-type: application/json

   AND

The JSON object has a type field set to 'application/json'.

The upshot of this is that the tiddler is being accepted as a
pseudo-binary tiddler. When you GET the tiddler with either a
default Accept header OR with an Accept header that matches its
type you will get it in its raw form (the contents of the text
field) with a sent content-type field of the stored 'type' field.

This has a side effect of making text/plain, text/html and
application/json have special meaning when accessing a tiddler.

To get the tiddler back as a tiddler in JSON form it needs to put
with a 'type' field that is not application/json.

--
Chris Dent   http://burningchrome.com/
[...]

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


Re: [twdev] Re: [TW5] Is anyone able to turn jscolor into a plugin?

2014-04-07 Thread Stephan Hradek


Am Montag, 7. April 2014 18:53:22 UTC+2 schrieb Jeremy Ruston:

 Hi Stephan

 The edit-text widget has a postRender method that is called immediately 
 after the DOM nodes for the text input have been created. So if you 
 subclass it you can define that method and have it call jscolor to 
 initialise the picker.

 We could also replace the current instances of the colour picker in the 
 core templates with a transclusion or macro that you could more easily 
 override?


Both sounds promising. Could you give me links to github where I could find 
the relevant stuff? 

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


Re: [twdev] [tw5] drag n drop plugins and tiddlyweb/tank

2014-04-07 Thread Jeremy Ruston
Hi Chris

Yes, I just tried simply removing the contents of the bag field

 rather than setting it to an appropriate bag and the right thing
 happened. So I would guess killing that field on drag would be the
 right way to go.


Great, I'll fix that for 5.0.9.


  If a tiddler has the type application/json does TiddlyWeb serve the text
 field directly as the JSON representation, rather than serialising the
 tiddler as normal? That's a bit unexpected if so. Is there a way I can
 retrieve the ordinary serialized JSON representation?


 The results that are happening is because of two things:

 The tiddler is being PUT with content-type: application/json

AND

 The JSON object has a type field set to 'application/json'.

 The upshot of this is that the tiddler is being accepted as a
 pseudo-binary tiddler. When you GET the tiddler with either a
 default Accept header OR with an Accept header that matches its
 type you will get it in its raw form (the contents of the text
 field) with a sent content-type field of the stored 'type' field.

 This has a side effect of making text/plain, text/html and
 application/json have special meaning when accessing a tiddler.

 To get the tiddler back as a tiddler in JSON form it needs to put
 with a 'type' field that is not application/json.


Ouch. This is tricky.

The tiddler clearly contains JSON data, and so I'd struggle to find a
rationale for making the type field be anything other than
application/json.

Wouldn't any code out there that reads JSON tiddlers expecting the usual
tiddler JSON structure going to get confused by this behaviour if they ever
try to read a tiddler that actually contains JSON?

Anyhow, no doubt it's too late to change. So, I guess the question is
whether there's any way for a client to read both the body and fields of a
JSON tiddler in one HTTP GET operation? Perhaps I could request it in XML
or something? (ugh!) Or maybe I should just use .tid format? Then I'd have
to special case JSON tiddlers I guess.

Best wishes

Jeremy.










 --
 Chris Dent   http://burningchrome.com/
 [...]

 --
 You received this message because you are subscribed to the Google Groups
 TiddlyWikiDev group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to tiddlywikidev+unsubscr...@googlegroups.com.
 To post to this group, send email to tiddlywikidev@googlegroups.com.
 Visit this group at http://groups.google.com/group/tiddlywikidev.
 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 
TiddlyWikiDev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: [TW5] Is anyone able to turn jscolor into a plugin?

2014-04-07 Thread Jeremy Ruston
 Both sounds promising. Could you give me links to github where I could
 find the relevant stuff?


Sure. The edit-text widget is here (highlighted on the line that invokes
postRender):

https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/edit-text.js#L66


You'll find instances of the edit-text widget with type=color
in $:/snippets/paletteeditor and $:/TagManager

Best wishes

Jeremy


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

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


Re: [twdev] Feature request for $:/core/modules/widgets/fieldmangler.js with code

2014-04-07 Thread Arlen Beiler
Ok, finally got it. processVariables tiddler:new-tiddler-test 

This takes the tiddler text in the specified tiddler and calls
substituteVariableReferences. It also has a text attribute for passing
straight text. This is a javascript macro.

/*\
title: $:/Arlen/macros/processVariables.js
type: application/javascript
module-type: macro

processVariables ... 

\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
use strict;

/*
Information about this macro
*/

exports.name = processVariables;

exports.params = [
{name: text},
 {name: tiddler}
];

/*
Run the macro
*/
exports.run = function(text, tiddler) {

var res = ;
if(text) res = this.substituteVariableReferences(text || );
if(tiddler) res =
this.substituteVariableReferences(this.wiki.getTiddlerText(tiddler) || );
return res;
};

})();

On Mon, Apr 7, 2014 at 1:45 PM, Arlen Beiler arlen...@gmail.com wrote:

 Hello Everyone,
 Yes, Danielo, I would like to see them in the next TW5 release, but
 we'll see.
 I take that back about answering everything in Skeeve's plugin. That
 is only if you don't use a separate template tiddler (which was the point,
 but anyway...). I'm still thinking what to do if you are using a separate
 tiddler. I checked it out and it indeed won't work. I thought of
 transcluding the template tiddler into the macro, but transclusions don't
 work in macros. I'm sure this is intentional.
 Actually, if I replace the macro call with a transclusion call (
 param={{new-tiddler-template}} ), this works fine, except that the
 variables are not filled in. Normally, if you want variables in a macro
 result you would use \define me()$($(test)$)$ which results in \define
 me()$(testValue)$ in the new tiddler. However, if I want to transclude
 another tiddler, I would have to process variables in the tw-new-tiddler
 handler, which would result in the wikitext from macros
 (param=tiddlerText) being processed a second time. I'm sure I'm way
 ahead of everyone else, but that just came as I was typing so I just kept
 going. Is this a realistic concern or is it not?
 What about using a global macro called process variables? OK, trying
 that without much success. Can't put widgets inside widget opening tags,
 can't transclude in macro calls. Still thinking over this one. I finally
 think I got skeeve's point. This provides an alternate means but not a
 solution to the problem.

 Note the single line macro me. Nested multiline macros do not work. A
 separate template tiddler would be required.

 \define tiddlerText()



 \define me()$($(test)$)$
 $set name=try value=tried it
 me
 /$set
 \end
 $set name=test value=try 
 $button message=tw-new-tiddler class=btn-invisible
 param=tiddlerText {{$:/core/images/new-button}}/$button
 /$set





 On Mon, Apr 7, 2014 at 10:02 AM, Danielo Rodríguez rdani...@gmail.comwrote:

 Hello Arlen

 Could you explain a little bit what are you talking about? Some of your
 sentences makes me curious about the bits you talk about. But since you
 have commented here and in github I'm a bit lost. Are those things to be
 implemented in the next TW5 release?

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




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


Re: [twdev] [tw5] drag n drop plugins and tiddlyweb/tank

2014-04-07 Thread chris . dent

On Mon, 7 Apr 2014, Jeremy Ruston wrote:


To get the tiddler back as a tiddler in JSON form it needs to put
with a 'type' field that is not application/json.


Ouch. This is tricky.


Is it too late for a single tiddler that contains tiddlers to have a
type of its own like application/tiddlywiki+json? If you then PUT as
application/json with a type of application/tiddlywiki+json you
should be able to get the right thing back.


The tiddler clearly contains JSON data, and so I'd struggle to find a
rationale for making the type field be anything other than
application/json.


Text tiddlers clearly contain plain text but we call them
text/x-tiddlywiki and text/vnd.tiddlywiki frequently?


Wouldn't any code out there that reads JSON tiddlers expecting the usual
tiddler JSON structure going to get confused by this behaviour if they ever
try to read a tiddler that actually contains JSON?


Apparently this case hasn't come up in the past. The standard way to
store structured data has been to use the existing attributes and
fields _on_ a tiddler, not put structured data _in_ the text field
of the tiddler.

Obviously the aggregate tiddlers-in-a-single-tiddler case doesn't
map well to that. From the server's standpoint this would make the
most sense: what we have here are tiddlers and thats it, none of
these weird things that are actually containers of tiddlers. This
buys some granularity of reuse too, in case that's of interest.

Would it be possible to explode the single tiddler to its constituent
tiddlers before PUTting to the server and recompose them on GET
(perhaps by way of transclusion)?

--
Chris Dent   http://burningchrome.com/
[...]

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


Re: [twdev] Feature request for $:/core/modules/widgets/fieldmangler.js with code

2014-04-07 Thread Arlen Beiler
OK, everyone. That's done and working. Now I am able to use a separate
tiddler as the template, or a macro in the same one. If it is a separate
tiddler, it only uses the text of the tiddler. It does not worry about
anything else.

Here is the macro:
https://github.com/Arlen22/TiddlyWiki5/blob/tiddler-seriel/core/modules/macros/substituteVariable.js

I like skeeve's Let widget. I'm sure it'd need a little tweaking, but... Is
there any reason we couldn't add that to core? Is there any reason why we
would ever need set? Yeah, to assign the variable name via a macro.


On Mon, Apr 7, 2014 at 3:03 PM, Arlen Beiler arlen...@gmail.com wrote:

 Ok, finally got it. processVariables tiddler:new-tiddler-test 

 This takes the tiddler text in the specified tiddler and calls
 substituteVariableReferences. It also has a text attribute for passing
 straight text. This is a javascript macro.



 On Mon, Apr 7, 2014 at 1:45 PM, Arlen Beiler arlen...@gmail.com wrote:

 Hello Everyone,
 Yes, Danielo, I would like to see them in the next TW5 release, but
 we'll see.
 I take that back about answering everything in Skeeve's plugin. That
 is only if you don't use a separate template tiddler (which was the point,
 but anyway...). I'm still thinking what to do if you are using a separate
 tiddler. I checked it out and it indeed won't work. I thought of
 transcluding the template tiddler into the macro, but transclusions don't
 work in macros. I'm sure this is intentional.
 Actually, if I replace the macro call with a transclusion call (
 param={{new-tiddler-template}} ), this works fine, except that the
 variables are not filled in. Normally, if you want variables in a macro
 result you would use \define me()$($(test)$)$ which results in \define
 me()$(testValue)$ in the new tiddler. However, if I want to transclude
 another tiddler, I would have to process variables in the tw-new-tiddler
 handler, which would result in the wikitext from macros
 (param=tiddlerText) being processed a second time. I'm sure I'm way
 ahead of everyone else, but that just came as I was typing so I just kept
 going. Is this a realistic concern or is it not?
 What about using a global macro called process variables? OK, trying
 that without much success. Can't put widgets inside widget opening tags,
 can't transclude in macro calls. Still thinking over this one. I finally
 think I got skeeve's point. This provides an alternate means but not a
 solution to the problem.

 Note the single line macro me. Nested multiline macros do not work. A
 separate template tiddler would be required.

 \define tiddlerText()



 \define me()$($(test)$)$
 $set name=try value=tried it
 me
 /$set
 \end
 $set name=test value=try 
 $button message=tw-new-tiddler class=btn-invisible
 param=tiddlerText {{$:/core/images/new-button}}/$button
 /$set





 On Mon, Apr 7, 2014 at 10:02 AM, Danielo Rodríguez rdani...@gmail.comwrote:

 Hello Arlen

 Could you explain a little bit what are you talking about? Some of your
 sentences makes me curious about the bits you talk about. But since you
 have commented here and in github I'm a bit lost. Are those things to be
 implemented in the next TW5 release?

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





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


Re: [twdev] Feature request for $:/core/modules/widgets/fieldmangler.js with code

2014-04-07 Thread Arlen Beiler
Danielo, this is pull request 510 and centers around creating new tiddlers
using the x-tiddler format, aka .tid files. I wanted a way to be able to
create new tiddlers with whatever fields I wanted and whatever text, and
have the template in the same tiddler as where it was used so I wouldn't
need two or more tiddlers. First I used JSON, and when I posted that here,
Jeremy said he was thinking of something more like the .tid file format for
the navigator widget. So I found the deserializer for the .tid files and
the rest is history: https://github.com/Jermolene/TiddlyWiki5/pull/510

And here is an updated link to the macro.
https://github.com/Arlen22/TiddlyWiki5/blob/tiddler-seriel/core/modules/macros/substituteVariables.js

I hope you can select which commits to pull in, Jeremy.


On Mon, Apr 7, 2014 at 3:59 PM, Arlen Beiler arlen...@gmail.com wrote:

 OK, everyone. That's done and working. Now I am able to use a separate
 tiddler as the template, or a macro in the same one. If it is a separate
 tiddler, it only uses the text of the tiddler. It does not worry about
 anything else.

 Here is the macro:
 https://github.com/Arlen22/TiddlyWiki5/blob/tiddler-seriel/core/modules/macros/substituteVariable.js

 I like skeeve's Let widget. I'm sure it'd need a little tweaking, but...
 Is there any reason we couldn't add that to core? Is there any reason why
 we would ever need set? Yeah, to assign the variable name via a macro.


 On Mon, Apr 7, 2014 at 3:03 PM, Arlen Beiler arlen...@gmail.com wrote:

 Ok, finally got it. processVariables tiddler:new-tiddler-test 

 This takes the tiddler text in the specified tiddler and calls
 substituteVariableReferences. It also has a text attribute for passing
 straight text. This is a javascript macro.



 On Mon, Apr 7, 2014 at 1:45 PM, Arlen Beiler arlen...@gmail.com wrote:

 Hello Everyone,
 Yes, Danielo, I would like to see them in the next TW5 release, but
 we'll see.
 I take that back about answering everything in Skeeve's plugin. That
 is only if you don't use a separate template tiddler (which was the point,
 but anyway...). I'm still thinking what to do if you are using a separate
 tiddler. I checked it out and it indeed won't work. I thought of
 transcluding the template tiddler into the macro, but transclusions don't
 work in macros. I'm sure this is intentional.
 Actually, if I replace the macro call with a transclusion call (
 param={{new-tiddler-template}} ), this works fine, except that the
 variables are not filled in. Normally, if you want variables in a macro
 result you would use \define me()$($(test)$)$ which results in \define
 me()$(testValue)$ in the new tiddler. However, if I want to transclude
 another tiddler, I would have to process variables in the tw-new-tiddler
 handler, which would result in the wikitext from macros
 (param=tiddlerText) being processed a second time. I'm sure I'm way
 ahead of everyone else, but that just came as I was typing so I just kept
 going. Is this a realistic concern or is it not?
 What about using a global macro called process variables? OK, trying
 that without much success. Can't put widgets inside widget opening tags,
 can't transclude in macro calls. Still thinking over this one. I finally
 think I got skeeve's point. This provides an alternate means but not a
 solution to the problem.

 Note the single line macro me. Nested multiline macros do not work. A
 separate template tiddler would be required.

 \define tiddlerText()



 \define me()$($(test)$)$
 $set name=try value=tried it
 me
 /$set
 \end
 $set name=test value=try 
 $button message=tw-new-tiddler class=btn-invisible
 param=tiddlerText {{$:/core/images/new-button}}/$button
 /$set





 On Mon, Apr 7, 2014 at 10:02 AM, Danielo Rodríguez 
 rdani...@gmail.comwrote:

 Hello Arlen

 Could you explain a little bit what are you talking about? Some of your
 sentences makes me curious about the bits you talk about. But since you
 have commented here and in github I'm a bit lost. Are those things to be
 implemented in the next TW5 release?

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






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


[twdev] Multitids and plugins

2014-04-07 Thread Arlen Beiler
Hi Everyone,
It would be nice if plugin bunch tiddlers could be multitid format instead
of JSON. Or is the multitid format not versatile enough. Or a way to
generate the JSON would be nice too.

Just a thought.
--Arlen

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


Re: [twdev] [tw5] drag n drop plugins and tiddlyweb/tank

2014-04-07 Thread PMario
On Monday, April 7, 2014 8:10:10 PM UTC+2, Chris Dent wrote:

  
  Ah, yes, sounds like the plugin is coming in with a bag field, and TW5 
 is 
  blindly accepting it. I guess we should remove the bag field on import 
 so 
  that the same processing would occur as with a manually newly created 
  tiddler? 

 Yes, I just tried simply removing the contents of the bag field 
 rather than setting it to an appropriate bag and the right thing 
 happened. So I would guess killing that field on drag would be the 
 right way to go. 


As long, as there is some feedback, that part of the tiddler content has 
been removed, I think I'm fine with removing the bag field from an imported 
tiddler.

-m

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


[twdev] Re: Multitids and plugins

2014-04-07 Thread PMario
Hi Arlen,
Did you see: How to create plugins in the browser at 
http://tiddlywiki.com ?

Can you describe your usecase a bit closer?
-mario

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


Re: [twdev] Re: Multitids and plugins

2014-04-07 Thread Arlen Beiler
Well, that's the use case. I do remember seeing it but forgot about it.
Thanks


On Mon, Apr 7, 2014 at 5:46 PM, PMario pmari...@gmail.com wrote:

 Hi Arlen,
 Did you see: How to create plugins in the browser at
 http://tiddlywiki.com ?

 Can you describe your usecase a bit closer?
 -mario

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


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


Re: [twdev] Re: Multitids and plugins

2014-04-07 Thread Arlen Beiler
Hey, another question about that. Is that dependants or dependancies?


On Mon, Apr 7, 2014 at 6:05 PM, Arlen Beiler arlen...@gmail.com wrote:

 Well, that's the use case. I do remember seeing it but forgot about it.
 Thanks


 On Mon, Apr 7, 2014 at 5:46 PM, PMario pmari...@gmail.com wrote:

 Hi Arlen,
 Did you see: How to create plugins in the browser at
 http://tiddlywiki.com ?

 Can you describe your usecase a bit closer?
 -mario

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




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


Re: [twdev] Feature request for $:/core/modules/widgets/fieldmangler.js with code

2014-04-07 Thread Danielo Rodríguez
Hello Arlen.

I suspect your macro can be useful for some of my proyects but I'm not sure.
What does it exactly? I tried to deduce reading the code with no luck. Do 
you have any running example? 

Thank you!

El lunes, 7 de abril de 2014 23:03:59 UTC+2, Arlen Beiler escribió:

 Danielo, this is pull request 510 and centers around creating new tiddlers 
 using the x-tiddler format, aka .tid files. I wanted a way to be able to 
 create new tiddlers with whatever fields I wanted and whatever text, and 
 have the template in the same tiddler as where it was used so I wouldn't 
 need two or more tiddlers. First I used JSON, and when I posted that here, 
 Jeremy said he was thinking of something more like the .tid file format for 
 the navigator widget. So I found the deserializer for the .tid files and 
 the rest is history: https://github.com/Jermolene/TiddlyWiki5/pull/510 

 And here is an updated link to the macro. 
 https://github.com/Arlen22/TiddlyWiki5/blob/tiddler-seriel/core/modules/macros/substituteVariables.js

 I hope you can select which commits to pull in, Jeremy.


 On Mon, Apr 7, 2014 at 3:59 PM, Arlen Beiler arle...@gmail.comjavascript:
  wrote:

 OK, everyone. That's done and working. Now I am able to use a separate 
 tiddler as the template, or a macro in the same one. If it is a separate 
 tiddler, it only uses the text of the tiddler. It does not worry about 
 anything else.

 Here is the macro: 
 https://github.com/Arlen22/TiddlyWiki5/blob/tiddler-seriel/core/modules/macros/substituteVariable.js

 I like skeeve's Let widget. I'm sure it'd need a little tweaking, but... 
 Is there any reason we couldn't add that to core? Is there any reason why 
 we would ever need set? Yeah, to assign the variable name via a macro.


 On Mon, Apr 7, 2014 at 3:03 PM, Arlen Beiler arle...@gmail.comjavascript:
  wrote:

 Ok, finally got it. processVariables tiddler:new-tiddler-test 

 This takes the tiddler text in the specified tiddler and calls 
 substituteVariableReferences. It also has a text attribute for passing 
 straight text. This is a javascript macro.



 On Mon, Apr 7, 2014 at 1:45 PM, Arlen Beiler arle...@gmail.comjavascript:
  wrote:

 Hello Everyone,
 Yes, Danielo, I would like to see them in the next TW5 release, but 
 we'll see. 
 I take that back about answering everything in Skeeve's plugin. 
 That is only if you don't use a separate template tiddler (which was the 
 point, but anyway...). I'm still thinking what to do if you are using a 
 separate tiddler. I checked it out and it indeed won't work. I thought of 
 transcluding the template tiddler into the macro, but transclusions don't 
 work in macros. I'm sure this is intentional. 
 Actually, if I replace the macro call with a transclusion call ( 
 param={{new-tiddler-template}} ), this works fine, except that the 
 variables are not filled in. Normally, if you want variables in a macro 
 result you would use \define me()$($(test)$)$ which results in \define 
 me()$(testValue)$ in the new tiddler. However, if I want to transclude 
 another tiddler, I would have to process variables in the tw-new-tiddler 
 handler, which would result in the wikitext from macros 
 (param=tiddlerText) being processed a second time. I'm sure I'm way 
 ahead of everyone else, but that just came as I was typing so I just kept 
 going. Is this a realistic concern or is it not? 
 What about using a global macro called process variables? OK, 
 trying that without much success. Can't put widgets inside widget opening 
 tags, can't transclude in macro calls. Still thinking over this one. I 
 finally think I got skeeve's point. This provides an alternate means but 
 not a solution to the problem.

 Note the single line macro me. Nested multiline macros do not work. A 
 separate template tiddler would be required. 

 \define tiddlerText()



 \define me()$($(test)$)$
 $set name=try value=tried it
 me
 /$set
 \end
 $set name=test value=try 
 $button message=tw-new-tiddler class=btn-invisible 
 param=tiddlerText {{$:/core/images/new-button}}/$button
 /$set





 On Mon, Apr 7, 2014 at 10:02 AM, Danielo Rodríguez 
 rdan...@gmail.comjavascript:
  wrote:

 Hello Arlen

 Could you explain a little bit what are you talking about? Some of 
 your sentences makes me curious about the bits you talk about. But since 
 you have commented here and in github I'm a bit lost. Are those things to 
 be implemented in the next TW5 release?

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







-- 
You received this message because you are subscribed to the Google Groups