mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-24 20:36:56 +00:00
Switched slider to use new syntax for inline content
This commit is contained in:
parent
11a563dfc6
commit
7c382c5f43
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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.>>
|
||||
|
Loading…
x
Reference in New Issue
Block a user