It should ideally fetch the list from the ListToTags tiddler and put
it into the just generated newClasstiddler...

On 12 Apr., 21:43, Måns <[email protected]> wrote:
> Of course it should be more like:
>
> <script label="L2T" title="List2Tags">
>   var tid=prompt("Skriv navnet på det nye hold","");
>         if (!tid || !tid.length) return;
>         var txt="";
>         var who=config.options.txtUserName;
>         var when=new Date();
>         var tags=['Class'];
>         var initialer=prompt("Teachers initials","");
>         if (!initials || !initials.length) return;
>         var fields={ teacher: initials };
>         store.saveTiddler(tid,tid,txt,who,when,tags,fields);
>         story.displayTiddler(null,tid);
>    var t=store.getTiddlerText("ListToTags");
> var here=story.findContainingTiddler(place);
>    if (!here) return;
>    var title=here.getAttribute("tiddler");
>    var tiddler=store.getTiddler(title);
>    var target = store.getTiddler(tiddler.title) ;
>    var taglist = t.split('\n') ;
>    for(var i=0 ; i < taglist.length ; i++) {
>     if ( taglist[i] && ! target.tags.contains(taglist[i]) )
> target.tags.push( taglist[i] ) ;
>    }
>   return 'List 2 tags - click edit and done' ;
> </script>
>
> It still fetches the list from ListToTags and puts the result in the
> tiddler holding the script..
>
> YS Måns Mårtensson
>
> On 12 Apr., 21:30, Eric Shulman <[email protected]> wrote:
>
> > >    var here=store.findContainingTiddler(place);
> > > And got this: TypeError: store.findContainingTiddler is not a function
>
> > oops!  typo... change "store" to "story":
>
> >  var here=story.findContainingTiddler(place);
>
> > -e
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to