From: itozyun Date: Mon, 6 Oct 2014 11:24:32 +0000 (+0900) Subject: Version 0.6.92, bugfix for ie. X-Git-Url: http://git.osdn.jp/view?p=pettanr%2FclientJs.git;a=commitdiff_plain;h=c54d46848e396b9208daa4d4cb535b4b461cb019 Version 0.6.92, bugfix for ie. --- diff --git a/0.6.x/js/01_core/01_X.js b/0.6.x/js/01_core/01_X.js index 035cfae..e53d43e 100644 --- a/0.6.x/js/01_core/01_X.js +++ b/0.6.x/js/01_core/01_X.js @@ -1,3 +1,4 @@ + if( !window['console'] || ( window.parent && window.parent.log ) ) console = { log : function(a){ var win, elm; //alert(a); diff --git a/0.6.x/js/01_core/03_XType.js b/0.6.x/js/01_core/03_XType.js index b30d82d..d896389 100644 --- a/0.6.x/js/01_core/03_XType.js +++ b/0.6.x/js/01_core/03_XType.js @@ -31,7 +31,7 @@ X.Type = { }, isString : function( v ){ - return typeof v === 'string'; + return typeof v === 'string'; // v === v + ''; }, isNumber : function( v ){ @@ -39,11 +39,11 @@ X.Type = { }, isFinite : function( v ){ - return typeof v === 'number' && isFinite( v ); // isFinite( '123' ) とかに対策 + return typeof v === 'number' && isFinite( v ); // isFinite( '123' ) === true に対策 }, isNaN : function( v ){ - return v !== v; // isNaN( 'NaN' ) になってしまう + return v !== v; // isNaN( 'NaN' ) === true に対策 }, isHTMLElement : diff --git a/0.6.x/js/01_core/05_XClass.js b/0.6.x/js/01_core/05_XClass.js index ae07f5e..db37581 100644 --- a/0.6.x/js/01_core/05_XClass.js +++ b/0.6.x/js/01_core/05_XClass.js @@ -59,7 +59,7 @@ X.Class = { opt_final = !!( classSetting & X.Class.FINAL ); opt_private = !!( classSetting & X.Class.PRIVATE_DATA ); if( opt_final && opt_abstract ){ - X.Notification.critical( 'final & Abstract!' ); + X.Logger.critical( 'final & Abstract!' ); return; }; args.shift(); @@ -71,11 +71,11 @@ X.Class = { if( X_Class_PRIVATE_CLASS_LIST.indexOf( args[ 0 ] ) !== -1 ){ privateDef = X_Class_getClassDef( args[ 0 ] ); if( privateDef.isPrivate !== true ){ - X.Notification.critical( 'PrivateClass not found! please, X.Class.create( X.Class.PRIVATE, {...} ).' ); + X.Logger.critical( 'PrivateClass not found! please, X.Class.create( X.Class.PRIVATE, {...} ).' ); return; } else if( privateDef.Abstract === true ){ - X.Notification.critical( 'PrivateClass is Abstract!' ); + X.Logger.critical( 'PrivateClass is Abstract!' ); return; }; classDef.privateClass = args.shift(); @@ -87,7 +87,7 @@ X.Class = { // サブクラスの場合、クラス定義の上書きがなくても作成可能 // サブクラスでなくても、クラスメンバ用オブジェクトが無しでも作成可能 //if( !X_Class_traits ){ - // X.Notification.critical( 'No Class Def!' ); + // X.Logger.critical( 'No Class Def!' ); // return; //}; props = {}; @@ -133,7 +133,7 @@ X.Class = { }; if( opt_private === true ){ if( classDef.privateClass ){ - X.Notification.critical( 'Private Data Class has no PrivateClass!' ); + X.Logger.critical( 'Private Data Class has no PrivateClass!' ); return; }; classDef.isPrivate = true; @@ -207,11 +207,11 @@ function X_Class_newPrivate( /* instance, args */ ){ def.dataList = []; }; if( i !== -1 ){ - X.Notification.critical( 'PrivateData already exist!' ); + X.Logger.critical( 'PrivateData already exist!' ); return; }; if( privateDef._tempUser ){ - X.Notification.critical( 'newPrivate を連続呼び出しされたところ破綻' ); + X.Logger.critical( 'newPrivate を連続呼び出しされたところ破綻' ); return; }; privateDef._tempUser = user; @@ -229,7 +229,7 @@ function X_Class_override( target, src, force ){ var p; for( p in src ){ if( p === 'Super' || p === 'SuperConstructor' || p === '__proto__' || p === 'prototype' || p === 'constructor' ){ - X.Notification.critical( 'Super & SuperConstructor is reserved!' ); + X.Logger.critical( 'Super & SuperConstructor is reserved!' ); return; }; if( force || target[ p ] === void 0 ){ @@ -270,7 +270,7 @@ function X_Class_inherits( /* displayName, classSetting, opt_PrivateClass, props classSetting, opt_super, klass, def; - if( superDef.Final ) X.Notification.critical( 'X.Class inherits, Class is final!' ); + if( superDef.Final ) X.Logger.critical( 'X.Class inherits, Class is final!' ); // サブクラス名 if( X.Type.isString( displayName ) ){ @@ -340,7 +340,7 @@ var X_Class_CommonProps = { def = X_Class_getClassDef( klass ), data, p, i; if( def.isPrivate && !X_Class_killPrivateFlag ){ - X.Notification.critical( 'PrivateInstance.kill() work in PrivateUser.kill().' ); + X.Logger.critical( 'PrivateInstance.kill() work in PrivateUser.kill().' ); return; }; X_Class_killPrivateFlag = false; // onKill 内で PrivateInstance.kill() を防ぐため @@ -364,6 +364,7 @@ var X_Class_CommonProps = { } else { this.dispatch( X.Event.BEFORE_KILL_INSTANCE ); }; + console.log('kill ' + this._dispatching); this.dispatch( X.Event.KILL_INSTANCE ); this._listeners && this.unlisten(); } else @@ -371,8 +372,6 @@ var X_Class_CommonProps = { return; }; - console.log('kill ' + this._dispatching); - for( p in instance ){ if( instance.hasOwnProperty && !instance.hasOwnProperty( p ) ) continue; delete instance[ p ]; @@ -421,11 +420,11 @@ function X_Class_actualConstructor( args ){ instance, obj, userDef; if( def.Abstract ){ - X.Notification.critical( 'AbstractClass!' ); + X.Logger.critical( 'AbstractClass!' ); return; }; if( def.isPrivate && !dataUser ){ - X.Notification.critical( 'use myClass.newPrivate( instance, ...args )!' ); + X.Logger.critical( 'use myClass.newPrivate( instance, ...args )!' ); return; }; klass.__new = null; diff --git a/0.6.x/js/01_core/06_XEvent.js b/0.6.x/js/01_core/06_XEvent.js index e69de29..87f02e7 100644 --- a/0.6.x/js/01_core/06_XEvent.js +++ b/0.6.x/js/01_core/06_XEvent.js @@ -0,0 +1,14 @@ +X.Event = { + COMPLETE : 1, + READY : 2, + SUCCESS : 3, + ERROR : 4, + PROGRESS : 5, + BEFORE_CANCEL : 6, + CANCELED : 7, + TIMEOUT : 8, + BEFORE_KILL_INSTANCE : 9, + KILL_INSTANCE : 10, + KILL_INSTANCE_CANCELED : 11, + _LAST_EVENT : 11 +}; \ No newline at end of file diff --git a/0.6.x/js/01_core/07_XEventDispatcher.js b/0.6.x/js/01_core/07_XEventDispatcher.js index e533736..426a05d 100644 --- a/0.6.x/js/01_core/07_XEventDispatcher.js +++ b/0.6.x/js/01_core/07_XEventDispatcher.js @@ -17,21 +17,6 @@ * イベントターゲット上にある現在のどのイベントリスナーも指定していない引数付きの removeEventListener は、何の効果もありません。 */ -X.Event = { - COMPLETE : 1, - READY : 2, - SUCCESS : 3, - ERROR : 4, - PROGRESS : 5, - BEFORE_CANCEL : 6, - CANCELED : 7, - TIMEOUT : 8, - BEFORE_KILL_INSTANCE : 9, - KILL_INSTANCE : 10, - KILL_INSTANCE_CANCELED : 11, - _LAST_EVENT : 11 -}; - // ------------------------------------------------------------------------- // // ------------ local variables -------------------------------------------- // // ------------------------------------------------------------------------- // @@ -464,7 +449,7 @@ function X_EventDispatcher_unlisten( opt_type, opt_arg1, opt_arg2, opt_arg3 ){ raw = this._rawObject || this._ie4getRawNode && this._ie4getRawNode(); delete list[ opt_type ]; if( empty = X.isEmptyObject( list ) ) delete this._listeners; - if( raw && '' + parseFloat( opt_type ) !== opt_type ){ // 数字イベントの除外 + if( raw && '' + parseFloat( opt_type ) !== '' + opt_type ){ // 数字イベントの除外 X_EventDispatcher_actualRemoveEvent( this, opt_type, raw, _list, !empty ); }; }; @@ -490,7 +475,7 @@ var X_EventDispatcher_actualAddEvent = } else { that._handleEvent || ( that._handleEvent = X.Callback.create( that, X_EventDispatcher_actualHandleEvent ) ); - if( that._isSilverLight ){ + if( that._isSilverlight ){ list.slcallback = X.Callback.create( that, X_EventDispatcher_sliverLightDispatch, [ type ] ); list.sltoken = raw.AddEventListener( type, list.slcallback ); } else @@ -521,7 +506,7 @@ var X_EventDispatcher_actualAddEvent = } else{ that._handleEvent || ( that._handleEvent = X.Callback.create( that, X_EventDispatcher_actualHandleEvent ) ); - if( that._isSilverLight ){ + if( that._isSilverlight ){ list.slcallback = X.Callback.create( that, X_EventDispatcher_sliverLightDispatch, [ type ] ); list.sltoken = raw.AddEventListener( type, list.slcallback ); } else @@ -544,7 +529,7 @@ var X_EventDispatcher_actualAddEvent = } else { that._handleEvent || ( that._handleEvent = X.Callback.create( that, X_EventDispatcher_actualHandleEvent ) ); - if( that._isSilverLight ){ + if( that._isSilverlight ){ list.slcallback = X.Callback.create( that, X_EventDispatcher_sliverLightDispatch, [ type ] ); list.sltoken = raw.AddEventListener( type, list.slcallback ); } else { @@ -572,7 +557,7 @@ var X_EventDispatcher_actualRemoveEvent = }; } else { - if( that._isSilverLight ){ + if( that._isSilverlight ){ raw.RemoveEventListener( type, list.sltoken ); // token X.Callback._correct( list.slcallback ); delete list.sltoken; @@ -609,7 +594,7 @@ var X_EventDispatcher_actualRemoveEvent = }; } else { - if( that._isSilverLight ){ + if( that._isSilverlight ){ raw.RemoveEventListener( type, list.sltoken ); // token X.Callback._correct( list.slcallback ); delete list.sltoken; @@ -639,7 +624,7 @@ var X_EventDispatcher_actualRemoveEvent = }; } else { - if( that._isSilverLight ){ + if( that._isSilverlight ){ raw.RemoveEventListener( type, list.sltoken ); // token X.Callback._correct( list.slcallback ); delete list.sltoken; diff --git a/0.6.x/js/01_core/10_XLogger.js b/0.6.x/js/01_core/10_XLogger.js index e566f95..2540040 100644 --- a/0.6.x/js/01_core/10_XLogger.js +++ b/0.6.x/js/01_core/10_XLogger.js @@ -1,30 +1,30 @@ -X.Notification = { +X.Logger = { _$LogArea : null, debug : function( msg ){ - X.Notification._output( msg, 0 ); + X.Logger._output( msg, 0 ); }, info : function( msg ){ - X.Notification._output( msg, 1 ); + X.Logger._output( msg, 1 ); }, warn : function( msg ){ - X.Notification._output( msg, 2 ); + X.Logger._output( msg, 2 ); }, critical : function( msg ){ - X.Notification._output( msg, 3 ); + X.Logger._output( msg, 3 ); }, _output : function( msg, level ){ var body, $Area; if( X.Dom && X.Dom.ready === true ){ - if( $Area = X.Notification._$LogArea ){ + if( $Area = X.Logger._$LogArea ){ $Area.remove(); - delete X.Notification._$LogArea; + delete X.Logger._$LogArea; }; } else if( X.Dom && X.Dom.ready === true ){ - if( !( $Area = X.Notification._$LogArea ) ){ - $Area = X.Notification._$LogArea = X.Dom.Node( 'div' ).addToRoot( 0 ); + if( !( $Area = X.Logger._$LogArea ) ){ + $Area = X.Logger._$LogArea = X.Dom.Node( 'div' ).addToRoot( 0 ); }; $Area.add( '

