mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 02:39:42 +00:00
24 lines
584 B
JavaScript
24 lines
584 B
JavaScript
|
/*\
|
||
|
title: $:/core/modules/editor/operations/text/save-selection.js
|
||
|
type: application/javascript
|
||
|
module-type: texteditoroperation
|
||
|
|
||
|
Text editor operation to save the current selection in a specified tiddler
|
||
|
|
||
|
\*/
|
||
|
(function(){
|
||
|
|
||
|
/*jslint node: true, browser: true */
|
||
|
/*global $tw: false */
|
||
|
"use strict";
|
||
|
|
||
|
exports["save-selection"] = function(event,operation) {
|
||
|
var tiddler = event.paramObject.tiddler,
|
||
|
field = event.paramObject.field || "text";
|
||
|
if(tiddler && field) {
|
||
|
this.wiki.setText(tiddler,field,null,operation.text.substring(operation.selStart,operation.selEnd));
|
||
|
}
|
||
|
};
|
||
|
|
||
|
})();
|