Created
December 5, 2009 14:25
-
-
Save mollifier/249695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jetpack feature : info.js | |
// info ボタンを押すと選択部分を Google で検索し、 | |
// 検索件数を alert する | |
jetpack.statusBar.append({ | |
html: "<button>info</button>", | |
width: 60, | |
onReady: function(widget) { | |
$(widget).click(function() { | |
var word = jetpack.tabs.focused.contentWindow.getSelection(); | |
$.get("http://www.google.co.jp/search", {q: word}, | |
function(data) { | |
var info = $(data, widget).find("#resultStats").text(); | |
jetpack.tabs.focused.contentWindow.alert(info); | |
}); | |
}); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment