From: itozyun Date: Tue, 28 Apr 2015 09:49:05 +0000 (+0900) Subject: Version 0.6.143, fix X.UI.ScrollBox for iOS3. X-Git-Url: http://git.osdn.jp/view?p=pettanr%2FclientJs.git;a=commitdiff_plain;h=0660e56af40d5df36e49c7a2deb7ec7e6638df98 Version 0.6.143, fix X.UI.ScrollBox for iOS3. --- diff --git a/0.6.x/js/01_core/00_builtin.js b/0.6.x/js/01_core/00_builtin.js index 8a8f073..b5cb1cb 100644 --- a/0.6.x/js/01_core/00_builtin.js +++ b/0.6.x/js/01_core/00_builtin.js @@ -173,7 +173,7 @@ DecodeURI=function(str){ }; */ -/* 正規表現が使われているため、まだ投入しない itozyun +/* 正規表現が使われているため、まだ投入しない itozyun*/ window.encodeURI || (window.encodeURI = function (x) { return ("" + x).replace(/[^!#$&-;=?-Z_a-z~]/g, function (s) { var c = s.charCodeAt(0), p = "%"; @@ -209,7 +209,7 @@ window.decodeURI || (window.decodeURI = function (x) { ); }); }); -*/ + //window.decodeURIComponent || (window.decodeURIComponent = window.decodeURI); diff --git a/0.6.x/js/01_core/01_X.js b/0.6.x/js/01_core/01_X.js index 5b76024..92cc634 100644 --- a/0.6.x/js/01_core/01_X.js +++ b/0.6.x/js/01_core/01_X.js @@ -84,7 +84,7 @@ var undefined, /** * バージョン文字列:"0.6.123" * @type {string} */ -X[ 'VERSION' ] = '0.6.127'; +X[ 'VERSION' ] = '0.6.143'; /** * ブートタイム ms diff --git a/0.6.x/js/01_core/02_XUA.js b/0.6.x/js/01_core/02_XUA.js index 52da87e..8c1d839 100644 --- a/0.6.x/js/01_core/02_XUA.js +++ b/0.6.x/js/01_core/02_XUA.js @@ -4,7 +4,7 @@ // ------------------------------------------------------------------------- // /** - * UserAgent の関する定数を保持する。 + * UserAgent に関する定数を保持する。 * @namespace X.UA * @alias X.UA * @type {object} diff --git a/0.6.x/js/01_core/14_XTimer.js b/0.6.x/js/01_core/14_XTimer.js index 48b27a3..741d12c 100644 --- a/0.6.x/js/01_core/14_XTimer.js +++ b/0.6.x/js/01_core/14_XTimer.js @@ -407,6 +407,7 @@ if( X_UA[ 'iOS' ] ){ X_Timer_timeStamp = now; X_Timer_waitTime = last / X_Timer_INTERVAL_TIME | 0; }; + X_ViewPort[ 'getScrollPosition' ](); // X_DomEvent のための X_ViewPort_scrollX & Y の更新、 }); }; diff --git a/0.6.x/js/01_core/16_XViewPort.js b/0.6.x/js/01_core/16_XViewPort.js index b970452..2ed34f4 100644 --- a/0.6.x/js/01_core/16_XViewPort.js +++ b/0.6.x/js/01_core/16_XViewPort.js @@ -5,6 +5,8 @@ var X_ViewPort_readyState, X_ViewPort_lock, X_ViewPort_width, X_ViewPort_height, + X_ViewPort_scrollX = 0, + X_ViewPort_scrollY = 0, X_ViewPort_baseFontSize, X_ViewPort_vScrollbarSize, X_ViewPort_hScrollbarSize, @@ -169,17 +171,17 @@ X[ 'ViewPort' ] = { window.pageXOffset !== undefined ? ( function(){ X_Node_updateTimerID && X_Node_startUpdate(); - return[ window.pageXOffset, window.pageYOffset ]; + return[ X_ViewPort_scrollX = window.pageXOffset, X_ViewPort_scrollY = window.pageYOffset ]; } ) : window.scrollLeft !== undefined ? ( function(){ X_Node_updateTimerID && X_Node_startUpdate(); - return[ window.scrollLeft, window.scrollTop ]; + return[ X_ViewPort_scrollX = window.scrollLeft, X_ViewPort_scrollY = window.scrollTop ]; } ) : ( function(){ X_Node_updateTimerID && X_Node_startUpdate(); // body は Safari2- - return[ X_ViewPort_rootElement.scrollLeft || document.body.scrollLeft, X_ViewPort_rootElement.scrollTop || document.body.scrollTop ]; + return[ X_ViewPort_scrollX = X_ViewPort_rootElement.scrollLeft || document.body.scrollLeft, X_ViewPort_scrollY = X_ViewPort_rootElement.scrollTop || document.body.scrollTop ]; } ), 'getScrollbarSize' : function(){ diff --git a/0.6.x/js/02_dom/03_XDomEvent.js b/0.6.x/js/02_dom/03_XDomEvent.js index bcfe934..a58bead 100644 --- a/0.6.x/js/02_dom/03_XDomEvent.js +++ b/0.6.x/js/02_dom/03_XDomEvent.js @@ -133,17 +133,17 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){ 'isPrimary' : true, 'hwTimestamp' : time, 'timestamp' : time, - 'button' : e.button, - 'buttons' : e.buttons || e.button, + 'button' : /*e.button ||*/ ( force ? 0 : -1 ), + 'buttons' : /*e.buttons || e.button ||*/ ( force ? 1 : 0 ), 'altKey' : altKey, 'ctrlKey' : ctrlKey, 'metaKey' : metaKey, 'shiftKey' : shiftKey, - 'pointerId' : touch.identifier + 2, + 'pointerId' : touch.identifier + 2, // iOS4 は 変換が必要! //screenX : touch.screenX, //screenY : touch.screenY, - 'clientX' : touch.clientX, - 'clientY' : touch.clientY, + 'clientX' : touch.clientX || ( touch.pageX - X_ViewPort_scrollX ), // iOS4以下は clientX が undefined, コードでは入れ子のスクロールに対応できない + 'clientY' : touch.clientY || ( touch.pageY - X_ViewPort_scrollY ), 'pageX' : touch.pageX, 'pageY' : touch.pageY, 'offsetX' : touch.offsetX, // 要素上の座標を取得 @@ -155,6 +155,7 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){ 'width' : touch.width || 0, 'height' : touch.height || 0 }; + console.log( 'e.pointerId = ' + touch.identifier ); }; return events.length === 1 ? events[ 0 ] : events; } else { diff --git a/0.6.x/js/02_dom/09_XHTMLParser.js b/0.6.x/js/02_dom/09_XHTMLParser.js index 764ce5f..c23bfe3 100644 --- a/0.6.x/js/02_dom/09_XHTMLParser.js +++ b/0.6.x/js/02_dom/09_XHTMLParser.js @@ -20,7 +20,7 @@ var X_HTMLParser_CHARS = { X_HTMLParser_block = {'ADDRESS':1,'APPLET':1,'BLOCKQUOTE':1,'BUTTON':1,'CENTER':1,'DD':1,'DEL':1,'DIR':1,'DIV':1,'DL':1,'DT':1,'FIELDSET':1,'FORM':1,'FRAMESET':1,'HR':1,'IFRAME':1,'INS':1, 'ISINDEX':1,'LI':1,'MAP':1,'MENU':1,'NOFRAMES':1,'NOSCRIPT':1,'OBJECT':1,'OL':1,'P':1,'PRE':1,'SCRIPT':1,'TABLE':1,'TBODY':1,'TD':1,'TFOOT':1,'TH':1,'THEAD':1,'TR':1,'UL':1 }, // Inline Elements - HTML 4.01 - X_HTMLParser_inline = {'A':1,'ABBR':1,'ACRONYM':1,'APPLET':1,'B':1,'BASEFONT':1,'BDO':1,'BIG':1,'BR':1,'BUTTON':1,'CITE':1,'CODE':1,'DEL':1,'DFN':1,'EM':1,'FONT':1,'I':1,'IFRAME':1,'IMG':1, + X_HTMLParser_inline = {/*'A':1,*/'ABBR':1,'ACRONYM':1,'APPLET':1,'B':1,'BASEFONT':1,'BDO':1,'BIG':1,'BR':1,'BUTTON':1,'CITE':1,'CODE':1,'DEL':1,'DFN':1,'EM':1,'FONT':1,'I':1,'IFRAME':1,'IMG':1, 'INPUT':1,'INS':1,'KBD':1,'LABEL':1,'MAP':1,'OBJECT':1,'Q':1,'S':1,'SAMP':1,'SCRIPT':1,'SELECT':1,'SMALL':1,'SPAN':1,'STRIKE':1,'STRONG':1,'SUB':1,'SUP':1,'TEXTAREA':1,'TT':1,'U':1,'VAR':1}, // Elements that you can,' intentionally,' leave open // (and which close themselves) diff --git a/0.6.x/js/02_dom/10_XNodeAnime.js b/0.6.x/js/02_dom/10_XNodeAnime.js index 247fe48..839697a 100644 --- a/0.6.x/js/02_dom/10_XNodeAnime.js +++ b/0.6.x/js/02_dom/10_XNodeAnime.js @@ -72,7 +72,7 @@ var X_Node_ANIMATIONS = [], X_Node_Anime_transitionProps = X_Node_Anime_hasTransform ? X_Node_CSS_VENDER_PREFIX[ 'transform' ] : 'left,top', // transitionEnd イベント中に要素の更新( X_Node_startUpdate() )ができるか? // iOS3+4 では可能、iOS6.1.5 で不可。TODO iOS5 及び他の環境で調査。ダメな場合、anime.html が正しく描画されない。 - X_Node_updateOnTransitionEnd = X_UA[ 'iOS' ] < 6; + X_Node_updateOnTransitionEnd = false; //X_UA[ 'iOS' ] < 6; // gpu化だけ transformX , willChange // 終了位置の変更 @@ -85,6 +85,7 @@ var X_Node_ANIMATIONS = [], * TODO : skew * TODO : filter * TODO 前回位置からの継続 + * TODO scrollLeft, scrollTop */ Node.prototype[ 'animate' ] = function( start, dest, duration, easing, wait ){ var isNew = !this[ '_anime' ], @@ -330,7 +331,7 @@ function X_Node_Anime_updateAnimation( xnode ){ obj.phase = obj.gpuParent ? 10 : 4; // このタイミングで animation 関連の css を削除したところ(X_Node_Anime_clearTransition)、iOS3、4 で再描画忘れが度々起きるように、、、 if( !obj.gpuParent ) X_Node_Anime_clearTransition( xnode ); - xnode[ 'dispatch' ]( { type : X_EVENT_ANIME_END, 'gpu' : obj.gpuParent } ); + //xnode[ 'dispatch' ]( { type : X_EVENT_ANIME_END, 'gpu' : obj.gpuParent } ); break; case 4 : @@ -365,7 +366,7 @@ function X_Node_Anime_updateAnimation( xnode ){ X_Node_Anime_clearTransition( xnode ); X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, phase === 14 ); obj.phase = phase === 14 ? 10 : 4; - xnode[ 'dispatch' ]( { type : X_EVENT_ANIME_END, 'gpu' : obj.gpuParent } ); + xnode[ 'asyncDispatch' ]( time, { type : X_EVENT_ANIME_END, 'gpu' : obj.gpuParent } ); } else { current = X_Node_Anime_getComputedPosition( xnode ); obj.startX = current.x; @@ -384,7 +385,8 @@ function X_Node_Anime_updateAnimation( xnode ){ // console.log( 'GPU有効で停止(待機)している xnode のGPU解除' ); X_Node_Anime_clearTransition( xnode ); X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, false ); - obj.gpuTimerID && X_Timer_remove( obj.gpuTimerID ); + //obj.gpuTimerID && X_Timer_remove( obj.gpuTimerID ); + //delete obj.gpuTimerID; X_ViewPort[ 'listenOnce' ]( X_EVENT_AFTER_UPDATE, xnode, X_Node_Anime_gpuReleased ); return true; @@ -418,7 +420,7 @@ function X_Node_Anime_getComputedPosition( that ) { }; function X_Node_Anime_onTransitionEnd( e ){ - // console.log( 'アニメ終了[onTransitionEnd] ' + ( this[ '_anime' ] && this[ '_anime' ].phase ) ); + console.log( '[TransitionEnd] ' + ( this[ '_anime' ] && this[ '_anime' ].phase ) ); if( !this[ '_anime' ] || this[ '_anime' ].phase !== 2 ){ // ここで return してしまうと、view の更新イベント待ちの場合、アニメが止まる @@ -432,6 +434,8 @@ function X_Node_Anime_onTransitionEnd( e ){ this[ 'dispatch' ]( { type : X_EVENT_ANIME_END, 'gpu' : this[ '_anime' ].gpuParent } ); X_Node_Anime_onTransition = false; + X_Node_Anime_clearTransition( this ); // iOS 大丈夫?? + X_Node_Anime_needsDetection = true; // iOS は transitionend 内の 更新でアニメーション可能 iOS3, iOS4 で確認 // win+Gecko は不可 @@ -477,7 +481,7 @@ function X_Node_Anime_clearTransition( xnode ){ }; function X_Node_Anime_updatePosition( xnode, x, y, opacity, useGPU ){ - // console.log( 'updatePosition y:' + y + ' gpu:' + !!useGPU ); + console.log( 'updatePosition x:' + x + ' gpu:' + !!useGPU ); if( X_Node_Anime_hasTransform ){ xnode[ 'css' ]({ transform : 'translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)' + ( useGPU ? X_Node_Anime_translateZ : '' ), diff --git a/0.6.x/js/03_plugin/00_XPlugin.js b/0.6.x/js/03_plugin/00_XPlugin.js index 8b31533..a6e6512 100644 --- a/0.6.x/js/03_plugin/00_XPlugin.js +++ b/0.6.x/js/03_plugin/00_XPlugin.js @@ -97,5 +97,5 @@ X[ 'Pulgin' ] = { }; -if( X_Pulgin_GEARS_ENABLED ) alert( 'X_Pulgin_GEARS_ENABLED' ); +//if( X_Pulgin_GEARS_ENABLED ) alert( 'X_Pulgin_GEARS_ENABLED' ); diff --git a/0.6.x/js/06_net/00_XNet.js b/0.6.x/js/06_net/00_XNet.js index 8e1e63d..4d96192 100644 --- a/0.6.x/js/06_net/00_XNet.js +++ b/0.6.x/js/06_net/00_XNet.js @@ -53,6 +53,9 @@ X[ 'Net' ] = { return new X_NET_Queue( X_NET_TYPE_IMAGE, { url : url, needSize : needSize } ); }, + 'gadget' : function( obj ){ + return new X_NET_Queue( 5, obj ); + }, //