mozilla

Revision 239406 of Template:B2GOnlyHeader

  • Revision slug: Template:B2GOnlyHeader
  • Revision title: Template:B2GOnlyHeader
  • Revision id: 239406
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

<% /* one parameter: Gecko version as of which should only be used in B2G (optional) */ /* get the page language */ var u = uri.parts(Page.uri); var lang = string.tolower(u.path[0]); if (string.contains(lang, "project") || string.contains(lang, "Project")) { lang = string.substr(lang, 8); } /* fall back to page.language on a user page */ else if (string.StartsWith(lang, "user:")) { lang = page.language; } var str = ""; var title = ""; switch(lang) { default:   if ($0) {    str = "Mobile Only in Gecko " + $0;       title = "Available only in Firefox Mobile as of Gecko " + $0 + " " + template.geckoRelease($0);    } else {      str = "Only available on Firefox OS";      title = "This is a Firefox OS (Boot to Gecko) specific API.";    } break; }

(str)

(title)

Revision Source

<%

/* one parameter: Gecko version as of which should only be used in B2G (optional) */
/* get the page language */

var u = uri.parts(Page.uri);
var lang = string.tolower(u.path[0]);
if (string.contains(lang, "project") || string.contains(lang, "Project")) {
  lang = string.substr(lang, 8);
}
/* fall back to page.language on a user page */
else if (string.StartsWith(lang, "user:")) {
 lang = page.language;
}

var str = "";
var title = "";

switch(lang) {
  default:
    if ($0) {
      str = "Mobile Only in Gecko " + $0;
      title = "Available only in Firefox Mobile as of Gecko " + $0 + " " + template.geckoRelease($0);
    } else {
      str = "Only available on Firefox OS";
      title = "This is a Firefox OS (Boot to Gecko) specific API.";
    }
    break;
}
<div class="geckoMinversionHeaderTemplate" style="border:solid 1px maroon; overflow:hidden; margin: 10px 0px; padding: 0px 10px; background-color: rgb(255, 225, 190); font-weight: bold; text-align: center;"><p style="margin: 4px 0px;">(str)</p> <p style="margin: 4px 0px;">(title)</p></div>
</pre>
Revert to this revision