Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
testing jetpack feature
<!DOCTYPE html>
<html>
<head>
<link rel="jetpack" href="jetpackTesting.js" />
<title>testing Jetpack</title>
</head>
<body>
<h1>testing Jetpack</h1>
</body>
</html>
jetpack.statusBar.append({
html: '<span id="changeAccount">account:</span><span id="status">testing</span>',
width: 200,
onReady: function(doc) {
// データの永続化は Jetpack.sessionStorage で
// ...どうせsession単位の記憶なら、closureでいいんじゃ
if (!jetpack.sessionStorage.twName) {
jetpack.sessionStorage.tw ={};
jetpack.sessionStorage.tw.name =
jetpack.tabs.focused.contentWindow.prompt('twitter id?');
jetpack.sessionStorage.tw.pass =
jetpack.tabs.focused.contentWindow.prompt('twitter pass?');
jetpack.sessionStorage.tw.counter = 1;
}
$("#changeAccount", doc).css({background:"green"});
$("#status", doc).css({background:"gold"});
var twitter = new jetpack.lib.twitter.Twit(
jetpack.sessionStorage.tw.name,
jetpack.sessionStorage.tw.pass
);
$(doc).click(function() {
var self = this;
//twitter.tweet("counter from jetpack, count:" + Jetpack.sessionStorage.counter);
jetpack.notifications.show(jetpack.sessionStorage.tw.toSource());
twitter.getLatestStatus(function(res){$(self).contents().find("p").html(res.text)});
jetpack.sessionStorage.tw.counter ++;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.