Template:optionalGeneric

<% /*
parameters:
    $0: "inline" or "method"
    $1: string of indicator
    $2: string of heading
    $3: heading level  ( optional / default = 3 )
*/

var hLevel = $3 || 3;
var attr = "";
var str = mdn.localString({
    "en-US": "Optional" + ($1 ? ' from Gecko ' + $1 : ''),
    "fr": "Facultatif" + ($1 ? ' depuis Gecko ' + $1 : ''),
    "ru": "Необязательный" + ($1 ? ' с версии Gecko ' + $1 : ''),
    "zh-CN": "可选" + ($1 ? '试用于Gecko ' + $1 : ''),
    "zh-TW": ($1 ? '自 Gecko ' + $1 + '開始變為' : '') + "選擇性"
});

if ($1) attr = template("geckoRelease", [$1]);

switch($0) {
    case 'inline':
        %><span class="inlineIndicator optional optionalInline"><%- str %></span><%
        break;
    case 'method':
        %><div>
            <span class="indicatorInHeadline optional optionalMethod"><%- str %></span>
            <h<%-hLevel%>><%= $2 %></h<%-hLevel%>>
        </div><%
        break;
    default :
        %><span class="inlineIndicator optional optionalInline"><%- str %></span><%
        break;
}%>
Search for pages that use Template:optionalGeneric to see example use cases and how many pages use this macro.

Document Tags and Contributors

Last updated by: Mingun,