mozilla

Revision 231424 of Template:LXRSearch

  • Revision slug: Template:LXRSearch
  • Revision title: Template:LXRSearch
  • Revision id: 231424
  • Created:
  • Creator: lmorchard
  • Is current revision? No
  • Comment
Tags: 

Revision Content

<% /* get the page language */ var u = uri.parts(Page.uri); var lang = string.tolower(u.path[0]); if (string.contains(lang, "project") || string.contains(lang, "Project")) { lang = string.substr(lang, 8); } /* fall back to page.language on a user page */ else if (string.StartsWith(lang, "user:")) { lang = page.language; } var searchfor = ' Search for ' + $2 + ''; switch(lang) { case 'de': searchfor = ' Suche nach ' + $2 + ''; break; case 'ja': searchfor = ' で ' + $2 + ' を'; break; } %> <%- string.trim($3) ? $3 : ('MXR ' + ($0 == 'ident' ? 'ID' : '') + searchfor) %>

Revision Source

<%

/* get the page language */
var u = uri.parts(Page.uri);
var lang = string.tolower(u.path[0]);
if (string.contains(lang, "project") || string.contains(lang, "Project")) {
  lang = string.substr(lang, 8);
}
/* fall back to page.language on a user page */
else if (string.StartsWith(lang, "user:")) {
 lang = page.language;
}
var searchfor = ' Search for <code>' + $2 + '</code>';
switch(lang) {
  case 'de':
    searchfor = ' Suche nach <code>' + $2 + '</code>';
    break;
  case 'ja':
    searchfor = ' で <code>' + $2 + '</code> を';
    break;
}
%>
<a href="http://mxr.mozilla.org/mozilla-central/<%= $0 + '?' + $1 + '=' + $2 %>"><%-
  string.trim($3) ? $3 : ('MXR ' + ($0 == 'ident' ? 'ID' : '') + searchfor) %></a>