Difference between revisions of "Template:Clickable button"

From FIThydrowiki
Jump to navigation Jump to search
m (1 revision imported: Clickable button)
 
(Undo revision 700 by Bendikhansen (talk))
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude>{{#if:{{{3|{{{external|}}}}}}
+
{{tracked|T39744}}
  | <span class="plainlinks" {{#if:{{{id|}}}|id="{{{id}}}"}}>[{{{1|{{{target|//parameter_target_is_empty.de}}}}}} <span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
+
{{TemplateBox
    |{{{4|{{{iconPrimary|}}}}}}
+
|1=target
    |{{{5|{{{iconSecondary|}}}}}}
+
|1d=The target page of the "button". For external links, however, it is recommended using the named parameter target. Please use named parameters if it is an external link because they often contain <code><nowiki>=</nowiki></code> which would confuse the parser.
    |{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
+
|1def=
  }} {{{class|}}}" role="button" aria-disabled="false"><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
+
|1stat=required
  |<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}">&nbsp;</span>
+
|1aliases=1
  }}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
 
  |<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}">&nbsp;</span>
 
  }}</span>]</span><!--
 
  -->
 
  | [[{{{1|{{{target|Parameter target is empty!}}}}}}|<span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
 
    |{{{4|{{{iconPrimary|}}}}}}
 
    |{{{5|{{{iconSecondary|}}}}}}
 
    |{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
 
  }} {{{class|}}}" role="button" aria-disabled="false" {{#if:{{{id|}}}|id="{{{id}}}"}}><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
 
  |<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}">&nbsp;</span>
 
  }}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
 
  |<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}">&nbsp;</span>
 
  }}</span>]]
 
}}<!--
 
  
 +
|3=text
 +
|Test=Text (caption) the button should carry. Either you specify text or an icon.
 +
|3def=
 +
|3stat=required
 +
|3aliases=2
  
--></onlyinclude>
+
|5=external
{{documentation}}
+
|5d=Is this an external link? If it is, set to yes or aye, or whatever you like, except nothing.
<!-- Add categories and interwikis to Template:Clickable button/doc subpage, not here! -->
+
|5def=
 +
|5stat=optional
 +
|5aliases=3
 +
 
 +
|7=iconPrimary
 +
|7d=A jquery UI icon class for the primary icon (in LTR languages on the left side of the button label/text). E.g. ''ui-icon-gear''[http://api.jqueryui.com/theming/icons/]
 +
|7def=
 +
|7stat=optional-
 +
|7aliases=4
 +
 
 +
|9=iconSecondary
 +
|9d=A jquery UI icon class for the secondary icon (in LTR languages on the right side of the button label/text). E.g. ''ui-icon-triangle-1-s''
 +
|9def=
 +
|9stat=optional-
 +
|9aliases=5
 +
 
 +
|11=class
 +
|11d=Add classes like <code> ui-button-green ui-button-large</code>
 +
|11def=
 +
|11stat=optional-
 +
 
 +
|13=id
 +
|13d=Unique id to be used as the button's ID-Attribute. Useful for JavaScript-binding and CSS-styling.
 +
|13def=
 +
|13stat=optional-
 +
 
 +
|name=Clickable button
 +
|desc=Provides a button with hover effects.
 +
|namespace=all
 +
|usergroup=all
 +
|placement=
 +
|usage-notes=
 +
----
 +
:<code><nowiki>{{Clickable button|FAQ|Frequently asked questions}}</nowiki></code> →
 +
::: {{Clickable button|FAQ|Frequently asked questions}}
 +
----
 +
: <code><nowiki>{{Clickable button|target={{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:VisualFileChange.js}}|text=This page with '''VisualFileChange'''|external=true}}</nowiki></code> →
 +
::: {{Clickable button|target={{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:VisualFileChange.js}}|text=This page with '''VisualFileChange'''|external=true}}
 +
----
 +
: <code><nowiki>{{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}</nowiki></code> →
 +
::: {{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}
 +
----
 +
: <code><nowiki>{{Clickable button|:en:Wikipedia:Twinkle/Preferences|'''Twinkle preferences'''|iconPrimary=ui-icon-wrench|class=ui-button-blue ui-button-large}}</nowiki></code> →
 +
::: {{Clickable button|:en:Wikipedia:Twinkle/Preferences|'''Twinkle preferences'''|iconPrimary=ui-icon-wrench|class=ui-button-blue ui-button-large}}
 +
----
 +
: <code><nowiki>{{Clickable button|target={{fullurl:Special:Random/User talk|action=edit&section=new&preloadtitle=I+love+your+work+because}}|text=Do something good|iconSecondary=ui-icon-heart|external=true|class=ui-button-red}}</nowiki></code> →
 +
::: {{Clickable button|target={{fullurl:Special:Random/User talk|action=edit&section=new&preloadtitle=I+love+your+work+because}}|text=Do something good|iconSecondary=ui-icon-heart|external=true|class=ui-button-red}}
 +
|type=formatting
 +
|example=
 +
|i18n-method=-
 +
|i18n-desc=
 +
|seealso=
 +
* {{tl|button}} (works without JS enabled)
 +
* {{tl|Clickable button 2}} (import from de.wikipedia)
 +
* {{tl|key press}}
 +
|setscats=
 +
|lines=1
 +
|shorthand=
 +
|relieson=
 +
* [https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=tree;f=resources/jquery.ui jquery.ui.button]
 +
}}
 +
== Test suite/ Unit tests ==
 +
<table>
 +
<tr><td>Icon only</td><td>{{Clickable button|iconPrimary=ui-icon-help}}</td><td>{{Clickable button|iconSecondary=ui-icon-help}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|iconPrimary=ui-icon-info}}</td></tr>
 +
<tr><td>Icon text</td><td>{{Clickable button|iconPrimary=ui-icon-help|text=Abc}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|text=Abc}}</td><td>{{Clickable button|iconSecondary=ui-icon-help|iconPrimary=ui-icon-info|text=Abc}}</td></tr>
 +
<tr><td>Text only, links</td><td>{{Clickable button|text=Abc}}</td><td>{{Clickable button|text=Abc|target=Main Page}}</td><td>{{Clickable button|text=Abc|target=//commons.wikimedia.org/wiki/Main_Page|external=1}}</td></tr>
 +
<tr><td>Colors</td><td>{{Clickable button|text=Abc|class=ui-button-green}}</td><td>{{Clickable button|text=Abc|class=ui-button-red}}</td><td>{{Clickable button|text=Abc|class=ui-button-blue}}</td></tr>
 +
</table>
 +
 
 +
<includeonly>
 +
<!-- Interwikis go on Wikidata, please add only Categories here -->
 +
[[Category:Formatting templates]]
 +
</includeonly>

Latest revision as of 13:43, 18 January 2019

Script error: No such module "Languages".

Test suite/ Unit tests

Icon only

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon text

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, links

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Colors

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button

Script error: No such module "Languages".

Test suite/ Unit tests

Icon onlyTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Icon textTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
Text only, linksTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button
ColorsTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable buttonTemplate loop detected: Template:Clickable button