| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
|
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 6 |
<title>Skia Client Code Search</title> |
| 7 |
|
| 8 |
<script> |
| 9 |
document.addEventListener('DOMContentLoaded', function () { |
| 10 |
document.getElementById('search-term').oninput = |
| 11 |
event => updateLinks(event.target.value); |
| 12 |
document.getElementById('open-all').onclick = event => { |
| 13 |
rawSearchTerm = document.getElementById('search-term').value; |
| 14 |
updateLinks(rawSearchTerm); |
| 15 |
openLinks(); |
| 16 |
document.getElementById('open-all').value = 'Update all'; |
| 17 |
}; |
| 18 |
document.getElementById('search-term').value = window.location.search.substring(1); |
| 19 |
}, false); |
| 20 |
|
| 21 |
function updateLinks(rawSearchTerm) { |
| 22 |
var term = encodeURIComponent(rawSearchTerm); |
| 23 |
document.getElementById('chromium-link').href = |
| 24 |
'https://cs.chromium.org/search/?q=' + term + |
| 25 |
'+-file:third_party/skia&sq=package:chromium&type=cs'; |
| 26 |
document.getElementById('android-link').href = |
| 27 |
'http://cs.android.com/search?q=' + term + |
| 28 |
'+(-file:%5Eexternal/skia OR file:%5Eexternal/skia/Android.bp OR file:SkUserConfig)' + |
| 29 |
'+-file:%5Eexternal/skqp'; |
| 30 |
document.getElementById('flutter-link').href = |
| 31 |
'https://github.com/search?q=repo%3Aflutter%2Fengine+' + term + '&type=code'; |
| 32 |
// We would prefer to use this link (better search controls), but bugs and |
| 33 |
// staffing have caused it to stop indexing. For now, use Github instead. |
| 34 |
// 'https://cs.opensource.google/search?ss=flutter%2Fengine&q=' + term; |
| 35 |
// See also: https://chat.google.com/room/AAAAXsGfCIs/NmPA4hBSwJc |
| 36 |
document.getElementById('mozilla-link').href = |
| 37 |
'https://dxr.mozilla.org/mozilla-central/search?q=' + term; |
| 38 |
document.getElementById('libreoffice-link').href = |
| 39 |
'https://opengrok.libreoffice.org/search?full=' + term + |
| 40 |
'&searchall=true'; |
| 41 |
} |
| 42 |
|
| 43 |
function openLink(elementId) { |
| 44 |
if (document.getElementById(elementId + '-box').checked) { |
| 45 |
window.open(document.getElementById(elementId + '-link').href, |
| 46 |
document.getElementById(elementId + '-link').id); |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
function openLinks() { |
| 51 |
openLink('chromium'); |
| 52 |
openLink('android'); |
| 53 |
openLink('flutter'); |
| 54 |
openLink('mozilla'); |
| 55 |
openLink('libreoffice'); |
| 56 |
} |
| 57 |
</script> |
| 58 |
</head> |
| 59 |
|
| 60 |
<body> |
| 61 |
<p>Note: Due to different querying capabilities, you may need to adjust your query after opening |
| 62 |
the links below.</p> |
| 63 |
<label for="search-term">Search term: </label> |
| 64 |
<input type="text" name="search-term" id="search-term"> |
| 65 |
<input type="submit" value="Update all" id="open-all"> |
| 66 |
<p>Links to Skia clients code search:</p> |
| 67 |
<ul> |
| 68 |
<li><input type="checkbox" id="chromium-box" checked="true"><a id="chromium-link">Chromium</a></li> |
| 69 |
<li><input type="checkbox" id="android-box" checked="true"><a id="android-link">Android (public)</a></li> |
| 70 |
<li><input type="checkbox" id="flutter-box" checked="true"><a id="flutter-link">Flutter</a></li> |
| 71 |
<li><input type="checkbox" id="mozilla-box" checked="true"><a id="mozilla-link">Mozilla</a>*</li> |
| 72 |
<!-- Less commonly used repos are not checked by default: --> |
| 73 |
<li><input type="checkbox" id="libreoffice-box"><a id="libreoffice-link">LibreOffice</a></li> |
| 74 |
</ul> |
| 75 |
<p>*: Mozilla results include Skia source code (searchfox.org doesn't support excluding paths). Most usage is in |
| 76 |
<b>gfx/2d</b>, but there is some usage elsewhere. Scoping your search to gfx/2d with the "Path filter" is |
| 77 |
helpful. |
| 78 |
</p> |
| 79 |
<p><a href="go/skia-client-search">Internal version</a></p> |
| 80 |
</body> |
| 81 |
|
| 82 |
</html> |