Changeset 8396
- Timestamp:
- 03/26/08 15:52:45 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/twitterView.js
r8344 r8396 1 1 // Vimperator plugin: 'Statusbar Twitter' 2 // Last Change: 2 4-Mar-2008. Jan 20082 // Last Change: 26-Mar-2008. Jan 2008 3 3 // License: Creative Commons 4 4 // Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid … … 12 12 13 13 var lastestId = 0; 14 var lastestStatus; 14 15 15 16 var statuses = []; … … 32 33 var statusPanel = document.createElement('textbox'); 33 34 34 hbox.style.overflow = "hidden";35 //hbox.style.overflow = "hidden"; 35 36 36 37 iconPanel.setAttribute('id','statusbar-twitter-timeline-icon'); … … 49 50 //document.getElementById('liberator-commandline').appendChild(hbox); 50 51 document.getElementById('liberator-commandline').insertBefore(hbox,document.getElementById('liberator-commandline-command')); 52 53 document.getElementById('liberator-commandline-command').style.textAlign = "right"; 51 54 document.getElementById('liberator-commandline-command').addEventListener("focus",function(e){ 52 55 hbox.hidden = true; 56 document.getElementById('liberator-commandline-command').style.textAlign = "left"; 53 57 },true); 54 58 document.getElementById('liberator-commandline-command').addEventListener("blur",function(e){ 55 59 hbox.hidden = false; 60 document.getElementById('liberator-commandline-command').style.textAlign = "right"; 56 61 },true); 57 62 58 63 checkTimeline(); 59 64 updateTimeline(); 65 setInterval(checkTimeline ,checkTime); 66 setInterval(updateTimeline ,updateTime); 60 67 61 68 function checkTimeline(){ … … 78 85 xhr.open("GET","http://twitter.com/statuses/friends_timeline.json",true,username,password); 79 86 xhr.send(null); 80 81 setTimeout(arguments.callee ,checkTime);82 87 } 83 88 function updateTimeline(){ 84 89 if(statuses.length > 0 && !hbox.hidden){ 85 vars = statuses.shift();86 statusPanel.value = s.user.screen_name + " : " +s.text;87 statusPanel.setAttribute('tooltiptext', s.user.screen_name + " : " +s.text);88 iconPanel.setAttribute('src', s.user.profile_image_url);89 iconPanel.setAttribute('tooltiptext', s.user.screen_name);90 lastestStatus = statuses.shift(); 91 statusPanel.value = lastestStatus.user.screen_name + " : " + lastestStatus.text; 92 statusPanel.setAttribute('tooltiptext',lastestStatus.user.screen_name + " : " + lastestStatus.text); 93 iconPanel.setAttribute('src',lastestStatus.user.profile_image_url); 94 iconPanel.setAttribute('tooltiptext',lastestStatus.user.screen_name); 90 95 } 96 } 91 97 92 setTimeout(arguments.callee ,updateTime); 93 } 98 liberator.mappings.addUserMap([liberator.modes.NORMAL], [",r"], 99 "Reply to current user", 100 function () { liberator.commandline.open(":", "twitter @" + lastestStatus.user.screen_name + " ", liberator.modes.EX); }); 94 101 })();
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)