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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 8月 17日 (火) 07:54:11 JST


Revision: 884
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=884
Author:   rsk
Date:     2010-08-17 07:54:10 +0900 (Tue, 17 Aug 2010)

Log Message:
-----------
expack:
- rev.100817.0750.
- iPhone用ツールバーを微調整。

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/js/iphone.js
    p2ex/trunk/lib/toolbar_i.inc.php
    p2ex/trunk/read_new_k.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2010-08-16 20:04:30 UTC (rev 883)
+++ p2ex/trunk/conf/conf.inc.php	2010-08-16 22:54:10 UTC (rev 884)
@@ -7,7 +7,7 @@
 // ƒo[ƒWƒ‡ƒ“î•ñ
 $_conf = array(
     'p2version' => '1.7.29+1.8.x',  // rep2‚̃o[ƒWƒ‡ƒ“
-    'p2expack'  => '100817.0000',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
+    'p2expack'  => '100817.0750',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
     'p2name'    => 'expack',        // rep2‚Ì–¼‘O
 );
 

Modified: p2ex/trunk/js/iphone.js
===================================================================
--- p2ex/trunk/js/iphone.js	2010-08-16 20:04:30 UTC (rev 883)
+++ p2ex/trunk/js/iphone.js	2010-08-16 22:54:10 UTC (rev 884)
@@ -256,71 +256,6 @@
 };
 
 // }}}
