チェンジセット 2653

差分発生行の前後
無視リスト:
コミット日時:
2009/05/17 00:20:27 (3 年前)
コミッタ:
uwi
ログメッセージ:

--

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • air/TLife/trunk/air/version.xml

    r2651 r2653  
    11<version> 
    2         <version>alpha19/version> 
     2        <version>alpha22/version> 
    33        <url>http://www.libspark.org/svn/air/TLife/trunk/air/TLife.air</url> 
    44</version>  
  • air/TLife/trunk/application.xml

    r2652 r2653  
    33   
    44  <id>uwi.TLife</id>  
    5   <version>alpha20</version> 
     5  <version>alpha22</version> 
    66  <filename>TLife</filename> 
    77  <name>TLife</name>  
  • air/TLife/trunk/src/Main.mxml

    r2652 r2653  
    180180                        public function changeCharLeft() : void 
    181181                        { 
    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        }); 
    195197                        } 
    196198                         
  • air/TLife/trunk/src/uwi/search/Searcher.as

    r2652 r2653  
    163163        if (query.content is RegExp) query.content = query.content.source; 
    164164         
    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 + "*'"); 
    176168        } 
    177169      } 
     
    191183          rule : conds.join(" and "), 
    192184          type : 1, 
    193           numdisplay : 20
     185          numdisplay : 999
    194186          numnotify : 0, 
    195187          manageunread : -1, 
  • air/TLife/trunk/src/uwi/shortening/URLShortenThread.as

    r2634 r2653  
    3232    protected override function run() : void  
    3333    { 
    34       var url : String = StringUtil.substitute(baseurl, encodeURIComponent(srcurl)
     34      var url : String = StringUtil.substitute(baseurl, encodeURIComponent(srcurl))
    3535      var req : URLRequest = new URLRequest(url); 
    3636      req.method = URLRequestMethod.GET; 
  • air/TLife/trunk/src/uwi/thread/event/PostEventThread.as

    r2652 r2653  
    1717  import org.libspark.thread.utils.ParallelExecutor; 
    1818  import uwi.shortening.URLShortenThread; 
     19  import uwi.thread.PostThread; 
    1920  import uwi.twitter.TwitterPostThread; 
    2021  import uwi.twitter.TwitterScrapeThread; 
     
    9091      if (e.keyCode == Keyboard.ENTER && e.controlKey == false) { 
    9192        e.preventDefault(); 
    92         onSubmit(null); 
     93        if (!CommonData.pt) { 
     94          CommonData.pt = new PostThread(); 
     95          CommonData.pt.start(); 
     96        } 
     97        next(waitEvents); 
    9398        return; 
    9499      } 
     
    137142    private function onKeyUp(e : KeyboardEvent) : void 
    138143    { 
    139       trace("up"); 
    140144      CommonData.datagridsuspend = false; 
    141145       
     
    174178    private function onSubmit(e : Event) : void 
    175179    { 
    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(); 
    180183      } 
    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() : void 
    203     { 
    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() : void 
    227     { 
    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() : void 
    248     { 
    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) : void 
    260     { 
    261       Logger.warn("PostEventThread Error"); 
    262       Logger.stacktrace(e); 
    263       CommonData.in_reply_to_status_id = ""; 
    264       postbtn.enabled = true; 
    265184      next(waitEvents); 
    266185    } 
  • air/TLife/trunk/src/uwi/twitter/TwitterOAuthAccessThread.as

    r2634 r2653  
    3838    { 
    3939      Logger.debug("TwitterOAuthAccessThread start"); 
    40       CommonData.state_oauth = 0; 
    4140      var otok : OAuthToken = new OAuthToken(oauth_token, oauth_token_secret); 
    4241      var oreq : OAuthRequest = new OAuthRequest("post", "http://twitter.com/oauth/access_token", null, CommonData.CONSUMER, otok); 
     
    6362        CommonData.configxml.login.oauth_token_secret = param.oauth_token_secret; 
    6463        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; 
    6667      } 
    6768       
  • air/TLife/trunk/src/uwi/twitter/TwitterOAuthRequestThread.as

    r2634 r2653  
    3737    { 
    3838      Logger.debug("TwitterOAuthRequestThread start"); 
     39       
     40      if (CommonData.state_oauth == 2) return; 
     41      CommonData.state_oauth = 2; 
    3942       
    4043      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  
    2525        // OAuth認証が有効な場合OAuthにする 
    2626        poststr = OAuthUtility.makeData(url, param); 
    27         trace(poststr); 
     27        Logger.debug(poststr); 
    2828      }else { 
    2929        poststr = Utility.objectToParam(param); 
    30         trace(poststr); 
     30        Logger.debug(poststr); 
    3131      } 
    3232       
  • air/TLife/trunk/src/uwi/twitter/TwitterStreamFollowGetThread.as

    r2642 r2653  
    6060    private function onProgress(e : ProgressEvent) : void 
    6161    { 
    62       trace("bytesavailable : " + _us.bytesAvailable); 
     62      Logger.debug("bytesavailable : " + _us.bytesAvailable); 
    6363      var data : String = _us.readMultiByte(_us.bytesAvailable, "UTF-8"); 
    6464      try { 
  • air/TLife/trunk/src/uwi/util/CommonData.as

    r2651 r2653  
    1212  import uwi.thread.event.DataGridEventThread; 
    1313  import uwi.thread.event.DataGridRoutineThread; 
     14  import uwi.thread.PostThread; 
    1415  import uwi.thread.ReplyGetThread; 
    1516  import uwi.thread.StreamManageThread; 
     
    5758     
    5859    public static const LIMLEN_POST : int = 140; 
     60    public static const LIMLEN_VALID : int = 160; 
    5961     
    6062    // 0 : nothing changed 
     
    8183    public static var mtbdet : MultipleTabBarDragEventThread = null; 
    8284    public static var smt : StreamManageThread = null; 
     85    public static var pt : PostThread = null; 
    8386     
    8487    public static var configxml : XML = null; 
     
    147150    // 0 : 未認証 
    148151    // 1 : 認証済 
     152    // 2 : 認証中 
    149153    public static var state_oauth : int; 
    150154     
     
    167171      "content" : uwi.ui.TimelineRenderer, 
    168172      "postedtime" : uwi.ui.TimelineRenderer 
    169     } 
     173    }; 
    170174     
    171175    public static const MAP_SHORTENEDDOMAIN : Object = { 
     
    188192      "budurl.com" : "", 
    189193      "friendfeed.com" : "" 
    190     } 
     194    }; 
    191195  } 
    192196