チェンジセット 2135
- コミット日時:
- 2009/01/12 02:40:12 (3 年前)
- ファイル:
-
- air/TLife/bin/TLife.swf (更新) (変更前)
- air/TLife/src/Main.mxml (更新) (1 diff)
- air/TLife/src/uwi/db/DB.as (更新) (1 diff)
- air/TLife/src/uwi/thread/ContextMenuItemEventThread.as (更新) (8 diffs)
- air/TLife/src/uwi/thread/StatusInsertThread.as (更新) (2 diffs)
- air/TLife/src/uwi/thread/TimelineThread.as (更新) (2 diffs)
- air/TLife/src/uwi/twitter/StatusPostThread.as (削除)
- air/TLife/src/uwi/twitter/TwitterDownTimeScheduleThread.as (追加)
- air/TLife/src/uwi/twitter/TwitterFollowThread.as (削除)
- air/TLife/src/uwi/twitter/TwitterTestThread.as (追加)
- air/TLife/src/uwi/twitter/TwitterUtility.as (更新) (1 diff)
- air/TLife/src/uwi/ui/TimelineRenderer.as (更新) (2 diffs)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/src/Main.mxml
r2134 r2135 162 162 </mx:DataGridColumn> 163 163 --> 164 <mx:DataGridColumn headerText="Name" dataField="postername" width="70" />165 <mx:DataGridColumn headerText="ID" dataField="posterid" width="40" />164 <mx:DataGridColumn headerText="Name" dataField="postername" width="70" showDataTips="true" dataTipField="postername" itemRenderer="uwi.ui.TimelineRenderer" /> 165 <mx:DataGridColumn headerText="ID" dataField="posterid" width="40" showDataTips="true" dataTipField="posterid" itemRenderer="uwi.ui.TimelineRenderer" /> 166 166 <mx:DataGridColumn headerText="Content" dataField="content" width="100" showDataTips="true" dataTipField="content" itemRenderer="uwi.ui.TimelineRenderer" /> 167 <mx:DataGridColumn headerText="Time" dataField="postedtime" width="60" />167 <mx:DataGridColumn headerText="Time" dataField="postedtime" width="60" showDataTips="true" dataTipField="postedtime" itemRenderer="uwi.ui.TimelineRenderer" /> 168 168 </uwi:columns> 169 169 </uwi:DataGridEx> air/TLife/src/uwi/db/DB.as
r2134 r2135 37 37 "postedtime date not null," + 38 38 "replyid integer not null check(replyid >= 0)," + 39 "fav boolean not null," + 39 40 "primary key(userid, postid)" + 40 41 ")"); air/TLife/src/uwi/thread/ContextMenuItemEventThread.as
r2134 r2135 35 35 private var item_follow : ContextMenuItem; 36 36 private var item_remove : ContextMenuItem; 37 private var item_block : ContextMenuItem;38 37 private var item_personalTL : ContextMenuItem; 39 38 private var item_pairTL : ContextMenuItem; … … 58 57 item_follow = new ContextMenuItem("follow"); 59 58 item_remove = new ContextMenuItem("remove"); 60 item_block = new ContextMenuItem("block");61 59 item_personalTL = new ContextMenuItem("パーソナルタイムライン"); 62 60 item_pairTL = new ContextMenuItem("ペアタイムライン"); … … 70 68 dgcm.customItems.push(item_follow); 71 69 dgcm.customItems.push(item_remove); 72 dgcm.customItems.push(item_block);73 70 dgcm.customItems.push(item_personalTL); 74 71 dgcm.customItems.push(item_pairTL); … … 94 91 event(item_follow, ContextMenuEvent.MENU_ITEM_SELECT, onFollow); 95 92 event(item_remove, ContextMenuEvent.MENU_ITEM_SELECT, onRemove); 96 event(item_block, ContextMenuEvent.MENU_ITEM_SELECT, onBlock);97 93 event(item_personalTL, ContextMenuEvent.MENU_ITEM_SELECT, onPersonalTL); 98 94 event(item_pairTL, ContextMenuEvent.MENU_ITEM_SELECT, onPairTL); … … 125 121 if (dg.selectedIndex != -1) { 126 122 for each(var ind : int in dg.selectedIndices) { 127 var postid : String = CommonData.timeline.getItemAt(ind).postid;128 new TwitterPostThread("http://twitter.com/favorites/create/" + postid + ".json", "id=" + postid, "Fav").start();123 TwitterUtility.fav(CommonData.timeline.getItemAt(ind).postid); 124 // favのチェックと更新 129 125 } 130 126 } … … 136 132 if (dg.selectedIndex != -1) { 137 133 for each(var ind : int in dg.selectedIndices) { 138 var postid : String = CommonData.timeline.getItemAt(ind).postid;139 new TwitterPostThread("http://twitter.com/favorites/destroy/" + postid + ".json", "id=" + postid, "Fav削除").start();134 TwitterUtility.favdel(CommonData.timeline.getItemAt(ind).postid); 135 // favのチェックと更新 140 136 } 141 137 } … … 145 141 private function onFollow(e : ContextMenuEvent) : void 146 142 { 143 if (dg.selectedIndex != -1) { 144 for each(var ind : int in dg.selectedIndices) { 145 TwitterUtility.follow(CommonData.timeline.getItemAt(ind).posterid); 146 // followのチェックと更新 147 } 148 } 147 149 next(run); 148 150 } … … 150 152 private function onRemove(e : ContextMenuEvent) : void 151 153 { 152 next(run); 153 } 154 154 if (dg.selectedIndex != -1) { 155 for each(var ind : int in dg.selectedIndices) { 156 TwitterUtility.remove(CommonData.timeline.getItemAt(ind).posterid); 157 // followのチェックと更新 158 } 159 } 160 next(run); 161 } 162 163 /* 155 164 private function onBlock(e : ContextMenuEvent) : void 156 165 { 157 next(run); 158 } 166 if (dg.selectedIndex != -1) { 167 for each(var ind : int in dg.selectedIndices) { 168 TwitterUtility.block(CommonData.timeline.getItemAt(ind).posterid); 169 } 170 } 171 next(run); 172 } 173 174 private function onBlockDel(e : ContextMenuEvent) : void 175 { 176 if (dg.selectedIndex != -1) { 177 for each(var ind : int in dg.selectedIndices) { 178 TwitterUtility.blockdel(CommonData.timeline.getItemAt(ind).posterid); 179 } 180 } 181 next(run); 182 } 183 */ 159 184 160 185 // TODO debug air/TLife/src/uwi/thread/StatusInsertThread.as
r2128 r2135 37 37 var stmt : SQLStatement = new SQLStatement(); 38 38 stmt.sqlConnection = conn; 39 stmt.text = "replace into " + CommonData.TABLE_STATUS + " (userid, postid, posterid, content, postedtime, replyid ) values (:userid, :postid, :posterid, :content, :postedtime, :replyid)";39 stmt.text = "replace into " + CommonData.TABLE_STATUS + " (userid, postid, posterid, content, postedtime, replyid, fav) values (:userid, :postid, :posterid, :content, :postedtime, :replyid, :fav)"; 40 40 var postermap : Object = {}; 41 41 … … 48 48 stmt.parameters[":postedtime"] = status.postedtime; 49 49 stmt.parameters[":replyid"] = status.replyid; 50 stmt.parameters[":fav"] = status.fav; 50 51 try { 51 52 stmt.execute(); air/TLife/src/uwi/thread/TimelineThread.as
r2134 r2135 33 33 { 34 34 var tabname : String = tabbar.titles.getItemAt(tabbar.SelectedIndex) as String; 35 var sqlbase : String = "select postid, posterid, content, postedtime, replyid from " +35 var sqlbase : String = "select postid, posterid, content, postedtime, replyid, fav from " + 36 36 CommonData.TABLE_STATUS + 37 37 " where userid = '" + CommonData.username + "'"; … … 87 87 replyid : obj.replyid, 88 88 rawcontent : obj.content, 89 fav : false89 fav : obj.fav 90 90 }); 91 91 } air/TLife/src/uwi/twitter/TwitterUtility.as
r1957 r2135 10 10 public class TwitterUtility 11 11 { 12 public static function fav( to: String) : void12 public static function fav(postid : String) : void 13 13 { 14 new URLLoaderThread(new URLRequest("http://twitter.com/favourings/create/" + to)).start();14 new TwitterPostThread("http://twitter.com/favorites/create/" + postid + ".xml", "id=" + postid, "Fav").start(); 15 15 } 16 16 17 public static function favdel( to: String) : void17 public static function favdel(postid : String) : void 18 18 { 19 new URLLoaderThread(new URLRequest("http://twitter.com/favourings/destroy/" + to)).start();19 new TwitterPostThread("http://twitter.com/favorites/destroy/" + postid + ".xml", "id=" + postid, "Fav削除").start(); 20 20 } 21 21 22 public static function follow(posterid : String) : void 23 { 24 new TwitterPostThread("http://twitter.com/friendships/create/" + posterid + ".xml", "id=" + posterid, "follow").start(); 25 } 26 27 public static function remove(posterid : String) : void 28 { 29 new TwitterPostThread("http://twitter.com/friendships/destroy/" + posterid + ".xml", "id=" + posterid, "remove").start(); 30 } 31 32 public static function block(posterid : String) : void 33 { 34 new TwitterPostThread("http://twitter.com/blocks/create/" + posterid + ".xml", "id=" + posterid, "block").start(); 35 } 36 37 public static function blockdel(posterid : String) : void 38 { 39 new TwitterPostThread("http://twitter.com/blocks/destroy/" + posterid + ".xml", "id=" + posterid, "blockdel").start(); 40 } 22 41 } 23 42 air/TLife/src/uwi/ui/TimelineRenderer.as
r2109 r2135 2 2 { 3 3 import mx.controls.dataGridClasses.DataGridItemRenderer; 4 import mx.controls.dataGridClasses.DataGridListData; 5 import uwi.util.CommonData; 4 6 5 7 /** … … 17 19 { 18 20 super.data = value; 19 // var dgld : DataGridListData = super.listData as DataGridListData;20 21 21 // if(dgld.columnIndex == 2){ 22 if (value.fav == true) { 23 setStyle("color", 0xff0000); 24 }else { 25 setStyle("color", 0x000000); 26 } 27 // } 22 var status : Object = CommonData.timeline.getItemAt((super.listData as DataGridListData).rowIndex); 23 if (status.fav == true) { 24 setStyle("color", 0xff0000); 25 }else { 26 setStyle("color", 0x000000); 27 } 28 28 } 29 29 }

