diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-06-30 15:34:22 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-06-30 15:34:22 +0200 |
commit | d39f5aa373a4422f7a5f3ee764fb0f6b0b719d61 (patch) | |
tree | 1833f8b72a4b3a8f00d0d143b079a8fcad01c6ae /misc/chrome/gophertool/popup.html | |
parent | 8652e6c371b8905498d3d314491d36c58d5f68d5 (diff) | |
download | golang-upstream/58.tar.gz |
Imported Upstream version 58upstream/58
Diffstat (limited to 'misc/chrome/gophertool/popup.html')
-rw-r--r-- | misc/chrome/gophertool/popup.html | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/misc/chrome/gophertool/popup.html b/misc/chrome/gophertool/popup.html new file mode 100644 index 000000000..ebbc71f3a --- /dev/null +++ b/misc/chrome/gophertool/popup.html @@ -0,0 +1,54 @@ +<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> +<script src="gopher.js"></script> +<script> + +function focusinput() { + document.getElementById("inputbox").focus(); +} + +function navigate() { + var box = document.getElementById("inputbox"); + box.focus(); + + var t = box.value; + if (t == "") { + return false; + } + + var success = function(url) { + console.log("matched " + t + " to: " + url) + box.value = ""; + openURL(url); + return false; // cancel form submission + }; + + var url = urlForInput(t); + if (url) { + return success(url); + } + + console.log("no match for text: " + t) + return false; +} + +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> +<small>Also: <a href="#" onclick="openURL('http://godashboard.appspot.com/')">buildbots</small> +</body> +</html> |