Extension:ExtTab
From MediaWiki.org
|
Ext Tab Release status: beta |
|||
|---|---|---|---|
| Implementation | Parser extension | ||
| Description | Tab control based on ExtJS | ||
| Author(s) | Ning Hu (dch), Justin Zhang, Jesse Wang (NingTalk) | ||
| Last version | 1.0 | ||
| MediaWiki | 1.13.5 or greater (tested up to 1.16.x), less than 1.17 | ||
| PHP | PHP 5.x or greater installed and working | ||
| License | GPL & [http:://www.sencha.com/products/extjs/license/ ExtJS license] | ||
| Download |
Download snapshot (Git master)
Git [?]: repo summary • tree • code changes SVN [?]: checkout-url • tree • code changes |
||
|
|||
|
Check usage (experimental) |
|||
Contents |
[edit] Installation
Edit $IP/LocalSettings.php and add:
include_once('extensions/ExtTab/includes/ET_Initialize.php');
[edit] Usage
Altogether two parser functions and one parser hook are implemented
[edit] 'embedwiki' parser hook
- parser functions inside other will cause parser frame conflict
- a possible solution for now is to use escape chars, e.g. '|'
- we just implement this hook to skip the escape chars
- e.g.
{{#pf1
| opt = text
| body =
<embedwiki>
{{#pf2
| opt = ...
|}}
</embedwiki>
|}}
[edit] 'tab' parser function
tab widget for wiki, the basic syntax is
{{#tab:
| name = widget name
| options = predefined widget options
| tab <id>.body = tab header in plain text
tab content in wiki text
| tab <id>.option = predefined tab options (optinal)
| tab <id>.body = [[internal page link | tab header (if necessary)]]
|}}
- name, name of the widget
- options, options for the widget
- height, height for the widget
- width, width for the widget
- tab id, tab id to specify a tab in the widget
- .body, body of the tab
- the first line is in plain text, which means the tab header, and tab body in wiki text is followed
- an internal page link, the tab content will lazy load when actived, use the body of internal page
- javascript actions for the body are not loaded for this version
- .option, tab options are not currently defined
- .body, body of the tab
[edit] Sample
E.g., Sci-Fi movies
{{#tab:
|options=width:700;height:500
|tab0.body=2000
<embedwiki>
{| class="wikitable"
|-
! Title !! Director !! Cast !! Notes
|-
|'''''[[The 6th Day]]'''''||[[Roger Spottiswoode]]||[[Arnold Schwarzenegger]], [[Tony Goldwyn]], [[Michael Rapaport]]||
|-
|'''''[[X-Men (film)|X-Men]]'''''||[[Bryan Singer]]||[[Hugh Jackman]], [[Patrick Stewart]], [[Ian McKellen]] || <ref>Won a [[Saturn Award]] for Best Science Fiction Film.</ref>
|-
|}
</embedwiki>
|tab1.body=2001
<embedwiki>
{| class="wikitable"
|-
! Title !! Director !! Cast !! Notes
|-
|'''''[[Vanilla Sky]]'''''||[[Cameron Crowe]]||[[Tom Cruise]], [[Penélope Cruz]], [[Cameron Diaz]] ||
|-
|}
</embedwiki>
|tab2.body=[[2002 sci-fi|2002]]
|}}
[edit] JS framework conflict
ExtTab uses ExtJS js framework, which may have js conflict with other js frameworks.
- Script manager extension may help.
