チェンジセット 2621
- コミット日時:
- 2009/05/11 20:21:07 (3 年前)
- ファイル:
-
- air/TLife/branches/OAuth/TLife.as3proj (更新) (1 diff)
- air/TLife/branches/OAuth/application.xml (更新) (1 diff)
- air/TLife/branches/OAuth/unused/TwitterFollowingGetThread.as (追加)
- air/TLife/trunk/air/TLife.air (更新) (変更前)
- air/TLife/trunk/air/version.xml (更新) (1 diff)
- air/TLife/trunk/bin/TLife.swf (更新) (変更前)
- air/TLife/trunk/lib/as3corelib.swc (追加)
- air/TLife/trunk/obj/TLifeConfig.old (更新) (1 diff)
- air/TLife/trunk/obj/TLifeConfig.xml (更新) (1 diff)
- air/TLife/trunk/res/icon/b.png (追加)
- air/TLife/trunk/res/icon/f.png (追加)
- air/TLife/trunk/src/Main.mxml (更新) (1 diff)
- air/TLife/trunk/src/uwi/bean/PageData.as (削除)
- air/TLife/trunk/src/uwi/db/DB.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/db/DBSelectThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/db/DBSupplyThread.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/thread/FollowingCheckThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/InitialMovementThread.as (更新) (4 diffs)
- air/TLife/trunk/src/uwi/thread/MainThread.as (更新) (5 diffs)
- air/TLife/trunk/src/uwi/thread/NotifyNewThread.as (更新) (4 diffs)
- air/TLife/trunk/src/uwi/thread/ReplyGetThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/thread/StatusInsertThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/thread/TimelineThread.as (更新) (4 diffs)
- air/TLife/trunk/src/uwi/thread/event/ContextMenuItemEventThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/event/DataGridEventThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/event/DataGridRoutineThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/event/IncrementalSearchThread.as (更新) (5 diffs)
- air/TLife/trunk/src/uwi/thread/event/PostEventThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterAPI.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterBitStatusGetThread.as (更新) (6 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterBitUserInfoGetThread.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterDirectMessageGetThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterFollowingGetThread.as (削除)
- air/TLife/trunk/src/uwi/twitter/TwitterFollowingScrapeThread.as (削除)
- air/TLife/trunk/src/uwi/twitter/TwitterFriendsInfoGetThread.as (更新) (5 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterRateLimitStatusGetThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterScrapeThread.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterTimelineGetThread.as (更新) (6 diffs)
- air/TLife/trunk/src/uwi/ui/DataGridEx.as (更新) (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/complete/UserIDCompletionListSupplyThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/ui/friends (追加)
- air/TLife/trunk/src/uwi/ui/friends/FetchBar.mxml (追加)
- air/TLife/trunk/src/uwi/ui/friends/Friends.mxml (追加)
- air/TLife/trunk/src/uwi/ui/friends/FriendsEventThread.as (追加)
- air/TLife/trunk/src/uwi/ui/globalconfig/GlobalConfig.mxml (更新) (1 diff)
- air/TLife/trunk/src/uwi/ui/globalconfig/GlobalConfigEventThread.as (更新) (5 diffs)
- air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBar.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/util/CommonData.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/util/FileIO.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/util/LazyExecutor.as (追加)
- air/TLife/trunk/src/uwi/util/StatusScraper.as (更新) (3 diffs)
- air/TLife/trunk/src/uwi/util/StatusUtility.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/util/StringUtility.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/util/URLPostThread.as (更新) (1 diff)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/branches/OAuth/TLife.as3proj
r2510 r2621 49 49 <element path="lib\AirAutoUpdater.swc" /> 50 50 <element path="lib\KenLogger.swc" /> 51 <element path="lib\as3corelib.swc" /> 51 52 </libraryPaths> 52 53 <!-- External Libraries --> air/TLife/branches/OAuth/application.xml
r2546 r2621 3 3 4 4 <id>uwi.TLife</id> 5 <version>alpha1 2</version>5 <version>alpha13</version> 6 6 <filename>TLife</filename> 7 7 <name>TLife</name> air/TLife/trunk/air/version.xml
r2546 r2621 1 1 <version> 2 <version>alpha1 2/version>2 <version>alpha13/version> 3 3 <url>http://www.libspark.org/svn/air/TLife/trunk/air/TLife.air</url> 4 4 </version> air/TLife/trunk/obj/TLifeConfig.old
r2501 r2621 17 17 <path-element>E:\flash\TLife\lib\AirAutoUpdater.swc</path-element> 18 18 <path-element>E:\flash\TLife\lib\KenLogger.swc</path-element> 19 <path-element>E:\flash\TLife\lib\as3corelib.swc</path-element> 19 20 </library-path> 20 21 </compiler> air/TLife/trunk/obj/TLifeConfig.xml
r2501 r2621 17 17 <path-element>E:\flash\TLife\lib\AirAutoUpdater.swc</path-element> 18 18 <path-element>E:\flash\TLife\lib\KenLogger.swc</path-element> 19 <path-element>E:\flash\TLife\lib\as3corelib.swc</path-element> 19 20 </library-path> 20 21 </compiler> air/TLife/trunk/src/Main.mxml
r2589 r2621 66 66 public var timeline : ArrayCollection = new ArrayCollection(); 67 67 68 [Embed(source = "../res/icon/icon_016.png")] 69 private var icon_16 : Class; 70 [Embed(source = "../res/icon/icon_032.png")] 71 private var icon_32 : Class; 72 [Embed(source = "../res/icon/icon_048.png")] 73 private var icon_48 : Class; 74 [Embed(source = "../res/icon/icon_128.png")] 75 private var icon_128 : Class; 68 [Embed(source = "../res/icon/icon_016.png")] private var icon_16 : Class; 69 [Embed(source = "../res/icon/icon_032.png")] private var icon_32 : Class; 70 [Embed(source = "../res/icon/icon_048.png")] private var icon_48 : Class; 71 [Embed(source = "../res/icon/icon_128.png")] private var icon_128 : Class; 76 72 77 73 private var systemtrayicon : SystemTrayIcon; air/TLife/trunk/src/uwi/db/DB.as
r2501 r2621 43 43 execute(conn, 44 44 "create table if not exists " + CommonData.TABLE_POSTER + "(" + 45 " posteridvarchar(15) primary key," +45 "screenname varchar(15) primary key," + 46 46 "id integer not null default -1," + 47 47 "name text not null," + 48 "url text not nulldefault ''," +48 "url text default ''," + 49 49 "iconurl string default null," + 50 50 "protected boolean not null default false," + 51 "following integer not null default -1," + 52 "follower integer not null default -1," + 53 "numpost integer not null default -1," + 54 "description string default null," + 51 "createdat date default 0," + 52 "nfriends integer not null default -1," + 53 "nfollowers integer not null default -1," + 54 "nstatuses integer not null default -1," + 55 "description string defualt ''," + 56 "lastpost string not null default ''," + 57 "lastposttime date default 0," + 55 58 "lastupdated date not null" + 56 59 ")"); 57 60 execute(conn, 58 61 "create table if not exists " + CommonData.TABLE_FOLLOWING + "(" + 59 " useridvarchar(15) not null," +60 " posteridvarchar(15) not null," +62 "idfrom varchar(15) not null," + 63 "idto varchar(15) not null," + 61 64 "lastupdated date not null," + 62 "primary key( userid, posterid)" +65 "primary key(idfrom, idto)" + 63 66 ")"); 64 67 } air/TLife/trunk/src/uwi/db/DBSelectThread.as
r2546 r2621 10 10 11 11 /** 12 * ...12 * DBに対しselect文を発行するThread 13 13 * @author Uwi 14 14 */ air/TLife/trunk/src/uwi/db/DBSupplyThread.as
r2497 r2621 19 19 private var conn : SQLConnection; 20 20 private var sqltxt : String; 21 private var funcvalid : Function; 21 22 22 public function DBSupplyThread(conn : SQLConnection, sqltxt : String, loaderthread : Thread )23 public function DBSupplyThread(conn : SQLConnection, sqltxt : String, loaderthread : Thread, funcvalid : Function = null) 23 24 { 24 25 nTry = 0; … … 26 27 this.sqltxt = sqltxt; 27 28 this.loaderthread = loaderthread; 29 this.funcvalid = funcvalid; 28 30 } 29 31 … … 42 44 var ret : SQLResult = dbst.Result; 43 45 var ar : Array = ret.data; 44 if (ar != null ){46 if (ar != null && (funcvalid == null || funcvalid.apply(null, [ar[0]]))){ 45 47 data = ar[0]; 46 48 }else { air/TLife/trunk/src/uwi/thread/FollowingCheckThread.as
r2533 r2621 37 37 this.supply = supply; 38 38 sqlprotected = "select protected, lastupdated from " + CommonData.TABLE_POSTER + 39 " where posterid= '" + StringUtility.escapeSQL(targid) + "'";39 " where screenname = '" + StringUtility.escapeSQL(targid) + "'"; 40 40 sqlfollowing = "select lastupdated from " + 41 41 CommonData.TABLE_FOLLOWING + 42 " where userid= '" + StringUtility.escapeSQL(CommonData.configxml.login.userid) + "'" +43 " and posterid= '" + StringUtility.escapeSQL(targid) + "'";42 " where idfrom = '" + StringUtility.escapeSQL(CommonData.configxml.login.userid) + "'" + 43 " and idto = '" + StringUtility.escapeSQL(targid) + "'"; 44 44 } 45 45 air/TLife/trunk/src/uwi/thread/InitialMovementThread.as
r2589 r2621 6 6 import org.libspark.thread.Thread; 7 7 import org.libspark.thread.utils.SerialExecutor; 8 import uwi.twitter.TwitterBitStatusGetThread; 9 import uwi.twitter.TwitterFriendsInfoGetThread; 8 10 import uwi.twitter.TwitterLoginThread; 9 11 import uwi.twitter.TwitterMobileLoginThread; … … 12 14 import uwi.util.Utility; 13 15 import uwi.wassr.WassrLoginThread; 16 import uwi.ui.friends.Friends; 14 17 15 18 /** … … 30 33 { 31 34 tlt = null; 35 32 36 } 33 37 … … 64 68 if (tlt.result == 0) { 65 69 // ログイン成功時 66 CommonData.state = 1; 70 // new Friends().open(true); 71 67 72 var rt : ReloadThread = new ReloadThread(true); 68 73 rt.start(); air/TLife/trunk/src/uwi/thread/MainThread.as
r2589 r2621 30 30 import uwi.thread.event.UndoThread; 31 31 import uwi.thread.ReloadTimerThread; 32 import uwi.twitter.TwitterFriendsInfoGetThread; 32 33 import uwi.twitter.TwitterMobileLogoutThread; 33 34 import uwi.ui.multipletabbar.MultipleTabBarDragEventThread; … … 128 129 Security.loadPolicyFile("https://static.twitter.com/crossdomain.xml"); 129 130 131 /* 130 132 new TabBarEventThread().start(); 131 133 new ContextMenuItemEventThread().start(); … … 136 138 new DataGridRoutineThread().start(); 137 139 new ReloadTimerThread(CommonData.configxml.interval).start(); 140 */ 138 141 139 142 if (CommonData.configxml.login.userid == "" || CommonData.configxml.login.password == "") { … … 232 235 private function onExit(e : Event) : void 233 236 { 234 e.preventDefault();235 237 236 238 // DBのクローズ … … 250 252 251 253 // ログアウト 252 var tmlt : TwitterMobileLogoutThread = new TwitterMobileLogoutThread(); 253 tmlt.start(); 254 tmlt.join(); 255 next(onLogout); 254 if(CommonData.configxml.logoutonexit == "true"){ 255 e.preventDefault(); 256 var tmlt : TwitterMobileLogoutThread = new TwitterMobileLogoutThread(); 257 tmlt.start(); 258 tmlt.join(); 259 next(onLogout); 260 } 256 261 } 257 262 air/TLife/trunk/src/uwi/thread/NotifyNewThread.as
r2589 r2621 56 56 case CommonData.LABEL_RECENT: 57 57 sql = sqlprefix + 58 " where posterid in (select posteridfrom " +58 " where posterid in (select idto from " + 59 59 CommonData.TABLE_FOLLOWING + 60 " where userid= '" + StringUtility.escapeSQL(CommonData.configxml.login.userid) + "')" +60 " where idfrom = '" + StringUtility.escapeSQL(CommonData.configxml.login.userid) + "')" + 61 61 " and " + condnewer + 62 62 (tabinfo.rule != "" ? (" and (" + tabinfo.rule + ")") : "") + … … 99 99 Logger.debug("NotifyNewThread onSelectComplete"); 100 100 101 var tempdbstmap2 : Object = { }; 102 dbstmap2 = { }; 101 var posteridset2 : Object = { }; 103 102 newtimeline = { }; 104 103 for (var tabname : String in dbstmap) { … … 108 107 if (ar != null) { 109 108 for each(var obj : * in ar) { 110 tempdbstmap2[obj.posterid] = null;109 posteridset2[obj.posterid] = null; 111 110 } 112 111 … … 123 122 } 124 123 124 dbstmap2 = { }; 125 125 pe = new ParallelExecutor(); 126 for (var posterid : String in tempdbstmap2) {127 var sql : String = "select name, iconurl from " + CommonData.TABLE_POSTER + " where posterid= '" + posterid + "'";126 for (var posterid : String in posteridset2) { 127 var sql : String = "select name, iconurl from " + CommonData.TABLE_POSTER + " where screenname = '" + posterid + "'"; 128 128 var ddbst : DBSelectThread = new DBSelectThread(CommonData.db_memory.conn, sql); 129 129 dbstmap2[posterid] = ddbst; air/TLife/trunk/src/uwi/thread/ReplyGetThread.as
r2589 r2621 17 17 18 18 /** 19 * ...20 * @author ...19 * reply先発言取得用Thread 20 * @author Uwi 21 21 */ 22 22 public class ReplyGetThread extends Thread … … 74 74 75 75 dbst = new DBSelectThread(CommonData.db_memory.conn, 76 "select name from " + CommonData.TABLE_POSTER + " where posterid= '" + StringUtility.escapeSQL(posterid) + "'"76 "select name from " + CommonData.TABLE_POSTER + " where screenname = '" + StringUtility.escapeSQL(posterid) + "'" 77 77 ); 78 78 dbst.start(); air/TLife/trunk/src/uwi/thread/StatusInsertThread.as
r2546 r2621 75 75 var stmt_upd_poster : SQLStatement = new SQLStatement(); 76 76 stmt_upd_poster.sqlConnection = conn; 77 stmt_upd_poster.text = "replace into " + CommonData.TABLE_POSTER + " ( posterid, name, iconurl, lastupdated) values (:posterid, :name, :iconurl, :lastupdated)";77 stmt_upd_poster.text = "replace into " + CommonData.TABLE_POSTER + " (screenname, name, iconurl, lastupdated) values (:screenname, :name, :iconurl, :lastupdated)"; 78 78 79 79 var key : String; 80 80 for (key in postermap) { 81 81 val = postermap[key]; 82 stmt_upd_poster.parameters[": posterid"] = key;82 stmt_upd_poster.parameters[":screenname"] = key; 83 83 stmt_upd_poster.parameters[":name"] = val.postername; 84 84 stmt_upd_poster.parameters[":iconurl"] = StatusUtility.compressIconUrl(val.iconurl); … … 96 96 var stmt_rep_following : SQLStatement = new SQLStatement(); 97 97 stmt_rep_following.sqlConnection = conn; 98 stmt_rep_following.text = "replace into " + CommonData.TABLE_FOLLOWING + " ( userid, posterid, lastupdated) values (:userid, :posterid, :lastupdated)";98 stmt_rep_following.text = "replace into " + CommonData.TABLE_FOLLOWING + " (idfrom, idto, lastupdated) values (:idfrom, :idto, :lastupdated)"; 99 99 100 100 for (key in postermap) { 101 stmt_rep_following.parameters[": userid"] = CommonData.configxml.login.userid.toString();102 stmt_rep_following.parameters[": posterid"] = key;101 stmt_rep_following.parameters[":idfrom"] = CommonData.configxml.login.userid.toString(); 102 stmt_rep_following.parameters[":idto"] = key; 103 103 stmt_rep_following.parameters[":lastupdated"] = now; 104 104 try { air/TLife/trunk/src/uwi/thread/TimelineThread.as
r2589 r2621 88 88 " where posterid in (select posterid from " + 89 89 CommonData.TABLE_FOLLOWING + 90 " where userid= '" + StringUtility.escapeSQL(CommonData.configxml.login.userid) + "')" +90 " where idfrom = '" + StringUtility.escapeSQL(CommonData.configxml.login.userid) + "')" + 91 91 (tabinfo.rule != "" ? (" and (" + tabinfo.rule + ")") : "") + 92 92 sqlsuffix; … … 136 136 var ar : Array = ret.data; 137 137 if (ar != null) { 138 var tempdbstmap: Object = { };138 var posteridset : Object = { }; 139 139 dbstmap = { }; 140 140 var manageunread : int = Utility.getNumber("manageunread", tabname); … … 143 143 if (obj.postedtime != null) obj.postedtime = CommonData.dateformatter_timeline.format(obj.postedtime); 144 144 145 // dbstmap[obj.posterid] = null; 146 tempdbstmap[obj.posterid] = null; 145 posteridset[obj.posterid] = null; 147 146 148 147 if (manageunread == 1) { … … 188 187 189 188 pe = new ParallelExecutor(); 190 // for (var posterid : String in dbstmap) { 191 for (var posterid : String in tempdbstmap) { 192 var sql : String = "select name, iconurl from " + CommonData.TABLE_POSTER + " where posterid = '" + StringUtility.escapeSQL(posterid) + "'"; 189 for (var posterid : String in posteridset) { 190 var sql : String = "select name, iconurl from " + CommonData.TABLE_POSTER + " where screenname = '" + StringUtility.escapeSQL(posterid) + "'"; 193 191 var ddbst : DBSelectThread = new DBSelectThread(conn, sql); 194 192 dbstmap[posterid] = ddbst; air/TLife/trunk/src/uwi/thread/event/ContextMenuItemEventThread.as
r2589 r2621 37 37 38 38 /** 39 * ...39 * 右クリックメニューイベントThread 40 40 * @author Uwi 41 41 */ air/TLife/trunk/src/uwi/thread/event/DataGridEventThread.as
r2546 r2621 79 79 private function onKeyDown(e : KeyboardEvent) : void 80 80 { 81 trace(e.charCode); 81 82 if (datagrid.selectedIndex != -1){ 82 83 switch(e.keyCode) { air/TLife/trunk/src/uwi/thread/event/DataGridRoutineThread.as
r2546 r2621 52 52 if (Utility.getNumber("manageunread", Application.application.tabbar.selectedTabName) == 1) { 53 53 // 選択したpostをすべて既読に 54 for each(var ind : int in datagrid.selectedIndices) {54 for each(var ind : int in datagrid.selectedIndices) { 55 55 datagrid.mark(index, false); 56 56 } air/TLife/trunk/src/uwi/thread/event/IncrementalSearchThread.as
r2589 r2621 13 13 import uwi.ui.DataGridEx; 14 14 import uwi.util.CommonData; 15 import uwi.util.LazyExecutor; 15 16 16 17 /** … … 25 26 private var query : String = ""; 26 27 private var timeoutManager : Timer = null; 28 private var le : LazyExecutor; 27 29 28 30 // 0 : none … … 48 50 } 49 51 mode = 0; 52 le = new LazyExecutor(function(func : Function) : void { 53 Application.application.timeline.filterFunction = func; 54 Application.application.timeline.refresh(); 55 }, 200); 50 56 } 51 57 … … 120 126 case Keyboard.ESCAPE: 121 127 eraseQuery(); 122 Application.application.timeline.filterFunction = null; 123 Application.application.timeline.refresh(); 124 mode = 0; 125 break; 126 case Keyboard.BACKSPACE: 127 if (query.length <= 1) { 128 eraseQuery(); 129 Application.application.timeline.filterFunction = null; 130 Application.application.timeline.refresh(); 131 mode = 0; 132 }else{ 133 query = query.substring(0, query.length - 1); 134 CommonData.mainstatusbar.write(STR_SEARCH[mode] + query, DEPTH_IST); 135 Application.application.timeline.filterFunction = function(item : Object) : Boolean { 128 le.impulse(null); 129 mode = 0; 130 break; 131 case Keyboard.BACKSPACE: 132 if (query.length <= 1) { 133 eraseQuery(); 134 le.impulse(null); 135 mode = 0; 136 }else{ 137 query = query.substring(0, query.length - 1); 138 CommonData.mainstatusbar.write(STR_SEARCH[mode] + query, DEPTH_IST); 139 le.impulse(function(item : Object) : Boolean { 136 140 // 前方一致 137 141 return item.posterid.substring(0, query.length) == query; 138 } 139 Application.application.timeline.refresh(); 140 } 141 break; 142 default: 143 if (e.charCode >= 0x20 && e.charCode < 0x7f) { 144 query += String.fromCharCode(e.charCode); 145 CommonData.mainstatusbar.write(STR_SEARCH[mode] + query, DEPTH_IST); 146 Application.application.timeline.filterFunction = function(item : Object) : Boolean { 142 }); 143 } 144 break; 145 default: 146 if (e.charCode >= 0x20 && e.charCode < 0x7f) { 147 query += String.fromCharCode(e.charCode); 148 CommonData.mainstatusbar.write(STR_SEARCH[mode] + query, DEPTH_IST); 149 le.impulse(function(item : Object) : Boolean { 147 150 // 前方一致 148 151 return item.posterid.substring(0, query.length) == query; 149 } 150 Application.application.timeline.refresh(); 151 } 152 break; 153 } 154 break; 152 }); 153 } 154 break; 155 } 156 break; 157 case 3: 158 switch(e.keyCode) { 159 case Keyboard.ESCAPE: 160 eraseQuery(); 161 le.impulse(null); 162 mode = 0; 163 break; 164 case Keyboard.BACKSPACE: 165 if (query.length <= 1) { 166 eraseQuery(); 167 le.impulse(null); 168 mode = 0; 169 }else{ 170 query = query.substring(0, query.length - 1); 171 CommonData.mainstatusbar.write(STR_SEARCH[mode] + query, DEPTH_IST); 172 le.impulse(function(item : Object) : Boolean { 173 // 中間一致 174 return item.content.indexOf(query) != -1; 175 }); 176 } 177 break; 178 default: 179 if (e.charCode >= 0x20 && e.charCode < 0x7f) { 180 query += String.fromCharCode(e.charCode); 181 CommonData.mainstatusbar.write(STR_SEARCH[mode] + query, DEPTH_IST); 182 } 183 le.impulse(function(item : Object) : Boolean { 184 // 中間一致 185 return item.content.indexOf(query) != -1; 186 }); 187 break; 188 } 189 break; 190 default: break; 191 } 192 } 193 next(run); 194 } 195 196 private function filterIncrementally(e : KeyboardEvent) : void 197 { 198 switch(mode) { 199 case 2: 155 200 case 3: 156 201 switch(e.keyCode) { … … 181 226 query += String.fromCharCode(e.charCode); 182 227 CommonData.mainstatusbar.write(STR_SEARCH[mode] + query, DEPTH_IST); 183 184 Application.application.timeline.filterFunction = function(item : Object) : Boolean { 185 // 中間一致 186 return item.content.indexOf(query) != -1; 187 } 188 Application.application.timeline.refresh(); 189 } 190 break; 191 } 192 break; 193 default: break; 194 } 228 } 229 Application.application.timeline.filterFunction = function(item : Object) : Boolean { 230 // 中間一致 231 return item.content.indexOf(query) != -1; 232 } 233 Application.application.timeline.refresh(); 234 break; 235 } 236 break; 237 default: 238 break; 195 239 } 196 next(run);197 240 } 198 241 air/TLife/trunk/src/uwi/thread/event/PostEventThread.as
r2589 r2621 148 148 // TODO 複数reply時のin_reply_to_status_idのとりかた 149 149 var tpt : TwitterPostThread = new TwitterPostThread( 150 "http://twitter.com/statuses/update. xml",150 "http://twitter.com/statuses/update.json", 151 151 "status=" + decodeURI(postarea.text + footer) + 152 152 (CommonData.in_reply_to_status_id != "" ? "&in_reply_to_status_id=" + CommonData.in_reply_to_status_id : "") + air/TLife/trunk/src/uwi/twitter/TwitterAPI.as
r2531 r2621 12 12 public static function fav(postid : String, onSucceed : Function = null) : void 13 13 { 14 new TwitterPostThread("http://twitter.com/favorites/create/" + postid + ". xml", "id=" + postid, "Fav", onSucceed).start();14 new TwitterPostThread("http://twitter.com/favorites/create/" + postid + ".json", "id=" + postid, "Fav", onSucceed).start(); 15 15 } 16 16 17 17 public static function favdel(postid : String, onSucceed : Function = null) : void 18 18 { 19 new TwitterPostThread("http://twitter.com/favorites/destroy/" + postid + ". xml", "id=" + postid, "Fav削除", onSucceed).start();19 new TwitterPostThread("http://twitter.com/favorites/destroy/" + postid + ".json", "id=" + postid, "Fav削除", onSucceed).start(); 20 20 } 21 21 22 22 public static function follow(posterid : String, onSucceed : Function = null) : void 23 23 { 24 new TwitterPostThread("http://twitter.com/friendships/create/" + posterid + ". xml", "id=" + posterid, "follow", onSucceed).start();24 new TwitterPostThread("http://twitter.com/friendships/create/" + posterid + ".json", "id=" + posterid, "follow", onSucceed).start(); 25 25 } 26 26 27 27 public static function remove(posterid : String, onSucceed : Function = null) : void 28 28 { 29 new TwitterPostThread("http://twitter.com/friendships/destroy/" + posterid + ". xml", "id=" + posterid, "remove", onSucceed).start();29 new TwitterPostThread("http://twitter.com/friendships/destroy/" + posterid + ".json", "id=" + posterid, "remove", onSucceed).start(); 30 30 } 31 31 32 32 public static function block(posterid : String, onSucceed : Function = null) : void 33 33 { 34 new TwitterPostThread("http://twitter.com/blocks/create/" + posterid + ". xml", "id=" + posterid, "block", onSucceed).start();34 new TwitterPostThread("http://twitter.com/blocks/create/" + posterid + ".json", "id=" + posterid, "block", onSucceed).start(); 35 35 } 36 36 37 37 public static function blockdel(posterid : String, onSucceed : Function = null) : void 38 38 { 39 new TwitterPostThread("http://twitter.com/blocks/destroy/" + posterid + ". xml", "id=" + posterid, "blockdel", onSucceed).start();39 new TwitterPostThread("http://twitter.com/blocks/destroy/" + posterid + ".json", "id=" + posterid, "blockdel", onSucceed).start(); 40 40 } 41 41 } air/TLife/trunk/src/uwi/twitter/TwitterBitStatusGetThread.as
r2501 r2621 1 1 package uwi.twitter 2 2 { 3 import com.adobe.serialization.json.JSON; 3 4 import flash.net.URLRequest; 4 5 import flash.net.URLRequestMethod; 6 import mx.utils.ObjectUtil; 5 7 import org.libspark.thread.Thread; 6 8 import org.libspark.thread.threads.net.URLLoaderThread; … … 12 14 import uwi.thread.StatusInsertThread; 13 15 import uwi.util.CommonData; 16 import uwi.util.StatusUtility; 14 17 15 18 /** … … 23 26 24 27 private var s : Status = null; 25 private var follower: int;28 private var nfollowers : int; 26 29 private var posterid : String; 27 30 … … 29 32 { 30 33 this.posterid = posterid; 31 var req : URLRequest = new URLRequest("http://twitter.com/statuses/show/" + postid + ". xml");34 var req : URLRequest = new URLRequest("http://twitter.com/statuses/show/" + postid + ".json"); 32 35 req.method = URLRequestMethod.GET; 33 36 ult = new URLLoaderThread(req); … … 44 47 private function onGetComplete() : void 45 48 { 46 var status : XML = XML(ult.loader.data); 47 // "Sun Mar 08 00:03:44 +0000 2009" 48 var datestr : String = status.created_at; 49 // "Sun Mar 08 00:03:44 UTC+0000 2009" にすればDateで読める。 50 var postedtime : Date = new Date(datestr.substring(0, 20) + "UTC" + datestr.substring(20)); 49 var status : Object = JSON.decode(ult.loader.data); 50 // nfollowers = status.user.followers_count; 51 51 52 follower = int(status.user.followers_count); 53 54 s = new Status(status.id, status.user.name, status.user.screen_name, status.text, status.in_reply_to_status_id, postedtime, status.user.profile_image_url, status.favorited == "true"); 52 s = new Status( 53 status.id, 54 status.user.name, 55 status.user.screen_name, 56 status.text, 57 status.in_reply_to_status_id || "0", 58 StatusUtility.toDate(status.created_at), 59 status.user.profile_image_url, 60 status.favorited 61 ); 55 62 lrt = new LinkResolveThread(s.content); 56 63 lrt.start(); … … 74 81 se.addThread(pe1); 75 82 76 var args : Array = [ { follower : follower, posterid : posterid } ]; 83 /* 84 var args : Array = [ { nfollowers : nfollowers, posterid : posterid } ]; 77 85 var sql : String = "update " + CommonData.TABLE_POSTER + " set" + 78 " follower = :follower" +86 " nfollowers = :nfollowers" + 79 87 " where posterid = :posterid"; 80 88 pe2.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sql, args)); 81 89 pe2.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sql, args)); 82 90 se.addThread(pe2); 83 91 */ 92 84 93 se.start(); 85 94 se.join(); air/TLife/trunk/src/uwi/twitter/TwitterBitUserInfoGetThread.as
r2438 r2621 1 1 package uwi.twitter 2 2 { 3 import com.adobe.serialization.json.JSON; 3 4 import flash.errors.IOError; 4 5 import flash.events.HTTPStatusEvent; … … 24 25 { 25 26 this.userid = userid; 26 var req : URLRequest = new URLRequest("http://twitter.com/users/show/" + userid + ". xml");27 var req : URLRequest = new URLRequest("http://twitter.com/users/show/" + userid + ".json"); 27 28 req.method = URLRequestMethod.GET; 28 29 ult = new URLLoaderThread(req); … … 52 53 private function onGetComplete() : void 53 54 { 54 var user : XML = XML(ult.loader.data);55 var user : Object = JSON.decode(ult.loader.data); 55 56 var pe : ParallelExecutor = new ParallelExecutor(); 56 var sql : String = "replace into " + CommonData.TABLE_POSTER + " ( posterid, id, name, url, iconurl, protected, following, follower, numpost, description, lastupdated) values" +57 " (: posterid, :id, :name, :url, :iconurl, :protected_, :following, :follower, :numpost, :description, :lastupdated)";57 var sql : String = "replace into " + CommonData.TABLE_POSTER + " (screenname, id, name, url, iconurl, protected, createdat, nfriends, nfollowers, nstatuses, description, lastpost, lastposttime, lastupdated) values" + 58 " (:screenname, :id, :name, :url, :iconurl, :protected_, :createdat, :nfriends, :nfollowers, :nstatuses, :description, :lastpost, :lastposttime, :lastupdated)"; 58 59 var args : Array = [{ 59 posterid : user.screen_name.toString(), 60 id : user.id.toString(), 61 url : user.url.toString(), 62 name : user.name.toString(), 63 iconurl : StatusUtility.compressIconUrl(user.profile_image_url.toString()), 64 protected_ : user.protected == "true", 65 following : user.friends_count.toString(), 66 follower : user.followers_count.toString(), 67 numpost : user.statuses_count.toString(), 68 description : user.description.toString(), 60 screenname : user.screen_name, 61 id : user.id, 62 url : user.url, 63 name : user.name, 64 iconurl : StatusUtility.compressIconUrl(user.profile_image_url), 65 protected_ : user.protected, 66 createdat : StatusUtility.toDate(user.created_at), 67 nfriends : user.friends_count, 68 nfollowers : user.followers_count, 69 nstatuses : user.statuses_count, 70 description : user.description, 71 lastpost : user.status ? user.status.text : null, 72 lastposttime : user.status ? StatusUtility.toDate(user.status.created_at) : 0, 69 73 lastupdated : new Date() 70 74 }]; air/TLife/trunk/src/uwi/twitter/TwitterDirectMessageGetThread.as
r2438 r2621 91 91 var args : Array = []; 92 92 for (var posterid : String in followers) { 93 args.push( { posterid : posterid, follower: followers[posterid] } );93 args.push( { screenname : posterid, nfollowers : followers[posterid] } ); 94 94 } 95 95 var sql : String = "update " + CommonData.TABLE_POSTER + " set" + 96 " follower = :follower" +97 " where posterid = :posterid";96 " nfollowers = :nfollowers" + 97 " where screenname = :screenname"; 98 98 pe2.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sql, args)); 99 99 pe2.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sql, args)); air/TLife/trunk/src/uwi/twitter/TwitterFriendsInfoGetThread.as
r2514 r2621 1 1 package uwi.twitter 2 2 { 3 import com.adobe.serialization.json.JSON; 3 4 import flash.data.SQLResult; 4 5 import flash.net.URLRequest; 5 6 import flash.net.URLRequestMethod; 7 import mx.utils.ObjectUtil; 6 8 import org.libspark.thread.Thread; 7 9 import org.libspark.thread.threads.net.URLLoaderThread; … … 27 29 private var pe : ParallelExecutor = null; 28 30 private var friends : Boolean; 31 private var timeout_ : int; 29 32 30 public function TwitterFriendsInfoGetThread(userid : String, friends : Boolean = true )33 public function TwitterFriendsInfoGetThread(userid : String, friends : Boolean = true, timeout_ : int = 0) 31 34 { 32 35 this.userid = userid; 33 36 this.friends = friends; 37 this.timeout_ = timeout_; 34 38 } 35 39 36 40 protected override function run() : void 37 41 { 42 // 件数を取得 38 43 dbst = new DBSupplyThread( 39 44 CommonData.db_memory.conn, 40 45 // TODO 最近という条件追加 41 "select " + (friends ? "following" : "follower") + " from " + CommonData.TABLE_POSTER + " where posterid = '" + StringUtility.escapeSQL(userid) + "'", 42 new TwitterBitUserInfoGetThread(userid) 46 "select " + (friends ? "nfriends" : "nfollowers") + " from " + CommonData.TABLE_POSTER + " where screenname = '" + StringUtility.escapeSQL(userid) + "'", 47 new TwitterBitUserInfoGetThread(userid), 48 function(o : Object) : Boolean { return o[friends ? "nfriends" : "nfollowers"] != -1; } 43 49 ); 44 50 dbst.start(); 45 dbst.join( );51 dbst.join(timeout_); 46 52 next(onBitGetComplete); 53 timeout(onTimeout); 47 54 interrupted(onInterrupted); 48 55 } … … 51 58 { 52 59 if(dbst.data != null){ 53 var ct : int = dbst.data[friends ? "following" : "follower"]; 60 var ct : int = dbst.data[friends ? "nfriends" : "nfollowers"]; 61 trace("ct : " + ct); 54 62 var pageend : int = (ct + 99) / 100; 55 63 56 64 pe = new ParallelExecutor(); 57 var baseurl : String = "http://twitter.com/statuses/" + (friends ? "friends" : "followers") + "/" + userid + ". xml";65 var baseurl : String = "http://twitter.com/statuses/" + (friends ? "friends" : "followers") + "/" + userid + ".json"; 58 66 for (var i : int = 1; i <= pageend; i++) { 59 67 var req : URLRequest = new URLRequest(baseurl + "?page=" + i); … … 62 70 } 63 71 pe.start(); 64 pe.join( );72 pe.join(timeout_); 65 73 next(onGetComplete); 74 timeout(onTimeout); 66 75 interrupted(onInterrupted); 67 76 } … … 70 79 private function onGetComplete() : void 71 80 { 72 var sql : String = "replace into " + CommonData.TABLE_POSTER + " (posterid, id, name, url, iconurl, protected, follower, description, lastupdated) values" + 73 " (:posterid, :id, :name, :url, :iconurl, :protected, :follower, :description, :lastupdated)"; 81 var userid : String = CommonData.configxml.login.userid; 82 var now : Date = new Date(); 83 84 // POSTERに追加 85 var sql : String = "replace into " + CommonData.TABLE_POSTER + " (screenname, id, name, url, iconurl, protected, createdat, nfriends, nfollowers, nstatuses, description, lastpost, lastposttime, lastupdated) values" + 86 " (:screenname, :id, :name, :url, :iconurl, :protected_, :createdat, :nfriends, :nfollowers, :nstatuses, :description, :lastpost, :lastposttime, :lastupdated)"; 87 // FOLLOWINGに追加 88 var sqlf : String = "replace into " + CommonData.TABLE_FOLLOWING + " (idfrom, idto, lastupdated) values" + 89 " (:idfrom, :idto, :lastupdated)"; 90 // 全削除 91 var sqldel : String = "delete from " + CommonData.TABLE_FOLLOWING + " where " + (friends ? "idfrom" : "idto") + 92 " = '" + StringUtility.escapeSQL(userid) + "'"; 93 74 94 var args : Array = []; 75 var now : Date = new Date(); 95 var argsf : Array = []; 96 76 97 for (var i : int = 0; i < pe.numThreads; i++) { 77 var users : XML = XML((pe.getThreadAt(i) as URLLoaderThread).loader.data); 78 for each (var user : XML in users.user) { 98 var users : Array = JSON.decode((pe.getThreadAt(i) as URLLoaderThread).loader.data) as Array; 99 for each (var user : Object in users) { 100 // trace(ObjectUtil.toString(user)); 79 101 args.push({ 80 posterid : user.screen_name.toString(), 81 id : user.id.toString(), 82 name : user.name.toString(), 83 url : user.url.toString(), 84 protected : user.protected == "true", 85 iconurl : StatusUtility.compressIconUrl(user.profile_image_url.toString()), 86 follower : user.followers_count.toString(), 87 description : user.description.toString(), 102 screenname : user.screen_name, 103 id : user.id, 104 url : user.url, 105 name : user.name, 106 iconurl : StatusUtility.compressIconUrl(user.profile_image_url), 107 protected_ : user.protected, 108 createdat : StatusUtility.toDate(user.created_at), 109 nfriends : user.friends_count, 110 nfollowers : user.followers_count, 111 nstatuses : user.statuses_count, 112 description : user.description, 113 lastpost : user.status ? user.status.text : null, 114 lastposttime : user.status ? StatusUtility.toDate(user.status.created_at) : 0, 88 115 lastupdated : now 89 116 }); 117 if (friends) { 118 argsf.push( { 119 idfrom : userid, 120 idto : user.screen_name, 121 lastupdated : now 122 }); 123 }else { 124 argsf.push( { 125 idfrom : user.screen_name, 126 idto : userid, 127 lastupdated : now 128 }); 129 } 90 130 } 91 131 } 92 132 93 pe = new ParallelExecutor(); 94 pe.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sql, args)); 95 pe.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sql, args)); 96 pe.start(); 97 pe.join(); 133 var se : SerialExecutor = new SerialExecutor(); 134 var pe1 : ParallelExecutor = new ParallelExecutor(); 135 pe1.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sql, args)); 136 pe1.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sql, args)); 137 pe1.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sqldel)); 138 pe1.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sqldel)); 139 se.addThread(pe1); 140 var pe2 : ParallelExecutor = new ParallelExecutor(); 141 pe2.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sqlf, argsf)); 142 pe2.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sqlf, argsf)); 143 se.addThread(pe2); 144 se.start(); 145 se.join(); 146 } 147 148 private function onTimeout() : void 149 { 150 if (dbst != null) dbst.interrupt(); 151 if (pe != null) pe.interrupt(); 98 152 } 99 153 air/TLife/trunk/src/uwi/twitter/TwitterRateLimitStatusGetThread.as
r2438 r2621 14 14 public function TwitterRateLimitStatusGetThread 15 15 { 16 var req : URLRequest = new URLRequest("http://twitter.com/account/rate_limit_status. xml");16 var req : URLRequest = new URLRequest("http://twitter.com/account/rate_limit_status.json"); 17 17 req.method = URLRequestMethod.GET; 18 18 super(req); air/TLife/trunk/src/uwi/twitter/TwitterScrapeThread.as
r2546 r2621 9 9 import org.libspark.thread.utils.ParallelExecutor; 10 10 import org.libspark.thread.utils.SerialExecutor; 11 import uwi.bean.PageData;12 11 import uwi.bean.Status; 13 12 import uwi.db.SimpleTransactionThread; … … 25 24 */ 26 25 public class TwitterScrapeThread extends StatusGetBaseThread { 27 private var pagedata : PageData;26 private var pagedata : Object; 28 27 29 28 private var pelrt : ParallelExecutor; … … 103 102 if (pagedata != null) { 104 103 var sql : String = "update " + CommonData.TABLE_POSTER + " set" + 105 " following = " + pagedata.following+ ", " +106 " follower = " + pagedata.follower+ ", " +107 " n umpost = " + pagedata.update+108 " where posterid= '" + StringUtility.escapeSQL((_posterid != null ? _posterid : CommonData.configxml.login.userid)) + "'";104 " nfriends = " + pagedata.nfriends + ", " + 105 " nfollowers = " + pagedata.nfollowers + ", " + 106 " nstatuses = " + pagedata.nstatuses + 107 " where screenname = '" + StringUtility.escapeSQL((_posterid != null ? _posterid : CommonData.configxml.login.userid)) + "'"; 109 108 pe2.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sql)); 110 109 pe2.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sql)); air/TLife/trunk/src/uwi/twitter/TwitterTimelineGetThread.as
r2493 r2621 1 1 package uwi.twitter 2 2 { 3 import com.adobe.serialization.json.JSON; 3 4 import flash.net.URLRequest; 4 5 import flash.net.URLRequestMethod; … … 32 33 * ""ならreplyを得る。取得後の挙動はuser_timelineと同じ。 33 34 * nullなら自分のtimelineを取得 35 * TODO check 34 36 */ 35 37 public function TwitterTimelineGetThread(posterid : String = null, count : int = 20, pageend : int = 1) … … 44 46 if(_posterid == " REPLIES"){ 45 47 _posterid = "REPLIES"; 46 baseurl = "http://twitter.com/statuses/replies. xml";48 baseurl = "http://twitter.com/statuses/replies.json"; 47 49 }else { 48 baseurl = _posterid != null ? ("http://twitter.com/statuses/user_timeline/" + _posterid + ". xml") : "http://twitter.com/statuses/friends_timeline.xml";50 baseurl = _posterid != null ? ("http://twitter.com/statuses/user_timeline/" + _posterid + ".json") : "http://twitter.com/statuses/friends_timeline.json"; 49 51 } 50 52 … … 68 70 69 71 for (var i : int = 0; i < pe.numThreads; i++) { 70 var timeline : XML = XML((pe.getThreadAt(i) as URLLoaderThread).loader.data);71 for each(var status : XML in timeline.status) {72 var timeline : Array = JSON.decode((pe.getThreadAt(i) as URLLoaderThread).loader.data); 73 for each(var status : Object in timeline) { 72 74 // "Sun Mar 08 00:03:44 +0000 2009" 73 75 var datestr : String = status.created_at; … … 75 77 var postedtime : Date = new Date(datestr.substring(0, 20) + "UTC" + datestr.substring(20)); 76 78 77 followers[status.user.screen_name] = int(status.user.followers_count);78 var s : Status = new Status(status.id, status.user.name, status.user.screen_name, status.text, status.in_reply_to_status_id , postedtime, status.user.profile_image_url, status.favorited == "true");79 followers[status.user.screen_name] = status.user.followers_count; 80 var s : Status = new Status(status.id, status.user.name, status.user.screen_name, status.text, status.in_reply_to_status_id || "0", postedtime, status.user.profile_image_url, status.favorited); 79 81 pelrt.addThread(new LinkResolveThread(s.content)); 80 82 … … 106 108 var args : Array = []; 107 109 for (var pid : String in followers) { 108 args.push( { posterid : pid, follower: followers[pid] } );110 args.push( { screenname : pid, nfollowers : followers[pid] } ); 109 111 } 110 112 var sql : String = "update " + CommonData.TABLE_POSTER + " set" + 111 " follower = :follower" +112 " where posterid = :posterid";113 " nfollowers = :nfollowers" + 114 " where screenname = :screenname"; 113 115 pe2.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, sql, args)); 114 116 pe2.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, sql, args)); air/TLife/trunk/src/uwi/ui/DataGridEx.as
r2519 r2621 30 30 public function mark(index : int, unread : Boolean) : void 31 31 { 32 if (index < 0 || index >= dataProvider.length)return; 32 33 var item : Object = dataProvider.getItemAt(index); 33 34 item.unread = unread; air/TLife/trunk/src/uwi/ui/TimelineRenderer.as
r2546 r2621 45 45 */ 46 46 } 47 48 public override function validateNow() : void49 {50 // super.validateNow();51 // trace("validateNow!");52 }53 47 } 54 48 air/TLife/trunk/src/uwi/ui/complete/CompleteThread.as
r2589 r2621 22 22 23 23 /** 24 * ...24 * 補完汎用Thread 25 25 * @author Uwi 26 26 */ air/TLife/trunk/src/uwi/ui/complete/UserIDCompletionListSupplyThread.as
r2453 r2621 22 22 protected override function run() : void 23 23 { 24 dbst = new DBSelectThread(CommonData.db_memory.conn, "select posteridfrom " + CommonData.TABLE_POSTER);24 dbst = new DBSelectThread(CommonData.db_memory.conn, "select screenname from " + CommonData.TABLE_POSTER); 25 25 dbst.start(); 26 26 dbst.join(); … … 35 35 var temp : Array = []; 36 36 for each(var obj : Object in ar) { 37 temp.push(obj. posterid);37 temp.push(obj.screenname); 38 38 } 39 39 temp.sort(); air/TLife/trunk/src/uwi/ui/globalconfig/GlobalConfig.mxml
r2546 r2621 6 6 height="400" 7 7 layout="absolute" 8 systemChrome=" none"9 transparent=" true"8 systemChrome="standard" 9 transparent="false" 10 10 type="utility" 11 11 paddingLeft="4" air/TLife/trunk/src/uwi/ui/globalconfig/GlobalConfigEventThread.as
r2531 r2621 14 14 import uwi.thread.InitialMovementThread; 15 15 import uwi.util.CommonData; 16 import uwi.util.LazyExecutor; 16 17 import uwi.util.Utility; 17 18 … … 23 24 { 24 25 private var gc : GlobalConfig; 26 private var le : LazyExecutor; 25 27 26 28 public function GlobalConfigEventThread(gc : GlobalConfig) 27 29 { 28 30 this.gc = gc; 31 le = new LazyExecutor(onChange, 200); 29 32 } 30 33 … … 32 35 { 33 36 if (gc.searchbox) { 34 event(gc.searchbox, Event.CHANGE, onChange);37 event(gc.searchbox, Event.CHANGE, function(e : Event) : void { le.impulse(); next(run); } ); 35 38 } 36 39 event(gc.tn1, FlexEvent.SHOW, onTN1Show); … … 41 44 } 42 45 43 private function onChange( e : Event) : void46 private function onChange() : void 44 47 { 45 48 gc.setvalue.filterFunction = function(item : Object) : Boolean { … … 49 52 }; 50 53 gc.setvalue.refresh(); 51 next(run);52 54 } 53 55 air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBar.as
r2589 r2621 8 8 9 9 /** 10 * ...10 * 多段TabBar 11 11 * @author Uwi 12 12 */ air/TLife/trunk/src/uwi/util/CommonData.as
r2589 r2621 25 25 26 26 /** 27 * ...27 * 共通変数、定数 28 28 * @author Uwi 29 29 */ air/TLife/trunk/src/uwi/util/FileIO.as
r2159 r2621 5 5 import flash.filesystem.FileMode; 6 6 import flash.filesystem.FileStream; 7 import flash.utils.ByteArray; 7 8 8 9 /** … … 44 45 } 45 46 47 public static function readToByteArray(file : File) : ByteArray 48 { 49 var fs : FileStream = new FileStream(); 50 fs.open(file, FileMode.READ); 51 var ret : ByteArray = new ByteArray(); 52 fs.readBytes(ret); 53 fs.close(); 54 return ret; 55 } 46 56 } 47 57 air/TLife/trunk/src/uwi/util/StatusScraper.as
r2589 r2621 4 4 import mx.formatters.DateFormatter; 5 5 import mx.utils.StringUtil; 6 import uwi.bean.PageData;7 6 import uwi.bean.Status; 8 7 … … 249 248 } 250 249 251 public static function scrapePageData(src : String) : PageData250 public static function scrapePageData(src : String) : Object 252 251 { 253 252 try { 254 var following: int = int(StringUtility.pinch(src, "<span id=\"following_count\" class=\"stats_count numeric\">", "</span>").replace(/,/g, ""));255 var follower: int = int(StringUtility.pinch(src, "<span id=\"follower_count\" class=\"stats_count numeric\">", "</span>").replace(/,/g, ""));256 var update: int = int(StringUtility.pinch(src, "<span id=\"update_count\" class=\"stats_count numeric\">", "</span>").replace(/,/g, ""));253 var nfriends : int = int(StringUtility.pinch(src, "<span id=\"following_count\" class=\"stats_count numeric\">", "</span>").replace(/,/g, "")); 254 var nfollowers : int = int(StringUtility.pinch(src, "<span id=\"follower_count\" class=\"stats_count numeric\">", "</span>").replace(/,/g, "")); 255 var nstatuses : int = int(StringUtility.pinch(src, "<span id=\"update_count\" class=\"stats_count numeric\">", "</span>").replace(/,/g, "")); 257 256 }catch (e : Error) { 258 257 Logger.stacktrace(e); … … 260 259 } 261 260 262 return new PageData(following, follower, update);261 return { nfriends : nfriends, nfollowers : nfollowers, nstatuses : nstatuses }; 263 262 } 264 263 air/TLife/trunk/src/uwi/util/StatusUtility.as
r2531 r2621 188 188 return ret; 189 189 } 190 191 // "Sun Mar 08 00:03:44 +0000 2009" -> 192 // "Sun Mar 08 00:03:44 UTC+0000 2009" にすればDateで読める。 193 public static function toDate(str : String) : Date 194 { 195 return new Date(str.substring(0, 20) + "UTC" + str.substring(20)); 196 } 190 197 } 191 198 air/TLife/trunk/src/uwi/util/StringUtility.as
r2533 r2621 212 212 } 213 213 214 public static function escapeRegExp(str : String) : String 215 { 216 str = str.replace(/([\^\$\\\.\*\+\?\(\)\[\]\{\}\|])/g, "\\$1"); 217 return str; 218 } 219 214 220 } 215 221 } air/TLife/trunk/src/uwi/util/URLPostThread.as
r2589 r2621 10 10 11 11 /** 12 * ...12 * POST専用Thread 13 13 * @author Uwi 14 14 */

