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:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user