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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 8月 19日 (木) 02:50:22 JST


Revision: 889
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=889
Author:   rsk
Date:     2010-08-19 02:50:22 +0900 (Thu, 19 Aug 2010)

Log Message:
-----------
expack:
- ImageCache2のiPhone用JavaScriptをリファクタリング。
- ImageCache2の新機能のための設定項目を追加。(未実装)

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/conf/conf_admin_ex.inc.php
    p2ex/trunk/iv2.php
    p2ex/trunk/js/iv2_iphone.js
    p2ex/trunk/lib/expack/ic2/templates/iv2.tpl.html
    p2ex/trunk/lib/expack/ic2/templates/iv2a.tpl.html
    p2ex/trunk/lib/expack/ic2/templates/iv2ip.tpl.html
    p2ex/trunk/lib/expack/ic2/templates/iv2m.tpl.html
    p2ex/trunk/lib/sb_header.inc.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/conf/conf.inc.php	2010-08-18 17:50:22 UTC (rev 889)
@@ -15,6 +15,8 @@
 
 define('P2_VERSION_ID', sprintf('%u', crc32($_conf['p2ua'])));
 
+$_conf['jquery_version'] = '1.4.2';
+
 /*
  * ’ʏí‚̓ZƒbƒVƒ‡ƒ“ƒtƒ@ƒCƒ‹‚̃ƒbƒN‘Ò‚¿‚ð‹É—Í’Z‚­‚·‚邽‚ß
  * ƒ†[ƒU[”FØŒã‚·‚®‚ɃZƒbƒVƒ‡ƒ“•Ï”‚̕ύX‚ðƒRƒ~ƒbƒg‚·‚éB

Modified: p2ex/trunk/conf/conf_admin_ex.inc.php
===================================================================
--- p2ex/trunk/conf/conf_admin_ex.inc.php	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/conf/conf_admin_ex.inc.php	2010-08-18 17:50:22 UTC (rev 889)
@@ -107,6 +107,11 @@
 // ˆêŽž“I‚ÈON/OFF‚̐ؑփtƒ‰ƒO‚ð•Û‘¶‚·‚éƒtƒ@ƒCƒ‹‚̃pƒX
 $_conf['expack.ic2.switch_path'] = $_conf['pref_dir'] . '/ic2_switch.txt';
 
+// ƒLƒƒƒbƒVƒ…‚µ‚Ä‚¢‚é‰æ‘œ‚ðzip‚ł܂Ƃ߂ă_ƒEƒ“ƒ[ƒhioff:0, on:1j
+// PC”ł̉摜ƒLƒƒƒbƒVƒ…ˆê——‚©‚ç‚Ì‚Ý—˜—p‚Å‚«‚éB
+// zipƒGƒNƒXƒeƒ“ƒVƒ‡ƒ“‚ª•K—vB
+$_conf['expack.ic2.zip'] = 0; // (0)
+
 // }}}
 // {{{ AAS
 

Modified: p2ex/trunk/iv2.php
===================================================================
--- p2ex/trunk/iv2.php	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/iv2.php	2010-08-18 17:50:22 UTC (rev 889)
@@ -16,6 +16,14 @@
     p2die('ImageCache2‚Í–³Œø‚Å‚·B', 'conf/conf_admin_ex.inc.php ‚̐ݒè‚ð•Ï‚¦‚Ä‚­‚¾‚³‚¢B');
 }
 
+$enable_zip = false;
+if (!$_conf['ktai'] && $_conf['expack.ic2.zip']) {
+    if (!extension_loaded('zip')) {
+        p2die('zip Šg’£ƒ‚ƒWƒ…[ƒ‹‚ªƒ[ƒh‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB');
+    }
+    $enable_zip = true;
+}
+
 if ($_conf['iphone']) {
     $_conf['extra_headers_ht'] .= <<<EOP
 \n<link rel="stylesheet" type="text/css" href="css/ic2_iphone.css?{$_conf['p2_version_id']}">
@@ -940,6 +948,11 @@
 $flexy->setData('page', $page);
 $flexy->setData('move', $qfObj);
 $flexy->setData('lightbox', $lightbox);
+if ($enable_zip) {
+    $flexy->setData('jquery', $_conf['jquery_version']);
+} else {
+    $flexy->setData('jquery', null);
+}
 
 // ƒy[ƒW‚ð•\Ž¦
 P2Util::header_nocache();
@@ -992,8 +1005,6 @@
     $thumb_height = (int)$ini['Thumb1']['height'];
     $flexy->setData('thumb_width', $thumb_width);
     $flexy->setData('thumb_height', $thumb_height);
-    $flexy->setData('title_width_v', 320 - (10 * 2) - $thumb_width);
-    $flexy->setData('title_width_h', 480 - (10 * 2) - $thumb_width);
     $flexy->setData('info_vertical', $thumb_width > 80);
     $flexy->setData('limelight_header', $limelight_header);
     $flexy->output();

Modified: p2ex/trunk/js/iv2_iphone.js
===================================================================
--- p2ex/trunk/js/iv2_iphone.js	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/js/iv2_iphone.js	2010-08-18 17:50:22 UTC (rev 889)
@@ -5,47 +5,42 @@
 // {{{ DOMContentLoaded
 
 document.addEventListener('DOMContentLoaded', function(event) {
-	var styleSheets, commonStyle, landscapeStyle, portraitStyle;
+	var table, css, cells, adjust, width1, width2, rules, index1, index2, callback;
 
 	document.removeEventListener(event.type, arguments.callee, false);
 
-	styleSheets    = document.styleSheets;
-	commonStyle    = styleSheets[styleSheets.length - 3];
-	landscapeStyle = styleSheets[styleSheets.length - 2];
-	portraitStyle  = styleSheets[styleSheets.length - 1];
+	table = document.getElementById('iv2-images');
+	if (!table) {
+		return;
+	}
 
-	if (typeof window.orientation != 'undefined') {
-		var resize_image_table = function() {
-			if (window.orientation % 180 == 0) {
-				portraitStyle.disabled = false;
-				landscapeStyle.disabled = true;
-			} else {
-				landscapeStyle.disabled = false;
-				portraitStyle.disabled = true;
-			}
-		};
+	css = document.styleSheets[document.styleSheets.length - 1];
+	cells = table.getElementsByTagName('td');
+	width1 = document.body.clientWidth;
+	width2 = 0;
+	rules = css.cssRules;
+	index1 = rules.length;
+	index2 = rules.length + 1;
 
-		// ƒe[ƒuƒ‹‚Ì‘å‚«‚³‚𒲐®
-		resize_image_table();
+	css.insertRule('table#iv2-images { width: ' + width1 + 'px; }', index1);
+	if (cells && cells.length) {
+		width2 = cells[0].clientWidth + 20;
+		css.insertRule('div.iv2-image-title { width: ' + (width1 - width2) + 'px; }', index2);
+	}
 
-		// ‰ñ“]Žž‚̃Cƒxƒ“ƒgƒnƒ“ƒhƒ‰‚ð’ljÁ
-		document.body.addEventListener('orientationchange', resize_image_table, false);
-	} else {
-		// ‰ñ“]‚ðƒTƒ|[ƒg‚µ‚È‚¢ƒuƒ‰ƒEƒU
-		var table = document.getElementById('iv2-images');
-		if (table) {
-			var width = document.body.clientWidth;
-			var cells = table.getElementsByTagName('td');
+	callback = function() {
+		var width = document.body.clientWidth;
 
-			commonStyle.insertRule('table#iv2-images { width: ' + width + 'px; }');
-			if (cells && cells.length) {
-				width -= (cells[0].clientWidth + 20);
-				commonStyle.insertRule('div.iv2-image-title { width: ' + width + 'px; }');
-			}
+		rules[index1].style.width = width + 'px';
+		if (width2) {
+			rules[index2].style.width = (width - width2) + 'px';
 		}
+	};
 
-		landscapeStyle.disabled = true;
-		portraitStyle.disabled = true;
+	if (typeof window.orientation === 'number') {
+		window.addEventListener('orientationchange', callback, false);
+	} else {
+		window.addEventListener('resize', callback, false);
 	}
 }, false);
 

Modified: p2ex/trunk/lib/expack/ic2/templates/iv2.tpl.html
===================================================================
--- p2ex/trunk/lib/expack/ic2/templates/iv2.tpl.html	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/lib/expack/ic2/templates/iv2.tpl.html	2010-08-18 17:50:22 UTC (rev 889)
@@ -12,6 +12,7 @@
 	<link rel="stylesheet" type="text/css" href="css.php?css=style&amp;skin={skin}" />
 	<link rel="stylesheet" type="text/css" href="css.php?css=read&amp;skin={skin}" />
 	<link rel="stylesheet" type="text/css" href="css.php?css=iv2&amp;skin={skin}" />
+	<script type="text/javascript" src="js/jquery-{jquery:h}.min.js" flexy:if="jquery"></script>
 	<script type="text/javascript" src="js/basic.js?{p2vid:h}"></script>
 	<script type="text/javascript" src="js/json2.js?{p2vid:h}"></script>
 	<script type="text/javascript" src="js/ic2_getinfo.js?{p2vid:h}"></script>

Modified: p2ex/trunk/lib/expack/ic2/templates/iv2a.tpl.html
===================================================================
--- p2ex/trunk/lib/expack/ic2/templates/iv2a.tpl.html	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/lib/expack/ic2/templates/iv2a.tpl.html	2010-08-18 17:50:22 UTC (rev 889)
@@ -12,6 +12,7 @@
 	<link rel="stylesheet" type="text/css" href="css.php?css=style&amp;skin={skin}" />
 	<link rel="stylesheet" type="text/css" href="css.php?css=read&amp;skin={skin}" />
 	<link rel="stylesheet" type="text/css" href="css.php?css=iv2&amp;skin={skin}" />
+	<script type="text/javascript" src="js/jquery-{jquery:h}.min.js" flexy:if="jquery"></script>
 	<script type="text/javascript" src="js/basic.js?{p2vid:h}"></script>
 	<script type="text/javascript" src="js/json2.js?{p2vid:h}"></script>
 	<script type="text/javascript" src="js/ic2_getinfo.js?{p2vid:h}"></script>

Modified: p2ex/trunk/lib/expack/ic2/templates/iv2ip.tpl.html
===================================================================
--- p2ex/trunk/lib/expack/ic2/templates/iv2ip.tpl.html	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/lib/expack/ic2/templates/iv2ip.tpl.html	2010-08-18 17:50:22 UTC (rev 889)
@@ -17,26 +17,6 @@
 }
 	/* ]]> */
 	</style>
