1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-27 05:37:39 +00:00

Text-slicer: better support for specifying the output title

Can be specified directly, or taken from a field of the tiddler being
sliced, falling back to a default.
This commit is contained in:
Jermolene
2016-02-27 12:25:48 +00:00
parent cd0a0aa1fb
commit 7498989ebb
3 changed files with 24 additions and 22 deletions

View File

@@ -16,7 +16,7 @@ var widget = require("$:/core/modules/widgets/widget.js");
exports.info = {
name: "slice",
synchronous: true
synchronous: false
};
var Command = function(params,commander,callback) {
@@ -31,11 +31,15 @@ Command.prototype.execute = function() {
}
var self = this,
wiki = this.commander.wiki,
tiddlerTitle = this.params[0],
slicer = new $tw.Slicer(wiki,tiddlerTitle);
slicer.sliceTiddler(tiddlerTitle)
sourceTitle = this.params[0],
destTitle = this.params[1],
slicer = new $tw.Slicer(wiki,sourceTitle,{
destTitle: destTitle
});
slicer.sliceTiddler()
slicer.outputTiddlers();
slicer.destroy();
$tw.utils.nextTick(this.callback);
return null;
};