Template:optionalGeneric

  • Revision slug: Template:optionalGeneric
  • Revision title: Template:optionalGeneric
  • Revision id: 324167
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment

Revision Content

<% /* 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 : ''), "zh-CN": "可选" + ($1 ? '试用于Gecko ' + $1 : ''), "zh-TW": ($1 ? '自 Gecko ' + $1 + '開始變為' : '') + "選擇性" }); if ($1) attr = template("geckoRelease", [$1]); switch($0) { case 'inline': %><%- str %><% break; case 'method': %>
<%- str %> <h<%-hlevel%>><%= $2 %></h<%-hlevel%>>
<% break; default : %><%- str %><% break; }%>

Revision Source

<% /*
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 : ''),
    "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;
}%>
Revert to this revision