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£pbNÌo[W + 'p2expack' => '100815.0200', // g£pbNÌ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ÉZbg¼îñðL^·ét@CÌpX $_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 - iPhonep[UúÝè */ -// {{{ subject-i (Xê) +// {{{ c[o[ANV -// ¨¢ð¦·CWP[^[ð\¦ (·é:1, µÈ¢:0) -$conf_user_def['iphone.subject.indicate-speed'] = 0; // (0) -$conf_user_rad['iphone.subject.indicate-speed'] = array('1' => '·é', '0' => 'µÈ¢'); +// iPhonepXbhêc[o[ANVÌURI +$conf_user_def['expack.tba.iphone.board_uri'] = ""; // ("") -// CWP[^[Ì (pixels) -$conf_user_def['iphone.subject.speed.width'] = 10; // (10) -$conf_user_rules['iphone.subject.speed.width'] = array('notIntExceptMinusToDef'); +// iPhonepXbhêc[o[ANVÌ^Cg +$conf_user_def['expack.tba.iphone.board_title'] = ""; // ("") -// CWP[^[ÌF (1X/ú¢) -$conf_user_def['iphone.subject.speed.0rpd'] = "#eeeeee"; // ("#eeeeee") -$conf_user_rules['iphone.subject.speed.0rpd'] = array('notCssColorToDef'); +// iPhonepXbhêc[o[ANVÌURI +$conf_user_def['expack.tba.iphone.thread_uri'] = ""; // ("") -// CWP[^[ÌF (1X/úÈã) -$conf_user_def['iphone.subject.speed.1rpd'] = "#ffcccc"; // ("#ffcccc") -$conf_user_rules['iphone.subject.speed.1rpd'] = array('notCssColorToDef'); +// iPhonepXbhàec[o[ANVÌ^Cg +$conf_user_def['expack.tba.iphone.thread_title'] = ""; // ("") -// CWP[^[ÌF (10X/úÈã) -$conf_user_def['iphone.subject.speed.10rpd'] = "#ff9999"; // ("#ff9999") -$conf_user_rules['iphone.subject.speed.10rpd'] = array('notCssColorToDef'); +// AndroidpXbhêc[o[ANVÌURI +$conf_user_def['expack.tba.android.board_uri'] = ""; // ("") -// CWP[^[ÌF (100X/úÈã) -$conf_user_def['iphone.subject.speed.100rpd'] = "#ff6666"; // ("#ff6666") -$conf_user_rules['iphone.subject.speed.100rpd'] = array('notCssColorToDef'); +// AndroidpXbhêc[o[ANVÌ^Cg +$conf_user_def['expack.tba.android.board_title'] = ""; // ("") -// CWP[^[ÌF (1000X/úÈã) -$conf_user_def['iphone.subject.speed.1000rpd'] = "#ff3333"; // ("#ff3333") -$conf_user_rules['iphone.subject.speed.1000rpd'] = array('notCssColorToDef'); +// AndroidpXbhàec[o[ANVÌURI +$conf_user_def['expack.tba.android.thread_uri'] = ""; // ("") -// CWP[^[ÌF (10000X/úÈã) -$conf_user_def['iphone.subject.speed.10000rpd'] = "#ff0000"; // ("#ff0000") -$conf_user_rules['iphone.subject.speed.10000rpd'] = array('notCssColorToDef'); +// AndroidpXbhàec[o[ANVÌ^Cg +$conf_user_def['expack.tba.android.thread_title'] = ""; // ("") -// }}} -// {{{ read-i (Xàe) +// gÑpXbhêc[o[ANVÌURI +$conf_user_def['expack.tba.mobile.board_uri'] = ""; // ("") +// gÑpXbhêc[o[ANVÌ^Cg +$conf_user_def['expack.tba.mobile.board_title'] = ""; // ("") +// gÑpXbhàec[o[ANVÌURI +$conf_user_def['expack.tba.mobile.thread_uri'] = ""; // ("") + +// gÑpXbhàec[o[ANVÌ^Cg +$conf_user_def['expack.tba.mobile.thread_title'] = ""; // ("") + +// PCpXbhêc[o[ANVÌURI +$conf_user_def['expack.tba.other.board_uri'] = ""; // ("") + +// PCpXbhêc[o[ANVÌ^Cg +$conf_user_def['expack.tba.other.board_title'] = ""; // ("") + +// PCpXbhàec[o[ANVÌURI +$conf_user_def['expack.tba.other.thread_uri'] = ""; // ("") + +// PCpXbhàec[o[ANVÌ^Cg +$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', '¨¢ð¦·CWP[^[ð\¦'), - array('iphone.subject.speed.width', 'CWP[^[Ì (pixels)'), - array('iphone.subject.speed.0rpd', 'CWP[^[ÌF (1X/ú¢)'), - array('iphone.subject.speed.1rpd', 'CWP[^[ÌF (1X/úÈã)'), - array('iphone.subject.speed.10rpd', 'CWP[^[ÌF (10X/úÈã)'), - array('iphone.subject.speed.100rpd', 'CWP[^[ÌF (100X/úÈã)'), - array('iphone.subject.speed.1000rpd', 'CWP[^[ÌF (1000X/úÈã)'), - array('iphone.subject.speed.10000rpd', 'CWP[^[ÌF (10000X/úÈã)'), ); printEditConfGroupHtml($groupname, $conflist, $flags); } - +*/ // }}} // {{{ iPhone - read /* @@ -694,7 +686,77 @@ } // }}} +// {{{ expack - c[o[ANV + +$groupname = 'c[o[ANV'; +$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>^CX^v</td></tr> +<tr><td>\$host</td><td>zXg¼</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[^ÍURLGR[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>^CX^v</td></tr> +<tr><td>\$host</td><td>zXg¼</td></tr> +<tr><td>\$bbs</td><td>¼</td></tr> +<tr><td>\$key</td><td>XbhL[</td></tr> +<tr><td>\$ls</td><td>\¦ÍÍ</td></tr> +<tr><td>\$url</td><td>XbhÌ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[^ÍURLGR[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ê/^Cg<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/^Cg<br>á) BB2C'), + array('expack.tba.android.board_uri', 'Android/Xê/URI', P2_EDIT_CONF_USER_LONGTEXT), + array('expack.tba.android.board_title', 'Android/Xê/^Cg'), + array('expack.tba.android.thread_uri', 'Android/Xàe/URI', P2_EDIT_CONF_USER_LONGTEXT), + array('expack.tba.android.thread_title', 'Android/Xàe/^Cg'), + array('expack.tba.mobile.board_uri', 'gÑ/Xê/URI', P2_EDIT_CONF_USER_LONGTEXT), + array('expack.tba.mobile.board_title', 'gÑ/Xê/^Cg'), + array('expack.tba.mobile.thread_uri', 'gÑ/Xàe/URI', P2_EDIT_CONF_USER_LONGTEXT), + array('expack.tba.mobile.thread_title', 'gÑ/Xàe/^Cg'), + array('expack.tba.other.board_uri', 'PC/Xê/URI', P2_EDIT_CONF_USER_LONGTEXT), + array('expack.tba.other.board_title', 'PC/Xê/^Cg'), + array('expack.tba.other.thread_uri', 'PC/Xàe/URI', P2_EDIT_CONF_USER_LONGTEXT), + array('expack.tba.other.thread_title', 'PC/Xàe/^Cg'), + ); + printEditConfGroupHtml($groupname, $conflist, $flags); + unset($_tba_board_uri_description, $_tba_thread_uri_description); +} + // }}} +// }}} // PCp\¦ 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 @@ // gbvÉßé 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>'; +// ANV +echo '<td>', toolbar_i_action_board_button('img/glyphish/icons2/12-eye.png', 'ANV', $aThreadList), '</td>'; // Vµ¢Xbhð§Äé 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^CV[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[eBeBiiPhonej */ -$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, ), '', '&'); - 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, ), '', '&'); - 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() +/** + * OAvÅÂð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() + +/** + * OAvÅXbhð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() + +/** + * NCAgÌíÞðÔ· + * + * @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èTuj [Ö©®ÅÚ® // $hashesÌ澪¢ÀÈÌÅóB