' + msg + '

' ); } else @@ -49,4 +49,4 @@ info サーバ情報 debug デバック用の情報 */ -console.log( 'X.Core.Notification' ); +console.log( 'X.Core.Log' ); diff --git a/0.6.x/js/02_dom/12_XDomNode.js b/0.6.x/js/02_dom/12_XDomNode.js index 79e67aa..34a41c8 100644 --- a/0.6.x/js/02_dom/12_XDomNode.js +++ b/0.6.x/js/02_dom/12_XDomNode.js @@ -1089,7 +1089,7 @@ Node.prototype._updateRawNode = if( this._dirty & X.Dom.Dirty.ATTR && ( attrs = this._newAttrs || this._attrs ) ){ rename = X.Dom.Attr.renameForDOM; for( k in attrs ){ - if( !X.UA.MacIE && 5 <= X.UA.IE && X.UA.IE < 6 ){ // IETester 5.5 ではエラーが出なかった.MultipulIE5.5 ではエラーが出たので + if( !X.UA.MacIE && ( X.UA.IE5 || X.UA.IE55 ) ){ // IETester 5.5 ではエラーが出なかった.MultipulIE5.5 ではエラーが出たので if( this._tag === 'TEXTAREA' && k === 'value' ){ elm.firstChild ? ( elm.firstChild.data = attrs[ k ] ) : @@ -1097,7 +1097,7 @@ Node.prototype._updateRawNode = continue; }; }; - // TODO IE では input, なぜか buttonも、type の変更が出来ない、k === 'type' && alert( this._dirty + ' ' + elm.outerHTML ); + // TODO IE では input, なぜか buttonも、type の変更が出来ない、object も 同値で置き換えようとしても不可 ( v = attrs[ k ] ) === undefined ? elm.removeAttribute( rename[ k ] || k ) : ( elm[ rename[ k ] || k ] = X.Dom.Attr.noValue[ k ] ? k : v ); @@ -1151,7 +1151,7 @@ Node.prototype._updateRawNode = for( k in attrs ){ ( v = attrs[ k ] ) === undefined ? elm.removeAttribute( rename[ k ] || k ) : - elm.setAttribute( rename[ k ] || k, v ); // TODO X.Dom.Attr.noValue + elm.setAttribute( rename[ k ] || k, v ); // TODO X.Dom.Attr.noValue[ k ] ? k : v }; delete this._newAttrs; }; @@ -1281,15 +1281,16 @@ Node.prototype._afterActualCreate = elm.appendChild( xnodes[ i ]._actualCreate( true ) ); }; }; - if( !X.Dom._strictElmCreation ){ + if( X.Dom._strictElmCreation ){ + if( this._dirty & X.Dom.Dirty.IE_FILTER ){ + elm.style.filter = X.Dom.Style.SPECIAL_FIX( this._css ); + }; + delete this._dirty; + } else { elm.UID = this._uid; this._newAttrs = this._attrs; this._dirty = X.Dom.Dirty.ID | X.Dom.Dirty.CLASSNAME | X.Dom.Dirty.CSS | X.Dom.Dirty.ATTR | X.Dom.Dirty.IE_FILTER; this._updateRawNode( elm ); - } else - if( this._dirty & X.Dom.Dirty.IE_FILTER ){ - elm.style.filter = X.Dom.Style.SPECIAL_FIX( this._css ); - delete this._dirty; }; delete this._isNew; @@ -1297,10 +1298,8 @@ Node.prototype._afterActualCreate = this._dirty && this._updateRawNode( elm ); }; - if( l ){ - for( i = 0; i < l; ++i ){ - xnodes[ i ]._afterActualCreate(); - }; + for( i = 0; i < l; ++i ){ + xnodes[ i ]._afterActualCreate(); }; // src の onload があるので先ではないか? // ie の str から要素を作る場合、srcだけ イベント設定後ではないか? diff --git a/0.6.x/js/02_dom/15_XDomAttr.js b/0.6.x/js/02_dom/15_XDomAttr.js index 3fd0ed2..9a43170 100644 --- a/0.6.x/js/02_dom/15_XDomAttr.js +++ b/0.6.x/js/02_dom/15_XDomAttr.js @@ -147,7 +147,7 @@ X.Dom.Node.prototype.attr = function( nameOrObj /* v */ ){ }; X.Dom.Node.prototype._setAttr = function( attrs, newAttrs, name, v ){ switch( name ){ - // case 'type' : TODO IE は input, button に対して type の再設定が出来ない _state が要素生成済なら不可 + // case 'type' : TODO IE は input, button, object に対して type の再設定が出来ない _state が要素生成済なら不可 case 'UID' : case 'tag' : case 'tagName' : @@ -169,7 +169,7 @@ X.Dom.Node.prototype._setAttr = function( attrs, newAttrs, name, v ){ }; // debug if( name.indexOf( 'on' ) === 0 ){ - X.Notification.warn( 'xnode.attr("' + name + '") is wrong, xnode.listen() & xnode.unlisten().' ); + X.Logger.warn( 'xnode.attr("' + name + '") is wrong, xnode.listen() & xnode.unlisten().' ); return; }; diff --git a/0.6.x/js/02_dom/19_XDomParser.js b/0.6.x/js/02_dom/19_XDomParser.js index 51e9cdb..648de81 100644 --- a/0.6.x/js/02_dom/19_XDomParser.js +++ b/0.6.x/js/02_dom/19_XDomParser.js @@ -310,7 +310,7 @@ X.Dom._htmlStringToXNode = { nest : [], err : function( html ){ X.Dom._htmlStringToXNode.flat.length = 0; - X.Dom._htmlStringToXNode.ignoreError !== true && X.Notification.warn( 'X_Dom_Parser() error ' + html ); + X.Dom._htmlStringToXNode.ignoreError !== true && X.Logger.warn( 'X_Dom_Parser() error ' + html ); }, start : function( tagName, attrs, noChild, length ){ var xnode, diff --git a/0.6.x/js/06_audio/00_XAudio.js b/0.6.x/js/06_audio/00_XAudio.js index 3727959..4b94da4 100644 --- a/0.6.x/js/06_audio/00_XAudio.js +++ b/0.6.x/js/06_audio/00_XAudio.js @@ -1,4 +1,4 @@ -X.Audio = { +X.Audio = { HTML5 : 1, Flash : 2, Silverlight : 3, @@ -14,6 +14,10 @@ X.Audio = { var X_Audio_BACKENDS = []; +/* + * TODO preplayerror play してみたら error が出た、backend の変更。 + */ + function X_Audio_detectBackend( proxy, sourceList, option ){ var source = sourceList.shift() || '', parts = source.split( '?' )[ 0 ].split( '#' )[ 0 ].split( '.' ), diff --git a/0.6.x/js/06_audio/01_XHTML5Audio.js b/0.6.x/js/06_audio/01_XHTML5Audio.js index 5bea55f..827bed8 100644 --- a/0.6.x/js/06_audio/01_XHTML5Audio.js +++ b/0.6.x/js/06_audio/01_XHTML5Audio.js @@ -1,4 +1,4 @@ -/* +/* * original : uupaa-js HTML5Audio.js * https://code.google.com/p/uupaa-js/source/browse/trunk/0.8/src/Audio/HTML5Audio.js?r=568 */ @@ -317,3 +317,10 @@ if( window.HTMLAudioElement ){ }; + + + + + + + diff --git a/0.6.x/js/06_audio/02_XSilverlightAudio.js b/0.6.x/js/06_audio/02_XSilverlightAudio.js index ca199d3..2faf847 100644 --- a/0.6.x/js/06_audio/02_XSilverlightAudio.js +++ b/0.6.x/js/06_audio/02_XSilverlightAudio.js @@ -1,14 +1,13 @@ -/* +/* * original : uupaa-js SilverlightAudio.js * https://code.google.com/p/uupaa-js/source/browse/trunk/0.8/src/Audio/SilverlightAudio.js?r=568 - */ - -/* + * * Silverlight 4 → 5における不具合の状況 * http://www.slideshare.net/wakabayashiy/silverlight-4-5 * * SilverlLight5 ie6&7(ietester,winxp), ie8(winxp) で動作確認。firefox32 では動作しない。(4以下の方がよい?) */ + var X_Audio_SLAudio, X_Audio_SLAudioWrapper, X_Audio_SLAudio_uid = 0, X_Audio_SLAudio_LIVE_LIST = [], @@ -192,7 +191,7 @@ if( X.Pulgin.SilverlightEnabled ){ case 'MediaOpened' : // http://msdn.microsoft.com/ja-jp/library/bb979710(VS.95).aspx this._duration = this._rawObject.NaturalDuration.Seconds; - + // TODO 'canplaythrough' this.proxy.dispatch( 'canplay' ); break; case 'MediaEnded' : @@ -392,3 +391,6 @@ if( X.Pulgin.SilverlightEnabled ){ ); }; + + +