Difference between revisions of "Buttons"

From Tweeki
Jump to: navigation, search
Line 2: Line 2:
 
With Tweeki it is very easy to create any button you would like to have. By using smart defaults the markup can be very reduced.
 
With Tweeki it is very easy to create any button you would like to have. By using smart defaults the markup can be very reduced.
  
<div class="alert alert-info" role="alert">This feature bypasses MediaWiki's default link handling. This might have security implications. You should only allow editing to people you trust! Also features like 'Links to this site' will not work for button links.</div>
+
<div class="alert alert-info" role="alert"><strong>Caveat:</strong> This feature bypasses MediaWiki's default link handling. This might have security implications. You should only allow editing to people you trust! Also features like 'Links to this site' will not work for button links.</div>
  
 
== Standard Buttons ==
 
== Standard Buttons ==

Revision as of 09:27, 25 February 2015

With Tweeki it is very easy to create any button you would like to have. By using smart defaults the markup can be very reduced.

Standard Buttons

Markup Result
<btn>Simple Button</btn>
<btn size="large">Large Button</btn>
<btn size="small">Small Button</btn>
<btn size="mini">Mini Button</btn>
<btn>
Grouped
Buttons
</btn>
<btn>
Button

Tool
Bar
</btn>
<btn class="btn-primary">
Classy
Buttons
</btn>
<btn>
Classy||btn-primary
Non-classy
Very Classy||btn-success
</btn>
<btn>
Standard Button
Some Page Title|Internal Target
http://some.where|External Target
</btn>

Dropdown Buttons

Markup Result
<btn>
Dropdown-Menu
* Some Menu Item
** Submenu
*
* Some Other Menu Item
</btn>
<btn>
Target|Split Dropdown
* Some Menu Item
</btn>
<btn class="">
Non-Button Dropdown
* Some Menu Item
</btn>
<btn>
Semantic Dropdown
* {{#ask:[[Category:Components]]}}
</btn>

Wrappers

Markup Result
<btn wrapperclass="btn-group dropup">
Dropup
* Some Menu Item
</btn>
<btn wrapperclass="btn-group btn-group-vertical">
Explicit
Wrapper
Setting
</btn>
<btn wrapper="">
Explicit
Wrapper
Unsetting
</btn>

ExplicitWrapperUnsetting

Specifications

The general structure for the code of a single button is target|text|class, where text and class are optional. If text is omitted it is assumed to be the same as target. target and text are parsed after the following algorithm.

  1. Check for semantic queries.
  2. If there is an existing or default interface message with that name, use the content of that message instead.
  3. Parse it.
  4. If it is a valid URL (beginning with http:// or other URL protocol), the link will point to that URL.
  5. Else, it will be treated as a wikilink.