Template:Interwiki

  • Revision slug: Template:Interwiki
  • Revision title: Template:Interwiki
  • Revision id: 264652
  • 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': web.link('http://' + lang + '.wikipedia.org/wiki/' + path, title); break; case 'wikimo': %> title; <% break; default: 'Unknown prefix: ' + prefix + '.'; } %>

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':
        web.link('http://' + lang + '.wikipedia.org/wiki/' + path, title);
        break;
    case 'wikimo':
        %>
        <a class="wikimo" title="<%=title%>" href="<%-'http://wiki.mozilla.org/' + path%>">title</a>;
        <%
        break;
    default:
        'Unknown prefix: ' + prefix + '.';
    }
%>
Revert to this revision