mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-24 02:27:19 +00:00
Add jsencoded view format
This commit is contained in:
parent
c46748b82f
commit
ad518c181d
@ -64,6 +64,9 @@ ViewWidget.prototype.execute = function() {
|
||||
case "stripcomments":
|
||||
this.text = this.getValueAsStrippedComments();
|
||||
break;
|
||||
case "jsencoded":
|
||||
this.text = this.getValueAsJsEncoded();
|
||||
break;
|
||||
default: // "text"
|
||||
this.text = this.getValueAsText();
|
||||
break;
|
||||
@ -153,6 +156,10 @@ ViewWidget.prototype.getValueAsStrippedComments = function() {
|
||||
return out.join("\n");
|
||||
};
|
||||
|
||||
ViewWidget.prototype.getValueAsJsEncoded = function() {
|
||||
return $tw.utils.stringify(this.getValueAsText());
|
||||
};
|
||||
|
||||
/*
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user