diff --git a/core/wiki/macros/tabs.tid b/core/wiki/macros/tabs.tid index 936d3fbf0..3b8fa5e04 100644 --- a/core/wiki/macros/tabs.tid +++ b/core/wiki/macros/tabs.tid @@ -1,41 +1,63 @@ title: $:/core/macros/tabs tags: $:/tags/Macro +code_body: yes + +\define tabs-button() +\whitespace trim +<$button set=<> setTo=<> default=<<__default__>> selectedClass="tc-tab-selected" tooltip={{!!tooltip}}> + <$tiddler tiddler=<>> + <$set name="tv-wikilinks" value="no"> + <$transclude tiddler=<<__buttonTemplate__>> mode="inline"> + <$transclude tiddler=<> field="caption"> + <$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/> + + + + + <<__actions__>> + +\end + +\define tabs-tab() +\whitespace trim +<$set name="save-currentTiddler" value=<>> + <$tiddler tiddler=<>> + <> + + +\end + +\define tabs-tab-list() +\whitespace trim +<$list filter=<<__tabsList__>> variable="currentTab" storyview="pop"> + <> + +\end + +\define tabs-tab-body() +\whitespace trim +<$list filter=<<__tabsList__>> variable="currentTab"> + <$reveal type="match" state=<> text=<> default=<<__default__>> retain=<<__retain__>> tag="div"> + <$transclude tiddler=<<__template__>> mode="block"> + <$transclude tiddler=<> mode="block"/> + + + +\end \define tabs(tabsList,default,state:"$:/state/tab",class,template,buttonTemplate,retain,actions,explicitState) \whitespace trim -<$let - qualifiedState=<> - tabsState={{{ [<__explicitState__>minlength[1]] ~[] }}}> -
-
-<$list filter="$tabsList$" variable="currentTab" storyview="pop"><$set name="save-currentTiddler" value=<>> -<$tiddler tiddler=<>> -<$button set=<> setTo=<> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}> -<$tiddler tiddler=<>> -<$set name="tv-wikilinks" value="no"> -<$transclude tiddler="$buttonTemplate$" mode="inline"> -<$transclude tiddler=<> field="caption"> -<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/> - - -$actions$ -
-
-
-<$list filter="$tabsList$" variable="currentTab"> - -<$reveal type="match" state=<> text=<> default="$default$" retain="""$retain$"""> - -<$transclude tiddler="$template$" mode="block"> - -<$transclude tiddler=<> mode="block"/> - - - - - - -
-
- +<$qualify title=<<__state__>> name="qualifiedState"> + <$set name="tabsState" filter={{{ [<__explicitState__>minlength[1]] ~[] }}}> +
] }}}> +
] }}}> + <> +
+
] }}}/> +
] }}}> + <> +
+
+ + \end diff --git a/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js b/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js index 9c015cf17..b37f402cc 100644 --- a/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js +++ b/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js @@ -54,31 +54,32 @@ describe("Tabs-macro HTML tests", function() { / Run the tests --------------------*/ // horizontal - it("should render horizontal tabs v5.2.1", function() { +/* + xit("should render horizontal tabs v5.2.1", function() { expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal")).toBe(expected.fields.text); }); - it("should render horizontal tabs macro with all parameters modified V5.2.1", function() { + xit("should render horizontal tabs macro with all parameters modified V5.2.1", function() { expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal-all")).toBe(expectedAll.fields.text); }); // vertical - it("should render tabs vertical tabs v5.2.1", function() { + xit("should render tabs vertical tabs v5.2.1", function() { expect(wiki.renderTiddler("text/html","test-tabs-macro-vertical")).toBe(expectedVert.fields.text); }); - +*/ // Future tests // horizontal - xit("should render 'horizontal' tabs from v5.2.2 and up with whitespace trim", function() { + it("should render 'horizontal' tabs from v5.2.2 and up with whitespace trim", function() { expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal")).toBe(expected.fields.text.replace(/\n/g,"")); }); - xit("should render 'horizontal' tabs from v5.2.2 and up with whitespace trim", function() { + it("should render 'horizontal' tabs from v5.2.2 and up with whitespace trim", function() { expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal-all")).toBe(expectedAll.fields.text.replace(/\n/g,"")); }); // vertical - xit("should render 'vertical' tabs from v5.2.2 and up with whitespace trim", function() { + it("should render 'vertical' tabs from v5.2.2 and up with whitespace trim", function() { expect(wiki.renderTiddler("text/html","test-tabs-macro-vertical")).toBe(expectedVert.fields.text.replace(/\n/g,"")); }); });