チェンジセット 2650
- コミット日時:
- 2009/05/16 00:04:27 (3 年前)
- ファイル:
-
- air/TLife/trunk/bin/TLife.swf (更新) (変更前)
- air/TLife/trunk/src/Main.mxml (更新) (2 diffs)
- air/TLife/trunk/src/uwi/search/Searcher.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/TimelineThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/thread/event/ContextMenuItemEventThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/event/DataGridEventThread.as (更新) (9 diffs)
- air/TLife/trunk/src/uwi/thread/event/DataGridRoutineThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/thread/event/PostEventThread.as (更新) (4 diffs)
- air/TLife/trunk/src/uwi/ui/DataGridEx.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/ui/TimelineRenderer.as (更新) (5 diffs)
- air/TLife/trunk/src/uwi/ui/tabconfig/TabConfigEventThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/util/CommonData.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/util/Utility.as (更新) (1 diff)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/trunk/src/Main.mxml
r2642 r2650 201 201 scrollposid : -1, 202 202 newestid : -1, 203 unread : {},204 203 numnotify : int(tab.@numnotify), 205 204 numdisplay : int(tab.@numdisplay), … … 279 278 // キーバインド 280 279 var keybindkeywords : Array = [ 281 "isearchcontent", "isearchscreenname", "ifiltercontent", "ifilterscreenname", 282 "jumptotimeline", "jumptopostarea", "replyatpostarea", "replyattimeline", 283 "downatpostarea", "upatpostarea", "leftatpostarea", "rightatpostarea" 280 "isearchcontent", "isearchscreenname", 281 "ifiltercontent", "ifilterscreenname", 282 "jumptotimeline", "jumptopostarea", 283 "replyatpostarea", "replyattimeline", 284 "downatpostarea", "upatpostarea", 285 "sameuserbackwardatpostarea", "sameuserbackwardattimeline", 286 "sameuserforwardatpostarea", "sameuserforwardattimeline" 284 287 ]; 285 288 CommonData.keybindjudgers = { }; air/TLife/trunk/src/uwi/search/Searcher.as
r2634 r2650 190 190 rule : conds.join(" and "), 191 191 type : 1, 192 unread : {},193 192 numdisplay : 0, 194 193 numnotify : 0, air/TLife/trunk/src/uwi/thread/TimelineThread.as
r2634 r2650 62 62 if (tabbar.SelectedIndex == -1) return; 63 63 64 tabname = tabbar. titles.getItemAt(tabbar.SelectedIndex).toString();64 tabname = tabbar.selectedTabName; 65 65 tabinfo = CommonData.tabmap[tabname]; 66 66 … … 145 145 posteridset[obj.posterid] = null; 146 146 147 if (manageunread == 1) { 148 if (tabinfo.unread[obj.postid] != null) { 149 // すでに既読未読が設定されていた場合tabinfoに従う 150 obj.unread = tabinfo.unread[obj.postid]; 151 }else { 152 // それ以外はすべて未読 153 obj.unread = true; 154 tabinfo.unread[obj.postid] = true; 155 } 156 } 157 147 // すべて未読リストに追加 148 if(tabinfo.type == 0){ 149 if (!CommonData.unreadset[obj.postid]) CommonData.unreadset[obj.postid] = 1; 150 } 151 158 152 timeline.addItem(obj); 159 153 } air/TLife/trunk/src/uwi/thread/event/ContextMenuItemEventThread.as
r2634 r2650 387 387 newestid : -1, 388 388 rule : "", 389 unread : {},390 389 numnotify : -1, 391 390 manageunread : -1, air/TLife/trunk/src/uwi/thread/event/DataGridEventThread.as
r2634 r2650 4 4 import flash.events.KeyboardEvent; 5 5 import flash.events.MouseEvent; 6 import flash.u i.Keyboard;6 import flash.utils.getTimer; 7 7 import mx.collections.ArrayCollection; 8 8 import mx.controls.listClasses.IListItemRenderer; 9 9 import mx.core.Application; 10 import mx.events.FlexEvent;11 10 import mx.events.ScrollEvent; 12 11 import org.libspark.thread.Thread; … … 14 13 import uwi.ui.multipletabbar.MultipleTabBar; 15 14 import uwi.util.CommonData; 15 import uwi.util.EventThread; 16 import uwi.util.Utility; 16 17 17 18 /** … … 24 25 private var tabbar : MultipleTabBar = Application.application.tabbar; 25 26 private var timeline : ArrayCollection = Application.application.timeline; 27 private var sub : EventThread; 26 28 27 29 public function DataGridEventThread() … … 30 32 } 31 33 34 protected override function finalize() : void 35 { 36 sub = null; 37 } 38 32 39 protected override function run() : void 33 40 { 41 sub = new EventThread(datagrid, Event.CHANGE, onChange); 42 sub.start(); 43 waitEvents(); 44 } 45 46 private function waitEvents() : void 47 { 34 48 event(datagrid, MouseEvent.DOUBLE_CLICK, onDoubleClick); 35 49 event(datagrid, MouseEvent.RIGHT_MOUSE_DOWN, onRightClick); 36 event(datagrid, Event.CHANGE, onChange);37 50 event(datagrid, KeyboardEvent.KEY_DOWN, onKeyDown); 51 event(datagrid, KeyboardEvent.KEY_UP, onKeyUp); 38 52 event(datagrid, ScrollEvent.SCROLL, onScroll); 39 53 } … … 42 56 { 43 57 CommonData.datagridroutineflag |= 1; 44 next( run);58 next(waitEvents); 45 59 } 46 60 … … 55 69 Application.application.appendReply(datagrid.selectedItem); 56 70 } 57 next( run);71 next(waitEvents); 58 72 } 59 73 … … 69 83 CommonData.datagridroutineflag |= 3; 70 84 } 71 next( run);85 next(waitEvents); 72 86 } 73 87 … … 79 93 private function onKeyDown(e : KeyboardEvent) : void 80 94 { 81 if (datagrid.selectedIndex != -1){ 82 switch(e.keyCode) { 83 case Keyboard.RIGHT: 84 datagrid.selectedIndex = searchSamePoster(datagrid.selectedIndex, 1); 85 datagrid.scrollToIndex(datagrid.selectedIndex); 86 CommonData.datagridroutineflag |= 3; 87 break; 88 case Keyboard.LEFT: 89 datagrid.selectedIndex = searchSamePoster(datagrid.selectedIndex, -1); 90 datagrid.scrollToIndex(datagrid.selectedIndex); 91 CommonData.datagridroutineflag |= 3; 92 break; 93 // up,downでscrollした場合、changeが打ち消されるため 94 case Keyboard.UP: 95 case Keyboard.DOWN: 96 CommonData.datagridroutineflag |= 3; 97 break; 98 default: 99 break; 100 } 101 CommonData.datagridsuspend = true; 95 if (datagrid.selectedIndex == -1) datagrid.selectedIndex = 0; 96 97 if (CommonData.keybindjudgers.jumptopostarea.apply(null, [e])) { 98 Application.application.postarea.setFocus(); 99 next(waitEvents); 100 return; 102 101 } 103 event(datagrid, KeyboardEvent.KEY_UP, onKeyUp); 104 // next(run); 102 103 if(CommonData.keybindjudgers.replyattimeline.apply(null, [e])){ 104 CommonData.in_reply_to_status_id = ""; 105 Application.application.appendReply(datagrid.selectedItem); 106 } 107 108 if (CommonData.keybindjudgers.sameuserforwardattimeline.apply(null, [e])) { 109 datagrid.selectedIndex = Utility.searchSamePoster(timeline, datagrid.selectedIndex, 1); 110 datagrid.scrollToIndex(datagrid.selectedIndex); 111 CommonData.datagridroutineflag |= 3; 112 } 113 114 if (CommonData.keybindjudgers.sameuserbackwardattimeline.apply(null, [e])) { 115 datagrid.selectedIndex = Utility.searchSamePoster(timeline, datagrid.selectedIndex, -1); 116 datagrid.scrollToIndex(datagrid.selectedIndex); 117 CommonData.datagridroutineflag |= 3; 118 } 119 120 CommonData.datagridsuspend = true; 121 next(waitEvents); 105 122 } 106 123 107 124 private function onKeyUp(e : KeyboardEvent) : void 108 125 { 126 trace("keyup"); 109 127 CommonData.datagridsuspend = false; 110 CommonData.datagridroutineflag |= 3; 111 next(run); 128 next(waitEvents); 112 129 } 113 130 … … 118 135 { 119 136 CommonData.datagridroutineflag |= 3; 120 next(run); 121 } 122 123 private function onDataChange(e : FlexEvent) : void 124 { 125 var tabname : String = tabbar.selectedTabName; 126 datagrid.selectedIndex = timeline.getItemIndex(CommonData.tabmap[tabname].postid); 127 next(run); 128 } 129 130 private function searchSamePoster(index : int, dir : int) : int 131 { 132 var oid : String = timeline.getItemAt(index).posterid; 133 var i : int = index + dir; 134 for (;; i += dir) { 135 if (i >= timeline.length) i = 0; 136 if (i < 0) i = timeline.length - 1; 137 if (timeline.getItemAt(i).posterid == oid) break; 137 138 var index : int = datagrid.selectedIndex; 139 if (Utility.getNumber("manageunread", Application.application.tabbar.selectedTabName) == 1) { 140 // 選択したpostをすべて既読に 141 for each(var ind : int in datagrid.selectedIndices) { 142 datagrid.mark(index, false); 143 } 138 144 } 139 return i;145 next(sub.waitEvents); 140 146 } 141 147 } air/TLife/trunk/src/uwi/thread/event/DataGridRoutineThread.as
r2634 r2650 50 50 var index : int = datagrid.selectedIndex; 51 51 52 /* 52 53 if (Utility.getNumber("manageunread", Application.application.tabbar.selectedTabName) == 1) { 53 54 // 選択したpostをすべて既読に … … 56 57 } 57 58 } 59 */ 58 60 59 61 if ((CommonData.datagridroutineflag & 2) != 0) { air/TLife/trunk/src/uwi/thread/event/PostEventThread.as
r2642 r2650 24 24 import uwi.util.EventThread; 25 25 import uwi.util.OAuthUtility; 26 import uwi.util.Utility; 26 27 27 28 /** … … 87 88 if (CommonData.keybindjudgers.jumptotimeline.apply(null, [e])) { 88 89 Application.application.datagrid.setFocus(); 90 next(waitEvents); 91 return; 92 } 93 94 if(CommonData.keybindjudgers.replyatpostarea.apply(null, [e])){ 95 CommonData.in_reply_to_status_id = ""; 96 Application.application.appendReply(datagrid.selectedItem); 97 next(waitEvents); 98 return; 89 99 } 90 100 … … 92 102 if (datagrid.selectedIndex == -1) datagrid.selectedIndex = datagrid.verticalScrollPosition; 93 103 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.DOWN)); 94 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.DOWN));95 104 } 96 105 … … 98 107 if (datagrid.selectedIndex == -1) datagrid.selectedIndex = datagrid.verticalScrollPosition; 99 108 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.UP)); 109 } 110 111 if (CommonData.keybindjudgers.sameuserforwardatpostarea.apply(null, [e])) { 112 datagrid.selectedIndex = Utility.searchSamePoster(Application.application.timeline, datagrid.selectedIndex, 1); 113 datagrid.scrollToIndex(datagrid.selectedIndex); 114 CommonData.datagridroutineflag |= 3; 115 } 116 117 if (CommonData.keybindjudgers.sameuserbackwardatpostarea.apply(null, [e])) { 118 datagrid.selectedIndex = Utility.searchSamePoster(Application.application.timeline, datagrid.selectedIndex, -1); 119 datagrid.scrollToIndex(datagrid.selectedIndex); 120 CommonData.datagridroutineflag |= 3; 121 } 122 123 CommonData.datagridsuspend = true; 124 event(postarea, KeyboardEvent.KEY_UP, onKeyUp); 125 // next(waitEvents); 126 } 127 128 private function onKeyUp(e : KeyboardEvent) : void 129 { 130 CommonData.datagridsuspend = false; 131 132 if (CommonData.keybindjudgers.downatpostarea.apply(null, [e])) { 133 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.DOWN)); 134 } 135 136 if (CommonData.keybindjudgers.upatpostarea.apply(null, [e])) { 100 137 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.UP)); 101 }102 103 if (CommonData.keybindjudgers.leftatpostarea.apply(null, [e])) {104 if (datagrid.selectedIndex == -1) datagrid.selectedIndex = datagrid.verticalScrollPosition;105 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT));106 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.LEFT));107 }108 109 if (CommonData.keybindjudgers.rightatpostarea.apply(null, [e])) {110 if (datagrid.selectedIndex == -1) datagrid.selectedIndex = datagrid.verticalScrollPosition;111 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT));112 datagrid.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, Keyboard.RIGHT));113 138 } 114 139 air/TLife/trunk/src/uwi/ui/DataGridEx.as
r2634 r2650 2 2 { 3 3 import mx.controls.DataGrid; 4 import mx.controls.dataGridClasses.DataGridItemRenderer; 4 5 import mx.controls.listClasses.IListItemRenderer; 5 6 import mx.core.Application; … … 32 33 if (index < 0 || index >= dataProvider.length)return; 33 34 var item : Object = dataProvider.getItemAt(index); 34 item.unread = unread; 35 dataProvider.setItemAt(item, index); 36 CommonData.tabmap[Application.application.tabbar.selectedTabName].unread[item.postid] = unread; 35 // item.unread = unread; 36 // dataProvider.setItemAt(item, index); 37 // CommonData.tabmap[Application.application.tabbar.selectedTabName].unread[item.postid] = unread; 38 CommonData.unreadset[item.postid] = unread ? 1 : 0; 39 for (var j : int = 0; j < columnCount;j++){ 40 var ir : TimelineRenderer = rowcolToItemRenderer(index, j) as TimelineRenderer; 41 if (!(ir is TimelineRenderer)) continue; 42 ir.validateFast(); 43 } 37 44 } 38 45 air/TLife/trunk/src/uwi/ui/TimelineRenderer.as
r2634 r2650 2 2 { 3 3 import flash.text.TextFormat; 4 import flash.utils.getTimer; 4 5 import mx.controls.dataGridClasses.DataGridColumn; 5 6 import mx.controls.dataGridClasses.DataGridItemRenderer; … … 8 9 import mx.core.Application; 9 10 import uwi.util.CommonData; 11 import uwi.util.Utility; 10 12 11 13 /** … … 24 26 super.data = value; 25 27 28 validateFast(); 29 } 30 31 public function validateFast() : void 32 { 26 33 var datagrid : DataGridEx = owner as DataGridEx; 27 34 var index : int = datagrid.ItemRendererToIndex(this); … … 29 36 30 37 var status : Object = datagrid.dataProvider.getItemAt(index); 31 var tfmt : TextFormat = CommonData.tfmt_timelines[(status.fav ? 2 : 0) | (status.unread ? 1 : 0)]; 38 39 var manageunread : int = Utility.getNumber("manageunread", Application.application.tabbar.selectedTabName); 40 var tfmt : TextFormat = CommonData.tfmt_timelines[(status.fav ? 2 : 0) | (manageunread == 1 ? (CommonData.unreadset[status.postid] || 0) : 0)]; 41 // var tfmt : TextFormat = CommonData.tfmt_timelines[(status.fav ? 2 : 0) | (manageunread & (CommonData.unreadset[status.postid] || 0)))]; 32 42 this.defaultTextFormat = tfmt; 33 43 this.setTextFormat(tfmt); … … 44 54 } 45 55 */ 56 57 } 58 59 public override function validateNow() : void 60 { 46 61 } 47 62 } air/TLife/trunk/src/uwi/ui/tabconfig/TabConfigEventThread.as
r2634 r2650 126 126 newestid : -1, 127 127 rule : "", 128 unread : {},129 128 numnotify : -1, 130 129 manageunread : -1, air/TLife/trunk/src/uwi/util/CommonData.as
r2642 r2650 100 100 // タブ関連 101 101 public static var tabrules : Array;// タブの抽出ルール 102 103 public static var unreadset : Object = { }; // 未読リスト 1 : 未読, 0 : 既読 104 102 105 public static var tabmap : Object = { }; // タブごとのデータへのMap 103 106 // <tabtitle : String, data : Object> … … 107 110 // type : int タブの種類 (0 : 通常のタブ, 1 : 検索結果タブ) 108 111 // cache : Object 検索結果のキャッシュ 109 // unread : Object 未読リスト(set)110 112 // --------以下はconfigxmlに格納-------- 111 113 // numnotify : int 新着通知件数 (0 : 新着通知しない, 負 : グローバル設定に従う) air/TLife/trunk/src/uwi/util/Utility.as
r2634 r2650 181 181 return ar.join("&"); 182 182 } 183 184 public static function searchSamePoster(col : ListCollectionView, index : int, dir : int) : int 185 { 186 var oid : String = col.getItemAt(index).posterid; 187 var i : int = index + dir; 188 for (;; i += dir) { 189 if (i >= col.length) i = 0; 190 if (i < 0) i = col.length - 1; 191 if (col.getItemAt(i).posterid == oid) break; 192 } 193 return i; 194 } 195 183 196 } 184 197

