1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00

Switched slider to use new syntax for inline content

This commit is contained in:
Jeremy Ruston 2012-06-06 11:29:10 +01:00
parent 11a563dfc6
commit 7c382c5f43
2 changed files with 7 additions and 8 deletions

View File

@ -47,8 +47,7 @@ exports.info = {
label: {byPos: 2, type: "text"},
tooltip: {byPos: 3, type: "text"},
"default": {byName: true, type: "text"},
"class": {byName: true, type: "text"},
content: {byName: true, type: "text"}
"class": {byName: true, type: "text"}
},
events: ["click"]
};
@ -76,15 +75,15 @@ exports.saveOpenState = function() {
};
exports.getSliderChildren = function() {
if(this.hasParameter("content")) {
return this.wiki.parseText("text/x-tiddlywiki",this.params.content).tree;
} else if(this.hasParameter("target")) {
// Use the target tiddler if specified
if(this.hasParameter("target")) {
return [$tw.Tree.Macro("tiddler",{
srcParams: {target: this.params.target},
wiki: this.wiki
})];
} else {
return [$tw.Tree.errorNode("No content specified for slider")];
// Otherwise use the content of the macro
return this.content;
}
};

View File

@ -15,8 +15,8 @@ And here's another slider that contains a video, with the state stored in VideoS
And here's a MiniSlider that works with text, rather than a separate tiddler.
<<slider state:MiniSlider label:"Click me! »" content:"This is the //content// of the slider. The state is stored in MiniSlider">>
<<slider state:MiniSlider label:"Click me! »"><This is the //content// of the slider. The state is stored in MiniSlider>>
And here's a slider that doesn't use a state tiddler:
<<slider label:"Click me! »" content:"This is the //content// of the slider. The state is not retained.">>
<<slider label:"Click me! »"><This is the //content// of the slider. The state is not retained.>>