From: itozyun Date: Sat, 5 Mar 2016 15:49:21 +0000 (+0900) Subject: Version 0.6.214, bug fixes X.KB. X-Git-Url: http://git.osdn.jp/view?p=pettanr%2FclientJs.git;a=commitdiff_plain;h=04ac203dfb25cc7e92db1f7f9f77122841f7cb1a Version 0.6.214, bug fixes X.KB. --- diff --git a/0.6.x/js/01_core/01_X.js b/0.6.x/js/01_core/01_X.js index 1581967..8f84e89 100644 --- a/0.6.x/js/01_core/01_X.js +++ b/0.6.x/js/01_core/01_X.js @@ -64,6 +64,7 @@ X[ 'emptyFunction' ] = X_emptyFunction; * このscriptはheadタグの中にあるか? * @type {boolean} */ // TODO defer の場合もあるので、document.readyState を見る +// TODO body の有無を見ればOKではないか? // MacIE で false X[ 'inHead' ] = (function( s ){ if( !s ) return false; diff --git a/0.6.x/js/01_core/02_XUA.js b/0.6.x/js/01_core/02_XUA.js index 79f00e8..acf31f4 100644 --- a/0.6.x/js/01_core/02_XUA.js +++ b/0.6.x/js/01_core/02_XUA.js @@ -10,7 +10,7 @@ * @type {object} */ var X_UA = X[ 'UA' ] = {}, - X_UA_classNameForHTML = 'js-enabled '; + X_UA_classNameForHTML = ''; (function(){ var dua = navigator.userAgent, @@ -807,9 +807,10 @@ var X_UA = X[ 'UA' ] = {}, for( k in X_UA ){ v = X_UA[ k ]; if( v ){ - X_UA_classNameForHTML += k + ' '; if( v !== true ){ X_UA_classNameForHTML += k + v + ' '; + } else { + X_UA_classNameForHTML += k + ' '; }; }; }; diff --git a/0.6.x/js/01_core/21_XViewPort.js b/0.6.x/js/01_core/21_XViewPort.js index 1dc98e9..86682a8 100644 --- a/0.6.x/js/01_core/21_XViewPort.js +++ b/0.6.x/js/01_core/21_XViewPort.js @@ -438,7 +438,7 @@ X[ 'ViewPort' ] = { * @alias X.Doc.html * @type {Node} */ - X[ 'Doc' ][ 'html' ] = html = X_Node_html = X_elmHtml && Node( X_elmHtml )[ 'removeClass' ]( 'js-disabled' )[ 'addClass' ]( X_UA_classNameForHTML ); + X[ 'Doc' ][ 'html' ] = html = X_Node_html = X_elmHtml && Node( X_elmHtml )[ 'removeClass' ]( 'js-disabled' )[ 'addClass' ]( X_UA_classNameForHTML.split( '.' ).join( '_' ) ); html[ '_flags' ] |= X_NodeFlags_IN_TREE; /** diff --git a/0.6.x/js/02_dom/03_XDomEvent.js b/0.6.x/js/02_dom/03_XDomEvent.js index bc7abf0..4497267 100644 --- a/0.6.x/js/02_dom/03_XDomEvent.js +++ b/0.6.x/js/02_dom/03_XDomEvent.js @@ -42,7 +42,7 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){ altKey, ctrlKey, metaKey, shiftKey, target, xtarget, offset, related, force, elm, i, n, time, touch, ev; - //this._event = e; + this._e = e; this[ 'type' ] = type = X_Event_RenameTo[ originalType ] || originalType; switch( type ){ diff --git a/0.6.x/js/02_dom/10_XNodeAnime.js b/0.6.x/js/02_dom/10_XNodeAnime.js index 8ae688e..2c877f2 100644 --- a/0.6.x/js/02_dom/10_XNodeAnime.js +++ b/0.6.x/js/02_dom/10_XNodeAnime.js @@ -12,7 +12,8 @@ var X_NodeAnime_QUEUE = [], /* Opera mobile で translateZ(0) が有効だと XY が 0 0 になる */ /* GPUレイヤーにいる間に要素のコンテンツを変更をすると transitionend が動かなくなるっぽい Mac safari と firefox */ X_NodeAnime_translateZ = X_Node_CSS_VENDER_PREFIX[ 'perspective' ] && - !X_UA[ 'OperaMobile' ] && !X_UA[ 'OperaTablet' ] ? ' translateZ(0)' : '', + !X_UA[ 'OperaMobile' ] && !X_UA[ 'OperaTablet' ] && + !( X_UA[ 'IE' ] === 11 ) && !( X_UA[ 'IEHost' ] === 11 ) ? ' translateZ(0)' : '', /* * phase: @@ -521,7 +522,7 @@ function X_NodeAnime_updatePosition( xnode, obj, ratio, useGPU ){ //console.log( 'updatePosition x:' + x + ' gpu:' + !!useGPU ); if( obj.transform ){ - if( x === x || y === y ) str += ' translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)'; + if( ( x === x || y === y ) && ( x !== 0 && y !== 0 ) ) str += ' translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)'; if( rotate < 0 || 0 < rotate ) str += ' rotate(' + rotate + 'deg)'; // opera は rad? if( skewX < 0 || 0 < skewX ) str += ' skewX(' + skewX + 'deg)'; if( skewY < 0 || 0 < skewY ) str += ' skewY(' + skewY + 'deg)'; diff --git a/0.6.x/js/06_net/04_XNetImage.js b/0.6.x/js/06_net/04_XNetImage.js index 3bcc3b8..9611900 100644 --- a/0.6.x/js/06_net/04_XNetImage.js +++ b/0.6.x/js/06_net/04_XNetImage.js @@ -11,7 +11,7 @@ var X_ImgLoader_image = window[ 'Image' ] && new Image(), X_ImgLoader_isElement = !( X_UA[ 'IE' ] < 9 ) && X_Type_isHTMLElement( X_ImgLoader_image ), // http://uupaa.hatenablog.com/entry/2013/12/17/171809 // お手軽に画像の読み込みをハンドリングする、今どきな方法 - X_ImgLoader_0forError = !X_UA[ 'IE' ] || X_UA[ 'IE' ] === 11; + X_ImgLoader_0forError = !X_UA[ 'IE' ] || X_UA[ 'IE' ] === 11 || X_UA[ 'IEHost' ] === 11; /* * TODO @@ -64,15 +64,17 @@ X_TEMP.X_ImgLoader_params = { }, reset : function(){ - console.log( 'X.Net.Image:reset ' + this.abspath + ' timerID:' + this.timerID ); + //console.log( '/ X.Net.Image:reset ' + this.abspath + ' timerID:' + this.timerID ); this.timerID && X_Timer_remove( this.timerID ); this.timerID = 0; + this.finish = false; + this.abspath = ''; //X_ImgLoader_isElement ? this[ '_rawObject' ].removeAttribute( 'src' ) : ( this[ '_rawObject' ].src = '' ); this[ '_rawObject' ].src = ''; - this.finish = false; - this.abspath = ''; + + //console.log( '\ X.Net.Image:reset ----------- *' ); } }; @@ -83,14 +85,16 @@ function X_ImgLoader_detect(){ if( raw && raw.complete ){ this.finish = true; - console.log( 'X.Net.Image:detect ' + raw.width ); + //console.log( 'X.Net.Image:detect ' + raw.width ); if( raw.width ) return; X_Timer_remove( this.timerID ); + //console.log( '* X.Net.Image:ERROR @detect(1) ' + this.abspath ); this.timerID = this[ 'asyncDispatch' ]( X_EVENT_ERROR ); } else if( this.timeout < ( this.tick += this.delay ) ){ this.finish = true; X_Timer_remove( this.timerID ); + //console.log( '* X.Net.Image:ERROR @detect(2) ' + this.abspath ); this.timerID = this[ 'asyncDispatch' ]( { type : X_EVENT_ERROR, 'timeout' : true } ); }; }; @@ -100,17 +104,18 @@ function X_ImgLoader_handleEvent( e ){ // IE11 reset() 時にここに入ってくる... if( !this.abspath ) return; - console.log( 'X.Net.Image:handleEvent ' + e.type ); + //console.log( 'X.Net.Image:handleEvent ' + e.type ); switch( e.type ){ case 'error' : - //case 'abort' : // TODO ?? // ie11(10,9 開発モード)で mineType 不正の場合、画像取得に成功してもエラーイベントが起こるのを無視する。 if( X_ImgLoader_0forError && raw.width ) return; if( this.finish ) return; this.finish = true; this.timerID && X_Timer_remove( this.timerID ); - this.timerID = this[ 'asyncDispatch' ]( /*e.type === 'error' ?*/ X_EVENT_ERROR /*: X_EVENT_CANCELED*/ ); + //console.log( '* X.Net.Image:ERROR @handle ' + this.abspath + X.Timer.now() ); + //console.dir( raw ); + this.timerID = this[ 'asyncDispatch' ]( this.timeout, X_EVENT_ERROR ); break; case 'load' : @@ -123,6 +128,9 @@ function X_ImgLoader_handleEvent( e ){ return; }; + //console.log( '* X.Net.Image:LOAD @handle ' + this.abspath + X.Timer.now() ); + //console.dir( raw ); + size = X_Util_Image_getActualDimension( !X_ImgLoader_isElement ? this.abspath : this ); this.timerID = this[ 'asyncDispatch' ]( { 'type' : X_EVENT_SUCCESS, diff --git a/0.6.x/js/11_hid/01_KB.js b/0.6.x/js/11_hid/01_KB.js index 83e0bfb..9d9646e 100644 --- a/0.6.x/js/11_hid/01_KB.js +++ b/0.6.x/js/11_hid/01_KB.js @@ -92,7 +92,7 @@ var X_KB_SPECIALS = eval( // IE5- 対策 case 'keypress' : // keydown 側で発火しているものは再び発火しない - console.log( 'keypress : chrCode:' + chrCode + ' down:' + X_KB_DOWN_KEYS[ chrCode ] + ( X_KB_CANCELED[ chrCode ] ? ' Cancel!' : '' ) ); + if( X_KB_DOWN_KEYS[ chrCode ] ){ return X_KB_CANCELED[ chrCode ] ? X_CALLBACK_PREVENT_DEFAULT : cb; } else @@ -114,7 +114,9 @@ var X_KB_SPECIALS = eval( // IE5- 対策 metaKey : !!X_KB_DOWN_KEYS[ 224 ] } ); - X_KB_lastIs10Key = true; + X_KB_lastIs10Key = false; + + console.log( X_KB_lastKeyCode + 'keypress : chrCode:' + chrCode + ' down:' + X_KB_DOWN_KEYS[ chrCode ] + ( X_KB_CANCELED[ chrCode ] ? ' Cancel!' : '' ) ); }; return cb; @@ -141,14 +143,21 @@ var X_KB_SPECIALS = eval( // IE5- 対策 if( X_KB_DOWN_KEYS[ keyCode ] ) delete X_KB_DOWN_KEYS[ keyCode ]; if( X_KB_CANCELED[ keyCode ] ) delete X_KB_CANCELED[ keyCode ]; - chrCode = 0; + if( !special ){ // keyCode から charCode を復帰する chrCode = X_KB_TRANSFOEM[ keyCode ]; if( !chrCode ) return cb; delete X_KB_TRANSFOEM[ keyCode ]; + } else + if( 42 <= special ){ + chrCode = special; // ie8で必要... Firefox でもテンキーの+-*/ で必要... + } else { + chrCode = 0; }; - + + console.log( keyCode + ' keyup ' + chrCode ); + cb |= this[ 'dispatch' ]( { type : 'keyup', keyCode : keyCode, @@ -159,7 +168,7 @@ var X_KB_SPECIALS = eval( // IE5- 対策 altKey : X_KB_DOWN_KEYS[ 18 ], metaKey : X_KB_DOWN_KEYS[ 224 ] } ); - + return cb; case X_EVENT_VIEW_ACTIVATE :