Hola As part of tiddlydrive I want the plugin to query the server for available > tiddlers on startup. The idea is to give the server a list of the already > available tiddlers on the wiki and the server will reply back with a list > of those tiddlers that are on the server but not on the wiki. This way you > can search at least for the tiddler title. Then, wen you open one of those > tiddler you will see a message that says: this tiddler is on the server. > Then you click on the download button. > My question is: can I do this from a startup module? Should I set this > module as ashynchronous? >
yes this is all possible just do your ajax query inside exports.startup. if you do an ajax query it would be non blocking anyways because you work with callbacks. Can I do this in the same startup module that currently attaches the event > listeners to the root widget? yes this does not make a difference > Will my startup method have access to the list of available tiddlers? > You can use $tw.wiki.getTiddler() and other functions to access any tiddler you want. I want to use a pre-comilled filter for this. this is no problem. For example take a look at the online version of https://github.com/felixhayashi/tw-taskgraph/blob/master/src/plugins/felixhayashi/taskgraph/caretaker.js I also use a compiled filter there for refreshes. But if you only use the filter once, you dont have to precompile it. Thank you for your example, but I don't know to which of my questions are > trying to answer. I have a startup module already implemented so I know how > to implement them. My question was focused on what can they do DURING the > startup process. I don't want to react to events (well, I want but I > already did it ) I want to lazy load tiddlers on wiki startup, but I don't > want to block the wiki while doing it. In the lastline of http://tiddlywiki.com/dev/#Startup%20Process it says something about asynchronous startup moduls. havent tried it myself... But I dont think you need it as ajax is non blocking per default > And I only want to do it once,I don't want to re-download the list on > every key press for example. No problem, just keep all the "download" code outside the change listener. --- Hope this helps. Otherwise good luck :) Felix -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywikidev. For more options, visit https://groups.google.com/d/optout.
