クライアント側 js 開発用
Revisão | bfca1aa94da405643253af65c421f6665d6e6262 (tree) |
---|---|
Hora | 2016-03-09 09:59:26 |
Autor | itozyun <itozyun@user...> |
Commiter | itozyun |
Version 0.6.215, bug fixes X.Net.Image & X.HTMLAudio.
@@ -158,7 +158,7 @@ function X_String_whiteSpaceToTag( text ){ | ||
158 | 158 | * @return {string} html文字列 |
159 | 159 | */ |
160 | 160 | function X_String_chrReferanceTo( str ){ |
161 | - var refs, i, l, ref; | |
161 | + var refs, i, l, ref, k; | |
162 | 162 | |
163 | 163 | if( str == null || str === '' ) return ''; |
164 | 164 | if( str.indexOf( '&' ) === -1 ) return str; |
@@ -15,7 +15,7 @@ var | ||
15 | 15 | * クラス名 |
16 | 16 | * @type {string} |
17 | 17 | */ |
18 | - name : '' | |
18 | + NAME : '' | |
19 | 19 | }, |
20 | 20 | |
21 | 21 | X_Class_CLASS_LIST = [], |
@@ -481,7 +481,7 @@ X[ 'Class' ] = /** @lends X.Class */ { | ||
481 | 481 | klass.prototype.constructor = klass; |
482 | 482 | }; |
483 | 483 | |
484 | - klass[ 'name' ] = displayName; | |
484 | + klass[ 'NAME' ] = displayName; | |
485 | 485 | |
486 | 486 | if( opt_abstract ){ |
487 | 487 | classDef.isAbstract = true; |
@@ -277,9 +277,10 @@ function X_Node_CSS_objToCssText( that, skipFilter ){ | ||
277 | 277 | }; |
278 | 278 | |
279 | 279 | if( filterFix ){ |
280 | - v = X_Node_CSS_objToIEFilterText( that, filterFix /* , css */ ); | |
280 | + v = X_Node_CSS_objToIEFilterText( that, filterFix, css ); | |
281 | + n = css.length; /* css が変更されている場合あり */ | |
281 | 282 | if( v ){ |
282 | - css[ ++n /* css.length */ ] = 'filter:' + v; | |
283 | + css[ ++n ] = 'filter:' + v; | |
283 | 284 | }; |
284 | 285 | skipFilter = skipFilter && v; |
285 | 286 | } else { |
@@ -289,6 +290,7 @@ function X_Node_CSS_objToCssText( that, skipFilter ){ | ||
289 | 290 | if( 0 <= n ){ |
290 | 291 | // cssText には完全なものを控えるが、戻すのは filter を抜いたもの |
291 | 292 | that[ '_cssText' ] = css.join( ';' ); |
293 | + //console.log( that[ '_cssText' ] ); | |
292 | 294 | if( skipFilter ){ |
293 | 295 | --css.length; |
294 | 296 | return css.join( ';' ); |
@@ -334,9 +336,10 @@ function X_Node_CSS_objToIEFilterText( that, opt_css, opt_cssList ){ | ||
334 | 336 | filters[ ++n ] = v; |
335 | 337 | break; |
336 | 338 | case 2 : //'opacity' : |
337 | - //if( v === 0 ){ | |
338 | - // opt_cssList && ( opt_cssList[ opt_cssList.length ] = 'visibility:hidden' ); | |
339 | - //} else | |
339 | + if( v === 0 ){ | |
340 | + console.log( '@opacity:0 ' + !!opt_cssList ); | |
341 | + opt_cssList && ( opt_cssList[ opt_cssList.length ] = 'visibility:hidden' ); | |
342 | + } else | |
340 | 343 | if( v < 1 ) filters[ ++n ] = 'alpha(opacity=' + ( v * 100 | 0 ) +')'; |
341 | 344 | break; |
342 | 345 | case 3 : //'boxShadow' : |
@@ -422,7 +425,7 @@ function X_Node_CSS_objToIEFilterText( that, opt_css, opt_cssList ){ | ||
422 | 425 | break; |
423 | 426 | }; |
424 | 427 | }; |
425 | - return filters.join( ' ' ); | |
428 | + return filters.join( ' ' );//n !== -1 ? filters.join( ' ' ) : ''; | |
426 | 429 | }; |
427 | 430 | |
428 | 431 |
@@ -291,7 +291,7 @@ var Node = X[ 'Node' ] = X_EventDispatcher[ 'inherits' ]( | ||
291 | 291 | 'toggleClass' : X_Node_toggleClass, |
292 | 292 | 'hasClass' : X_Node_hasClass, |
293 | 293 | |
294 | - 'html' : X_Node_html, | |
294 | + 'html' : X_Node__html, | |
295 | 295 | 'text' : X_Node_text, |
296 | 296 | 'call' : X_Node_call, |
297 | 297 | 'each' : X_Node_each |
@@ -1114,7 +1114,7 @@ function X_Node_hasClass( v ){ | ||
1114 | 1114 | * @return {string|Node} |
1115 | 1115 | * @example node.html( '<img>' ); |
1116 | 1116 | */ |
1117 | -function X_Node_html( html ){ | |
1117 | +function X_Node__html( html ){ | |
1118 | 1118 | var _ = '', q = '"', xnodes, n, i, l; |
1119 | 1119 | // setter |
1120 | 1120 | if( html !== undefined ){ // String 以外に Number や false null なども許可 |
@@ -1419,7 +1419,7 @@ function X_Node_startUpdate( time ){ | ||
1419 | 1419 | removal.length = 0; |
1420 | 1420 | }; |
1421 | 1421 | |
1422 | - | |
1422 | + // | |
1423 | 1423 | X_UA[ 'IE5' ] && ( X_elmBody.style.visibility = 'hidden' ); |
1424 | 1424 | |
1425 | 1425 | if( X_Node_html[ '_flags' ] & X_Node_BitMask_IS_DIRTY ){ |
@@ -1816,7 +1816,7 @@ var X_Node__updateRawNode = | ||
1816 | 1816 | elm.setAttribute( 'class', that[ '_className' ] ) : |
1817 | 1817 | ( elm.className = that[ '_className' ] ) |
1818 | 1818 | ) : |
1819 | - ( elm.className && elm.removeAttribute( X_UA[ 'IE' ] < 8 ? 'className' : 'class' ) ); // className は ie7- | |
1819 | + ( elm.className && elm.removeAttribute( X_UA[ 'IE' ] < 8 ? 'className' : 'class' ) ); // className は ie7- | |
1820 | 1820 | }; |
1821 | 1821 | |
1822 | 1822 | // attr |
@@ -67,7 +67,7 @@ X_TEMP.X_ImgLoader_params = { | ||
67 | 67 | //console.log( '/ X.Net.Image:reset ' + this.abspath + ' timerID:' + this.timerID ); |
68 | 68 | |
69 | 69 | this.timerID && X_Timer_remove( this.timerID ); |
70 | - this.timerID = 0; | |
70 | + this.timerID = this.tick = 0; | |
71 | 71 | |
72 | 72 | this.finish = false; |
73 | 73 | this.abspath = ''; |
@@ -111,7 +111,7 @@ function X_ImgLoader_handleEvent( e ){ | ||
111 | 111 | // ie11(10,9 開発モード)で mineType 不正の場合、画像取得に成功してもエラーイベントが起こるのを無視する。 |
112 | 112 | if( X_ImgLoader_0forError && raw.width ) return; |
113 | 113 | if( this.finish ) return; |
114 | - this.finish = true; | |
114 | + this.finish = true; | |
115 | 115 | this.timerID && X_Timer_remove( this.timerID ); |
116 | 116 | //console.log( '* X.Net.Image:ERROR @handle ' + this.abspath + X.Timer.now() ); |
117 | 117 | //console.dir( raw ); |
@@ -54,6 +54,8 @@ var | ||
54 | 54 | |
55 | 55 | // Opera Mobile 12 は 2回目以降の currentTime へのセットで currentTime が更新されなくなるため、タイマーを使用する |
56 | 56 | X_HTMLAudio_currentTimeFix = !!X_UA[ 'OperaMobile' ] || !!X_UA[ 'OperaTablet' ], |
57 | + // Firefox44.0.2 で音声の再生開始に難あり... | |
58 | + X_HTMLAudio_playStartFix = X_UA[ 'Windows' ] && X_UA[ 'Gecko' ] === 44, | |
57 | 59 | |
58 | 60 | X_HTMLAudio_volumeFix = X_UA[ 'Chrome' ], |
59 | 61 | /* |
@@ -107,7 +109,7 @@ if( X_Audio_constructor ){ | ||
107 | 109 | // 8:duration 取得済 |
108 | 110 | // :timeupdate イベントで durationFixは完了 |
109 | 111 | _durationFixPhase : X_HTMLAudio_durationFix ? 1 : 0, |
110 | - _lastCurrentTime : 0, | |
112 | + _lastCurrentTime : 0, // ms | |
111 | 113 | |
112 | 114 | _shortPlayFixON : false, |
113 | 115 | _shortPlayFixTime : 0, |
@@ -203,7 +205,7 @@ if( X_Audio_constructor ){ | ||
203 | 205 | |
204 | 206 | if( !raw ) return; |
205 | 207 | |
206 | - //e.type !== 'timeupdate' && console.log( ' > ' + e.type ); | |
208 | + // e.type !== 'timeupdate' && console.log( ' > ' + e.type ); | |
207 | 209 | |
208 | 210 | switch( e.type ){ |
209 | 211 |
@@ -278,11 +280,18 @@ if( X_Audio_constructor ){ | ||
278 | 280 | if( ( now = this.getActualCurrentTime() ) === this._lastCurrentTime ){ |
279 | 281 | eventType = X_EVENT_MEDIA_WAITING; |
280 | 282 | } else |
283 | + if( X_HTMLAudio_playStartFix && ( now < this._lastCurrentTime ) ){ | |
284 | + eventType = X_EVENT_MEDIA_WAITING; | |
285 | + //console.log( '@Firefox44.0.2 !! ' + now + ' / ' + this._lastCurrentTime ); | |
286 | + // Firefox44.0.2 で音声の再生開始に難あり... | |
287 | + // 20回程度 currentTime の更新に失敗する.... | |
288 | + this.actualPlay(); | |
289 | + } else | |
281 | 290 | if( this.playing ){ |
282 | 291 | end = X_Audio_getEndTime( this ) + this._shortPlayFixTime; |
283 | - | |
284 | - console.log( now + ' / ' + end );// Firefox44.0.2 で音声の再生開始に難あり... | |
285 | - | |
292 | + | |
293 | + //console.log( '@ ' + now + ' / ' + this._lastCurrentTime + ' / ' + end );// Firefox44.0.2 で音声の再生開始に難あり... | |
294 | + | |
286 | 295 | if( ( 0 + end <= 0 + now ) || // 0+ なぜか iem9 で必要,,, |
287 | 296 | ( now < this._lastCurrentTime && now < 2000 ) ){ |
288 | 297 | //( ( X_HTMLAudio_endedFixAOSP2 || X_HTMLAudio_endedFixAOSP4 ) && ( now < this._lastCurrentTime && now < 1000 ) ) ){ |
@@ -438,7 +447,7 @@ if( X_Audio_constructor ){ | ||
438 | 447 | end = X_Audio_getEndTime( this ); |
439 | 448 | begin = X_Audio_getStartTime( this, end, true ); |
440 | 449 | |
441 | - this._lastCurrentTime = begin / 1000; | |
450 | + this._lastCurrentTime = begin; | |
442 | 451 | |
443 | 452 | if( this._shortPlayFixON ){ |
444 | 453 | this._shortPlayFixTime = ( 1000 < end - begin ) ? 200 : 400; |
@@ -469,7 +478,7 @@ if( X_Audio_constructor ){ | ||
469 | 478 | |
470 | 479 | // iOS で duration が 0 の時に触ると error |
471 | 480 | // 0 or 8 |
472 | - if( !( this._durationFixPhase % 8 ) && this.duration ) raw.currentTime = this._lastCurrentTime; | |
481 | + if( !( this._durationFixPhase % 8 ) && this.duration ) raw.currentTime = this._lastCurrentTime / 1000; | |
473 | 482 | |
474 | 483 | console.log( '[HTMLAudio] play ' + begin + ' -> ' + end + ' crt:' + ( raw.currentTime | 0 ) + ' last:' + this._lastCurrentTime ); |
475 | 484 |
@@ -509,7 +518,7 @@ if( X_Audio_constructor ){ | ||
509 | 518 | getActualCurrentTime : function(){ |
510 | 519 | return ( X_HTMLAudio_currentTimeFix ? |
511 | 520 | X_Timer_now() - this._currentFixStart + this._currentFixBegin : |
512 | - this._seekingFixON ? this._lastCurrentTime * 1000 : | |
521 | + this._seekingFixON ? this._lastCurrentTime : | |
513 | 522 | this[ '_rawObject' ].currentTime * 1000 | 0 ); |
514 | 523 | }, |
515 | 524 | /* |