-// {{{ setHashScrool()
-
-/**
- * ƒy[ƒW“àƒŠƒ“ƒN‚̃NƒŠƒbƒN‚ðƒXƒNƒ[ƒ‹‚É‚·‚é
- *
- * ‚ ‚Ü‚è“®‚«‚ª‚æ‚­‚È‚©‚Á‚½‚Ì‚Å••ˆóB
- *
- * @param {Node|String} contextNode
- * @return void
- */
-iutil.setHashScrool = function(contextNode) {
-	var anchors, anchor, targetId, targetElement, i, l, expr;
-
-	switch (typeof contextNode) {
-		case 'string':
-			contextNode = document.getElementById(contextNode);
-			break;
-		case 'undefined':
-			contextNode = document.body;
-			break;
-	}
-	if (!contextNode) {
-		return;
-	}
-
-	expr = './/a[starts-with(@href, "#") and ('
-		+ '@href = "#header" or @href = "#footer" or @href = "#top" or @href = "#bottom"'
-		+ ' or contains(concat(" ", @class, " "), " button ")'
-		+ ')]';
-	anchors = document.evaluate(expr,
-	                            contextNode, null,
-	                            XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
-	l = anchors.snapshotLength;
-
-	for (i = 0; i < l; i++) {
-		anchor = anchors.snapshotItem(i);
-		targetId = anchor.getAttribute('href').substring(1);
-		targetElement = document.getElementById(targetId);
-		if (!targetElement) {
-			continue;
-		}
-
-		anchor.onclick = (function (element) {
-			return function (event) {
-				var from, to, d, e, f, g;
-
-				from = iutil.getPageY(event || window.event);
-				to = element.offsetTop;
-				d = to - from;
-				e = 30;
-				f = 30;
-
-				for (g = 1; g < f; g++) {
-					window.setTimeout(window.scrollTo, e * g,
-						0, from + Math.floor(d * Math.sqrt(g / f)));
-				}
-				window.setTimeout(window.scrollTo, e * g, 0, to);
-
-				return false;
-			};
-		})(targetElement);
-	}
-};
-
-// }}}
 // {{{ setAccessKeys()
 
 /**
@@ -767,6 +702,36 @@
 };
 
 // ]}}
+// {{{ toolbarScrollTo()
+
+/**
+ * ƒc[ƒ‹ƒo[ƒ{ƒ^ƒ“‚ŃIƒuƒWƒFƒNƒg‚̈ʒu‚ðŽæ“¾‚µA‚»‚±‚܂ŃXƒNƒ[ƒ‹‚·‚é
+ *
+ * @param {Element} element
+ * @param {Event} event
+ * @return {Boolean}
+ */
+iutil.toolbarScrollTo = function(element, event) {
+	var url, offset, id, target;
+
+	url = element.href;
+	offset = url.indexOf('#');
+	if (offset === -1) {
+		return true;
+	}
+
+	iutil.stopEvent(event);
+
+	id = url.slice(offset + 1);
+	target = document.getElementById(id);
+	if (target) {
+		window.scrollTo(0, target.offsetTop + 1);
+	}
+
+	return false;
+};
+
+// }}}
 // {{{ toolbarShowHide()
 
 /**
@@ -784,7 +749,7 @@
 	url = element.href;
 	offset = url.indexOf('#');
 	if (offset !== -1) {
-		id = url.substring(offset + 1, url.length);
+		id = url.slice(offset + 1);
 		target = document.getElementById(id);
 		if (target) {
 			if (target.style.display === 'block') {
@@ -1420,7 +1385,6 @@
 		// ƒ‰ƒxƒ‹‚âƒ{ƒ^ƒ“‚ɃCƒxƒ“ƒgƒnƒ“ƒhƒ‰‚ð“o˜^‚·‚é
 		if (iutil.iphone) {
 			iutil.setLabelAction(document.body);
-			//iutil.setHashScrool(document.body);
 			iutil.setHoverable(document.body);
 		}
 

Modified: p2ex/trunk/lib/toolbar_i.inc.php
===================================================================
--- p2ex/trunk/lib/toolbar_i.inc.php	2010-08-16 20:04:30 UTC (rev 883)
+++ p2ex/trunk/lib/toolbar_i.inc.php	2010-08-16 22:54:10 UTC (rev 884)
@@ -18,7 +18,7 @@
 {
     global $_conf;
 
-    if (strncmp($attrs, ' ', 1) === 0) {
+    if (strlen($attrs) && strncmp($attrs, ' ', 1) !== 0) {
         $attrs = ' ' . $attrs;
     }
 
@@ -52,7 +52,12 @@
  */
 function toolbar_i_standard_button($icon, $label, $uri)
 {
-    return _toolbar_i_button($icon, $label, $uri);
+    if (strlen($uri) > 1 && strncmp($uri, '#', 1) === 0) {
+        $attrs = ' onclick="return iutil.toolbarScrollTo(this, event);"';
+    } else {
+        $attrs = '';
+    }
+    return _toolbar_i_button($icon, $label, $uri, $attrs);
 }
 
 // }}}

Modified: p2ex/trunk/read_new_k.php
===================================================================
--- p2ex/trunk/read_new_k.php	2010-08-16 20:04:30 UTC (rev 883)
+++ p2ex/trunk/read_new_k.php	2010-08-16 22:54:10 UTC (rev 884)
@@ -519,18 +519,18 @@
 <div class="ntoolbar mtoolbar mtoolbar_bottom" id="ntt_bt{$newthre_num}">
 <table><tbody><tr>
 EOP;
+        // î•ñ
+        $read_footer_ht .= '<td>';
+        $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}";
+        $read_footer_ht .= toolbar_i_opentab_button('img/gp5-info.png', '', $escaped_url);
+        $read_footer_ht .= '</td>';
         // ƒc[ƒ‹
         $read_footer_ht .= '<td>';
-        $escaped_url = "spm_k.php?{$host_bbs_key_q}&amp;ls={$aThread->ls}&amp;spm_default={$aThread->resrange['to']}&amp;from_read_new=1{$_conf['k_at_a']}";
+        $escaped_url = "spm_k.php?{$host_bbs_key_q}&amp;ls={$aThread->ls}&amp;spm_default={$aThread->resrange['to']}{$_conf['k_at_a']}";
         $read_footer_ht .= toolbar_i_opentab_button('img/glyphish/icons2/20-gear2.png', '', $escaped_url);
         $read_footer_ht .= '</td>';
         // •\Ž¦”͈Í
         $read_footer_ht .= "<td colspan=\"3\"><span class=\"large\">{$read_range_ht}</span></td>";
-        // î•ñ
-        $read_footer_ht .= '<td>';
-        $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}";
-        $read_footer_ht .= toolbar_i_opentab_button('img/gp5-info.png', '', $escaped_url);
-        $read_footer_ht .= '</td>';
         // ƒ^ƒCƒgƒ‹“™
         $read_footer_ht .= <<<EOP
 </tr></tbody></table>



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