Changeset 38813

Show
Ignore:
Timestamp:
01/29/11 10:56:32 (2 years ago)
Author:
NeoCat
Message:

Add block/unblock/report_spam menu in userInfo

Location:
websites/twicli
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • websites/twicli/lang.js

    r38764 r38813  
    77        'Retweet': ['リツイート','官方锐推'], 
    88        'Quote with RT:': ['RT:を付けて引用','加入RT:引用回复'], 
     9        'Block this user': ['ユーザをブロック', null], 
     10        'Unblock this user': ['ユーザをブロック解除', null], 
     11        'Report as spam': ['スパム報告', null], 
    912        'GeoTagging': ['ジオタグ','地理标签'], 
    1013        'Location':     ['場所','方位'], 
     
    4952        'Are you sure to delete this tweet?': ['このツイートを削除してもよろしいですか?','确定要删除该发言?'], 
    5053        'Are you sure to remove $1?': ['本当に $1 をリムーブしますか?','确定要取消关注$1吗?'], 
     54        'Are you sure to block $1?': ['本当に $1 をブロックしますか?',null], 
     55        'Are you sure to report $1 as spam?': ['本当に $1 をスパムとして報告しますか?',null], 
    5156        'An external plugin is specified. This plugin can fully access to your account.\nAre you sure to load this?': ['外部プラグインが指定されています。このプラグインはあなたのアカウントに自由にアクセス可能になります。本当にロードしてもよろしいですか?','你欲加载外部地址上的插件。这个插件将自由访问你的帐号信息。确认加载?'] 
    5257}; 
  • websites/twicli/oauth/oauth.js

    r37185 r38813  
    322322    timeCorrectionMsec: 0 
    323323, 
     324    lastTimestamp: 0 
     325, 
    324326    timestamp: function timestamp() { 
    325327        var t = (new Date()).getTime() + OAuth.timeCorrectionMsec; 
    326         return Math.floor(t / 1000); 
     328        t = Math.floor(t / 1000); 
     329        if (this.lastTimestamp >= t) t = this.lastTimestamp + 1; 
     330        this.lastTimestamp = t; 
     331        return t; 
    327332    } 
    328333, 
  • websites/twicli/styles/default.css

    r38767 r38813  
    4747.button { text-decoration: none; -webkit-text-size-adjust:140%; } 
    4848.popup { padding: 0 4px; color: #888; } 
     49.upopup { float: right; padding: 4px 4px; color: #888; } 
    4950.lock { position: relative; top: 2px; left: 0; } 
    5051.close { color: red; } 
     
    5354#rep > a > img { padding: 2px 1px 1px 3px; } 
    5455#reps { margin-top: 1px; } 
    55 #popup { display: none; background-color: #eee; position: absolute; left: 0; top: 200px; border: 2px solid #666; z-index: 6; width: 180px; font-size: x-small; } 
    56 #popup a { display: block; background-color: #fff; color: black; text-decoration: none; padding: 3px; border-bottom: 1px solid #888; } 
    57 #popup a:hover { background-color: #33f; color: #fff; text-decoration: none; } 
    58 #popup a.row2 { background-color: #eee; } 
     56.popup_menu { display: none; background-color: #eee; position: absolute; left: 0; top: 200px; border: 2px solid #666; z-index: 6; width: 180px; font-size: x-small; } 
     57.popup_menu a { display: block; background-color: #fff; color: black; text-decoration: none; padding: 3px; border-bottom: 1px solid #888; } 
     58.popup_menu a:hover { background-color: #33f; color: #fff; text-decoration: none; } 
     59.popup_menu a.row2 { background-color: #eee; } 
    5960#popup_hide { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.2; filter: alpha(opacity=20); background-color: black; z-index: 5; } 
    6061#user_info { margin: 1px; border: 1px solid #888; } 
  • websites/twicli/twicli.html

    r38705 r38813  
    5757        <a href="javascript:pickup2()" class="close"><img alt="⇔" src="images/both.png"></a><div id="reps"></div></div> 
    5858<!--ポップアップメニュー--> 
    59 <div id="popup" onClick="popup_hide()"> 
     59<div class="popup_menu" id="popup" onClick="popup_hide()"> 
    6060<a id="popup_status_delete" href="#" onClick="return deleteStatus()">Delete tweet</a> 
    6161<a id="popup_status_retweet" href="#" onClick="return retweetStatus()">Retweet</a> 
     
    6363<a id="popup_link_user" href="" target="twitter">Twitter / user</a> 
    6464<a id="popup_link_status" href="" target="twitter">Twitter / tweet</a> 
     65</div> 
     66<div class="popup_menu" id="userinfo_popup" onClick="popup_hide()"> 
     67<a id="upopup_user_block" href="#" onClick="return blockUser(true)">Block this user</a> 
     68<a id="upopup_user_unblock" href="#" onClick="return blockUser(false)">Unblock this user</a> 
     69<a id="upopup_user_spam" href="#" onClick="return reportSpam()">Report as spam</a> 
    6570</div> 
    6671<!--ポップアップメニュー非表示用--> 
  • websites/twicli/twicli.js

    r38806 r38813  
    587587function popup_init() { 
    588588        var popup_id_list = ['popup_link_user', 'popup_link_status', 'popup_status_delete', 
    589                                                 'popup_status_retweet', 'popup_status_quote']; 
     589                                                'popup_status_retweet', 'popup_status_quote', 
     590                                                'upopup_user_block', 'upopup_user_unblock', 'upopup_user_spam']; 
    590591        for (var x = 0; x < popup_id_list.length; x++) 
    591592                $(popup_id_list[x]).innerHTML = _($(popup_id_list[x]).innerHTML); 
     
    612613function popup_hide() { 
    613614        $('popup').style.display = 'none'; 
     615        $('userinfo_popup').style.display = 'none'; 
    614616        $('popup_hide').style.display = 'none'; 
    615617        popup_user = popup_id = popup_ele = null; 
     618} 
     619// ユーザ情報のポップアップメニューを表示 
     620function userinfo_popup_menu(user, id, ele) { 
     621        popup_user = user; 
     622        popup_id = id; 
     623        callPlugins("userinfo_popup", $('userinfo_popup'), user, id, ele); 
     624        $('userinfo_popup').style.display = "block"; 
     625        var pos = cumulativeOffset(ele); 
     626        $('userinfo_popup').style.left = pos[0] <  $('userinfo_popup').offsetWidth - ele.offsetWidth ? 0 : pos[0] - $('userinfo_popup').offsetWidth + ele.offsetWidth; 
     627        $('userinfo_popup').style.top = pos[1] + 20; 
     628        $('popup_hide').style.height = Math.max(document.body.scrollHeight, $("tw").offsetHeight+$("control").offsetHeight); 
     629        $('popup_hide').style.display = "block"; 
    616630} 
    617631// 発言のReTweet 
     
    765779                        '<br><a href="javascript:switchStatus()">' + user.statuses_count + '<small>'+_('tweets')+'</small></a> / ' + 
    766780                                                '<a href="javascript:switchFav()">' + user.favourites_count + '<small>'+_('favs')+'</small></a></b>' + 
    767                         '</td></tr></table><a target="twitter" href="' + twitterURL + user.screen_name + '">[Twitter]</a> ' 
     781                        '</td></tr></table>'+ 
     782                        '<a class="button upopup" href="#" onClick="userinfo_popup_menu(\'' + user.screen_name + '\',' + user.id + ', this); return false;"><small><small>▼</small></small></a>'+ 
     783                        '<a target="twitter" href="' + twitterURL + user.screen_name + '">[Twitter]</a> '; 
    768784} 
    769785// 過去の発言取得ボタン(DOM)生成 
     
    799815// followとremove 
    800816function follow(f) { 
    801         if (!f && !confirm(_("Are you sure to remove $1?", last_user))) return; 
     817        if (!f && !confirm(_("Are you sure to remove $1?", last_user))) return false; 
    802818        enqueuePost(twitterAPI + 'friendships/' + (f ? 'create' : 'destroy') + '/' + last_user + '.xml', switchUser); 
    803819        $("loading").style.display = "block"; 
     820        return false; 
     821} 
     822// blockとunblock 
     823function blockUser(f) { 
     824        if (f && !confirm(_("Are you sure to block $1?", last_user))) return false; 
     825        enqueuePost(twitterAPI + 'blocks/' + (f ? 'create' : 'destroy') + '/' + last_user + '.xml', switchUser); 
     826        $("loading").style.display = "block"; 
     827        return false; 
     828} 
     829function reportSpam(f) { 
     830        if (f && !confirm(_("Are you sure to report $1 as spam?", last_user))) return false; 
     831        enqueuePost(twitterAPI + 'report_spam.xml?screen_name=' + last_user, switchUser); 
     832        $("loading").style.display = "block"; 
     833        return false; 
    804834} 
    805835// ユーザ情報を表示