Template:MozillaOnly

  • Revision slug: Template:MozillaOnly
  • Revision title: Template:MozillaOnly
  • Revision id: 437107
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment

Revision Content

<% // Presents a banner marking a page as covering a topic specific to Mozilla. Intended // for use on API pages in particular, where the API is intentionally designed for // Mozilla products. // // Parameters: // // $0 Explanatory text (optional) // $1 Mozilla product (Optional) // // The "product" (parameter $1) is one of: // // "firefox", "firefoxos", "gecko", "thunderbird"... // // The "product" may be used to customize the appearance of the banner in some way. var mozillaOnlyStr; var explanationStr; var lang = env.locale; var message = $0 || NULL; var product = $1 || NULL; // No Gecko logo, so... if (product == "gecko") { product = "firefox"; } switch(lang) { default: mozillaOnlyStr = "Mozilla-specific API"; explanationStr = "This API is only available in Gecko-based software, including Firefox and Firefox OS."; break; } %>
<%-mozillaOnlyStr%>
<%-explanationStr%>

Revision Source

<%
// Presents a banner marking a page as covering a topic specific to Mozilla. Intended
// for use on API pages in particular, where the API is intentionally designed for
// Mozilla products.
//
// Parameters:
//
//  $0  Explanatory text (optional)
//  $1  Mozilla product (Optional)
//
// The "product" (parameter $1) is one of:
//
//  "firefox", "firefoxos", "gecko", "thunderbird"...
//
// The "product" may be used to customize the appearance of the banner in some way.

var mozillaOnlyStr;
var explanationStr;
var lang = env.locale;
var message = $0 || NULL;
var product = $1 || NULL;

// No Gecko logo, so...

if (product == "gecko") {
    product = "firefox";
}

switch(lang) {
    default:
        mozillaOnlyStr = "Mozilla-specific API";
        explanationStr = "This API is only available in Gecko-based software, including Firefox and Firefox OS.";
        break;
}
%>
<div class="mozOnlyBanner">
    <dl>
        <dt><%-mozillaOnlyStr%></dt>
        <dd><%-explanationStr%></dd>
    </dl>
</div>
Revert to this revision