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

@@ -21,7 +21,9 @@ exports.synchronous = true;
// Install the root widget event handlers
exports.startup = function() {
$tw.rootWidget.addEventListener("tm-slice-tiddler",function(event) {
var slicer = new $tw.Slicer($tw.wiki,event.param);
var slicer = new $tw.Slicer($tw.wiki,event.param,{
destTitle: event.paramObject.destTitle
});
slicer.sliceTiddler(event.param)
slicer.outputTiddlers();
slicer.destroy();