Difference between revisions of "Buttons"

From Tweeki
Jump to: navigation, search
Line 214: Line 214:
 
The general structure for the code of a single button is <code>target|text|class</code>, where <code>text</code> and <code>class</code> are optional. If <code>text</code> is omitted it is assumed to be the same as <code>target</code>. <code>target</code> and <code>text</code> are parsed after the following algorithm.
 
The general structure for the code of a single button is <code>target|text|class</code>, where <code>text</code> and <code>class</code> are optional. If <code>text</code> is omitted it is assumed to be the same as <code>target</code>. <code>target</code> and <code>text</code> are parsed after the following algorithm.
  
 +
# Check for semantic queries.
 
# If there is an existing or default interface message with that name, use the content of that message instead.
 
# If there is an existing or default interface message with that name, use the content of that message instead.
 
# Parse it.
 
# Parse it.
 
# If it is a valid URL (beginning with http:// or other URL protocol), the link will point to that URL.
 
# If it is a valid URL (beginning with http:// or other URL protocol), the link will point to that URL.
 
# Else, it will be treated as a wikilink.
 
# Else, it will be treated as a wikilink.

Revision as of 19:46, 16 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
<button>Simple Button</button>

<button>Simple Button</button>

<button size="large">Large Button</button>
<button size="small">Small Button</button>
<button size="mini">Mini Button</button>
<button size="large">Large Button</button>

<button size="small">Small Button</button>

<button size="mini">Mini Button</button>
<button>
Grouped
Buttons
</button>

<button> Grouped Buttons </button>

<button>
Button

Tool
Bar
</button>

<button> Button

Tool Bar </button>

<button class="btn-primary">
Classy
Buttons
</button>

<button class="btn-primary"> Classy Buttons </button>

<button>
Classy||btn-primary
Non-classy
Very Classy||btn-success
</button>

<button> Classy||btn-primary Non-classy Very Classy||btn-success </button>

<button>
Standard Button
Internal Target|Some Page Title
External Target|http://some.where
</button>

<button> Standard Button Internal Target|Some Page Title External Target|http://some.where </button>

Dropdown Buttons

Markup Result
<button>
Dropdown-Menu
* Some Menu Item
** Submenu
*
* Some Other Menu Item
</button>

<button> Dropdown-Menu

  • Some Menu Item
    • Submenu
  • Some Other Menu Item

</button>

<button>
Split Dropdown|Target
* Some Menu Item
</button>

<button> Split Dropdown|Target

  • Some Menu Item

</button>

<button class="">
Non-Button Dropdown
* Some Menu Item
</button>

<button class=""> Non-Button Dropdown

  • Some Menu Item

</button>

<button>
Semantic Dropdown
* {{#ask:[[Category:Components]]}}
</button>

<button> Semantic Dropdown

</button>

Wrappers

Markup Result
<button wrapperclass="btn-group dropup">
Dropup
* Some Menu Item
</button>

<button wrapperclass="btn-group dropup"> Dropup

  • Some Menu Item

</button>

<button wrapperclass="btn-group btn-group-vertical">
Explicit
Wrapper
Setting
</button>

<button wrapperclass="btn-group btn-group-vertical"> Explicit Wrapper Setting </button>

<button wrapper="">
Explicit
Wrapper
Unsetting
</button>

<button wrapper=""> Explicit Wrapper Unsetting </button>

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.