- Timestamp:
- 10/10/08 06:45:12 (3 months ago)
- Location:
- websites/twicli
- Files:
-
- 3 added
- 1 modified
-
cache-manifest (added)
-
favicon.ico (added)
-
icon.png (added)
-
twicli.html (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
websites/twicli/twicli.html
r20435 r21065 1 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> 2 <html >2 <html manifest="cache-manifest"> 3 3 <head> 4 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5 <meta name="apple-mobile-web-app-capable" content="yes"> 5 6 <meta name="viewport" content="width=280"> 7 <link rel="apple-touch-icon" href="icon.png"> 8 <link rel="shortcut icon" href="favicon.ico"> 6 9 <title>twicli</title> 7 10 <style type="text/css"><!-- 8 body { background-image: url(block_bg.png); background-attachment: fixed; background-color: transparent;margin: 1px; min-height: 500px; }11 body { background-image: url(block_bg.png); background-attachment: fixed; margin: 1px; min-height: 500px; } 9 12 img { border: 0 none; } 10 13 hr { margin: 0; padding: 0; } … … 30 33 .fromme { background-color: #cfc; } 31 34 .tome { background-color: #ccf; } 32 .button { color: #f29; border: 1px solid #ddd; text-decoration: none; font-size: medium; }35 .button { color: #f29; border: 1px solid #ddd; text-decoration: none; font-size: medium; -webkit-text-size-adjust:120%; } 33 36 .green { color: #195; } 34 37 .popup { padding: 0 4px; color: #888; } … … 46 49 --></style> 47 50 <script type="text/javascript"> 51 var iphone = navigator.userAgent.indexOf('iPhone OS') >= 0; 48 52 function $(id) { return document.getElementById(id); } 49 53 // クロスドメインJavaScript呼び出し … … 168 172 return res; 169 173 }; 174 } 175 // iPhone / iPod touchではリンクをフレームに開く 176 function clickLink(ele) { 177 if (iphone) { 178 switchTo("misc"); 179 var height = Math.max(document.body.scrollHeight, $("tw").offsetHeight+$("control").offsetHeight) - 54; 180 $("tw2c").innerHTML = '<iframe style="display:block; border: 0;" src="' + ele.href + '" width="100%" height="' + height + '"></iframe>'; 181 } 182 return !iphone; 170 183 } 171 184 // user-defined CSS … … 206 219 <!--ポップアップメニュー--> 207 220 <div id="popup" onClick="popup_hide()"> 208 <a id="popup_link_user" href="" target="twitter" >Twitter / User</a>209 <a id="popup_link_status" href="" target="twitter" >Twitter / Status</a>221 <a id="popup_link_user" href="" target="twitter" onClick="return clickLink(this)">Twitter / User</a> 222 <a id="popup_link_status" href="" target="twitter" onClick="return clickLink(this)">Twitter / Status</a> 210 223 </div> 211 224 <!--ポップアップメニュー非表示用--> … … 325 338 } 326 339 // ポップアップメニューを表示 327 function popup (user, id, ele) {340 function popup_menu(user, id, ele) { 328 341 user_popup = user; 329 342 callPlugins("popup", $('popup'), user, id); … … 359 372 (!no_name ? 360 373 //ユーザアイコン 361 (tw.user.url ? '<a target="twitter" href="'+tw.user.url+'">' : '') +374 (tw.user.url ? '<a target="twitter" onClick="return clickLink(this)" href="'+tw.user.url+'">' : '') + 362 375 '<img align="left" width="32" height="32" src="' + tw.user.profile_image_url + '">' + (tw.user.url ? '</a>' : '') + 363 376 //名前 … … 369 382 //本文 (https〜をリンクに置換 + @を本家リンク+JavaScriptに置換) 370 383 " <span id=\"text" + tw.id + "\" class=\"status\">" + 371 tw.text.replace(/https?:\/\/[\w!#$%&'()*+,.\/:;=?@~-]+/g, " <a target=\"twitter\" href=\"$&\">$&</a>")384 tw.text.replace(/https?:\/\/[\w!#$%&'()*+,.\/:;=?@~-]+/g, " <a target=\"twitter\" onClick=\"return clickLink(this)\" href=\"$&\">$&</a>") 372 385 .replace(/@([\w-]+)/g, "<a href=\"http://twitter.com/$1\" onClick=\"switchUser('$1'); return false;\" >$&</a>").replace(/\r?\n|\r/g, "<br>") + '</span>' + 373 386 //日付'クライアント … … 378 391 (tw.in_reply_to_status_id ? ' <a class="button" href="#" onClick="dispReply(\'' + un + '\',' + tw.in_reply_to_status_id + ',this); return false;">☞</a>' : '') + 379 392 //popupメニュー表示 380 ' <a class="button popup" href="#" onClick="popup (\'' + un + "'," + tw.id + ', this); return false;"><small><small>▼</small></small></a>' +393 ' <a class="button popup" href="#" onClick="popup_menu(\'' + un + "'," + tw.id + ', this); return false;"><small><small>▼</small></small></a>' + 381 394 '</span><br clear="left">'; 382 395 } … … 386 399 '<b>' + user.screen_name + '</b> / <b>' + user.name + '</b><br>' + 387 400 (user.location ? '<b>Location</b>: ' + user.location + '<br>' : '') + 388 (user.url ? '<b>URL</b>: <a target="twitter" href="' + user.url + '">' + user.url + '</a><br>' : '') +401 (user.url ? '<b>URL</b>: <a target="twitter" onClick="return clickLink(this)" href="' + user.url + '">' + user.url + '</a><br>' : '') + 389 402 (user.description ? user.description : '') + 390 '</td></tr></table><a target="twitter" href="http://twitter.com/' + user.screen_name + '">[Twitter]</a> <a href="javascript:switchFav()">[fav]</a> ';403 '</td></tr></table><a target="twitter" onClick="return clickLink(this)" href="http://twitter.com/' + user.screen_name + '">[Twitter]</a> <a href="javascript:switchFav()">[fav]</a> '; 391 404 } 392 405 // favoriteの追加(f=true)/削除(f=false) … … 634 647 function switchMisc() { 635 648 switchTo("misc"); 636 $("tw2h").innerHTML = '<p><a target="twitter" href="index.html"><b>twicli</b></a> : browser-base Twitter client</p><hr>' +649 $("tw2h").innerHTML = '<p><a target="twitter" onClick="return clickLink(this)" href="index.html"><b>twicli</b></a> : browser-base Twitter client</p><hr>' + 637 650 '<p><form onSubmit="switchUser($(\'user_id\').value); return false;">show user info : @<input type="text" size="15" id="user_id" value="' + myname + '"><input type="image" src="go.png"></form></p><hr>' + 638 651 '<p><b>Preferences:</b><form onSubmit="setPreps(this.limit.value, this.maxc.value, this.maxu.value, this.list.value, this.user_style.value); return false;">max #msgs in TL: <input name="limit" size="3" value="' + nr_limit + '"><br>#msgs in TL on update (max=200): <input name="maxc" size="3" value="' + max_count + '"><br>#msgs in user on update (max=200): <input name="maxu" size="3" value="' + max_count_u + '"><br>Plugins:<br><textarea cols="30" rows="4" name="list">' + pluginstr + '</textarea><br>user stylesheet:<br><textarea cols="30" rows="4" name="user_style">' + user_style + '</textarea><br><input type="submit" value="Save"></form></p><hr>' … … 651 664 alert("Saved in Cookie. Please reload."); 652 665 } 666 // 初期化 667 function init() { 668 setTimeout(scrollTo, 0, 0, 1); 669 // 初回アップデート 670 setTimeout(update, 0); 671 setInterval(update, 45*1000); 672 // ログインしていなかったときなどに20秒でログインを試みる 673 failover_timeout = setTimeout(function(){ switchTo("misc"); $("tw2c").innerHTML = '<iframe style="display:block" src="http://twitter.com/home" width="100%" height="400"></iframe>' }, 20*1000); 674 } 653 675 // プラグイン 654 676 function registerPlugin(obj) { … … 667 689 document.write('<scr'+'ipt src="'+list[i]+'"></scr'+'ipt>'); 668 690 } 669 // 初期化670 function init() {671 setTimeout(scrollTo, 0, 0, 1);672 // 初回アップデート673 setTimeout(update, 0);674 setInterval(update, 60*1000);675 // ログインしていなかったときなどに20秒で本家にリダイレクト676 failover_timeout = setTimeout(function(){ switchTo("misc"); $("tw2c").innerHTML = '<iframe style="display:block" src="http://twitter.com/home" width="100%" height="400"></iframe>' }, 20*1000);677 }678 679 691 // ホイールの回転でスクロール (スクロール不可のウィンドウ・フレーム内で有効) 680 692 function wheel(event) { … … 696 708 window.onmousewheel = document.onmousewheel = wheel; 697 709 710 // 自ユーザ名ロード 698 711 loadXDomainScript('http://twitter.com/statuses/user_timeline.json?count=1&callback=twUser'); 699 712 </script>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)