In an attempt to resolve my synchronisation woes keeping a copy of my TiddlyWiki on my N95 I've added a new option to my TiddlyWiki file. This allows me to specify a path to create a mirror copy of the file. This points to my N95 synchonisation folder.
If I do work out how to enable editing on the phone I'll have to work out another approach but this does mean I can have a copy to read. Another benefit is that I can leave the backup copies accumulating in the folder or sub-folder and not have those copy across automatically as well.
I've created a new version of an empty TiddlyWiki and copied it to : ftp://ftp.esendex.com/adam/Tiddlywiki.AEB.v2.MirrorPath.html. The changes are summarised below.
Ln 571, added a new item to the config.options array:
txtMirrorPath: ""
Ln 791, added a new item to the config.optionsDesc array:
txtMirrorPath: "Path to mirror the file to"
Ln 831, added two new items to config.messages array:
mirrorSaved: "Mirror saved", mirrorFailed: "Failed to save mirror file"
Ln 6152, added a new method saveMirror. Note this expects a complete path and not a relative folder as in the backup folder option.
function saveMirror(localPath,original)
{
var mirrorPath = config.options.txtMirrorPath;
var saveMirrorFile = mirrorPath != "";
if (saveMirrorFile)
{
// add backslash if not present at end
var backslashPos = mirrorPath.lastIndexOf("\\");
var pathLastIndex = mirrorPath.length - 1;
var backslashEnd = backslashPos == pathLastIndex;
mirrorPath = mirrorPath + (backslashEnd ? "" : "\\");
// copy to relevant locations
var mirror = config.browser.isIE ? ieCopyFile(mirrorPath,localPath) : saveFile(mirrorPath,original);
if(mirror)
displayMessage(config.messages.mirrorSaved,"file://" + mirrorPath);
else
alert(config.messages.mirrorFailed);
}
}
Ln 6133, added a call to the saveMirror method from the saveChanges method:
saveMirror(localPath,original);
Do let me know what you think.



