[P2-php-svn] [878] expack:

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 8月 15日 (日) 02:55:07 JST


Revision: 878
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=878
Author:   rsk
Date:     2010-08-15 02:55:06 +0900 (Sun, 15 Aug 2010)

Log Message:
-----------
expack:
- rev.100815.0200.
- スレ一覧/スレ内容のツールバーにユーザー定義のアクションを実行するボタンを追加。
-- 設定管理 > ユーザ設定編集 > 拡張パック設定 > ツールバーアクション で設定する。
-- 現状ではiPhone用ビューのスレ一覧のみ実装している。
- 従来のBB2Cで開くボタンは廃止。
-- ツールバーアクションの設定例にBB2Cを使う場合の記述をしている。
- スレの速さを示すインジケーターを廃止。
- Android端末でiPhone用ビュー使用時、強制的にJavaScript-XPathを使うように変更。

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/conf/conf_admin_ex.inc.php
    p2ex/trunk/conf/conf_user_def_i.inc.php
    p2ex/trunk/edit_conf_user.php
    p2ex/trunk/lib/bootstrap.php
    p2ex/trunk/lib/read_footer_k.inc.php
    p2ex/trunk/lib/sb_footer_i.inc.php
    p2ex/trunk/lib/sb_header_i.inc.php
    p2ex/trunk/lib/sb_print_k.inc.php
    p2ex/trunk/lib/toolbar_i.inc.php
    p2ex/trunk/menu_i.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/conf/conf.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -7,7 +7,7 @@
 // ƒo[ƒWƒ‡ƒ“î•ñ
 $_conf = array(
     'p2version' => '1.7.29+1.8.x',  // rep2‚̃o[ƒWƒ‡ƒ“
-    'p2expack'  => '100813.1950',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
+    'p2expack'  => '100815.0200',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
     'p2name'    => 'expack',        // rep2‚Ì–¼‘O
 );
 

Modified: p2ex/trunk/conf/conf_admin_ex.inc.php
===================================================================
--- p2ex/trunk/conf/conf_admin_ex.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/conf/conf_admin_ex.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -137,9 +137,6 @@
 // ‚¨‹C‚ɃZƒbƒg–¼î•ñ‚ð‹L˜^‚·‚éƒtƒ@ƒCƒ‹‚̃pƒX
 $_conf['expack.misc.favset_file'] = $_conf['pref_dir'] . '/p2_favset.txt';
 
-// iPhone‚Å”Â/ƒXƒŒ‚ðBB2C‚ÅŠJ‚­ƒ{ƒ^ƒ“‚ð•\Ž¦ (off:0, on:1)
-$_conf['expack.misc.use_bb2c'] = 0; // (0)
-
 // }}}
 
 /*

Modified: p2ex/trunk/conf/conf_user_def_i.inc.php
===================================================================
--- p2ex/trunk/conf/conf_user_def_i.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/conf/conf_user_def_i.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -3,44 +3,56 @@
  * rep2expack - iPhone—pƒ†[ƒU‰ŠúÝ’è
  */
 
-// {{{ subject-i (ƒXƒŒˆê——)
+// {{{ ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“
 
-// ¨‚¢‚ðŽ¦‚·ƒCƒ“ƒWƒP[ƒ^[‚ð•\Ž¦ (‚·‚é:1, ‚µ‚È‚¢:0)
-$conf_user_def['iphone.subject.indicate-speed'] = 0; // (0)
-$conf_user_rad['iphone.subject.indicate-speed'] = array('1' => '‚·‚é', '0' => '‚µ‚È‚¢');
+// iPhone—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.iphone.board_uri'] = ""; // ("")
 
-// ƒCƒ“ƒWƒP[ƒ^[‚Ì• (pixels)
-$conf_user_def['iphone.subject.speed.width'] = 10; // (10)
-$conf_user_rules['iphone.subject.speed.width'] = array('notIntExceptMinusToDef');
+// iPhone—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.iphone.board_title'] = ""; // ("")
 
-// ƒCƒ“ƒWƒP[ƒ^[‚̐F (1ƒŒƒX/“ú–¢–ž)
-$conf_user_def['iphone.subject.speed.0rpd'] = "#eeeeee"; // ("#eeeeee")
-$conf_user_rules['iphone.subject.speed.0rpd'] = array('notCssColorToDef');
+// iPhone—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.iphone.thread_uri'] = ""; // ("")
 
