Created
May 22, 2009 14:09
-
-
Save konk303/116147 to your computer and use it in GitHub Desktop.
testing jetpack feature
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="jetpack" href="jetpackTesting.js" /> | |
<title>testing Jetpack</title> | |
</head> | |
<body> | |
<h1>testing Jetpack</h1> | |
</body> | |
</html> |
This file contains hidden or 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.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