Re: [tw] Re: How to change a Tiddler's property through javascript?

2010-09-21 Thread FND
 Could you explain - or point to an explanation of -
 the difference between fetchTiddler and getTiddler, and why one is
 higher than the other?

See this adjacent discussion:
http://groups.google.com/group/tiddlywiki/msg/a4b11061a9ba8750


-- F.

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



[tw] Re: How to change a Tiddler's property through javascript?

2010-09-21 Thread passingby
I am no programmer, but as far as I understand a higher function is
the one that 'calls' the lower function. The reason for existence of a
higher function is that it might be doing certain things beside the
call, it might be there to provide a consistency in the API
(application programming interface), it might be there for scalability
and future development of the software etc etc.
A getFoo() function might be a part of an API and a user/poweruser/
client-software can rest assured that it will always return object
'foo' when called, even in future versions.
What a getFoo() function does in order to return the Foo object is the
headache of the API developer, so it might be calling fetchFoo(), or
it might be calling digOutFooFromSomewhere(). We need not worry about
it.

On Sep 21, 3:17 am, cmari cema...@gmail.com wrote:
 Hi FND,
 I wondered about this, but to be honest, I'm too ignorant to know what it is
 that higher-level is modifying in your sentence (in the grammatical
 sense).  Could you explain - or point to an explanation of - the difference
 between fetchTiddler and getTiddler, and why one is higher than the other?
 Thanks!
 cmari

 On Mon, Sep 20, 2010 at 2:11 AM, FND f...@gmx.net wrote:
   var tid = store.fetchTiddler('your tiddler title');

  It's probably better to use the higher-level getTiddler method instead.

  -- F.

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

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



[tw] Re: How to change a Tiddler's property through javascript?

2010-09-21 Thread Tobias Beer
Hi passingby,

Well, it turns out there are cases of needing to worry about the
difference between lower level implementations and higher level
ones, since certain TiddlySpace functions are based on high-level
implementations (whereas the low level one might fail on its own),
e.g. deleteTiddler vs. RemoveTiddler.

Cheers, Tobias.

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



[tw] Re: How to change a Tiddler's property through javascript?

2010-09-21 Thread cmari
Thanks for the pointer to the other discussion (proving once again
that it really pays to read all messages posted to this group,
regardless of the subject line!).
cmari

On Sep 21, 5:43 am, Tobias Beer beertob...@googlemail.com wrote:
 Hi passingby,

 Well, it turns out there are cases of needing to worry about the
 difference between lower level implementations and higher level
 ones, since certain TiddlySpace functions are based on high-level
 implementations (whereas the low level one might fail on its own),
 e.g. deleteTiddler vs. RemoveTiddler.

 Cheers, Tobias.

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



Re: [tw] Re: How to change a Tiddler's property through javascript?

2010-09-20 Thread FND
 var tid = store.fetchTiddler('your tiddler title');

It's probably better to use the higher-level getTiddler method instead.


-- F.

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



[tw] Re: How to change a Tiddler's property through javascript?

2010-09-19 Thread colmjude
On Sep 19, 6:28 pm, Zans Mihejevs zans@gmail.com wrote:
 I'm trying to create a script that would automatically change a
 property of a tiddler when some event happens. For example, I would
 like to make it so that if I press a checkbox a certain Tiddler's
 modified date would change to today (I'm using CheckBoxPlugin).
 Would anyone have any advice?

One way you could go about it is to assign code like the following to
the action of checking the box:
var tid = store.fetchTiddler('your tiddler title');
tid.modified = new Date();
store.saveTiddler(tid.title, tid.title, tid.text, tid.creator,
tid.modified, tid.tags, tid.fields);

This fetches the tiddler object from the tiddlywiki store, changes the
modified date to the current date and time and then saves it.

That should do it. If you need anymore help let us know

Colm

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