Template:interface-method

  • Revision slug: Template:interface-method
  • Revision title: Template:interface-method
  • Revision id: 120862
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment page content-type changed to 'application/x.deki0805+xml'

Revision Content

/* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];
if(string.Contains(lang, "project") || string.Contains(lang, "Project")) {
 lang = string.Substr(lang, 8);
}

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

Revision Source

<pre class="script">
/* get a page's language (Don't use page.language!) */
var u = Uri.Parts(Page.uri);
var lang = u.path[0];
if(string.Contains(lang, "project") || string.Contains(lang, "Project")) {
 lang = string.Substr(lang, 8);
}

/* check $0#$1 exists */
if(wiki.pageExists(lang + '/XPCOM_Interface_Reference/' + $0)) {
    <code>(web.link(wiki.uri(lang + '/XPCOM_Interface_Reference/' + $0) + '#' + $1 + '()', $0 + '.' + $1 + '()'))</code>;
} else if(wiki.pageExists(lang + '/' + $0)) {
    <code>(web.link(wiki.uri(lang + '/' + $0) + '#' + $1 + '()', $0 + '.' + $1 + '()'))</code>;
} else {
    <code><<span class="start-tag">a</span><span class="attribute-name"> rel</span>=(<span class="attribute-value">'internal') </span><span class="attribute-name">href</span><span>=</span>(<span>wiki.uri(</span>lang + '/XPCOM_Interface_Reference/' + $0<span>)</span> + '#' + $1 + '()'<span>) </span><span class="attribute-name">class</span>=<span class="attribute-value">('new')></span>$0 + '.' + $1 + '()'</<span class="end-tag">a></span></code>;
}
%>
Revert to this revision