Revision 65235 of Template:interface

  • Revision slug: Template:interface
  • Revision title: Template:interface
  • Revision id: 65235
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment cleanup; 6 words added, 11 words removed

Revision Content

/* get a page's language (Don't use page.language!) */
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;
}

/* check $0 exists */
if(wiki.pageExists(lang + '/XPCOM_Interface_Reference/' + $0)) {
(web.link(wiki.uri(lang + '/XPCOM_Interface_Reference/' + $0), $0));
} else if(wiki.pageExists(lang + '/' + $0)) {
    (web.link(wiki.uri(lang + '/' + $0), $0));
} else {
    $0
}

%>
      

Revision Source

<pre class="script">
/* get a page's language (Don't use page.language!) */
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;
}

/* check $0 exists */
if(wiki.pageExists(lang + '/XPCOM_Interface_Reference/' + $0)) {
<code>(web.link(wiki.uri(lang + '/XPCOM_Interface_Reference/' + $0), $0))</code>;
} else if(wiki.pageExists(lang + '/' + $0)) {
    <code>(web.link(wiki.uri(lang + '/' + $0), $0))</code>;
} else {
    <code><a rel=('internal') href=(wiki.uri(lang + '/XPCOM_Interface_Reference/' + $0)) class=('new')>$0</a></code>
}

%>