-	<style type="text/css" media="only screen and (max-device-height: 480px)">
-	/* <![CDATA[ */
-table#iv2-images {
-	width: 480px;
-}
-div.iv2-image-title {
-	width: {title_width_h:h}px;
-}
-	/* ]]> */
-	</style>
-	<style type="text/css" media="only screen and (max-device-width: 320px)">
-	/* <![CDATA[ */
-table#iv2-images {
-	width: 320px;
-}
-div.iv2-image-title {
-	width: {title_width_v:h}px;
-}
-	/* ]]> */
-	</style>
 </head>
 <body>
 <h1>{title}</h1>

Modified: p2ex/trunk/lib/expack/ic2/templates/iv2m.tpl.html
===================================================================
--- p2ex/trunk/lib/expack/ic2/templates/iv2m.tpl.html	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/lib/expack/ic2/templates/iv2m.tpl.html	2010-08-18 17:50:22 UTC (rev 889)
@@ -11,6 +11,7 @@
 	<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
 	<link rel="stylesheet" type="text/css" href="css.php?css=style&amp;skin={skin}" />
 	<link rel="stylesheet" type="text/css" href="css.php?css=iv2&amp;skin={skin}" />
+	<script type="text/javascript" src="js/jquery-{jquery:h}.min.js" flexy:if="jquery"></script>
 	<script type="text/javascript" src="js/basic.js?{p2vid:h}"></script>
 	<script type="text/javascript" src="js/json2.js?{p2vid:h}"></script>
 	<script type="text/javascript" src="js/ic2_getinfo.js?{p2vid:h}"></script>

Modified: p2ex/trunk/lib/sb_header.inc.php
===================================================================
--- p2ex/trunk/lib/sb_header.inc.php	2010-08-18 08:03:36 UTC (rev 888)
+++ p2ex/trunk/lib/sb_header.inc.php	2010-08-18 17:50:22 UTC (rev 889)
@@ -210,7 +210,7 @@
     <script type="text/javascript" src="js/delelog.js?{$_conf['p2_version_id']}"></script>
     <script type="text/javascript" src="js/respopup.js?{$_conf['p2_version_id']}"></script>
     <script type="text/javascript" src="js/motolspopup.js?{$_conf['p2_version_id']}"></script>
-    <script type="text/javascript" src="js/jquery-1.4.2.min.js?{$_conf['p2_version_id']}"></script>
+    <script type="text/javascript" src="js/jquery-{$_conf['jquery_version']}.min.js"></script>
     <script type="text/javascript">
     //<![CDATA[
     rep2.subject.properties = {



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