--
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.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/ea2a2628-7f01-4c24-8e86-16d176d99bd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tasker is an android application that allows you to control your phone progragmatically:
Here is the syncadaptor that I have created:I just copied it into an empty tw5 file and I have uploaded it to my phone. It want to focus first on saving tiddlers. It works just partially: the storyList tiddler is saved to the sdcard, and the first draft I create is saved also, but after that nothing else is working, and no error is displayed. Could you let me know why?
Regarding the error I get when I try to build the wiki file using node js, is basically that the functions defined at [1] are not available. Seems that node tries to "execute" or use the syncadaptor even when I just try to "build" the offline file.
Great stuff, thanks for the explanation. This is a wonderful area for experimentation and I shall be very interested to see what you come up with.
Reading the code I don't see anything obviously wrong, I'm afraid.
I'd suggest adding a console.log to the top of each of your functions so that you can see what is being called.
I notice that the deleteTiddler() method is commented out, and that it doesn't call the callback; if it is in fact being called by the syncer then that would be a problem.
I suspect that will be because TW is attempting to run the syncadaptor on the server as well as in the browser. The fix is to only export your syncadaptor in the browser:if($tw.browser) {exports.adaptorClass = FileSystemAdaptor;}
I'd suggest adding a console.log to the top of each of your functions so that you can see what is being called.The problem is that I can't open a console in Tasker's webview. I should log it to a file. It's enough to write a function that writes to the file or should I use some kind of logger?
I notice that the deleteTiddler() method is commented out, and that it doesn't call the callback; if it is in fact being called by the syncer then that would be a problem.What kind of problem? What would be the easiest option for this?
I suspect that will be because TW is attempting to run the syncadaptor on the server as well as in the browser. The fix is to only export your syncadaptor in the browser:if($tw.browser) {exports.adaptorClass = FileSystemAdaptor;}I'll try that out! Thank you
That's always awkward. A lot of the time one can use alert(), but it doesn't always play well with asynchronous code. Logging to the DOM with something like this can be useful:document.body.appendChild(document.createTextNode("My message------"))
The syncer is calling deleteTiddler() expecting that it will at some point invoke the callback, with either success or failure. If the deleteTiddler method just exits, without calling the callback, the syncer will never get the chance to kick off the next sync task. I'd suggest first adding logging so you can tell whether the method is being called. If necessary, you could mock the function by just calling the callback with the success parameters.
I updated the deleteTiddler function, first with a dummy definition and it started to work. But as a side effect the draft tiddlers remained there. I modified the code to do real deletion of tiddlers and it is working perfectly right now. I updated the gist. I have single tiddler files!! hooray! Now the loading part is missing.
What would be the better way to provide skinny tiddlers? Does it makes sense at all? Because I have to read the whole file in order to give the skinny definition there is no advantage of using just a skeleton tiddlers. I worked before with loading tiddlers from the FS and it was a total disaster. Any advice will be very welcome.