Add jsencoded view format

print-window-tiddler
Jeremy Ruston 2013-10-25 23:00:43 +01:00
rodzic c46748b82f
commit ad518c181d
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -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
*/