mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-08 23:03:50 +00:00
Introduce command to load tiddler folders into a bag
This commit is contained in:
parent
61b54125be
commit
066e553f84
@ -0,0 +1,40 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/plugins/tiddlywiki/multiwikiserver/mws-load-tiddlers.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: command
|
||||||
|
|
||||||
|
Command to recursively load a directory of tiddler files into a bag
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
exports.info = {
|
||||||
|
name: "mws-load-tiddlers",
|
||||||
|
synchronous: true
|
||||||
|
};
|
||||||
|
|
||||||
|
var Command = function(params,commander,callback) {
|
||||||
|
this.params = params;
|
||||||
|
this.commander = commander;
|
||||||
|
this.callback = callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
Command.prototype.execute = function() {
|
||||||
|
var self = this;
|
||||||
|
// Check parameters
|
||||||
|
if(this.params.length < 2) {
|
||||||
|
return "Missing pathname and/or bagname";
|
||||||
|
}
|
||||||
|
var tiddlersPath = this.params[0],
|
||||||
|
bagName = this.params[1];
|
||||||
|
$tw.mws.store.saveTiddlersFromPath(tiddlersPath,bagName);
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Command = Command;
|
||||||
|
|
||||||
|
})();
|
Loading…
x
Reference in New Issue
Block a user