mozilla

Revision 235341 of Template:jsapixref

  • Revision slug: Template:jsapixref
  • Revision title: Template:jsapixref
  • Revision id: 235341
  • Created:
  • Creator: lmorchard
  • Is current revision? No
  • Comment

Revision Content

<% var lang = env.locale; var api = $0; if (string.endswith($0, '()')) { api = string.remove(api, string.length(api) - 2); } var dest = lang + '/' + 'SpiderMonkey/JSAPI_Reference/' + api; if (wiki.pageExists(dest)) { /* the page exists */ %><%- (web.link(wiki.uri(dest), $0)) %><% } else { /* the page doesn't exist */   var targeturi = "/" + lang + "/docs/new?slug=SpiderMonkey/JSAPI_Reference/" + $0; %><%-$0%><% } %>

Revision Source

<%
var lang = env.locale;
var api = $0;

if (string.endswith($0, '()')) {
    api = string.remove(api, string.length(api) - 2);
}

var dest = lang + '/' + 'SpiderMonkey/JSAPI_Reference/' + api;

if (wiki.pageExists(dest)) { /* the page exists */
    %><code><%- (web.link(wiki.uri(dest), $0)) %></code><%
} else { /* the page doesn't exist */
    var targeturi = "/" + lang + "/docs/new?slug=SpiderMonkey/JSAPI_Reference/" + $0;
    %><code><a rel="internal" href="<%=targeturi%>" class="new"><%-$0%></a></code><%
}
%>