X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F02_dom%2F07_XNodeList.js;h=be45a3b0cb56033e1e3dff1ad23d2adf44174114;hb=e28511741c97176b8ffe67bb1ea0660da37f754b;hp=891bc795e5fa97827111de6ab3d3874ef9872e93;hpb=d9cca45398f61025472f2858818519562a746e61;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/02_dom/07_XNodeList.js b/0.6.x/js/02_dom/07_XNodeList.js index 891bc79..be45a3b 100644 --- a/0.6.x/js/02_dom/07_XNodeList.js +++ b/0.6.x/js/02_dom/07_XNodeList.js @@ -1,22 +1,20 @@ -X.Dom.NodeList = function( v ){ +function X_NodeList( v ){ var args = [], l = arguments.length, i = 0, - indexOf, xnode, j, n = 0, skip; + xnode, j, n = 0, skip; + for( ; i < l; ++i ){ - //args.push( arguments[ i ] ); args.push.apply( args, arguments[ i ] ); }; - //alert( arguments[ 0 ].length + ' , ' + args.length ) - if( ( l = args.length ) === 1 ) return new X.Dom.Node( args[ 0 ] ); - if( !this || this.append !== X.Dom.NodeList.prototype.append ) return new X.Dom.NodeList( args ); + + if( ( l = args.length ) === 1 ) return new Node( args[ 0 ] ); + if( !this || this[ 'append' ] !== X_NodeList.prototype[ 'append' ] ) return new X_NodeList( args ); for( i = 0; i < l; ++i ){ xnode = args[ i ]; - //xnode = xnode && xnode.constructor === X.Dom.Node ? xnode : new X.Dom.Node( xnode ); skip = false; - if( xnode._xnodeType === 0 ) continue; for( j = 0; j < n; ++j ){ if( this[ j ] === xnode ){ skip = true; @@ -25,18 +23,18 @@ X.Dom.NodeList = function( v ){ }; if( !skip ){ this[ n ] = xnode; - n = ++this.length; + n = ++this.length; }; }; }; -X.Dom.NodeList.prototype.length = 0; +X_NodeList.prototype.length = 0; -X.Dom.NodeList.prototype.each = function( func /* opt_args... */ ){ +X_NodeList.prototype[ 'each' ] = function( func /* opt_args... */ ){ var l = this.length, i = 0, args; if( 1 < arguments.length ){ - args = X_Object_cloneArray( arguments ); + args = X_Array_copy( arguments ); for( ; i < l; ++i ){ args[ 0 ] = i; if( func.apply( this[ i ], args ) === false ) break; @@ -52,15 +50,16 @@ X.Dom.NodeList.prototype.each = function( func /* opt_args... */ ){ /* -------------------------------------- * Fuction Base, multi, getter, setter, */ -X.ViewPort.listenOnce( X_TEMP.SYSTEM_EVENT_PRE_INIT, function(){ - var target = X.Dom.NodeList.prototype, - src = X.Dom.Node.prototype, +X_TEMP.onSystemReady.push( function( sys ){ + var target = X_NodeList.prototype, + src = Node.prototype, p, v, multi; for( p in src ){ + //if( X_EMPTY_OBJECT[ p ] ) continue; v = src[ p ]; - if( X.Type.isFunction( v ) && !target[ p ] ){ + if( X_Type_isFunction( v ) && !target[ p ] ){ target[ p ] = multi = new Function( [ - 'var a=arguments,f=X.Dom.Node.prototype.', p, ',t=this,i,l=t.length;', + 'var a=arguments,f=X.Node.prototype.', p, ',t=this,i,l=t.length;', 'if(l)', 'for(i=0;i