OSDN Git Service

Version 0.6.13, X.UI use X.Dom.Node.
[pettanr/clientJs.git] / 0.6.x / js / core / 00_X.js
index c0fd382..6808394 100644 (file)
@@ -2,18 +2,21 @@ if( !window['console'] ) console = { log : function(){} };
 \r
 var undefined,\r
        X = X || {\r
-                       \r
-               emptyFunction : new Function,\r
                \r
-               inHead        : (function( s, p ){\r
-                       s = s[ s.length - 1 ];\r
-                       p = s.parent || s.parentNode;\r
-                       if( !p ) return true;// ??\r
-                       return p.tagName.toLowerCase() === 'head';\r
-               })( document.scripts || document.getElementsByTagName( 'script' ) || document.all.tags( 'script' ) ),\r
+               VERSION : '0.6.13',\r
+               \r
+               bootTime : + new Date,\r
                \r
                getTime : Date.now ? new Function( 'return Date.now()' ) : new Function( 'return +new Date' ),\r
                \r
+               emptyFunction : new Function,\r
+               \r
+               inHead        : (function( s ){\r
+                       s = s[ s.length - 1 ];\r
+                       // Dom0 || Dom1\r
+                       return ( s.parentElement || s.parentNode ).tagName.toLowerCase() === 'head';\r
+               })( document.scripts || document.getElementsByTagName( 'script' ) || document.all.tags( 'script' ) ),\r
+\r
                parse : function( v ){\r
                        var _v, n;\r
                        if( Type.isString( v ) === true ){\r
@@ -36,18 +39,31 @@ var undefined,
                        return v;\r
                },\r
                \r
+               skipCleanupTagNames : 'pre,textarea,code,kbd,samp,xmp,plaintext,listing'.split( ',' ),\r
+               \r
                cleanupWhiteSpace : function( text ){\r
-                       text.indexOf( '\r\n' ) !== -1 && ( text = text.split( '\r\n' ).join( ' ' ) );\r
-                       text.indexOf( '\n\r' ) !== -1 && ( text = text.split( '\n\r' ).join( ' ' ) );\r
-                       text.indexOf( '\t' )   !== -1 && ( text = text.split( '\t' ).join( ' ' ) );\r
-                       text.indexOf( '\r' )   !== -1 && ( text = text.split( '\r' ).join( ' ' ) );\r
-                       text.indexOf( '\n' )   !== -1 && ( text = text.split( '\n' ).join( ' ' ) );\r
-                       text.indexOf( '\f' )   !== -1 && ( text = text.split( '\f' ).join( ' ' ) );\r
-                       text.indexOf( '\b' )   !== -1 && ( text = text.split( '\b' ).join( ' ' ) );\r
-                       while( text.indexOf( '  ' ) !== -1 ){\r
-                               text = text.split( '  ' ).join( ' ' );\r
+                       var _ = ' ', __ = '  ';\r
+                       text.indexOf( '\r\n' ) !== -1 && ( text = text.split( '\r\n' ).join( _ ) );\r
+                       text.indexOf( '\n\r' ) !== -1 && ( text = text.split( '\n\r' ).join( _ ) );\r
+                       text.indexOf( '\t' )   !== -1 && ( text = text.split( '\t' ).join( _ ) );\r
+                       text.indexOf( '\r' )   !== -1 && ( text = text.split( '\r' ).join( _ ) );\r
+                       text.indexOf( '\n' )   !== -1 && ( text = text.split( '\n' ).join( _ ) );\r
+                       text.indexOf( '\f' )   !== -1 && ( text = text.split( '\f' ).join( _ ) );\r
+                       text.indexOf( '\b' )   !== -1 && ( text = text.split( '\b' ).join( _ ) );\r
+                       while( text.indexOf( __ ) !== -1 ){\r
+                               text = text.split( __ ).join( _ );\r
                        };\r
                        return text;\r
+               },\r
+               \r
+               isEmptyObject : function( v ){\r
+                       if( v.length !== 0 ) return false;\r
+                       for( var p in v ){\r
+                               if( v.hasOwnProperty( p ) ) return false;\r
+                       };\r
+                       return true;\r
                }\r
        };\r
        \r
+// bonus: hotfix for IE6 SP1 (bug KB823727)\r
+document.execCommand && document.execCommand( 'BackgroundImageCache', false, true );\r