-// ƒCƒ“ƒWƒP[ƒ^[‚̐F (1ƒŒƒX/“úˆÈã)
-$conf_user_def['iphone.subject.speed.1rpd'] = "#ffcccc"; // ("#ffcccc")
-$conf_user_rules['iphone.subject.speed.1rpd'] = array('notCssColorToDef');
+// iPhone—pƒXƒŒƒbƒh“à—eƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.iphone.thread_title'] = ""; // ("")
 
-// ƒCƒ“ƒWƒP[ƒ^[‚̐F (10ƒŒƒX/“úˆÈã)
-$conf_user_def['iphone.subject.speed.10rpd'] = "#ff9999"; // ("#ff9999")
-$conf_user_rules['iphone.subject.speed.10rpd'] = array('notCssColorToDef');
+// Android—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.android.board_uri'] = ""; // ("")
 
-// ƒCƒ“ƒWƒP[ƒ^[‚̐F (100ƒŒƒX/“úˆÈã)
-$conf_user_def['iphone.subject.speed.100rpd'] = "#ff6666"; // ("#ff6666")
-$conf_user_rules['iphone.subject.speed.100rpd'] = array('notCssColorToDef');
+// Android—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.android.board_title'] = ""; // ("")
 
-// ƒCƒ“ƒWƒP[ƒ^[‚̐F (1000ƒŒƒX/“úˆÈã)
-$conf_user_def['iphone.subject.speed.1000rpd'] = "#ff3333"; // ("#ff3333")
-$conf_user_rules['iphone.subject.speed.1000rpd'] = array('notCssColorToDef');
+// Android—pƒXƒŒƒbƒh“à—eƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.android.thread_uri'] = ""; // ("")
 
-// ƒCƒ“ƒWƒP[ƒ^[‚̐F (10000ƒŒƒX/“úˆÈã)
-$conf_user_def['iphone.subject.speed.10000rpd'] = "#ff0000"; // ("#ff0000")
-$conf_user_rules['iphone.subject.speed.10000rpd'] = array('notCssColorToDef');
+// Android—pƒXƒŒƒbƒh“à—eƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.android.thread_title'] = ""; // ("")
 
-// }}}
-// {{{ read-i (ƒXƒŒ“à—e)
+// Œg‘Ñ—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.mobile.board_uri'] = ""; // ("")
 
+// Œg‘Ñ—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.mobile.board_title'] = ""; // ("")
 
