From: itozyun Date: Thu, 18 Sep 2014 02:59:11 +0000 (+0900) Subject: Version 0.6.81, bugfix for X.Class. X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=640a1e4af97cd2220b2d2f3531e1bf0fbe101cb2;p=pettanr%2FclientJs.git Version 0.6.81, bugfix for X.Class. --- diff --git a/0.6.x/js/00_core/04_XClass.js b/0.6.x/js/00_core/04_XClass.js index dfe3340..031f5b1 100644 --- a/0.6.x/js/00_core/04_XClass.js +++ b/0.6.x/js/00_core/04_XClass.js @@ -217,7 +217,7 @@ X.Class = ( function(){ def[ CONSTRUCTOR ].apply( instance, args ) : def.SuperConstructor && def.SuperConstructor.apply( instance, args ); - if( X.Type.isObject( obj ) && obj !== instance ){ + if( ( X.Type.isObject( obj ) && obj !== instance ) || X.Type.isFunction( obj ) ){ // Class instance.kill(); return obj; }; diff --git a/0.6.x/js/01_dom/11_XDomNode.js b/0.6.x/js/01_dom/11_XDomNode.js index f4acbf8..d9bd701 100644 --- a/0.6.x/js/01_dom/11_XDomNode.js +++ b/0.6.x/js/01_dom/11_XDomNode.js @@ -46,7 +46,7 @@ X.Dom.Node = X.EventDispatcher.inherits( _isNew : false, - _rawObject : null, + _rawObject : null, _rect : null, // _root : null, // xnode が文書ツリーに属しているか?はこれを見る @@ -70,6 +70,9 @@ X.Dom.Node = X.EventDispatcher.inherits( _anime : null, + /* + * TODO Node の継承ができない! + */ Constructor : function( v ){ var css, xnodes, xnode, parent, uid = Node._chashe.length; @@ -102,7 +105,7 @@ X.Dom.Node = X.EventDispatcher.inherits( // v.parentNode || v.parentElement : dom1 || dom0 this.parent = ( parent = v.parentNode || v.parentElement ) && parent.tagName /* ie7- */ && Node._getXNode( parent ); this._root = this.parent ? this.parent._root : null; - this._rawObject = v; + this._rawObject = v; this._xnodeType = 1; this._state = X.Dom.State.DISPLAY_BLOCK; // todo this._tag = v.tagName.toUpperCase(); @@ -123,7 +126,7 @@ X.Dom.Node = X.EventDispatcher.inherits( if( xnode = Node._getXNode( v ) ) return xnode; this.parent = Node._getXNode( v.parentNode ); this._root = this.parent ? this.parent._root : null; - this._rawObject = v; + this._rawObject = v; this._xnodeType = 3; this._state = X.Dom.State.DISPLAY_INLINE; this._text = v.data; @@ -136,7 +139,7 @@ X.Dom.Node = X.EventDispatcher.inherits( return Node.none; case Node.IS_IMAGE : if( xnode = Node._getXNode( v ) ) return xnode; - this._rawObject = v; + this._rawObject = v; this._xnodeType = 4; v.UID = uid; this._state = X.Dom.State.EXIST; @@ -144,7 +147,7 @@ X.Dom.Node = X.EventDispatcher.inherits( case Node.IS_WINDOW : case Node.IS_DOCUMENT : if( xnode = Node._getXNode( v ) ) return xnode; - this._rawObject = v; + this._rawObject = v; this._xnodeType = 2; this._state = X.Dom.State.DISPLAY_BLOCK; break; diff --git a/0.6.x/js/04_net/00_XNet.js b/0.6.x/js/04_net/00_XNet.js index d3604f4..2135f20 100644 --- a/0.6.x/js/04_net/00_XNet.js +++ b/0.6.x/js/04_net/00_XNet.js @@ -2,11 +2,11 @@ X.Net = { xhrGet : function( url ){ - return new X_NET_Queue( X_NET_TYPE_XHR, { method : 'GET', get : url } ); + return new X_NET_Queue( X_NET_TYPE_XHR, { method : 'GET', url : url } ); }, - xhrPost : function( url ){ - return new X_NET_Queue( X_NET_TYPE_XHR, { method : 'POST', post : url } ); + xhrPost : function( url, data ){ + return new X_NET_Queue( X_NET_TYPE_XHR, { method : 'POST', url : url, postbody : postbody } ); }, formGet : function(){ @@ -18,12 +18,17 @@ X.Net = { }, // TODO chashe - jsonp : function( url ){ + // TODO iframe useful or not. + jsonp : function( url, useIframe ){ return new X_NET_Queue( X_NET_TYPE_JSONP, url ); }, - image : function(){ + image : function( url, useIframe ){ + }, + + amountQueue : function(){ + return X_NET_QUEUE_LIST.length; } }; diff --git a/0.6.x/js/04_net/01_XNetXHR.js b/0.6.x/js/04_net/01_XNetXHR.js index 91330ef..98d3b6b 100644 --- a/0.6.x/js/04_net/01_XNetXHR.js +++ b/0.6.x/js/04_net/01_XNetXHR.js @@ -59,23 +59,33 @@ if( X.Net.XHR.W3C || X_Net_XHR_ACTIVE_X ){ _isXHR : true, _isXDR : false, // for ie8 - _method : null, - _type : null, + _method : '', + _type : '', _busy : false, _canceled : false, _lastProgress : 0, load : function( obj ){ var raw = X_NET_XHRWrapper._rawObject, - method = obj[ 'get' ] ? 'GET' : 'POST', - url = obj[ 'get' ] || obj[ 'post' ], + method = obj[ 'method' ], + url = obj[ 'url' ], async = obj[ 'async' ], user = obj[ 'user' ], password = obj[ 'password' ], headers = obj[ 'headers' ], postbody = obj[ 'postbody' ], - timeout = obj[ 'timeout' ]; - + timeout = obj[ 'timeout' ], + temp; + + if( obj[ 'type' ] ){ + this._type = obj[ 'type' ]; + } else { + temp = url.split( '#' )[ 0 ].split( '?' )[ 0 ].split( '.' ); + if( 2 <= temp.length ){ + this._type = temp[ temp.length - 1 ].toLowerCase(); + }; + }; + if( X_Net_XHR_X_DOMAIN ){ if( false /* isXDomain( url ) */ ){ // isXDomain //if( raw !== X_Net_XHR_X_DOMAIN ){ @@ -197,15 +207,22 @@ if( X.Net.XHR.W3C || X_Net_XHR_ACTIVE_X ){ // parse json, html, xml, text, script, css switch( this._type ){ - case null : + case '' : case 'text' : data = raw[ 'responseText' ]; break; case 'json' : case 'moz-json' : + break; case 'document' : + case 'xml' : + case 'html' : + case 'htm' : + data = raw[ 'responseXML' ]; + break; case 'blob' : case 'arraybuffer' : + break; }; //console.log( 'status ' + status );