mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-28 23:10:46 +00:00
Extend view widget with plainwikified
format
This commit is contained in:
parent
28730caf7b
commit
3d5885f5a5
@ -55,6 +55,9 @@ ViewWidget.prototype.execute = function() {
|
|||||||
case "htmlwikified":
|
case "htmlwikified":
|
||||||
this.text = this.getValueAsHtmlWikified();
|
this.text = this.getValueAsHtmlWikified();
|
||||||
break;
|
break;
|
||||||
|
case "plainwikified":
|
||||||
|
this.text = this.getValueAsPlainWikified();
|
||||||
|
break;
|
||||||
case "htmlencodedplainwikified":
|
case "htmlencodedplainwikified":
|
||||||
this.text = this.getValueAsHtmlEncodedPlainWikified();
|
this.text = this.getValueAsHtmlEncodedPlainWikified();
|
||||||
break;
|
break;
|
||||||
@ -135,6 +138,10 @@ ViewWidget.prototype.getValueAsHtmlWikified = function() {
|
|||||||
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
|
return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ViewWidget.prototype.getValueAsPlainWikified = function() {
|
||||||
|
return this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this});
|
||||||
|
};
|
||||||
|
|
||||||
ViewWidget.prototype.getValueAsHtmlEncodedPlainWikified = function() {
|
ViewWidget.prototype.getValueAsHtmlEncodedPlainWikified = function() {
|
||||||
return $tw.utils.htmlEncode(this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this}));
|
return $tw.utils.htmlEncode(this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{parentWidget: this}));
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
title: ViewWidget
|
|
||||||
created: 201310241419
|
|
||||||
modified: 20150220161335000
|
|
||||||
tags: Widgets
|
|
||||||
caption: view
|
caption: view
|
||||||
|
created: 20131024141900000
|
||||||
|
modified: 20160623152830060
|
||||||
|
tags: Widgets
|
||||||
|
title: ViewWidget
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
! Introduction
|
! Introduction
|
||||||
|
|
||||||
@ -26,8 +27,12 @@ The following formats can be specified in the `format` attribute:
|
|||||||
|
|
||||||
|!Format |!Description |
|
|!Format |!Description |
|
||||||
|''text'' |Plain text |
|
|''text'' |Plain text |
|
||||||
|''htmlwikified'' |The field is wikified and the resulting HTML returned as plain text |
|
|''htmlencoded'' |The field is displayed with HTML encoding |
|
||||||
|''htmlencoded'' |The field is displayed with HTML encoding issues |
|
|''urlencoded'' |The field is displayed with URL encoding |
|
||||||
|
|''doubleurlencoded'' |The field is displayed with double URL encoding |
|
||||||
|
|''htmlwikified'' |The field is wikified and the resulting HTML returned as plain text (ie HTML elements will appear in plain text) |
|
||||||
|
|''plainwikified'' |The field is wikified and the text content of the resulting HTML returned as plain text (ie HTML elements will be removed) |
|
||||||
|
|''htmlencodedplainwikified'' |The field is wikified and the text content of the resulting HTML returned as HTML encoded plain text (ie HTML elements will be removed) |
|
||||||
|''date'' |The field is interpreted as a UTC date and displayed according to the DateFormat specified in the `template` attribute |
|
|''date'' |The field is interpreted as a UTC date and displayed according to the DateFormat specified in the `template` attribute |
|
||||||
|''relativedate'' |The field is interpreted as a UTC date and displayed as the interval from the present instant |
|
|''relativedate'' |The field is interpreted as a UTC date and displayed as the interval from the present instant |
|
||||||
|''stripcomments'' |The field is interpreted as JavaScript source code and any lines beginning `\\#` are stripped |
|
|''stripcomments'' |The field is interpreted as JavaScript source code and any lines beginning `\\#` are stripped |
|
||||||
|
Loading…
Reference in New Issue
Block a user