+// Œg‘Ñ—pƒXƒŒƒbƒh“à—eƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.mobile.thread_uri'] = ""; // ("")
+
+// Œg‘Ñ—pƒXƒŒƒbƒh“à—eƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.mobile.thread_title'] = ""; // ("")
+
+// PC—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.other.board_uri'] = ""; // ("")
+
+// PC—pƒXƒŒƒbƒhˆê——ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.other.board_title'] = ""; // ("")
+
+// PC—pƒXƒŒƒbƒh“à—eƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚ÌURI
+$conf_user_def['expack.tba.other.thread_uri'] = ""; // ("")
+
+// PC—pƒXƒŒƒbƒh“à—eƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“‚̃^ƒCƒgƒ‹
+$conf_user_def['expack.tba.other.thread_title'] = ""; // ("")
+
 // }}}
 
 /*

Modified: p2ex/trunk/edit_conf_user.php
===================================================================
--- p2ex/trunk/edit_conf_user.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/edit_conf_user.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -476,7 +476,7 @@
 
 // }}}
 // {{{ iPhone - subject
-
+/*
 $groupname = 'subject (iPhone)';
 $groups[] = $groupname;
 $flags = getGroupShowFlags($groupname);
@@ -484,18 +484,10 @@
     $keep_old = true;
 } else {
     $conflist = array(
-        array('iphone.subject.indicate-speed', '¨‚¢‚ðŽ¦‚·ƒCƒ“ƒWƒP[ƒ^[‚ð•\Ž¦'),
-        array('iphone.subject.speed.width', 'ƒCƒ“ƒWƒP[ƒ^[‚Ì• (pixels)'),
-        array('iphone.subject.speed.0rpd', 'ƒCƒ“ƒWƒP[ƒ^[‚̐F (1ƒŒƒX/“ú–¢–ž)'),
-        array('iphone.subject.speed.1rpd', 'ƒCƒ“ƒWƒP[ƒ^[‚̐F (1ƒŒƒX/“úˆÈã)'),
-        array('iphone.subject.speed.10rpd', 'ƒCƒ“ƒWƒP[ƒ^[‚̐F (10ƒŒƒX/“úˆÈã)'),
-        array('iphone.subject.speed.100rpd', 'ƒCƒ“ƒWƒP[ƒ^[‚̐F (100ƒŒƒX/“úˆÈã)'),
-        array('iphone.subject.speed.1000rpd', 'ƒCƒ“ƒWƒP[ƒ^[‚̐F (1000ƒŒƒX/“úˆÈã)'),
-        array('iphone.subject.speed.10000rpd', 'ƒCƒ“ƒWƒP[ƒ^[‚̐F (10000ƒŒƒX/“úˆÈã)'),
     );
     printEditConfGroupHtml($groupname, $conflist, $flags);
 }
-
+*/
 // }}}
 // {{{ iPhone - read
 /*
@@ -694,7 +686,77 @@
 }
 
 // }}}
+// {{{ expack - ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“
+
+$groupname = 'ƒc[ƒ‹ƒo[ƒAƒNƒVƒ‡ƒ“';
+$groups[] = $groupname;
+$flags = getGroupShowFlags($groupname);
+if ($flags & P2_EDIT_CONF_USER_SKIPPED) {
+    $keep_old = true;
+} else {
+    $_tba_board_uri_description = <<<EOS
+iPhone/ƒXƒŒˆê——/URI<br>
+—á) beebee2seeopen://\$host/\$bbs/<br>
+<table style="margin:5px auto;background:#ccc;color:#000">
+<caption>’uŠ·ƒpƒ^[ƒ“</caption>
+<thead>
+<tr><th>from</th><th>to</th></tr>
+</thead>
+<tbody>
+<tr><td>\$time</td><td>ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv</td></tr>
+<tr><td>\$host</td><td>ƒzƒXƒg–¼</td></tr>
+<tr><td>\$bbs</td><td>”–¼</td></tr>
+<tr><td>\$url</td><td>”‚ÌURL</td></tr>
+<tr><td>\$eurl</td><td>V</td></tr>
+</tbody>
+</table>
+(\$urlˆÈŠO‚Ì’uŠ·ƒpƒ‰ƒ[ƒ^‚ÍURLƒGƒ“ƒR[ƒhÏ)
+EOS;
+    $_tba_thread_uri_description = <<<EOS
+iPhone/ƒXƒŒˆê——/URI<br>
+—á) beebee2seeopen://\$path<br>
+<table style="margin:5px auto;background:#ccc;color:#000">
+<caption>’uŠ·ƒpƒ^[ƒ“</caption>
+<thead>
+<tr><th>from</th><th>to</th></tr>
+</thead>
+<tbody>
+<tr><td>\$time</td><td>ƒ^ƒCƒ€ƒXƒ^ƒ“ƒv</td></tr>
+<tr><td>\$host</td><td>ƒzƒXƒg–¼</td></tr>
+<tr><td>\$bbs</td><td>”–¼</td></tr>
+<tr><td>\$key</td><td>ƒXƒŒƒbƒhƒL[</td></tr>
+<tr><td>\$ls</td><td>•\Ž¦”͈Í</td></tr>
+<tr><td>\$url</td><td>ƒXƒŒƒbƒh‚ÌURL</td></tr>
+<tr><td>\$eurl</td><td>V</td></tr>
+<tr><td>\$path</td><td>http://‚ðœŠO‚µ‚½URL</td></tr>
+</tbody>
+</table>
+(\$url, \$pathˆÈŠO‚Ì’uŠ·ƒpƒ‰ƒ[ƒ^‚ÍURLƒGƒ“ƒR[ƒhÏ)
+EOS;
+    $conflist = array(
+        array('expack.tba.iphone.board_uri', $_tba_board_uri_description, P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.iphone.board_title', 'iPhone/ƒXƒŒˆê——/ƒ^ƒCƒgƒ‹<br>—á) BB2C'),
+        array('expack.tba.iphone.thread_uri', $_tba_thread_uri_description, P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.iphone.thread_title', 'iPhone/ƒXƒŒ“à—e/ƒ^ƒCƒgƒ‹<br>—á) BB2C'),
+        array('expack.tba.android.board_uri', 'Android/ƒXƒŒˆê——/URI', P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.android.board_title', 'Android/ƒXƒŒˆê——/ƒ^ƒCƒgƒ‹'),
+        array('expack.tba.android.thread_uri', 'Android/ƒXƒŒ“à—e/URI', P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.android.thread_title', 'Android/ƒXƒŒ“à—e/ƒ^ƒCƒgƒ‹'),
+        array('expack.tba.mobile.board_uri', 'Œg‘Ñ/ƒXƒŒˆê——/URI', P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.mobile.board_title', 'Œg‘Ñ/ƒXƒŒˆê——/ƒ^ƒCƒgƒ‹'),
+        array('expack.tba.mobile.thread_uri', 'Œg‘Ñ/ƒXƒŒ“à—e/URI', P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.mobile.thread_title', 'Œg‘Ñ/ƒXƒŒ“à—e/ƒ^ƒCƒgƒ‹'),
+        array('expack.tba.other.board_uri', 'PC/ƒXƒŒˆê——/URI', P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.other.board_title', 'PC/ƒXƒŒˆê——/ƒ^ƒCƒgƒ‹'),
+        array('expack.tba.other.thread_uri', 'PC/ƒXƒŒ“à—e/URI', P2_EDIT_CONF_USER_LONGTEXT),
+        array('expack.tba.other.thread_title', 'PC/ƒXƒŒ“à—e/ƒ^ƒCƒgƒ‹'),
+    );
+    printEditConfGroupHtml($groupname, $conflist, $flags);
+    unset($_tba_board_uri_description, $_tba_thread_uri_description);
+}
+
 // }}}
+// }}}
 
 // PC—p•\Ž¦
 if (!$_conf['ktai']) {

Modified: p2ex/trunk/lib/bootstrap.php
===================================================================
--- p2ex/trunk/lib/bootstrap.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/lib/bootstrap.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -460,6 +460,7 @@
 // Android‚Å‚ÍJavaScript-XPath‚ðŽg‚¤
 if ($_conf['iphone'] && UA::isAndroidWebKit()) {
     $_conf['extra_headers_ht'] .= <<<EOS
+<script type="text/javascript">window.jsxpath = { 'useNative': false };</script>
 <script type="text/javascript" src="js/javascript-xpath.js?{$_conf['p2_version_id']}"></script>
 EOS;
 }

Modified: p2ex/trunk/lib/read_footer_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_footer_k.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/lib/read_footer_k.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -80,12 +80,6 @@
 }
 
 echo "<hr>\n<div class=\"center\">{$_conf['k_to_index_ht']}";
-if ($_conf['iphone'] && $_conf['expack.misc.use_bb2c']) {
-    $bb2c_open_uri = str_replace('http://', 'beebee2seeopen://', $aThread->getMotoThread(true, ''));
-    echo ' <a class="button" href="javascript:location.replace(\'';
-    echo htmlspecialchars($bb2c_open_uri, ENT_QUOTES);
-    echo '\');">BB2C</a>';
-}
 echo "</div>\n";
 
 // iPhone

Modified: p2ex/trunk/lib/sb_footer_i.inc.php
===================================================================
--- p2ex/trunk/lib/sb_footer_i.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/lib/sb_footer_i.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -202,8 +202,6 @@
 // }}}
 // {{{ ƒc[ƒ‹ƒo[‚ð•\Ž¦
 
-$touch_handlers = ' ontouchstart="this.className=\'hover\'" ontouchend="this.className=\'\'"';
-
 echo '<div class="ntoolbar" id="footer">';
 echo '<table><tbody><tr>';
 
@@ -270,16 +268,8 @@
 // ƒgƒbƒv‚É–ß‚é
 echo '<td>', toolbar_i_standard_button('img/glyphish/icons2/53-house.png', 'TOP', "index.php{$_conf['k_at_q']}"), '</td>';
 
-// BB2C‚ŃXƒŒ‚ðŠJ‚­
-echo '<td>';
-if (!$aThreadList->spmode && $_conf['expack.misc.use_bb2c']) {
-    $bb2c_open_uri = 'beebee2seeopen://' . str_replace('%2F', '/', rawurldecode("{$aThreadList->host}/{$aThreadList->bbs}/"));
-    $escaped_url = "javascript:location.replace('{$bb2c_open_uri}')";
-    echo toolbar_i_standard_button('img/glyphish/icons2/12-eye.png', 'BB2C', $escaped_url);
-} else {
-    echo toolbar_i_disabled_button('img/glyphish/icons2/12-eye.png', 'BB2C');
-}
-echo '</td>';
+// ƒAƒNƒVƒ‡ƒ“
+echo '<td>', toolbar_i_action_board_button('img/glyphish/icons2/12-eye.png', 'ƒAƒNƒVƒ‡ƒ“', $aThreadList), '</td>';
 
 // V‚µ‚¢ƒXƒŒƒbƒh‚𗧂Ăé
 echo '<td>';

Modified: p2ex/trunk/lib/sb_header_i.inc.php
===================================================================
--- p2ex/trunk/lib/sb_header_i.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/lib/sb_header_i.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -77,22 +77,6 @@
 <script type="text/javascript" src="js/json2.js?{$_conf['p2_version_id']}"></script>
 <script type="text/javascript" src="js/sb_iphone.js?{$_conf['p2_version_id']}"></script>
 EOS;
-// ƒXƒŒ‚̐¨‚¢‚ðŽ¦‚·‚½‚߂̃Xƒ^ƒCƒ‹ƒV[ƒg
-if ($_conf['iphone.subject.indicate-speed']) {
-    $_conf['extra_headers_ht'] .= <<<EOS
-<style type="text/css">
-/* <![CDATA[ */
-ul.subject > li > a { border-left: transparent solid {$_conf['iphone.subject.speed.width']}px; }
-ul.subject > li > a.dayres-0 { border-left-color: {$_conf['iphone.subject.speed.0rpd']}; }
-ul.subject > li > a.dayres-1 { border-left-color: {$_conf['iphone.subject.speed.1rpd']}; }
-ul.subject > li > a.dayres-10 { border-left-color: {$_conf['iphone.subject.speed.10rpd']}; }
-ul.subject > li > a.dayres-100 { border-left-color: {$_conf['iphone.subject.speed.100rpd']}; }
-ul.subject > li > a.dayres-1000 { border-left-color: {$_conf['iphone.subject.speed.1000rpd']}; }
-ul.subject > li > a.dayres-10000 { border-left-color: {$_conf['iphone.subject.speed.10000rpd']}; }
-/* ]]> */
-</style>
-EOS;
-}
 
 // ƒXƒŒî•ñ
 if (!$spmode) {

Modified: p2ex/trunk/lib/sb_print_k.inc.php
===================================================================
--- p2ex/trunk/lib/sb_print_k.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/lib/sb_print_k.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -265,32 +265,12 @@
                                  $aThread->dayres                  // ¨‚¢BØ‚èã‚°‚È‚µ
                                  );
 
