mozilla

Revision 348033 of Template:Interwiki

  • Revision slug: Template:Interwiki
  • Revision title: Template:Interwiki
  • Revision id: 348033
  • Created:
  • Creator: trevorh
  • Is current revision? No
  • Comment

Revision Content

<% var path = $1; var title = $2 || path; var lang = env.locale.substr(0, 2); var prefix = $0; switch(prefix) { case 'wikipedia': %><%-title%><% break; case 'wikimo': %><%-title%><% break; default: %>Unknown prefix: <%- prefix %>.<% break; }%>

Revision Source

<%
var path = $1;
var title = $2 || path;

var lang = env.locale.substr(0, 2);
var prefix = $0;

switch(prefix) {
    case 'wikipedia':
        %><a title="<%=title%>" href="<%-'http://' + lang + '.wikipedia.org/wiki/' + path%>"><%-title%></a><%
        break;
    case 'wikimo':
        %><a class="wikimo" title="<%=title%>" href="<%-'http://wiki.mozilla.org/' + path%>"><%-title%></a><%
        break;
    default:
        %>Unknown prefix: <%- prefix %>.<%
        break;
}%>