Open Marxsal opened 2 years ago
The savemedia mechanism is through browser download, and uses 'media' as a subdir to the location of the tiddlywiki in use, therefore it is not possible to use the save with nodejs.
You misunderstand my intent. I know you can't use it with node.js. But node.js and Bob use "files". So you could download your files using media save and then later, in another session, use it with node.js or Bob. It would just work better if everyone used the same subdir for external files.
Ok I now understand.
The subdir is hardcoded in the csaver macro in tiddler /home/buggyj/Documents/dev/js/TiddlyWiki5/plugins/bj/tiddlyclip-plugin/tw5/csaver.js i.e. var subdir = "media";
the most obvious change would be to have a configuration file e.g
var subdir = $tw.wiki.getTiddlerText("$:/plugin/bj/tiddlyclip-plugin/tw5/media-sub-directory").trim();
however not all characters are allowed in a directory name and this varies with system. We could restrict the subdirectory to be alphanumeric with spaces:
subdir=(subdir.match(/^[0-9 a-z]+$/))?subdir:"media";
what do you think?
To be clear tiddlyclip can be used with nodejs or any other file server, it is just local saving of clips that is different.
the config would better be var subdir = $tw.wiki.getTiddlerText("$:/plugin/bj/savemedia/tw5/media-sub-directory").trim();
is it 'Files' or 'files'?
Having a configuration for it would be the best. Perhaps there could be a warning about what language sets can be used. But if that's not possible, or too inconvenient, then just being able to set it to "files" would make it cross-compatible with the other node.js products.
At present I am not going to handle different languages.
There needs to be a global setting of the subdir, which will be the setting for all tiddlywikis, but this should be overridden by a setting in individual tiddlywikis. Therefore there need to be a config here in the tiddlyclip plugin (local setting) and a config page created in the savemedia download (global setting). In both places the only options will be 'files' or 'media'.
Therefore there need to be a config here in the tiddlyclip plugin (local setting) and a config page created in the savemedia download (global setting). In both places the only options will be 'files' or 'media'.
Can this config option be added to the tiddlyclip plug in and savemedia add on
I plan to implement this, but, as I am not planning to use this new feature, it is not high on my list of things to do.
It's for compatibility with the file upload plug in which might get into the core in the future
I would like this feature to be added along with the save media addon configuration option (for download location or the saving folder). This is mainly for compatibility when wiki is used in node.js mode and if files upload plug in is also used along with it. Again this is important to me since I am using relative path for displaying images within my wiki.
I have added a config tiddler to enable 'files' or 'media' to be selected.
I have added a config tiddler to enable 'files' or 'media' to be selected.
Where is this config tiddler ?
This one right ?
I replaced this with the savetofiles macro
I have added a config tiddler to enable 'files' or 'media' to be selected.
Where is this config tiddler ?
This one right ?
This was also working.
How to use the savetofiles macro
$:/plugin/bj/savemedia/useFilesDir is available in the latest pre-release.
savetofiles macro is the same as csaver macro.
$:/plugin/bj/savemedia/useFilesDir
What's the use of this config tiddler. I can see that in my wiki. How to make use of it?
I guess I know how to use the savetofile macro..I will do some testing with it.
if $:/plugin/bj/savemedia/useFilesDir contains 'yes' then csaver puts clips into 'files' subdir, otherwise it puts them into 'media' subdir
'Files' is used by the node.js server, and by (I think) Bob.