チェンジセット 2653
- コミット日時:
- 2009/05/17 00:20:27 (3 年前)
- ファイル:
-
- air/TLife/trunk/air/TLife.air (更新) (変更前)
- air/TLife/trunk/air/version.xml (更新) (1 diff)
- air/TLife/trunk/application.xml (更新) (1 diff)
- air/TLife/trunk/bin/TLife.swf (更新) (変更前)
- air/TLife/trunk/src/Main.mxml (更新) (1 diff)
- air/TLife/trunk/src/uwi/search/Searcher.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/shortening/URLShortenThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/thread/PostThread.as (追加)
- air/TLife/trunk/src/uwi/thread/event/PostEventThread.as (更新) (4 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterOAuthAccessThread.as (更新) (2 diffs)
- air/TLife/trunk/src/uwi/twitter/TwitterOAuthRequestThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterPostThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/twitter/TwitterStreamFollowGetThread.as (更新) (1 diff)
- air/TLife/trunk/src/uwi/util/CommonData.as (更新) (6 diffs)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/trunk/air/version.xml
r2651 r2653 1 1 <version> 2 <version>alpha 19/version>2 <version>alpha22/version> 3 3 <url>http://www.libspark.org/svn/air/TLife/trunk/air/TLife.air</url> 4 4 </version> air/TLife/trunk/application.xml
r2652 r2653 3 3 4 4 <id>uwi.TLife</id> 5 <version>alpha2 0</version>5 <version>alpha22</version> 6 6 <filename>TLife</filename> 7 7 <name>TLife</name> air/TLife/trunk/src/Main.mxml
r2652 r2653 180 180 public function changeCharLeft() : void 181 181 { 182 postbtn.enabled = (postarea.length != 0); 183 184 var left : int = CommonData.LIMLEN_POST - postarea.length; 185 charleft.text = left.toString(); 186 if (left < 0) { 187 charleft.setStyle("color", CommonData.configxml.main.fontcolor.charleft.error); 188 }else { 189 charleft.setStyle("color", CommonData.configxml.main.fontcolor.charleft.normal); 190 } 191 192 // StringValidator用 193 // XXX ときどきrepaintしないと元の色に戻らない場合がある。バグ? 194 postarea.dispatchEvent(EVENT_CHARLEFT); 182 postarea.callLater(function() : void { 183 postbtn.enabled = (postarea.length != 0); 184 185 var left : int = CommonData.LIMLEN_POST - postarea.length; 186 charleft.text = left.toString(); 187 if (left < 0) { 188 charleft.setStyle("color", CommonData.configxml.main.fontcolor.charleft.error); 189 }else { 190 charleft.setStyle("color", CommonData.configxml.main.fontcolor.charleft.normal); 191 } 192 193 // StringValidator用 194 // XXX ときどきrepaintしないと元の色に戻らない場合がある。バグ? 195 postarea.dispatchEvent(EVENT_CHARLEFT); 196 }); 195 197 } 196 198 air/TLife/trunk/src/uwi/search/Searcher.as
r2652 r2653 163 163 if (query.content is RegExp) query.content = query.content.source; 164 164 165 for each(var frag : String in query.content) { 166 var prefix : String = frag.charAt(0); 167 if (prefix == "-") { 168 frag = frag.substring(1); 169 } 170 frag = StringUtility.escapeSQLForLike(frag); 171 if(!option.capital){ 172 conds.push("content " + (prefix == "-" ? "not " : "") + "glob '" + frag + "'"); 173 }else { 174 conds.push("content " + (prefix == "-" ? "not " : "") + "like '" + frag + "'"); 175 } 165 for each(var frag : Object in query.content) { 166 var value : String = StringUtility.escapeSQLForLike(frag.value); 167 conds.push("content " + (frag.flag == "-" ? "not " : "") + (option.capital ? "like" : "glob") + " '*" + value + "*'"); 176 168 } 177 169 } … … 191 183 rule : conds.join(" and "), 192 184 type : 1, 193 numdisplay : 20,185 numdisplay : 999, 194 186 numnotify : 0, 195 187 manageunread : -1, air/TLife/trunk/src/uwi/shortening/URLShortenThread.as
r2634 r2653 32 32 protected override function run() : void 33 33 { 34 var url : String = StringUtil.substitute(baseurl, encodeURIComponent(srcurl) ;34 var url : String = StringUtil.substitute(baseurl, encodeURIComponent(srcurl)); 35 35 var req : URLRequest = new URLRequest(url); 36 36 req.method = URLRequestMethod.GET; air/TLife/trunk/src/uwi/thread/event/PostEventThread.as
r2652 r2653 17 17 import org.libspark.thread.utils.ParallelExecutor; 18 18 import uwi.shortening.URLShortenThread; 19 import uwi.thread.PostThread; 19 20 import uwi.twitter.TwitterPostThread; 20 21 import uwi.twitter.TwitterScrapeThread; … … 90 91 if (e.keyCode == Keyboard.ENTER && e.controlKey == false) { 91 92 e.preventDefault(); 92 onSubmit(null); 93 if (!CommonData.pt) { 94 CommonData.pt = new PostThread(); 95 CommonData.pt.start(); 96 } 97 next(waitEvents); 93 98 return; 94 99 } … … 137 142 private function onKeyUp(e : KeyboardEvent) : void 138 143 { 139 trace("up");140 144 CommonData.datagridsuspend = false; 141 145 … … 174 178 private function onSubmit(e : Event) : void 175 179 { 176 postedtext = postarea.text; 177 178 if (postedtext.length > CommonData.LIMLEN_POST) { 179 return; 180 if (!CommonData.pt) { 181 CommonData.pt = new PostThread(); 182 CommonData.pt.start(); 180 183 } 181 if (postedtext.length == 0) {182 return;183 }184 185 // post();186 /*187 // ポスト直前に短縮する188 switch(CommonData.configxml.urlshotening.policy) {189 case "all" :190 case "smart" :191 case "none" :192 default:193 post();194 break;195 }196 */197 }198 199 private static const PTN_URL : RegExp = /https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#]+/g;200 201 /*202 private function shorten() : void203 {204 var pe : ParallelExecutor = new ParallelExecutor();205 206 var temp : String = postedtext;207 // 発言からURLを抽出208 var ret : Object;209 while (ret = PTN_URL.exec(postedtext)) {210 var href : String = ret[0];211 if (href.substring(0, 7) == "http://") {212 // ドメインを取り出す213 var slash : int = href.indexOf("/", 7);214 if (slash != -1) {215 var domain : String = href.substring(7, slash);216 if (!CommonData.MAP_SHORTENEDDOMAIN[domain]) {217 // 短縮されていない場合短縮する218 pe.addThread(new URLShortenThread(219 }220 }221 }222 }223 }224 */225 226 private function post() : void227 {228 postbtn.enabled = false;229 var footer : String = CommonData.configxml.footer;230 if (footer != "") footer = " " + footer;231 trace(CommonData.configxml.login.oauth_token.toString());232 233 // TODO 複数reply時のin_reply_to_status_idのとりかた234 var param : Object = { };235 param["status"] = postarea.text + footer;236 if (CommonData.in_reply_to_status_id != "") {237 param["in_reply_to_status_id"] = CommonData.in_reply_to_status_id;238 }239 240 var tpt : TwitterPostThread = new TwitterPostThread("http://twitter.com/statuses/update.xml", param, "POST");241 tpt.start();242 tpt.join();243 error(Error, onError);244 next(onPostComplete);245 }246 247 private function onPostComplete() : void248 {249 Logger.debug("PostEventThread Succeeded");250 251 CommonData.in_reply_to_status_id = "";252 postarea.text = "";253 Application.application.changeCharLeft();254 255 postbtn.enabled = true;256 next(waitEvents);257 }258 259 private function onError(e : Error, t : Thread) : void260 {261 Logger.warn("PostEventThread Error");262 Logger.stacktrace(e);263 CommonData.in_reply_to_status_id = "";264 postbtn.enabled = true;265 184 next(waitEvents); 266 185 } air/TLife/trunk/src/uwi/twitter/TwitterOAuthAccessThread.as
r2634 r2653 38 38 { 39 39 Logger.debug("TwitterOAuthAccessThread start"); 40 CommonData.state_oauth = 0;41 40 var otok : OAuthToken = new OAuthToken(oauth_token, oauth_token_secret); 42 41 var oreq : OAuthRequest = new OAuthRequest("post", "http://twitter.com/oauth/access_token", null, CommonData.CONSUMER, otok); … … 63 62 CommonData.configxml.login.oauth_token_secret = param.oauth_token_secret; 64 63 CommonData.state_oauth = 1; 65 trace("token : " + CommonData.configxml.login.oauth_token); 64 Logger.debug("token : " + CommonData.configxml.login.oauth_token); 65 }else { 66 CommonData.state_oauth = 0; 66 67 } 67 68 air/TLife/trunk/src/uwi/twitter/TwitterOAuthRequestThread.as
r2634 r2653 37 37 { 38 38 Logger.debug("TwitterOAuthRequestThread start"); 39 40 if (CommonData.state_oauth == 2) return; 41 CommonData.state_oauth = 2; 39 42 40 43 var oreq : OAuthRequest = new OAuthRequest("post", "http://twitter.com/oauth/request_token", null, CommonData.CONSUMER); air/TLife/trunk/src/uwi/twitter/TwitterPostThread.as
r2642 r2653 25 25 // OAuth認証が有効な場合OAuthにする 26 26 poststr = OAuthUtility.makeData(url, param); 27 trace(poststr);27 Logger.debug(poststr); 28 28 }else { 29 29 poststr = Utility.objectToParam(param); 30 trace(poststr);30 Logger.debug(poststr); 31 31 } 32 32 air/TLife/trunk/src/uwi/twitter/TwitterStreamFollowGetThread.as
r2642 r2653 60 60 private function onProgress(e : ProgressEvent) : void 61 61 { 62 trace("bytesavailable : " + _us.bytesAvailable);62 Logger.debug("bytesavailable : " + _us.bytesAvailable); 63 63 var data : String = _us.readMultiByte(_us.bytesAvailable, "UTF-8"); 64 64 try { air/TLife/trunk/src/uwi/util/CommonData.as
r2651 r2653 12 12 import uwi.thread.event.DataGridEventThread; 13 13 import uwi.thread.event.DataGridRoutineThread; 14 import uwi.thread.PostThread; 14 15 import uwi.thread.ReplyGetThread; 15 16 import uwi.thread.StreamManageThread; … … 57 58 58 59 public static const LIMLEN_POST : int = 140; 60 public static const LIMLEN_VALID : int = 160; 59 61 60 62 // 0 : nothing changed … … 81 83 public static var mtbdet : MultipleTabBarDragEventThread = null; 82 84 public static var smt : StreamManageThread = null; 85 public static var pt : PostThread = null; 83 86 84 87 public static var configxml : XML = null; … … 147 150 // 0 : 未認証 148 151 // 1 : 認証済 152 // 2 : 認証中 149 153 public static var state_oauth : int; 150 154 … … 167 171 "content" : uwi.ui.TimelineRenderer, 168 172 "postedtime" : uwi.ui.TimelineRenderer 169 } 173 }; 170 174 171 175 public static const MAP_SHORTENEDDOMAIN : Object = { … … 188 192 "budurl.com" : "", 189 193 "friendfeed.com" : "" 190 } 194 }; 191 195 } 192 196