-            if ($_conf['iphone.subject.indicate-speed']) {
-                // ¨‚¢”»’èB‚È‚º‚©•sˆÀ’è‚É‚È‚é‚Ì‚Ålog10()‚ÌŒ‹‰Ê‚Å•ªŠò‚Í‚µ‚È‚¢
-                $dayres = (int)$aThread->dayres;
-                if ($dayres > 9999) {
-                    $classspeed_at = ' class="dayres-10000"';
-                } elseif ($dayres > 999) {
-                    $classspeed_at = ' class="dayres-1000"';
-                } elseif ($dayres > 99) {
-                    $classspeed_at = ' class="dayres-100"';
-                } elseif ($dayres > 9) {
-                    $classspeed_at = ' class="dayres-10"';
-                } elseif ($dayres > 0) {
-                    $classspeed_at = ' class="dayres-1"';
-                } else {
-                    $classspeed_at = ' class="dayres-0"';
-                }
-            } else {
-                $classspeed_at = '';
-            }
-
             if ($htm['ita'] !== '') {
                 $htm['ita'] = "<span class=\"ita\">{$htm['ita']}</span>";
             }
 
             echo <<<EOP
-<li><a href="{$thre_url}"{$classspeed_at}><span class="info">{$thre_info}</span> {$htm['unum']} <span class="{$classtitle}">{$ttitle_ht}</span> {$htm['rnum']} {$htm['sim']} {$htm['ita']}</a></li>\n
+<li><a href="{$thre_url}"><span class="info">{$thre_info}</span> {$htm['unum']} <span class="{$classtitle}">{$ttitle_ht}</span> {$htm['rnum']} {$htm['sim']} {$htm['ita']}</a></li>\n
 EOP;
         } else {
             echo <<<EOP

Modified: p2ex/trunk/lib/toolbar_i.inc.php
===================================================================
--- p2ex/trunk/lib/toolbar_i.inc.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/lib/toolbar_i.inc.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -3,13 +3,36 @@
  * rep2 - ƒc[ƒ‹ƒo[—pƒ†[ƒeƒBƒŠƒeƒBiiPhonej
  */
 
-$GLOBALS['_TOOLBAR_I_TOGGLE_HOVER'] = implode(' ', array(
-    '',
-    'ontouchstart="iutil.toggleClass(this, \'hover\', true);"',
-    'ontouchend="iutil.toggleClass(this, \'hover\', false);"',
-    'ontouchcancel="iutil.toggleClass(this, \'hover\', false);"',
-));
+// {{{ _toolbar_i_button()
 
+/**
+ * ƒc[ƒ‹ƒo[ƒ{ƒ^ƒ“ (ƒŠƒ“ƒN)
+ *
+ * @param string $icon
+ * @param string $label
+ * @param string $uri
+ * @param string $attrs
+ * @return string
+ */
+function _toolbar_i_button($icon, $label, $uri, $attrs = '')
+{
+    static $hover = null;
+
+    if ($hover === null) {
+        $hover = implode(' ', array(
+            '',
+            'ontouchstart="iutil.toggleClass(this, \'hover\', true);"',
+            'ontouchend="iutil.toggleClass(this, \'hover\', false);"',
+            'ontouchcancel="iutil.toggleClass(this, \'hover\', false);"',
+        ));
+    }
+
+    return <<<EOS
+<a href="{$uri}"{$attrs}{$hover}><img src="{$icon}" width="48" height="32" alt=""><br>{$label}</a>
+EOS;
+}
+
+// }}}
 // {{{ toolbar_i_standard_button()
 
 /**
@@ -22,10 +45,7 @@
  */
 function toolbar_i_standard_button($icon, $label, $uri)
 {
-    $attrs = $GLOBALS['_TOOLBAR_I_TOGGLE_HOVER'];
-    return <<<EOS
-<a href="{$uri}"{$attrs}><img src="{$icon}" width="48" height="32" alt=""><br>{$label}</a>
-EOS;
+    return _toolbar_i_button($icon, $label, $uri);
 }
 
 // }}}
@@ -42,11 +62,8 @@
  */
 function toolbar_i_badged_button($icon, $label, $uri, $badge)
 {
-    $attrs = $GLOBALS['_TOOLBAR_I_TOGGLE_HOVER'];
-    $l = min(strlen($badge), 4);
-    return <<<EOS
-<a href="{$uri}"{$attrs}><img src="{$icon}" width="48" height="32" alt=""><br>{$label}<span class="badge l{$l}">{$badge}</span></a>
-EOS;
+    $label .= sprintf('<span class="badge l%d">%s</span>', min(strlen($badge), 4), $badge);
+    return _toolbar_i_button($icon, $label, $uri);
 }
 
 // }}}
@@ -62,10 +79,7 @@
  */
 function toolbar_i_opentab_button($icon, $label, $uri)
 {
-    $attrs = $GLOBALS['_TOOLBAR_I_TOGGLE_HOVER'] . ' target="_blank"';
-    return <<<EOS
-<a href="{$uri}"{$attrs}><img src="{$icon}" width="48" height="32" alt=""><br>{$label}</a>
-EOS;
+    return _toolbar_i_button($icon, $label, $uri, ' target="_blank"');
 }
 
 // }}}
@@ -99,10 +113,8 @@
  */
 function toolbar_i_showhide_button($icon, $label, $id)
 {
-    $attrs = ' onclick="return iutil.toolbarShowHide(this, event);"' . $GLOBALS['_TOOLBAR_I_TOGGLE_HOVER'];
-    return <<<EOS
-<a href="#{$id}"{$attrs}><img src="{$icon}" width="48" height="32" alt=""><br>{$label}</a>
-EOS;
+    $attrs = ' onclick="return iutil.toolbarShowHide(this, event);"';
+    return _toolbar_i_button($icon, $label, "#{$id}", $attrs);
 }
 
 // }}}
@@ -124,11 +136,11 @@
     }
 
     $fav = $info->favs[$setnum];
-    $attrs = ' onclick="return iutil.toolbarSetFavIta(this, event);"' . $GLOBALS['_TOOLBAR_I_TOGGLE_HOVER'];
+    $attrs = ' onclick="return iutil.toolbarSetFavIta(this, event);"';
     if (!$fav['set']) {
         $attrs .= ' class="inactive"';
     }
-    $query = http_build_query(array(
+    $uri = 'httpcmd.php?' . http_build_query(array(
         'cmd'       => 'setfavita',
         'host'      => $info->host,
         'bbs'       => $info->bbs,
@@ -137,9 +149,7 @@
         'setfavita' => -1,
     ), '', '&amp;');
 
-    return <<<EOS
-<a href="httpcmd.php?{$query}"{$attrs}><img src="{$icon}" width="48" height="32" alt=""><br>{$fav['title']}</a>
-EOS;
+    return _toolbar_i_button($icon, $fav['title'], $uri, $attrs);
 }
 
 // }}}
@@ -161,11 +171,11 @@
     }
 
     $fav = $info->favs[$setnum];
-    $attrs = ' onclick="return iutil.toolbarSetFav(this, event);"' . $GLOBALS['_TOOLBAR_I_TOGGLE_HOVER'];
+    $attrs = ' onclick="return iutil.toolbarSetFav(this, event);"';
     if (!$fav['set']) {
         $attrs .= ' class="inactive"';
     }
-    $query = http_build_query(array(
+    $uri = 'httpcmd.php?' . http_build_query(array(
         'cmd'       => 'setfav',
         'host'      => $info->host,
         'bbs'       => $info->bbs,
@@ -175,13 +185,120 @@
         'setfav'    => -1,
     ), '', '&amp;');
 
-    return <<<EOS
-<a href="httpcmd.php?{$query}"{$attrs}><img src="{$icon}" width="48" height="32" alt=""><br>{$fav['title']}</a>
-EOS;
+    return _toolbar_i_button($icon, $fav['title'], $uri, $attrs);
 }
 
 // }}}
+// {{{ toolbar_i_action_board_button()
 
+/**
+ * ŠO•”ƒAƒvƒŠ“™‚Ŕ‚ðŠJ‚­ƒ{ƒ^ƒ“
+ *
+ * @param string $icon
+ * @param string $label (fallback)
+ * @param ThreadList $aThreadList
+ * @return string
+ */
+function toolbar_i_action_board_button($icon, $label, ThreadList $aThreadList)
+{
+    global $_conf;
+
+    $type = _toolbar_i_client_type();
+    $pattern = $_conf["expack.tba.{$type}.board_uri"];
+    if (!$pattern) {
+        return toolbar_i_disabled_button($icon, $label);
+    }
+
+    $host = $aThreadList->host;
+    $bbs = $aThreadList->bbs;
+    $url = "http://{$host}/{$bbs}/";
+    $uri = htmlspecialchars(strtr($pattern, array(
+        '$time' => time(),
+        '$host' => rawurlencode($host),
+        '$bbs'  => rawurlencode($bbs),
+        '$url'  => $url,
+        '$eurl' => rawurlencode($url),
+    )), ENT_QUOTES, 'Shift_JIS', false);
+
+    $title = $_conf["expack.tba.{$type}.board_title"];
+    if ($title !== '') {
+        $label = htmlspecialchars($title, ENT_QUOTES, 'Shift_JIS', false);
+    }
+
+    return _toolbar_i_button($icon, $label, $uri);
+}
+
+// }}}
+// {{{ toolbar_i_action_thread_button()
+
+/**
+ * ŠO•”ƒAƒvƒŠ“™‚ŃXƒŒƒbƒh‚ðŠJ‚­ƒ{ƒ^ƒ“
+ *
+ * @param string $icon
+ * @param string $label (fallback)
+ * @param Thread $aThread
+ * @return string
+ */
+function toolbar_i_action_thread_button($icon, $label, Thread $aThread)
+{
+    global $_conf;
+
+    $type = _toolbar_i_client_type();
+    $pattern = $_conf["expack.tba.{$type}.thread_uri"];
+    if (!$pattern) {
+        return toolbar_i_disabled_button($icon, $label);
+    }
+
+    $url = $aThread->getMotoThread(true, '');
+    $uri = htmlspecialchars(strtr($pattern, array(
+        '$time' => time(),
+        '$host' => rawurlencode($aThread->host),
+        '$bbs'  => rawurlencode($aThread->bbs),
+        '$key'  => rawurlencode($aThread->key),
+        '$ls'   => rawurlencode($aThread->ls),
+        '$url'  => $url,
+        '$eurl' => rawurlencode($url),
+        '$path' => preg_replace('!^https?://!', '', $url),
+    )), ENT_QUOTES, 'Shift_JIS', false);
+
+    $title = $_conf["expack.tba.{$type}.thread_title"];
+    if ($title !== '') {
+        $label = htmlspecialchars($title, ENT_QUOTES, 'Shift_JIS', false);
+    }
+
+    return _toolbar_i_button($icon, $label, $uri);
+}
+
+// }}}
+// {{{ _toolbar_i_client_type()
+
+/**
+ * ƒNƒ‰ƒCƒAƒ“ƒg‚ÌŽí—Þ‚ð•Ô‚·
+ *
+ * @param void
+ * @return string
+ */
+function _toolbar_i_client_type()
+{
+    global $_conf;
+
+    switch ($_conf['client_type']) {
+        case 'i':
+            $type = UA::isAndroidWebKit() ? 'android' : 'iphone';
+            break;
+        case 'i':
+            $type = 'mobile';
+            break;
+        case 'pc':
+        default:
+            $type = 'other';
+    }
+
+    return $type;
+}
+
+// }}}
+
 /*
  * Local Variables:
  * mode: php

Modified: p2ex/trunk/menu_i.php
===================================================================
--- p2ex/trunk/menu_i.php	2010-08-14 14:48:44 UTC (rev 877)
+++ p2ex/trunk/menu_i.php	2010-08-14 17:55:06 UTC (rev 878)
@@ -56,9 +56,12 @@
     <link rel="apple-touch-icon" type="image/png" href="img/touch-icon/p2-serif.png" />
     <script type="text/javascript" src="iui/iui.js?<?php echo $_conf['p2_version_id']; ?>"></script>
     <script type="text/javascript" src="js/json2.js?<?php echo $_conf['p2_version_id']; ?>"></script>
+<?php if (UA::isAndroidWebKit()) { ?>
+    <script type="text/javascript">window.jsxpath = { 'useNative': false };</script>
+    <script type="text/javascript" src="js/javascript-xpath.js?<?php echo $_conf['p2_version_id']; ?>"></script>
+<?php } ?>
     <script type="text/javascript" src="js/iphone.js?<?php echo $_conf['p2_version_id']; ?>"></script>
     <script type="text/javascript" src="js/menu_i.js?<?php echo $_conf['p2_version_id']; ?>"></script>
-    <script type="text/javascript" src="js/javascript-xpath.js?<?php echo $_conf['p2_version_id']; ?>"></script>
 <?php
 // {{{ Žw’èƒTƒuƒƒjƒ…[‚ÖŽ©“®‚ňړ®
 // $hashes‚̎擾‚ª–¢ŽÀ‘•‚È‚Ì‚Å••ˆóB



P2-php-svn メーリングリストの案内
Back to archive index