2011-05-23 15:05:18 -06:00
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
Copyright 2011 The Go Authors. All rights reserved.
|
|
|
|
Use of this source code is governed by a BSD-style
|
|
|
|
license that can be found in the LICENSE file.
|
|
|
|
-->
|
|
|
|
<head>
|
2011-05-31 14:16:51 -06:00
|
|
|
<script src="gopher.js"></script>
|
|
|
|
<script>
|
2011-05-23 15:05:18 -06:00
|
|
|
|
|
|
|
function focusinput() {
|
2011-05-31 14:16:51 -06:00
|
|
|
document.getElementById("inputbox").focus();
|
2011-05-23 15:05:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
function navigate() {
|
2011-05-31 14:16:51 -06:00
|
|
|
var box = document.getElementById("inputbox");
|
2011-05-23 15:05:18 -06:00
|
|
|
box.focus();
|
2011-05-31 14:16:51 -06:00
|
|
|
|
2011-05-23 15:05:18 -06:00
|
|
|
var t = box.value;
|
|
|
|
if (t == "") {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-05-31 14:16:51 -06:00
|
|
|
var success = function(url) {
|
2011-05-23 15:05:18 -06:00
|
|
|
console.log("matched " + t + " to: " + url)
|
|
|
|
box.value = "";
|
|
|
|
openURL(url);
|
|
|
|
return false; // cancel form submission
|
2011-05-31 14:16:51 -06:00
|
|
|
};
|
2011-05-23 15:05:18 -06:00
|
|
|
|
2011-05-31 14:16:51 -06:00
|
|
|
var url = urlForInput(t);
|
|
|
|
if (url) {
|
|
|
|
return success(url);
|
|
|
|
}
|
2011-05-23 15:05:18 -06:00
|
|
|
|
2011-05-31 14:16:51 -06:00
|
|
|
console.log("no match for text: " + t)
|
|
|
|
return false;
|
2011-05-23 15:05:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
function openURL(url) {
|
|
|
|
chrome.tabs.create({ "url": url })
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="focusinput()" style='margin: 0.5em; font-family: sans;'>
|
|
|
|
<small><a href="#" onclick="openURL('http://code.google.com/p/go/issues/list')">issue</a>,
|
|
|
|
<a href="#" onclick="openURL('http://codereview.appspot.com/')">codereview</a>,
|
|
|
|
<a href="#" onclick="openURL('http://code.google.com/p/go/source/list')">commit</a>, or
|
|
|
|
<a href="#" onclick="openURL('http://golang.org/pkg/')">pkg</a> id/name:</small>
|
|
|
|
<form style='margin: 0' onsubmit="return navigate();"><nobr><input id="inputbox" size=10 /><input type="submit" value="go" /></nobr></form>
|
2012-02-01 21:53:31 -07:00
|
|
|
<small>Also: <a href="#" onclick="openURL('http://build.golang.org/')">buildbots</small>
|
2011-05-23 15:05:18 -06:00
|
|
|
</body>
|
|
|
|
</html>
|