Template:Interwiki

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

Revision Content

<% var path = $1; var title = $2 || path; var lang = env.locale; if (lang === 'zh_tw' || lang === 'cn') { lang = 'zh'; } else if (lang === 'en-US') { lang = 'en'; } 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;
    
    if (lang === 'zh_tw' || lang === 'cn') {
        lang = 'zh';
    } else if (lang === 'en-US') {
        lang = 'en';
    }
    
    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;
    }
%>
Revert to this revision