mozilla

Revision 65238 of Template:interface

  • Revision slug: Template:interface
  • Revision title: Template:interface
  • Revision id: 65238
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 42 words added, 13 words removed

Revision Content

<% /* get a page's language (Don't use page.language!) */ /* one parameter: Interface name */ var u = Uri.Parts(Page.uri); var lang = string.toLower(u.path[0]); if(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 = "/XPCOM_Interface_Reference/"; switch(lang) { case 'de': str = "/XPCOM_Interface_Referenz/"; break; } /* check $0 exists */ if(wiki.pageExists(lang + str + $0)) {   (web.link(wiki.uri(lang + str + $0), $0)); } else if(wiki.pageExists(lang + '/' + $0)) {   (web.link(wiki.uri(lang + '/' + $0), $0)); } else { var targeturi = "https://developer.mozilla.org/Article_not_found?uri=" + lang + str + $0 +       "&ident=" + $0;   $0 }

Revision Source

<%

/* get a page's language (Don't use page.language!) */
/* one parameter: Interface name */
var u = Uri.Parts(Page.uri);
var lang = string.toLower(u.path[0]);
if(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 = "/XPCOM_Interface_Reference/";

switch(lang) {
  case 'de':
    str = "/XPCOM_Interface_Referenz/";
    break;
}

/* check $0 exists */
if(wiki.pageExists(lang + str + $0)) {
  <code>(web.link(wiki.uri(lang + str + $0), $0))</code>;
} else if(wiki.pageExists(lang + '/' + $0)) {
  <code>(web.link(wiki.uri(lang + '/' + $0), $0))</code>;
} else {
  var targeturi = "https://developer.mozilla.org/Article_not_found?uri=" + lang + str + $0 +
        "&ident=" + $0;
  <code><a rel=('internal') href=(targeturi) class=('new')>$0</a></code>
}
</pre>