kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Move rename tiddler handling into navigator widget
For consistency with the other tiddler manipulation primitives.print-window-tiddler
rodzic
a204784c0c
commit
68e15c1064
|
@ -1,28 +0,0 @@
|
||||||
/*\
|
|
||||||
title: $:/core/modules/startup/bulkops.js
|
|
||||||
type: application/javascript
|
|
||||||
module-type: startup
|
|
||||||
|
|
||||||
Support for bulk tiddler operations
|
|
||||||
|
|
||||||
\*/
|
|
||||||
(function(){
|
|
||||||
|
|
||||||
/*jslint node: true, browser: true */
|
|
||||||
/*global $tw: false */
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
// Export name and synchronous status
|
|
||||||
exports.name = "bulkops";
|
|
||||||
exports.platforms = ["browser"];
|
|
||||||
exports.after = ["startup"];
|
|
||||||
exports.synchronous = true;
|
|
||||||
|
|
||||||
exports.startup = function() {
|
|
||||||
$tw.rootWidget.addEventListener("tm-rename-tiddler",function(event) {
|
|
||||||
var paramObject = event.paramObject || {};
|
|
||||||
$tw.wiki.renameTiddler(paramObject.from,paramObject.to);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
|
|
@ -33,7 +33,8 @@ var NavigatorWidget = function(parseTreeNode,options) {
|
||||||
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
|
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
|
||||||
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
|
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
|
||||||
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
|
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
|
||||||
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"}
|
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"},
|
||||||
|
{type: "tm-rename-tiddler", handler: "handleRenameTiddlerEvent"}
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -609,6 +610,14 @@ NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NavigatorWidget.prototype.handleRenameTiddlerEvent = function(event) {
|
||||||
|
var self = this,
|
||||||
|
paramObject = event.paramObject || {},
|
||||||
|
from = paramObject.from || event.tiddlerTitle,
|
||||||
|
to = paramObject.to;
|
||||||
|
$tw.wiki.renameTiddler(from,to);
|
||||||
|
};
|
||||||
|
|
||||||
exports.navigator = NavigatorWidget;
|
exports.navigator = NavigatorWidget;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
Ładowanie…
Reference in New Issue