Revision 264877 of Template:ifattribute

  • Revision slug: Template:ifattribute
  • Revision title: Template:ifattribute
  • Revision id: 264877
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment
Tags: 

Revision Content

<% /* creates a link to an attribute in an interface */ /* parameters: interface_name, attribute_name */ var lang = env.locale; var destNewType = "/" + lang + '/docs/XPCOM Interface Reference/' + $0; var destOldType = "/" + lang + '/docs/' + $0; var apiString = $0 + '.' + $1; var html = ""; if (wiki.pageExists(destNewType)) { /* the page exists from the dekiwiki age */ html = web.link(wiki.uri(destNewType) + '#' + $1, apiString); } else if (wiki.pageExists(destOldType)) { /* the page exists from the mediawiki age */ html = web.link(wiki.uri(destOldType) + '#' + $1, apiString); } else { /* the page doesn't exist */   html = web.link(wiki.uri(destNewType) + '#' + $1, apiString); } %> <%-html%>

Revision Source

<%
/* creates a link to an attribute in an interface */
/* parameters: interface_name, attribute_name */

var lang = env.locale;

var destNewType = "/" + lang + '/docs/XPCOM Interface Reference/' + $0;
var destOldType = "/" + lang + '/docs/' + $0;
var apiString = $0 + '.' + $1;
var html = "";

if (wiki.pageExists(destNewType)) { /* the page exists from the dekiwiki age */
    html = web.link(wiki.uri(destNewType) + '#' + $1, apiString);
} else if (wiki.pageExists(destOldType)) { /* the page exists from the mediawiki age */
    html = web.link(wiki.uri(destOldType) + '#' + $1, apiString);
} else { /* the page doesn't exist */
  html = web.link(wiki.uri(destNewType) + '#' + $1, apiString);
}
%>
<%-html%>