チェンジセット 2708: air/TLife/trunk
- コミット日時:
- 2009/05/24 23:02:24 (3 年前)
- ファイル:
-
- air/TLife/trunk/bin/TLife.swf (更新) (変更前)
- air/TLife/trunk/bin/initial/config.xml (更新) (1 diff)
- air/TLife/trunk/res/icon/oauth.png (追加)
- air/TLife/trunk/res/icon/oauthg.png (追加)
- air/TLife/trunk/src/Main.mxml (更新) (8 diffs)
- air/TLife/trunk/src/uwi/migemo/AIRMigemo.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/migemo/SocialIMEAPIThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/search/Searcher.as (更新) (5 diffs)
- air/TLife/trunk/src/uwi/thread/FollowingCheckThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/LinkResolveThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/MainThread.as (更新) (5 diffs)
- air/TLife/trunk/src/uwi/thread/NotifyNewThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/PostThread.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/thread/StatusGetBaseThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/thread/event/ContextMenuItemEventThread.as (更新) (14 diffs)
- air/TLife/trunk/src/uwi/thread/event/DataGridEventThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/thread/event/DataGridRoutineThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/event/IncrementalSearchThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/event/PostEventThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/thread/event/TabBarEventThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/tinysegmenter/TinySegmenter.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterDirectMessageGetThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterFriendsInfoGetThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterOAuthAccessThread.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterOAuthRequestThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterScrapeThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterTimelineGetThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/ui/DataGridEx.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/ImageEx.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/TextAreaEditor.mxml (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/TimelineRenderer.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/complete/CompleteThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/mainmenu/MainMenu.mxml (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/mainmenu/MainMenuEventThread.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/ui/mainstatusbar/MainStatusBar.mxml (更新) (3 diffs)
- air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBar.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBarDragEventThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/ui/tabconfig/TabConfig.mxml (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/tabconfig/TabConfigEventThread.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/util/CommonData.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/util/StatusUtility.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/wassr/WassrTimelineGetThread.as (更新) (2 diffs)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/trunk/bin/initial/config.xml
r2651 r2708 153 153 <timeout>10000</timeout> 154 154 <autorelogininterval>60000</autorelogininterval> 155 <urlshortening> 156 <policy>smart</policy> 157 <services>tinyurl.com</services> 158 </urlshortening> 155 159 <log> 156 160 <level>DEBUG</level> air/TLife/trunk/src/Main.mxml
r2669 r2708 1 <?xml version="1.0" encoding="utf-8"?>1 <?xml version="1.0" encoding="utf-8"?> 2 2 <mx:WindowedApplication 3 3 xmlns:mx="http://www.adobe.com/2006/mxml" … … 81 81 // アイコンの設定 82 82 NativeApplication.nativeApplication.icon.bitmaps = [ 83 (new icon_16() as BitmapAsset).bitmapData,84 (new icon_32() as BitmapAsset).bitmapData,85 (new icon_48() as BitmapAsset).bitmapData,86 (new icon_128() as BitmapAsset).bitmapData83 BitmapAsset(new icon_16()).bitmapData, 84 BitmapAsset(new icon_32()).bitmapData, 85 BitmapAsset(new icon_48()).bitmapData, 86 BitmapAsset(new icon_128()).bitmapData 87 87 ]; 88 88 if (NativeApplication.supportsSystemTrayIcon) { 89 systemtrayicon = NativeApplication.nativeApplication.icon as SystemTrayIcon;89 systemtrayicon = SystemTrayIcon(NativeApplication.nativeApplication.icon); 90 90 systemtrayicon.tooltip = "TLife"; 91 91 } 92 92 if (NativeApplication.supportsDockIcon) { 93 dockicon = NativeApplication.nativeApplication.icon as DockIcon;93 dockicon = DockIcon(NativeApplication.nativeApplication.icon); 94 94 } 95 95 … … 126 126 127 127 // postvalidatorの設定 128 postvalidator.required = false; 129 postvalidator.maxLength = CommonData.LIMLEN_POST; 130 postvalidator.tooLongError = "長すぎですよー"; 128 //postvalidator.required = false; 129 //postvalidator.maxLength = CommonData.LIMLEN_POST; 130 //postvalidator.tooLongError = "長すぎですよー"; 131 MainStatusBar(statusBar).setStateOAuth(0); 131 132 132 133 new MainThread().start(); … … 176 177 } 177 178 178 private static const EVENT_CHARLEFT : Event = new Event("charleft");179 // private static const EVENT_CHARLEFT : Event = new Event("charleft"); 179 180 180 181 public function changeCharLeft() : void … … 193 194 // StringValidator用 194 195 // XXX ときどきrepaintしないと元の色に戻らない場合がある。バグ? 195 postarea.dispatchEvent(EVENT_CHARLEFT);196 // postarea.dispatchEvent(EVENT_CHARLEFT); 196 197 }); 197 198 } … … 361 362 // XXX too dangerous! 362 363 // TextArea.textField 363 var pos : int = (friendpost.getChildAt(2) as IUITextField).getCharIndexAtPoint(event.localX, event.localY);364 var pos : int = IUITextField(friendpost.getChildAt(2)).getCharIndexAtPoint(event.localX, event.localY); 364 365 if (pos == CommonData.prevpos_friendpost || pos == -1) return; 365 366 CommonData.prevpos_friendpost = pos; … … 386 387 // XXX too dangerous! 387 388 // Text.textField 388 var pos : int = (replypost.getChildAt(0) as IUITextField).getCharIndexAtPoint(event.localX, event.localY);389 var pos : int = IUITextField(replypost.getChildAt(0)).getCharIndexAtPoint(event.localX, event.localY); 389 390 if (pos == CommonData.prevpos_replypost || pos == -1) return; 390 391 CommonData.prevpos_replypost = pos; … … 509 510 </mx:VBox> 510 511 511 <mx:StringValidator id="postvalidator" source="{postarea}" property="text" triggerEvent="charleft" />512 <!-- <mx:StringValidator id="postvalidator" source="{postarea}" property="text" triggerEvent="charleft" />--> 512 513 513 514 <mx:Style> air/TLife/trunk/src/uwi/migemo/AIRMigemo.as
r2634 r2708 94 94 if (ar != null) { 95 95 for each(x in ar) { 96 ar2 = (x.value as String).split("|");96 ar2 = String(x.value).split("|"); 97 97 for each(x2 in ar2){ 98 98 ret.push(x2); air/TLife/trunk/src/uwi/migemo/SocialIMEAPIThread.as
r2634 r2708 52 52 { 53 53 for (var i : int = 0; i < pe.numThreads; i++) { 54 var ult : URLLoaderThread = pe.getThreadAt(i) as URLLoaderThread;54 var ult : URLLoaderThread = URLLoaderThread(pe.getThreadAt(i)); 55 55 var src : String = ult.loader.data.replace(/([\*\+\.\?\{\}\(\)\[\]\^\$\-\|\/\\])/g, "\\$1"); 56 56 var regexpstr : String = ""; air/TLife/trunk/src/uwi/search/Searcher.as
r2669 r2708 90 90 if (val is Array) { 91 91 if (option.word) { 92 for each(q in val as Array) {92 for each(q in val) { 93 93 if ((q.flag == "-") == (segs.indexOf(q.value) != -1)) { 94 94 found = false; … … 97 97 } 98 98 }else{ 99 for each(q in val as Array) {99 for each(q in val) { 100 100 if ((q.flag == "-") == (targ.indexOf(q.value) != -1)) { 101 101 found = false; … … 108 108 found = false; 109 109 for (var seg : String in segs) { 110 if ( (val as RegExp).test(seg)) {110 if (RegExp(val).test(seg)) { 111 111 found = true; 112 112 break; … … 114 114 } 115 115 }else{ 116 found = (val as RegExp).test(targ);116 found = RegExp(val).test(targ); 117 117 } 118 118 }else { … … 124 124 if (option.idfullMatch == true) { 125 125 // 完全一致 126 found = (val as Array).indexOf(targ) != -1;126 found = val.indexOf(targ) != -1; 127 127 }else { 128 128 found = false; air/TLife/trunk/src/uwi/thread/FollowingCheckThread.as
r2634 r2708 58 58 private function onSelectComplete() : void 59 59 { 60 var arprotected : Array = (pe.getThreadAt(0) as DBSelectThread).Result.data;61 var arfollowing : Array = (pe.getThreadAt(1) as DBSelectThread).Result.data;60 var arprotected : Array = DBSelectThread(pe.getThreadAt(0)).Result.data; 61 var arfollowing : Array = DBSelectThread(pe.getThreadAt(1)).Result.data; 62 62 63 63 if (arprotected == null) { air/TLife/trunk/src/uwi/thread/LinkResolveThread.as
r2634 r2708 102 102 var decodeds : Array = [dst]; 103 103 for (var i : int = 0; i < pe.numThreads; i++) { 104 var uet : URLExpandThread = pe.getThreadAt(i) as URLExpandThread;104 var uet : URLExpandThread = URLExpandThread(pe.getThreadAt(i)); 105 105 if(uet.expanded != null){ 106 106 decodeds.push("<a href=\"" + uet.expanded + "\">" + uet.expanded + "</a>"); air/TLife/trunk/src/uwi/thread/MainThread.as
r2669 r2708 1 package uwi.thread {1 package uwi.thread { 2 2 import flash.desktop.NativeApplication; 3 3 import flash.display.NativeWindow; … … 33 33 import uwi.twitter.TwitterFriendsInfoGetThread; 34 34 import uwi.twitter.TwitterMobileLogoutThread; 35 import uwi.twitter.TwitterOAuthAccessThread; 35 36 import uwi.ui.multipletabbar.MultipleTabBarDragEventThread; 36 37 import uwi.util.CommonData; … … 64 65 CommonData.searcher = new Searcher(); 65 66 CommonData.cache_protectedpostid = { }; 66 CommonData.state_oauth = 0;67 67 68 68 // configxmlの読み込み … … 134 134 new TabBarEventThread().start(); 135 135 new ContextMenuItemEventThread().start(); 136 /* 136 137 new IncrementalSearchThread().start(); 137 138 new PostEventThread().start(); … … 147 148 }else{ 148 149 new InitialMovementThread().start(); 149 } 150 // OAuth 151 // 現状では正しく認証されているか確認する術はない 152 CommonData.state_oauth = (CommonData.configxml.login.oauth_token != "" && CommonData.configxml.login.oauth_token_secret != "") 153 ? 1 : 0; 154 } 155 */ 150 156 } 151 157 air/TLife/trunk/src/uwi/thread/NotifyNewThread.as
r2669 r2708 212 212 var ret : Number = Screen.mainScreen.visibleBounds.bottom; 213 213 for (var bobj : Object in CommonData.balloons) { 214 var b : Balloon = bobj as Balloon;214 var b : Balloon = Balloon(bobj); 215 215 var y : Number = b.baseY - Balloon.MAXHEIGHT - Balloon.MARGINY; 216 216 if (y < ret) { air/TLife/trunk/src/uwi/thread/PostThread.as
r2653 r2708 39 39 { 40 40 postedtext = postarea.text; 41 42 if (postedtext.length > CommonData.LIMLEN_POST) {43 return;44 }45 if (postedtext.length == 0) {46 return;47 }48 49 var footer : String = CommonData.configxml.footer;50 if (footer != "") footer = " " + footer;51 postedtext += footer;52 41 53 42 // ポスト直前に短縮する … … 119 108 var prev : int = 0; 120 109 for (var i : int = 0; i < gpe.numThreads; i++) { 121 var ust : URLShortenThread = (gpe.getThreadAt(i) as ParallelExecutor).getThreadAt(0) as URLShortenThread;110 var ust : URLShortenThread = URLShortenThread(ParallelExecutor(gpe.getThreadAt(i)).getThreadAt(0)); 122 111 postedtext += origtext.substring(prev, hrefs[i].index) + ust.shortened; 123 112 prev = hrefs[i].index + hrefs[i].href.length; … … 125 114 postedtext += origtext.substring(prev); 126 115 116 postarea.text = postedtext; 117 Application.application.changeCharLeft(); 118 127 119 post(); 128 120 } 129 121 122 private static const PTN_REPLYONLY : RegExp = /^. ?(@[A-Za-z0-9]+ )+ *$/; 123 130 124 private function post() : void 131 125 { 126 if (postedtext.length == 0) { 127 return; 128 } 129 130 if (PTN_REPLYONLY.test(postedtext)) { 131 return; 132 } 133 134 var footer : String = CommonData.configxml.footer; 135 if (footer != "") footer = " " + footer; 136 postedtext += footer; 137 138 if (postedtext.length > CommonData.LIMLEN_VALID) { 139 return; 140 } 141 132 142 // TODO 複数reply時のin_reply_to_status_idのとりかた 133 143 var param : Object = { }; air/TLife/trunk/src/uwi/thread/StatusGetBaseThread.as
r2634 r2708 79 79 if(response){ 80 80 for (var i : int = 0; i < pe.numThreads; i++) { 81 var ult : URLLoaderThread = pe.getThreadAt(i) as URLLoaderThread;81 var ult : URLLoaderThread = URLLoaderThread(pe.getThreadAt(i)); 82 82 event(ult.loader, HTTPStatusEvent.HTTP_RESPONSE_STATUS, onResponseStatus); 83 83 } … … 112 112 Logger.debug("StatusGetBaseThread status : " + e.status); 113 113 if (e.status != 200) { 114 (e.currentTarget as URLLoader).close();114 URLLoader(e.currentTarget).close(); 115 115 } 116 116 next(waitProgresses); air/TLife/trunk/src/uwi/thread/event/ContextMenuItemEventThread.as
r2669 r2708 1 package uwi.thread.event1 package uwi.thread.event 2 2 { 3 3 import flash.display.DisplayObject; … … 24 24 import uwi.thread.ReloadThread; 25 25 import uwi.twitter.TwitterAPI; 26 import uwi.twitter.TwitterOAuthRequestThread; 26 27 import uwi.twitter.TwitterScrapeThread; 27 28 import uwi.ui.answer.Answer; … … 59 60 private var item_ruletab : ContextMenuItem; 60 61 62 private var item_oauthlogin : ContextMenuItem; 63 private var item_oauthlogout : ContextMenuItem; 64 61 65 private var friendpost : TextArea = Application.application.friendpost; 62 66 private var datagrid : DataGridEx = Application.application.datagrid; … … 109 113 tabbar.contextMenu = tbcm; 110 114 111 var ui : UITextField = friendpost.getChildAt(2) as UITextField;115 var ui : UITextField = UITextField(friendpost.getChildAt(2)); 112 116 var cm : ContextMenu = new ContextMenu(); 113 117 cm.clipboardMenu = true; 114 118 ui.contextMenu = cm; 119 120 item_oauthlogin = new ContextMenuItem("OAuthログイン"); 121 item_oauthlogout = new ContextMenuItem("OAuthログアウト"); 122 123 var oacm : ContextMenu = new ContextMenu(); 124 oacm.customItems.push(item_oauthlogin); 125 oacm.customItems.push(item_oauthlogout); 126 CommonData.mainstatusbar.oauthimage.contextMenu = oacm; 115 127 116 128 // friendpost.contextMenu = tbcm; … … 136 148 item_deltab = null; 137 149 item_ruletab = null; 150 151 item_oauthlogin = null; 152 item_oauthlogout = null; 138 153 } 139 154 … … 158 173 event(item_deltab, ContextMenuEvent.MENU_ITEM_SELECT, onDeleteTab); 159 174 event(item_ruletab, ContextMenuEvent.MENU_ITEM_SELECT, onRuleTab); 175 176 event(item_oauthlogin, ContextMenuEvent.MENU_ITEM_SELECT, onOAuthLogin); 177 event(item_oauthlogout, ContextMenuEvent.MENU_ITEM_SELECT, onOAuthLogout); 160 178 } 161 179 … … 367 385 private function onCreateTab(e : ContextMenuEvent) : void 368 386 { 369 var tb : TabBar = e.mouseTarget.parent as TabBar;387 var tb : TabBar = TabBar(e.mouseTarget.parent); 370 388 var srclabel : String = tb.itemToLabel(e.mouseTarget); 371 389 var ind : int = tabbar.titles.source.indexOf(srclabel); … … 394 412 }; 395 413 } 396 var main : DisplayObject = Application.application as DisplayObject;414 var main : DisplayObject = DisplayObject(Application.application); 397 415 PopUpManager.addPopUp(ans, main, false); 398 416 ans.x = main.width / 2 - ans.width / 2; … … 404 422 private function onDupTab(e : ContextMenuEvent) : void 405 423 { 406 var tb : TabBar = e.mouseTarget.parent as TabBar;424 var tb : TabBar = TabBar(e.mouseTarget.parent); 407 425 var srclabel : String = tb.itemToLabel(e.mouseTarget); 408 426 var newlabel : String = Utility.addAvoidingOverlap(tabbar.titles, newlabel); … … 415 433 private function onRenameTab(e : ContextMenuEvent) : void 416 434 { 417 var tb : TabBar = e.mouseTarget.parent as TabBar;435 var tb : TabBar = TabBar(e.mouseTarget.parent); 418 436 var oldtabname : String = tb.itemToLabel(e.mouseTarget); 419 437 var ans : Answer = new Answer(); … … 435 453 CommonData.tabmap[newtabname] = val; 436 454 } 437 var main : DisplayObject = Application.application as DisplayObject;455 var main : DisplayObject = DisplayObject(Application.application); 438 456 PopUpManager.addPopUp(ans, main, false); 439 457 ans.x = main.width / 2 - ans.width / 2; … … 446 464 { 447 465 if(tabbar.titles.length > 1){ 448 var tb : TabBar = e.mouseTarget.parent as TabBar;466 var tb : TabBar = TabBar(e.mouseTarget.parent); 449 467 var label : String = tb.itemToLabel(e.mouseTarget); 450 468 var index : int = tabbar.titles.getItemIndex(label); … … 476 494 { 477 495 if (CommonData.tabconfig == null) { 478 var tb : TabBar = e.mouseTarget.parent as TabBar;496 var tb : TabBar = TabBar(e.mouseTarget.parent); 479 497 CommonData.tabconfig = new TabConfig(); 480 498 CommonData.tabconfig.initialtabname = tb.itemToLabel(e.mouseTarget); … … 484 502 CommonData.tabconfig.orderToFront(); 485 503 } 504 next(run); 505 } 506 507 private function onOAuthLogin(e : ContextMenuEvent) : void 508 { 509 new TwitterOAuthRequestThread().start(); 510 next(run); 511 } 512 513 private function onOAuthLogout(e : ContextMenuEvent) : void 514 { 515 CommonData.configxml.login.oauth_token = ""; 516 CommonData.configxml.login.oauth_token_secret = ""; 517 CommonData.mainstatusbar.setStateOAuth(0); 486 518 next(run); 487 519 } air/TLife/trunk/src/uwi/thread/event/DataGridEventThread.as
r2669 r2708 81 81 private function onRightClick(e : MouseEvent) : void 82 82 { 83 var ir : IListItemRenderer = e.target as IListItemRenderer;83 var ir : IListItemRenderer = IListItemRenderer(e.target); 84 84 if (ir != null) { 85 85 datagrid.selectedIndex = datagrid.itemRendererToIndex(ir); … … 99 99 if (CommonData.keybinds.jumptopostarea == code) { 100 100 Application.application.postarea.setFocus(); 101 e.preventDefault(); 101 102 next(waitEvents); 102 103 return; air/TLife/trunk/src/uwi/thread/event/DataGridRoutineThread.as
r2669 r2708 93 93 var posterid : String = timeline[i].posterid; 94 94 for (var j : uint = 0; j < datagrid.columnCount;j++){ 95 var ir : DataGridItemRenderer = datagrid.rowcolToItemRenderer(i, j) as DataGridItemRenderer;95 var ir : DataGridItemRenderer = DataGridItemRenderer(datagrid.rowcolToItemRenderer(i, j)); 96 96 if (ir == null) continue; 97 97 if(i != index && posterid == obj.posterid){ air/TLife/trunk/src/uwi/thread/event/IncrementalSearchThread.as
r2669 r2708 65 65 protected override function run() : void 66 66 { 67 event( Application.application as DisplayObject, KeyboardEvent.KEY_DOWN, onKeyDown);67 event(DisplayObject(Application.application), KeyboardEvent.KEY_DOWN, onKeyDown); 68 68 if(timeoutManager != null)event(timeoutManager, TimerEvent.TIMER, onTimeout); 69 69 } air/TLife/trunk/src/uwi/thread/event/PostEventThread.as
r2669 r2708 50 50 public function PostEventThread() 51 51 { 52 uict = new UserIDCompleteThread(postarea, Application.application as Container);52 uict = new UserIDCompleteThread(postarea, Container(Application.application)); 53 53 downatpostarea = false; 54 54 upatpostarea = false; … … 82 82 // e.stopPropagation(); 83 83 84 if (e.altKey == true) { 85 e.preventDefault(); 86 } 87 84 88 // \rが文字数にカウントされない現象の改善(1行目の改行には反映されていない様子) 85 89 if (e.keyCode == Keyboard.ENTER && (e.controlKey == true || e.altKey == true)) { 86 90 e.preventDefault(); 87 91 postarea.TextField.replaceSelectedText("\n"); 88 trace("にゃー");89 92 postarea.TextField.dispatchEvent(EVENT_CHANGE); 90 93 } air/TLife/trunk/src/uwi/thread/event/TabBarEventThread.as
r2669 r2708 66 66 var len : int = mtb.titles.length; 67 67 for (var i : int = 0; i < len; i++) { 68 var title : String = mtb.titles.getItemAt(i) as String;68 var title : String = String(mtb.titles.getItemAt(i)); 69 69 var btn : Button = mtb.getTab(i); 70 70 btn.setStyle("fontWeight", CommonData.tabmap[title].highlighted ? "bold" : "normal"); air/TLife/trunk/src/uwi/tinysegmenter/TinySegmenter.as
r2634 r2708 76 76 { 77 77 for (var i : Object in chartype) { 78 if (str.match( i as RegExp)) {78 if (str.match(RegExp(i))) { 79 79 return chartype[i]; 80 80 } air/TLife/trunk/src/uwi/twitter/TwitterDirectMessageGetThread.as
r2634 r2708 52 52 53 53 for (var i : int = 0; i < pe.numThreads; i++) { 54 var dms : XML = XML( (pe.getThreadAt(i) as URLLoaderThread).loader.data);54 var dms : XML = XML(URLLoaderThread(pe.getThreadAt(i)).loader.data); 55 55 for each(var dm : XML in dms.direct_message) { 56 56 // "Sun Mar 08 00:03:44 +0000 2009" … … 77 77 // リンク解決 78 78 for (var i : int = 0; i < pelrt.numThreads;i++){ 79 statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst;79 statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 80 80 } 81 81 air/TLife/trunk/src/uwi/twitter/TwitterFriendsInfoGetThread.as
r2634 r2708 96 96 97 97 for (var i : int = 0; i < pe.numThreads; i++) { 98 var users : Array = JSON.decode( (pe.getThreadAt(i) as URLLoaderThread).loader.data) as Array;98 var users : Array = JSON.decode(URLLoaderThread(pe.getThreadAt(i)).loader.data); 99 99 for each (var user : Object in users) { 100 100 // trace(ObjectUtil.toString(user)); air/TLife/trunk/src/uwi/twitter/TwitterOAuthAccessThread.as
r2653 r2708 1 package uwi.twitter1 package uwi.twitter 2 2 { 3 3 import flash.events.Event; … … 18 18 /** 19 19 * OAuth認証のaccessフェイズ 20 * 認証が通っているかの確認 も行える?20 * 認証が通っているかの確認は行えない 21 21 * @author Uwi 22 22 */ … … 59 59 var param : Object = Utility.paramToObject(ult.loader.data); 60 60 if (param.oauth_token) { 61 // 成功時tokenを入れ替える 61 62 CommonData.configxml.login.oauth_token = param.oauth_token; 62 63 CommonData.configxml.login.oauth_token_secret = param.oauth_token_secret; 63 CommonData. state_oauth = 1;64 CommonData.mainstatusbar.setStateOAuth(1); 64 65 Logger.debug("token : " + CommonData.configxml.login.oauth_token); 65 66 }else { 66 CommonData. state_oauth = 0;67 CommonData.mainstatusbar.setStateOAuth(0); 67 68 } 68 69 // 現状めんどくさいので勝手に終了させる70 // Application.application.exit();71 69 } 72 70 air/TLife/trunk/src/uwi/twitter/TwitterOAuthRequestThread.as
r2653 r2708 1 package uwi.twitter1 package uwi.twitter 2 2 { 3 3 import com.hurlant.crypto.Crypto; … … 39 39 40 40 if (CommonData.state_oauth == 2) return; 41 CommonData. state_oauth = 2;41 CommonData.mainstatusbar.setStateOAuth(2); 42 42 43 43 var oreq : OAuthRequest = new OAuthRequest("post", "http://twitter.com/oauth/request_token", null, CommonData.CONSUMER); air/TLife/trunk/src/uwi/twitter/TwitterScrapeThread.as
r2634 r2708 66 66 67 67 // スクレイピング 68 pagedata = StatusScraper.scrapePageData( (pe.getThreadAt(0) as URLLoaderThread).loader.data);68 pagedata = StatusScraper.scrapePageData(URLLoaderThread(pe.getThreadAt(0)).loader.data); 69 69 statuses = new Vector.<Status>(); 70 70 for (var i : int = 0; i < pe.numThreads;i++){ 71 var ret : Object = StatusScraper.scrape( (pe.getThreadAt(i) as URLLoaderThread).loader.data, _posterid != null && _posterid != "REPLIES");71 var ret : Object = StatusScraper.scrape(URLLoaderThread(pe.getThreadAt(i)).loader.data, _posterid != null && _posterid != "REPLIES"); 72 72 if(ret.code == 0)statuses = statuses.concat(ret.statuses); 73 73 } … … 88 88 // リンク解決 89 89 for (var i : int = 0; i < pelrt.numThreads;i++){ 90 statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst;90 statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 91 91 } 92 92 air/TLife/trunk/src/uwi/twitter/TwitterTimelineGetThread.as
r2634 r2708 70 70 71 71 for (var i : int = 0; i < pe.numThreads; i++) { 72 var timeline : Array = JSON.decode( (pe.getThreadAt(i) as URLLoaderThread).loader.data);72 var timeline : Array = JSON.decode(URLLoaderThread(pe.getThreadAt(i)).loader.data); 73 73 for each(var status : Object in timeline) { 74 74 // "Sun Mar 08 00:03:44 +0000 2009" … … 94 94 // リンク解決 95 95 for (var i : int = 0; i < pelrt.numThreads;i++){ 96 statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst;96 statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 97 97 } 98 98 air/TLife/trunk/src/uwi/ui/DataGridEx.as
r2650 r2708 39 39 for (var j : int = 0; j < columnCount;j++){ 40 40 var ir : TimelineRenderer = rowcolToItemRenderer(index, j) as TimelineRenderer; 41 if (!(ir is TimelineRenderer)) continue; 42 ir.validateFast(); 41 if (ir != null)ir.validateFast(); 43 42 } 44 43 } air/TLife/trunk/src/uwi/ui/ImageEx.as
r2634 r2708 23 23 var val : Object = _cache[url]; 24 24 if (val) { 25 super.load(new Bitmap( val as BitmapData));25 super.load(new Bitmap(BitmapData(val))); 26 26 }else { 27 27 super.load(url); air/TLife/trunk/src/uwi/ui/TextAreaEditor.mxml
r2634 r2708 29 29 { 30 30 data[dataField] = area.text; 31 (owner as DataGrid).destroyItemEditor();32 (owner as DataGrid).dataProvider.refresh();31 DataGrid(owner).destroyItemEditor(); 32 DataGrid(owner).dataProvider.refresh(); 33 33 } 34 34 air/TLife/trunk/src/uwi/ui/TimelineRenderer.as
r2650 r2708 31 31 public function validateFast() : void 32 32 { 33 var datagrid : DataGridEx = owner as DataGridEx;33 var datagrid : DataGridEx = DataGridEx(owner); 34 34 var index : int = datagrid.ItemRendererToIndex(this); 35 35 if (index < 0 || index >= datagrid.dataProvider.length)return; air/TLife/trunk/src/uwi/ui/complete/CompleteThread.as
r2634 r2708 53 53 { 54 54 if (targ is TextArea) { 55 tf = targ.getChildAt(2) as IUITextField;55 tf = IUITextField(targ.getChildAt(2)); 56 56 } else if (targ is TextInput) { 57 tf = targ.getChildAt(1) as IUITextField;57 tf = IUITextField(targ.getChildAt(1)); 58 58 } else if (targ is ComboBoxEx) { 59 tf = (targ as ComboBoxEx).TextInput_.getChildAt(1) as IUITextField;59 tf = IUITextField(ComboBoxEx(targ).TextInput_.getChildAt(1)); 60 60 } 61 61 air/TLife/trunk/src/uwi/ui/mainmenu/MainMenu.mxml
r2669 r2708 14 14 <mx:VBox> 15 15 <mx:Button id="dbsearch" label="DB検索" width="100%" /> 16 <mx:Button id="friendlist" label="friendリスト" width="100%" /> 16 17 <mx:Button id="relogin" label="再ログイン" width="100%" /> 18 <mx:Button id="cleardbmemory" label="オンメモリDBクリア" width="100%" /> 19 </mx:VBox> 20 <mx:VBox> 17 21 <mx:Button id="oauth" label="OAuth認証" width="100%" /> 18 22 <mx:Button id="config" label="設定" width="100%" /> 19 </mx:VBox>20 <mx:VBox>21 23 <mx:Button id="checkupdate" label="更新チェック" width="100%" /> 22 <mx:Button id="cleardbmemory" label="オンメモリDBクリア" width="100%" />23 24 <mx:Button id="about" label="About" width="100%" click="PopUpManager.removePopUp(this)" /> 24 25 </mx:VBox> air/TLife/trunk/src/uwi/ui/mainmenu/MainMenuEventThread.as
r2669 r2708 6 6 import net.jirox.AirAutoUpdater; 7 7 import org.libspark.thread.Thread; 8 import uwi.db.DBExcite;9 import uwi.thread.InitialMovementThread;10 import uwi.twitter.TwitterOAuthRequestThread;11 import uwi.ui.dbsearch.DBSearchWindow;8 import uwi.db.DBExcite; 9 import uwi.thread.InitialMovementThread; 10 import uwi.twitter.TwitterOAuthRequestThread; 11 import uwi.ui.dbsearch.DBSearchWindow; 12 12 import uwi.ui.globalconfig.GlobalConfig; 13 import uwi.ui.friends.Friends; 13 14 import uwi.util.CommonData; 14 15 … … 34 35 event(mainmenu.checkupdate, MouseEvent.CLICK, onCheckUpdateClick); 35 36 event(mainmenu.cleardbmemory, MouseEvent.CLICK, onClearDBMemoryClick); 37 event(mainmenu.friendlist, MouseEvent.CLICK, onFriendListClick); 36 38 } 37 39 … … 86 88 DBExcite.excite(true); 87 89 } 90 91 private function onFriendListClick(e : MouseEvent) : void 92 { 93 PopUpManager.removePopUp(mainmenu); 94 if (CommonData.friendlist == null) { 95 CommonData.friendlist = new Friends(); 96 CommonData.friendlist.open(true); 97 }else { 98 CommonData.friendlist.restore(); 99 CommonData.friendlist.orderToFront(); 100 } 101 } 102 88 103 } 89 104 air/TLife/trunk/src/uwi/ui/mainstatusbar/MainStatusBar.mxml
r2634 r2708 1 <?xml version="1.0" encoding="utf-8"?>1 <?xml version="1.0" encoding="utf-8"?> 2 2 <mx:HBox width="100%" height="20" xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onLoad()" horizontalGap="2" paddingTop="2" paddingBottom="2" verticalAlign="middle"> 3 3 <mx:Label id="sbar" text="{status}" width="100%" height="100%" /> … … 5 5 <mx:Button id="searchbtn" label="検索" click="createSearch()" /> 6 6 <mx:Button id="menubtn" label="メニュー" click="popupMenu()" /> 7 <mx:Image id="oauthimage" height="20" /> 7 8 <mx:Spacer width="20" /> 8 9 … … 78 79 } 79 80 81 [Embed("../../../../res/icon/oauth.png")] private var oauth_valid : Class; 82 [Embed("../../../../res/icon/oauthg.png")] private var oauth_invalid : Class; 83 84 public function setStateOAuth(state : int) : void 85 { 86 CommonData.state_oauth = state; 87 switch(state) { 88 case 0: oauthimage.data = new oauth_invalid(); break; 89 case 1: oauthimage.data = new oauth_valid(); break; 90 default: break; 91 } 92 return; 93 } 94 80 95 ]]> 81 96 </mx:Script> air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBar.as
r2669 r2708 90 90 internal function select(e : ItemClickEvent) : void 91 91 { 92 var targ : TabBar = e.currentTarget as TabBar;92 var targ : TabBar = TabBar(e.currentTarget); 93 93 // for eachでもいいかも 94 94 for (var i : int = 0, sum : int = 0; i < tablist.length && tablist[i] != targ; i++, sum += tablist[i].numChildren); … … 117 117 sum -= tabbar.numChildren; 118 118 if (sum < 0) { 119 return tabbar.getChildAt(sum + tabbar.numChildren) as Button;119 return Button(tabbar.getChildAt(sum + tabbar.numChildren)); 120 120 break; 121 121 } … … 129 129 return null; 130 130 }else{ 131 return titles.getItemAt(selectedIndex) as String;131 return String(titles.getItemAt(selectedIndex)); 132 132 } 133 133 } air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBarDragEventThread.as
r2634 r2708 40 40 { 41 41 if (e.target is Tab) { 42 var tb : TabBar = e.target.parent as TabBar;42 var tb : TabBar = TabBar(e.target.parent); 43 43 fromind = mtb.titles.getItemIndex(tb.itemToLabel(e.target)); 44 44 Mouse.cursor = MouseCursor.HAND; … … 55 55 56 56 if (e.target is Tab) { 57 var tb : TabBar = e.target.parent as TabBar;57 var tb : TabBar = TabBar(e.target.parent); 58 58 var toind : int = mtb.titles.getItemIndex(tb.itemToLabel(e.target)); 59 59 Logger.debug("MutipleTabBarDragEventThread " + fromind + "->" + toind); air/TLife/trunk/src/uwi/ui/tabconfig/TabConfig.mxml
r2634 r2708 199 199 curtabname = tabdg.selectedItem.tabname; 200 200 for (var i : int = 0; i < temprules.length; i++) { 201 var rule : TabRule = temprules[i] as TabRule;201 var rule : TabRule = TabRule(temprules[i]); 202 202 if (rule.tabname == curtabname){ 203 203 reqs.addItem( { air/TLife/trunk/src/uwi/ui/tabconfig/TabConfigEventThread.as
r2669 r2708 183 183 { 184 184 if(e.dataField == "tabname"){ 185 var newtabname : String = (tc.tabdg.itemEditorInstance as TextInput).text;185 var newtabname : String = TextInput(tc.tabdg.itemEditorInstance).text; 186 186 var oldtabname : String = tc.tabdg.selectedItem.tabname; 187 187 if(newtabname != oldtabname){ … … 211 211 private function onTabDGItemFocusIn(e : DataGridEvent) : void 212 212 { 213 var dg : DataGrid = e.currentTarget as DataGrid;213 var dg : DataGrid = DataGrid(e.currentTarget); 214 214 if (dg.itemEditorInstance && dg.itemEditorInstance is ComboBox) { 215 215 var col:DataGridColumn = e.currentTarget.columns[e.columnIndex]; 216 var editor:ComboBox = dg.itemEditorInstance as ComboBox;216 var editor:ComboBox = ComboBox(dg.itemEditorInstance); 217 217 var cell:Object = dg.selectedItem.hasOwnProperty(col.dataField) ? dg.selectedItem[col.dataField] : ""; 218 218 … … 231 231 private function onRegDGItemFocusIn(e : DataGridEvent) : void 232 232 { 233 var dg : DataGrid = e.currentTarget as DataGrid;233 var dg : DataGrid = DataGrid(e.currentTarget); 234 234 if (dg.itemEditorInstance && dg.itemEditorInstance is ComboBox) { 235 235 var col:DataGridColumn = e.currentTarget.columns[e.columnIndex]; 236 var editor:ComboBox = dg.itemEditorInstance as ComboBox;236 var editor:ComboBox = ComboBox(dg.itemEditorInstance); 237 237 var cell:Object = dg.selectedItem.hasOwnProperty(col.dataField) ? dg.selectedItem[col.dataField] : ""; 238 238 air/TLife/trunk/src/uwi/util/CommonData.as
r2669 r2708 27 27 import uwi.ui.dbsearch.DBSearchWindow; 28 28 import uwi.ui.mainstatusbar.MainStatusBar; 29 import uwi.ui.friends.Friends; 29 30 import uwi.ui.*; 30 31 … … 131 132 public static var searchwindow : SearchWindow = null; 132 133 public static var dbsearchwindow : DBSearchWindow = null; 134 public static var friendlist : Friends = null; 133 135 134 136 public static var tfmt_timelines : Array; air/TLife/trunk/src/uwi/util/StatusUtility.as
r2634 r2708 114 114 { 115 115 var res : Object = PTN_REPLY.exec(content); 116 if (res == null) return ""; 117 return res[1] as String; 116 return res ? res[1] : ""; 118 117 } 119 118 air/TLife/trunk/src/uwi/wassr/WassrTimelineGetThread.as
r2634 r2708 79 79 80 80 for (var i : int = 0; i < pe.numThreads; i++) { 81 var timeline : XML = XML( (pe.getThreadAt(i) as URLLoaderThread).loader.data);81 var timeline : XML = XML(URLLoaderThread(pe.getThreadAt(i)).loader.data); 82 82 for each(var status : XML in timeline.status) { 83 83 var s : Status = new Status(status.id, status.user.screen_name, status.user_login_id, status.html, status.reply_message, new Date(status.epoch), status.user.profile_image_url, false); … … 98 98 // リンク解決 99 99 for (var i : int = 0; i < pelrt.numThreads;i++){ 100 statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst;100 statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 101 101 } 102 102

