mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-12 10:20:26 +00:00
Let the new rendering methods accept a parent widget
This commit is contained in:
parent
dc9c2522b9
commit
e33f588b73
@ -715,11 +715,12 @@ Parse text in a specified format and render it into another format
|
|||||||
textType: content type of the input text
|
textType: content type of the input text
|
||||||
text: input text
|
text: input text
|
||||||
*/
|
*/
|
||||||
exports.new_renderText = function(outputType,textType,text,context) {
|
exports.new_renderText = function(outputType,textType,text,parentWidget) {
|
||||||
var parser = $tw.wiki.new_parseText(textType,text),
|
var parser = $tw.wiki.new_parseText(textType,text),
|
||||||
parseTreeNode = parser ? {type: "widget", children: parser.tree} : undefined,
|
parseTreeNode = parser ? {type: "widget", children: parser.tree} : undefined,
|
||||||
widgetNode = new widget.widget(parseTreeNode,{
|
widgetNode = new widget.widget(parseTreeNode,{
|
||||||
wiki: this,
|
wiki: this,
|
||||||
|
parentWidget: parentWidget,
|
||||||
document: $tw.document
|
document: $tw.document
|
||||||
});
|
});
|
||||||
var container = $tw.document.createElement("div");
|
var container = $tw.document.createElement("div");
|
||||||
@ -746,11 +747,12 @@ Parse text from a tiddler and render it into another format
|
|||||||
outputType: content type for the output
|
outputType: content type for the output
|
||||||
title: title of the tiddler to be rendered
|
title: title of the tiddler to be rendered
|
||||||
*/
|
*/
|
||||||
exports.new_renderTiddler = function(outputType,title,context) {
|
exports.new_renderTiddler = function(outputType,title,parentWidget) {
|
||||||
var parser = $tw.wiki.new_parseTiddler(title),
|
var parser = $tw.wiki.new_parseTiddler(title),
|
||||||
parseTreeNode = parser ? {type: "widget", children: parser.tree} : undefined,
|
parseTreeNode = parser ? {type: "widget", children: parser.tree} : undefined,
|
||||||
widgetNode = new widget.widget(parseTreeNode,{
|
widgetNode = new widget.widget(parseTreeNode,{
|
||||||
wiki: this,
|
wiki: this,
|
||||||
|
parentWidget: parentWidget,
|
||||||
document: $tw.document
|
document: $tw.document
|
||||||
});
|
});
|
||||||
var container = $tw.document.createElement("div");
|
var container = $tw.document.createElement("div");
|
||||||
|
Loading…
Reference in New Issue
Block a user