リビジョン | 04ac203dfb25cc7e92db1f7f9f77122841f7cb1a (tree) |
---|---|
日時 | 2016-03-06 00:49:21 |
作者 | itozyun <itozyun@user...> |
コミッター | itozyun |
Version 0.6.214, bug fixes X.KB.
@@ -64,6 +64,7 @@ X[ 'emptyFunction' ] = X_emptyFunction; | ||
64 | 64 | * このscriptはheadタグの中にあるか? |
65 | 65 | * @type {boolean} */ |
66 | 66 | // TODO defer の場合もあるので、document.readyState を見る |
67 | +// TODO body の有無を見ればOKではないか? | |
67 | 68 | // MacIE で false |
68 | 69 | X[ 'inHead' ] = (function( s ){ |
69 | 70 | if( !s ) return false; |
@@ -10,7 +10,7 @@ | ||
10 | 10 | * @type {object} |
11 | 11 | */ |
12 | 12 | var X_UA = X[ 'UA' ] = {}, |
13 | - X_UA_classNameForHTML = 'js-enabled '; | |
13 | + X_UA_classNameForHTML = ''; | |
14 | 14 | |
15 | 15 | (function(){ |
16 | 16 | var dua = navigator.userAgent, |
@@ -807,9 +807,10 @@ var X_UA = X[ 'UA' ] = {}, | ||
807 | 807 | for( k in X_UA ){ |
808 | 808 | v = X_UA[ k ]; |
809 | 809 | if( v ){ |
810 | - X_UA_classNameForHTML += k + ' '; | |
811 | 810 | if( v !== true ){ |
812 | 811 | X_UA_classNameForHTML += k + v + ' '; |
812 | + } else { | |
813 | + X_UA_classNameForHTML += k + ' '; | |
813 | 814 | }; |
814 | 815 | }; |
815 | 816 | }; |
@@ -438,7 +438,7 @@ X[ 'ViewPort' ] = { | ||
438 | 438 | * @alias X.Doc.html |
439 | 439 | * @type {Node} |
440 | 440 | */ |
441 | - X[ 'Doc' ][ 'html' ] = html = X_Node_html = X_elmHtml && Node( X_elmHtml )[ 'removeClass' ]( 'js-disabled' )[ 'addClass' ]( X_UA_classNameForHTML ); | |
441 | + X[ 'Doc' ][ 'html' ] = html = X_Node_html = X_elmHtml && Node( X_elmHtml )[ 'removeClass' ]( 'js-disabled' )[ 'addClass' ]( X_UA_classNameForHTML.split( '.' ).join( '_' ) ); | |
442 | 442 | html[ '_flags' ] |= X_NodeFlags_IN_TREE; |
443 | 443 | |
444 | 444 | /** |
@@ -42,7 +42,7 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){ | ||
42 | 42 | altKey, ctrlKey, metaKey, shiftKey, target, xtarget, offset, related, force, |
43 | 43 | elm, i, n, time, touch, ev; |
44 | 44 | |
45 | - //this._event = e; | |
45 | + this._e = e; | |
46 | 46 | this[ 'type' ] = type = X_Event_RenameTo[ originalType ] || originalType; |
47 | 47 | |
48 | 48 | switch( type ){ |
@@ -12,7 +12,8 @@ var X_NodeAnime_QUEUE = [], | ||
12 | 12 | /* Opera mobile で translateZ(0) が有効だと XY が 0 0 になる */ |
13 | 13 | /* GPUレイヤーにいる間に要素のコンテンツを変更をすると transitionend が動かなくなるっぽい Mac safari と firefox */ |
14 | 14 | X_NodeAnime_translateZ = X_Node_CSS_VENDER_PREFIX[ 'perspective' ] && |
15 | - !X_UA[ 'OperaMobile' ] && !X_UA[ 'OperaTablet' ] ? ' translateZ(0)' : '', | |
15 | + !X_UA[ 'OperaMobile' ] && !X_UA[ 'OperaTablet' ] && | |
16 | + !( X_UA[ 'IE' ] === 11 ) && !( X_UA[ 'IEHost' ] === 11 ) ? ' translateZ(0)' : '', | |
16 | 17 | |
17 | 18 | /* |
18 | 19 | * phase: |
@@ -521,7 +522,7 @@ function X_NodeAnime_updatePosition( xnode, obj, ratio, useGPU ){ | ||
521 | 522 | |
522 | 523 | //console.log( 'updatePosition x:' + x + ' gpu:' + !!useGPU ); |
523 | 524 | if( obj.transform ){ |
524 | - if( x === x || y === y ) str += ' translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)'; | |
525 | + if( ( x === x || y === y ) && ( x !== 0 && y !== 0 ) ) str += ' translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)'; | |
525 | 526 | if( rotate < 0 || 0 < rotate ) str += ' rotate(' + rotate + 'deg)'; // opera は rad? |
526 | 527 | if( skewX < 0 || 0 < skewX ) str += ' skewX(' + skewX + 'deg)'; |
527 | 528 | if( skewY < 0 || 0 < skewY ) str += ' skewY(' + skewY + 'deg)'; |
@@ -11,7 +11,7 @@ var X_ImgLoader_image = window[ 'Image' ] && new Image(), | ||
11 | 11 | X_ImgLoader_isElement = !( X_UA[ 'IE' ] < 9 ) && X_Type_isHTMLElement( X_ImgLoader_image ), |
12 | 12 | // http://uupaa.hatenablog.com/entry/2013/12/17/171809 |
13 | 13 | // お手軽に画像の読み込みをハンドリングする、今どきな方法 |
14 | - X_ImgLoader_0forError = !X_UA[ 'IE' ] || X_UA[ 'IE' ] === 11; | |
14 | + X_ImgLoader_0forError = !X_UA[ 'IE' ] || X_UA[ 'IE' ] === 11 || X_UA[ 'IEHost' ] === 11; | |
15 | 15 | |
16 | 16 | /* |
17 | 17 | * TODO |
@@ -64,15 +64,17 @@ X_TEMP.X_ImgLoader_params = { | ||
64 | 64 | }, |
65 | 65 | |
66 | 66 | reset : function(){ |
67 | - console.log( 'X.Net.Image:reset ' + this.abspath + ' timerID:' + this.timerID ); | |
67 | + //console.log( '/ X.Net.Image:reset ' + this.abspath + ' timerID:' + this.timerID ); | |
68 | 68 | |
69 | 69 | this.timerID && X_Timer_remove( this.timerID ); |
70 | 70 | this.timerID = 0; |
71 | 71 | |
72 | + this.finish = false; | |
73 | + this.abspath = ''; | |
72 | 74 | //X_ImgLoader_isElement ? this[ '_rawObject' ].removeAttribute( 'src' ) : ( this[ '_rawObject' ].src = '' ); |
73 | 75 | this[ '_rawObject' ].src = ''; |
74 | - this.finish = false; | |
75 | - this.abspath = ''; | |
76 | + | |
77 | + //console.log( '\ X.Net.Image:reset ----------- *' ); | |
76 | 78 | } |
77 | 79 | }; |
78 | 80 |
@@ -83,14 +85,16 @@ function X_ImgLoader_detect(){ | ||
83 | 85 | |
84 | 86 | if( raw && raw.complete ){ |
85 | 87 | this.finish = true; |
86 | - console.log( 'X.Net.Image:detect ' + raw.width ); | |
88 | + //console.log( 'X.Net.Image:detect ' + raw.width ); | |
87 | 89 | if( raw.width ) return; |
88 | 90 | X_Timer_remove( this.timerID ); |
91 | + //console.log( '* X.Net.Image:ERROR @detect(1) ' + this.abspath ); | |
89 | 92 | this.timerID = this[ 'asyncDispatch' ]( X_EVENT_ERROR ); |
90 | 93 | } else |
91 | 94 | if( this.timeout < ( this.tick += this.delay ) ){ |
92 | 95 | this.finish = true; |
93 | 96 | X_Timer_remove( this.timerID ); |
97 | + //console.log( '* X.Net.Image:ERROR @detect(2) ' + this.abspath ); | |
94 | 98 | this.timerID = this[ 'asyncDispatch' ]( { type : X_EVENT_ERROR, 'timeout' : true } ); |
95 | 99 | }; |
96 | 100 | }; |
@@ -100,17 +104,18 @@ function X_ImgLoader_handleEvent( e ){ | ||
100 | 104 | |
101 | 105 | // IE11 reset() 時にここに入ってくる... |
102 | 106 | if( !this.abspath ) return; |
103 | - console.log( 'X.Net.Image:handleEvent ' + e.type ); | |
107 | + //console.log( 'X.Net.Image:handleEvent ' + e.type ); | |
104 | 108 | |
105 | 109 | switch( e.type ){ |
106 | 110 | case 'error' : |
107 | - //case 'abort' : // TODO ?? | |
108 | 111 | // ie11(10,9 開発モード)で mineType 不正の場合、画像取得に成功してもエラーイベントが起こるのを無視する。 |
109 | 112 | if( X_ImgLoader_0forError && raw.width ) return; |
110 | 113 | if( this.finish ) return; |
111 | 114 | this.finish = true; |
112 | 115 | this.timerID && X_Timer_remove( this.timerID ); |
113 | - this.timerID = this[ 'asyncDispatch' ]( /*e.type === 'error' ?*/ X_EVENT_ERROR /*: X_EVENT_CANCELED*/ ); | |
116 | + //console.log( '* X.Net.Image:ERROR @handle ' + this.abspath + X.Timer.now() ); | |
117 | + //console.dir( raw ); | |
118 | + this.timerID = this[ 'asyncDispatch' ]( this.timeout, X_EVENT_ERROR ); | |
114 | 119 | break; |
115 | 120 | |
116 | 121 | case 'load' : |
@@ -123,6 +128,9 @@ function X_ImgLoader_handleEvent( e ){ | ||
123 | 128 | return; |
124 | 129 | }; |
125 | 130 | |
131 | + //console.log( '* X.Net.Image:LOAD @handle ' + this.abspath + X.Timer.now() ); | |
132 | + //console.dir( raw ); | |
133 | + | |
126 | 134 | size = X_Util_Image_getActualDimension( !X_ImgLoader_isElement ? this.abspath : this ); |
127 | 135 | this.timerID = this[ 'asyncDispatch' ]( { |
128 | 136 | 'type' : X_EVENT_SUCCESS, |
@@ -92,7 +92,7 @@ var X_KB_SPECIALS = eval( // IE5- 対策 | ||
92 | 92 | |
93 | 93 | case 'keypress' : |
94 | 94 | // keydown 側で発火しているものは再び発火しない |
95 | - console.log( 'keypress : chrCode:' + chrCode + ' down:' + X_KB_DOWN_KEYS[ chrCode ] + ( X_KB_CANCELED[ chrCode ] ? ' Cancel!' : '' ) ); | |
95 | + | |
96 | 96 | if( X_KB_DOWN_KEYS[ chrCode ] ){ |
97 | 97 | return X_KB_CANCELED[ chrCode ] ? X_CALLBACK_PREVENT_DEFAULT : cb; |
98 | 98 | } else |
@@ -114,7 +114,9 @@ var X_KB_SPECIALS = eval( // IE5- 対策 | ||
114 | 114 | metaKey : !!X_KB_DOWN_KEYS[ 224 ] |
115 | 115 | } ); |
116 | 116 | |
117 | - X_KB_lastIs10Key = true; | |
117 | + X_KB_lastIs10Key = false; | |
118 | + | |
119 | + console.log( X_KB_lastKeyCode + 'keypress : chrCode:' + chrCode + ' down:' + X_KB_DOWN_KEYS[ chrCode ] + ( X_KB_CANCELED[ chrCode ] ? ' Cancel!' : '' ) ); | |
118 | 120 | }; |
119 | 121 | return cb; |
120 | 122 |
@@ -141,14 +143,21 @@ var X_KB_SPECIALS = eval( // IE5- 対策 | ||
141 | 143 | if( X_KB_DOWN_KEYS[ keyCode ] ) delete X_KB_DOWN_KEYS[ keyCode ]; |
142 | 144 | if( X_KB_CANCELED[ keyCode ] ) delete X_KB_CANCELED[ keyCode ]; |
143 | 145 | |
144 | - chrCode = 0; | |
146 | + | |
145 | 147 | if( !special ){ |
146 | 148 | // keyCode から charCode を復帰する |
147 | 149 | chrCode = X_KB_TRANSFOEM[ keyCode ]; |
148 | 150 | if( !chrCode ) return cb; |
149 | 151 | delete X_KB_TRANSFOEM[ keyCode ]; |
152 | + } else | |
153 | + if( 42 <= special ){ | |
154 | + chrCode = special; // ie8で必要... Firefox でもテンキーの+-*/ で必要... | |
155 | + } else { | |
156 | + chrCode = 0; | |
150 | 157 | }; |
151 | - | |
158 | + | |
159 | + console.log( keyCode + ' keyup ' + chrCode ); | |
160 | + | |
152 | 161 | cb |= this[ 'dispatch' ]( { |
153 | 162 | type : 'keyup', |
154 | 163 | keyCode : keyCode, |
@@ -159,7 +168,7 @@ var X_KB_SPECIALS = eval( // IE5- 対策 | ||
159 | 168 | altKey : X_KB_DOWN_KEYS[ 18 ], |
160 | 169 | metaKey : X_KB_DOWN_KEYS[ 224 ] |
161 | 170 | } ); |
162 | - | |
171 | + | |
163 | 172 | return cb; |
164 | 173 | |
165 | 174 | case X_EVENT_VIEW_ACTIVATE : |