GeezerVison is showing github.com — Merge branch 'p2ex-hacks' · unpush/p2-php@4153c39
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: conf/conf.inc.php +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 | // バージョン情報 | 8 | 8 | $_conf = array( | 9 | 9 | 'p2version' => '1.7.29+1.8.x', // rep2のバージョン | 10 | | - 'p2expack' => '100817.0000', // 拡張パックのバージョン | | 10 | + 'p2expack' => '100817.2020', // 拡張パックのバージョン | 11 | 11 | 'p2name' => 'expack', // rep2の名前 | 12 | 12 | 'p2custom' => 'e53c9d7', // カスタムバージョン | 13 | 13 | ); | |
Collapse file Copy file name to clipboardExpand all lines: css/iphone.css +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -298,15 +298,15 @@ div.respop { | 298 | 298 | top: 0; | 299 | 299 | left: 0; | 300 | 300 | margin: 0; | 301 | | - padding: 12px 6px 0 14px; | | 301 | + padding: 12px 0 0 14px; | 302 | 302 | } | 303 | 303 |
| 304 | 304 | div.respop > div.res { | 305 | 305 | margin: 0 0 8px 0 !important; | 306 | 306 | background-color: rgba(255, 255, 250, 0.95) !important; | 307 | 307 | border: rgba(108, 108, 108, 0.8) solid 1px !important; | 308 | | - -webkit-border-radius: 8px; | 309 | | - border-radius: 8px; | | 308 | + -webkit-border-bottom-left-radius: 8px; | | 309 | + border-bottom-left-radius: 8px; | 310 | 310 | -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; | 311 | 311 | box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; | 312 | 312 | } | |
Collapse file Copy file name to clipboardExpand all lines: js/iphone.js +40-70Lines changed: 40 additions & 70 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -255,71 +255,6 @@ iutil.setLabelAction = function(contextNode) { | 255 | 255 | } | 256 | 256 | }; | 257 | 257 |
| 258 | | -// }}} | 259 | | -// {{{ setHashScrool() | 260 | | - | 261 | | -/** | 262 | | - * ページ内リンクのクリックをスクロールにする | 263 | | - * | 264 | | - * あまり動きがよくなかったので封印。 | 265 | | - * | 266 | | - * @param {Node|String} contextNode | 267 | | - * @return void | 268 | | - */ | 269 | | -iutil.setHashScrool = function(contextNode) { | 270 | | - var anchors, anchor, targetId, targetElement, i, l, expr; | 271 | | - | 272 | | - switch (typeof contextNode) { | 273 | | - case 'string': | 274 | | - contextNode = document.getElementById(contextNode); | 275 | | - break; | 276 | | - case 'undefined': | 277 | | - contextNode = document.body; | 278 | | - break; | 279 | | - } | 280 | | - if (!contextNode) { | 281 | | - return; | 282 | | - } | 283 | | - | 284 | | - expr = './/a[starts-with(@href, "#") and (' | 285 | | - + '@href = "#header" or @href = "#footer" or @href = "#top" or @href = "#bottom"' | 286 | | - + ' or contains(concat(" ", @class, " "), " button ")' | 287 | | - + ')]'; | 288 | | - anchors = document.evaluate(expr, | 289 | | - contextNode, null, | 290 | | - XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | 291 | | - l = anchors.snapshotLength; | 292 | | - | 293 | | - for (i = 0; i < l; i++) { | 294 | | - anchor = anchors.snapshotItem(i); | 295 | | - targetId = anchor.getAttribute('href').substring(1); | 296 | | - targetElement = document.getElementById(targetId); | 297 | | - if (!targetElement) { | 298 | | - continue; | 299 | | - } | 300 | | - | 301 | | - anchor.onclick = (function (element) { | 302 | | - return function (event) { | 303 | | - var from, to, d, e, f, g; | 304 | | - | 305 | | - from = iutil.getPageY(event || window.event); | 306 | | - to = element.offsetTop; | 307 | | - d = to - from; | 308 | | - e = 30; | 309 | | - f = 30; | 310 | | - | 311 | | - for (g = 1; g < f; g++) { | 312 | | - window.setTimeout(window.scrollTo, e * g, | 313 | | - 0, from + Math.floor(d * Math.sqrt(g / f))); | 314 | | - } | 315 | | - window.setTimeout(window.scrollTo, e * g, 0, to); | 316 | | - | 317 | | - return false; | 318 | | - }; | 319 | | - })(targetElement); | 320 | | - } | 321 | | -}; | 322 | | - | 323 | 258 | // }}} | 324 | 259 | // {{{ setAccessKeys() | 325 | 260 |
| @@ -767,6 +702,42 @@ iutil.setHoverable = function(contextNode) { | 767 | 702 | }; | 768 | 703 |
| 769 | 704 | // ]}} | | 705 | +// {{{ toolbarScrollTo() | | 706 | + | | 707 | +/** | | 708 | + * ツールバーボタンでオブジェクトの位置を取得し、そこまでスクロールする | | 709 | + * | | 710 | + * @param {Element} element | | 711 | + * @param {Event} event | | 712 | + * @return {Boolean} | | 713 | + */ | | 714 | +iutil.toolbarScrollTo = function(element, event) { | | 715 | + var url, offset, id, target; | | 716 | + | | 717 | + url = element.href; | | 718 | + offset = url.indexOf('#'); | | 719 | + if (offset === -1) { | | 720 | + return true; | | 721 | + } | | 722 | + | | 723 | + iutil.stopEvent(event); | | 724 | + | | 725 | + id = url.slice(offset + 1); | | 726 | + target = document.getElementById(id); | | 727 | + if (target) { | | 728 | + offset = target.offsetTop; | | 729 | + // 1つだけ外側の要素も考慮する | | 730 | + if (target.offsetParent) { | | 731 | + offset += target.offsetParent.offsetTop; | | 732 | + } | | 733 | + // +1 はボーダー幅 | | 734 | + window.scrollTo(0, offset + 1); | | 735 | + } | | 736 | + | | 737 | + return false; | | 738 | +}; | | 739 | + | | 740 | +// }}} | 770 | 741 | // {{{ toolbarShowHide() | 771 | 742 |
| 772 | 743 | /** | @@ -784,7 +755,7 @@ iutil.toolbarShowHide = function(element, event) { | 784 | 755 | url = element.href; | 785 | 756 | offset = url.indexOf('#'); | 786 | 757 | if (offset !== -1) { | 787 | | - id = url.substring(offset + 1, url.length); | | 758 | + id = url.slice(offset + 1); | 788 | 759 | target = document.getElementById(id); | 789 | 760 | if (target) { | 790 | 761 | if (target.style.display === 'block') { | @@ -1414,13 +1385,12 @@ document.addEventListener('DOMContentLoaded', function(event) { | 1414 | 1385 | document.removeEventListener(event.type, arguments.callee, false); | 1415 | 1386 |
| 1416 | 1387 | if (typeof window.iphone_js_no_modification === 'undefined' || !window.iphone_js_no_modification) { | 1417 | | - // リンクにイベントハンドラを登録する | | 1388 | + // 外部リンクにイベントハンドラを登録する | 1418 | 1389 | iutil.modifyExternalLink(document.body); | 1419 | 1390 |
| 1420 | | - // labelにイベントハンドラを登録する | | 1391 | + // ラベルやボタンにイベントハンドラを登録する | 1421 | 1392 | if (iutil.iphone) { | 1422 | 1393 | iutil.setLabelAction(document.body); | 1423 | | - //iutil.setHashScrool(document.body); | 1424 | 1394 | iutil.setHoverable(document.body); | 1425 | 1395 | } | 1426 | 1396 |
| @@ -1440,7 +1410,7 @@ document.addEventListener('DOMContentLoaded', function(event) { | 1440 | 1410 | // ロケーションバーを隠す | 1441 | 1411 | if (typeof window.iui !== 'undefined') { | 1442 | 1412 | window.scrollTo(0, 1); | 1443 | | - } else if (!window.location.hash.length && iutil.getScrollX() < 1) { | | 1413 | + } else if (!window.location.hash.length && iutil.getScrollY() < 1) { | 1444 | 1414 | window.scrollTo(0, 1); | 1445 | 1415 | } | 1446 | 1416 | }, false); | |
Collapse file Copy file name to clipboardExpand all lines: lib/ResHist.php +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -271,8 +271,11 @@ public function showArticlesK() | 271 | 271 | $ls_q = "&ls={$lf}-"; | 272 | 272 | $footer_q = "#r{$lf}"; | 273 | 273 | } | | 274 | + if ($_conf['iphone']) { | | 275 | + $footer_q = ''; | | 276 | + } | 274 | 277 | $time = time(); | 275 | | - $href_ht = $_conf['read_php'] . "?host=" . $a_res->host . "&bbs=" . $a_res->bbs . "&key=" . $a_res->key . $ls_q . "{$_conf['k_at_a']}&nt={$time}={$footer_q}"; | | 278 | + $href_ht = $_conf['read_php'] . "?host=" . $a_res->host . "&bbs=" . $a_res->bbs . "&key=" . $a_res->key . $ls_q . "{$_conf['k_at_a']}&nt={$time}{$footer_q}"; | 276 | 279 | } | 277 | 280 |
| 278 | 281 | // 大きさ制限 | |
Collapse file Copy file name to clipboardExpand all lines: lib/read_footer_i.inc.php +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 63 | 63 | // 新着 | 64 | 64 | echo '<td>'; | 65 | 65 | if (!$aThread->diedat) { | 66 | | - $escaped_url = "{$_conf['read_php']}?{$host_bbs_key_q}&ls={$aThread->rescount}-n&nt={$newtime}{$_conf['k_at_a']}#r{$aThread->rescount}"; | | 66 | + $escaped_url = "{$_conf['read_php']}?{$host_bbs_key_q}&ls={$aThread->rescount}-n&nt={$newtime}{$_conf['k_at_a']}"; | 67 | 67 | echo toolbar_i_standard_button('img/glyphish/icons2/01-refresh.png', '新着', $escaped_url); | 68 | 68 | } else { | 69 | 69 | echo toolbar_i_disabled_button('img/glyphish/icons2/01-refresh.png', '新着'); | |
Collapse file Copy file name to clipboardExpand all lines: lib/read_header_i.inc.php -6Lines changed: 0 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 39 | 39 | $read_navi_previous_url = ''; | 40 | 40 | } else { | 41 | 41 | $read_navi_previous_url = "{$_conf['read_php']}?{$host_bbs_key_q}&ls={$before_rnum}-{$aThread->resrange['start']}n{$offline_q}{$_conf['k_at_a']}"; | 42 | | - /*if ($before_rnum != 1) { | 43 | | - $read_navi_previous_url .= "#r{$before_rnum}"; | 44 | | - }*/ | 45 | 42 | } | 46 | 43 |
| 47 | 44 | // }}} | | 62 | 59 | $read_navi_next_url = ''; | 63 | 60 | } else { | 64 | 61 | $read_navi_next_url = "{$_conf['read_php']}?{$host_bbs_key_q}&ls={$aThread->resrange['to']}-{$after_rnum}n{$offline_q}&nt={$newtime}{$_conf['k_at_a']}"; | 65 | | - if ($aThread->resrange['to'] == $aThread->rescount) { | 66 | | - $read_navi_next_url .= "#r{$aThread->rescount}"; | 67 | | - } | 68 | 62 | } | 69 | 63 |
| 70 | 64 | // }}} | |
Collapse file Copy file name to clipboardExpand all lines: lib/sb_print_k.inc.php +8-6Lines changed: 8 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -94,26 +94,26 @@ function sb_print_k($aThreadList) | 94 | 94 | $i = 0; | 95 | 95 | foreach ($aThreadList->threads as $aThread) { | 96 | 96 | $i++; | 97 | | - $midoku_ari = ""; | 98 | | - $anum_ht = ""; //#r1 | | 97 | + $midoku_ari = ''; | | 98 | + $anum_ht = ''; //#r1 | 99 | 99 | $htm = array('ita' => '', 'rnum' => '', 'unum' => '', 'sim' => ''); | 100 | 100 |
| 101 | 101 | $bbs_q = '&bbs=' . $aThread->bbs; | 102 | 102 | $key_q = '&key=' . $aThread->key; | 103 | 103 | $host_bbs_key_q = 'host=' . $aThread->host . $bbs_q . $key_q; | 104 | 104 | $offline_q = ''; | 105 | 105 |
| 106 | | - if ($aThreadList->spmode!="taborn") { | 107 | | - if (!$aThread->torder) {$aThread->torder=$i;} | | 106 | + if ($aThreadList->spmode!='taborn') { | | 107 | + if (!$aThread->torder) { | | 108 | + $aThread->torder = $i; | | 109 | + } | 108 | 110 | } | 109 | 111 |
| 110 | 112 | // 新着レス数 ============================================= | 111 | 113 | // 既得済み | 112 | 114 | if ($show_unum && $aThread->isKitoku()) { | 113 | 115 | $htm['unum'] = "{$aThread->unum}"; | 114 | 116 |
| 115 | | - $anum_ht = sprintf('#r%d', min($aThread->rescount, $aThread->rescount - $aThread->nunum + 1 - $_conf['respointer'])); | 116 | | - | 117 | 117 | // iPhone用 | 118 | 118 | if ($_conf['iphone']) { | 119 | 119 | $classunum = 'num unread'; | @@ -132,6 +132,8 @@ function sb_print_k($aThreadList) | 132 | 132 |
| 133 | 133 | $htm['unum'] = "<span class=\"{$classunum}\">{$htm['unum']}</span>"; | 134 | 134 | } else { | | 135 | + $anum_ht = sprintf('#r%d', min($aThread->rescount, $aThread->rescount - $aThread->nunum + 1 - $_conf['respointer'])); | | 136 | + | 135 | 137 | // 新着あり | 136 | 138 | if ($aThread->unum >= 1) { | 137 | 139 | $midoku_ari = true; | |
Collapse file Copy file name to clipboardExpand all lines: lib/toolbar_i.inc.php +7-2Lines changed: 7 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ function _toolbar_i_button($icon, $label, $uri, $attrs = '') | 18 | 18 | { | 19 | 19 | global $_conf; | 20 | 20 |
| 21 | | - if (strncmp($attrs, ' ', 1) === 0) { | | 21 | + if (strlen($attrs) && strncmp($attrs, ' ', 1) !== 0) { | 22 | 22 | $attrs = ' ' . $attrs; | 23 | 23 | } | 24 | 24 |
| @@ -52,7 +52,12 @@ function _toolbar_i_button($icon, $label, $uri, $attrs = '') | 52 | 52 | */ | 53 | 53 | function toolbar_i_standard_button($icon, $label, $uri) | 54 | 54 | { | 55 | | - return _toolbar_i_button($icon, $label, $uri); | | 55 | + if (strlen($uri) > 1 && strncmp($uri, '#', 1) === 0) { | | 56 | + $attrs = ' onclick="return iutil.toolbarScrollTo(this, event);"'; | | 57 | + } else { | | 58 | + $attrs = ''; | | 59 | + } | | 60 | + return _toolbar_i_button($icon, $label, $uri, $attrs); | 56 | 61 | } | 57 | 62 |
| 58 | 63 | // }}} | |
Collapse file Copy file name to clipboardExpand all lines: post.php +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 123 | 123 | $location_ht = "{$_conf['subject_php']}?host={$host}&bbs={$bbs}{$_conf['k_at_a']}"; | 124 | 124 | } else { | 125 | 125 | unset($post[$subject_k]); | 126 | | - $location_ht = "{$_conf['read_php']}?host={$host}&bbs={$bbs}&key={$key}&ls={$rescount}-&refresh=1&nt={$newtime}{$_conf['k_at_a']}#r{$rescount}"; | | 126 | + $location_ht = "{$_conf['read_php']}?host={$host}&bbs={$bbs}&key={$key}&ls={$rescount}-&refresh=1&nt={$newtime}{$_conf['k_at_a']}"; | | 127 | + if (!$_conf['iphone']) { | | 128 | + $location_ht .= "#r{$rescount}"; | | 129 | + } | 127 | 130 | } | 128 | 131 |
| 129 | 132 | if ($_POST['savedraft']) { | |
Collapse file Copy file name to clipboardExpand all lines: read_new_k.php +10-10Lines changed: 10 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -461,7 +461,7 @@ function readNew($aThread) | 461 | 461 | <h2 class="ttitle">{$aThread->ttitle_hd} {$read_header_itaj_ht}</h2> | 462 | 462 | EOP; | 463 | 463 | $read_header_ht .= '<div class="mover">'; | 464 | | - $read_header_ht .= toolbar_i_standard_button('img/gp2-down.png', '', "#ntt_bt{$newthre_num}"); | | 464 | + $read_header_ht .= toolbar_i_standard_button('img/gp2-down.png', '', sprintf('#ntt%d', $newthre_num + 1)); | 465 | 465 | $read_header_ht .= '</div>'; | 466 | 466 |
| 467 | 467 | $info_ht = P2Util::getInfoHtml(); | @@ -519,25 +519,25 @@ function readNew($aThread) | 519 | 519 | } | 520 | 520 |
| 521 | 521 | $read_footer_ht = <<<EOP | 522 | | -<div class="ntoolbar mtoolbar mtoolbar_bottom" id="ntt_bt{$newthre_num}"> | | 522 | +<div class="ntoolbar mtoolbar mtoolbar_bottom" id="ntt_btm{$newthre_num}"> | 523 | 523 | <table><tbody><tr> | 524 | 524 | EOP; | 525 | | - // ツール | | 525 | + // 情報 | 526 | 526 | $read_footer_ht .= '<td>'; | 527 | | - $escaped_url = "spm_k.php?{$host_bbs_key_q}&ls={$aThread->ls}&spm_default={$aThread->resrange['to']}&from_read_new=1{$_conf['k_at_a']}"; | 528 | | - $read_footer_ht .= toolbar_i_opentab_button('img/glyphish/icons2/20-gear2.png', '', $escaped_url); | | 527 | + $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}"; | | 528 | + $read_footer_ht .= toolbar_i_opentab_button('img/gp5-info.png', '', $escaped_url); | 529 | 529 | $read_footer_ht .= '</td>'; | 530 | 530 | // 表示範囲 | 531 | 531 | $read_footer_ht .= "<td colspan=\"3\"><span class=\"large\">{$read_range_ht}</span></td>"; | 532 | | - // 情報 | | 532 | + // ツール | 533 | 533 | $read_footer_ht .= '<td>'; | 534 | | - $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}"; | 535 | | - $read_footer_ht .= toolbar_i_opentab_button('img/gp5-info.png', '', $escaped_url); | | 534 | + $escaped_url = "spm_k.php?{$host_bbs_key_q}&ls={$aThread->ls}&spm_default={$aThread->resrange['to']}{$_conf['k_at_a']}"; | | 535 | + $read_footer_ht .= toolbar_i_opentab_button('img/glyphish/icons2/20-gear2.png', '', $escaped_url); | 536 | 536 | $read_footer_ht .= '</td>'; | 537 | 537 | // タイトル等 | 538 | 538 | $read_footer_ht .= <<<EOP | 539 | 539 | </tr></tbody></table> | 540 | | -<div class="ttitle"><a href="{$_conf['read_php']}?{$host_bbs_key_q}&offline=1&rescount={$aThread->rescount}{$_conf['k_at_a']}#r{$aThread->rescount}" target="_blank">{$aThread->ttitle_hd}</a> {$toolbar_itaj_ht}</div> | | 540 | +<div class="ttitle"><a href="{$_conf['read_php']}?{$host_bbs_key_q}&offline=1&rescount={$aThread->rescount}{$_conf['k_at_a']}" target="_blank">{$aThread->ttitle_hd}</a> {$toolbar_itaj_ht}</div> | 541 | 541 | <div class="mover"> | 542 | 542 | EOP; | 543 | 543 | $read_footer_ht .= toolbar_i_standard_button('img/gp1-up.png', '', "#ntt{$newthre_num}"); | @@ -616,7 +616,7 @@ function readNew($aThread) | 616 | 616 | echo '<p class="empty">新着レスはないぽ</p>'; | 617 | 617 | } | 618 | 618 |
| 619 | | - echo '<div class="ntoolbar" id="footer"><table><tbody><tr>'; | | 619 | + echo "<div class=\"ntoolbar\" id=\"footer\"><table id=\"ntt{$newthre_num}\"><tbody><tr>"; | 620 | 620 |
| 621 | 621 | // トップに戻る | 622 | 622 | echo '<td>'; | |
|