OSDN Git Service

Version 0.6.104, fix X_shortcut & etc.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 03_XType.js
index b30d82d..f3ede40 100644 (file)
@@ -19,9 +19,9 @@ X.Type = {
        \r
        isArray :\r
                new Function( 'v',\r
-                       X.UA.IE < 5.5 ?\r
+                       X_UA.IE < 5.5 ?\r
                                'return v&&v.push===Array.prototype.push' : // win ie5-, MacIE5.2\r
-                       X.UA.IE ?\r
+                       X_UA.IE ?\r
                                'return v&&Object.prototype.toString.call(v)==="[object Array]"' :\r
                                'return v instanceof Array'\r
                ),\r
@@ -31,7 +31,7 @@ X.Type = {
        },\r
        \r
        isString : function( v ){\r
-               return typeof v === 'string';\r
+               return typeof v === 'string'; // v === v + '';\r
        },\r
        \r
        isNumber : function( v ){\r
@@ -39,22 +39,22 @@ X.Type = {
        },\r
        \r
        isFinite : function( v ){\r
-               return typeof v === 'number' && isFinite( v ); // isFinite( '123' ) とかに対策\r
+               return typeof v === 'number' && isFinite( v ); // isFinite( '123' ) === true に対策\r
        },\r
        \r
        isNaN : function( v ){\r
-               return v !== v; // isNaN( 'NaN' ) になってしまう\r
+               return v !== v; // isNaN( 'NaN' ) === true      に対策\r
        },\r
        \r
        isHTMLElement :\r
                new Function( 'v',\r
-                       ( X.UA.IE4 || X.UA.MacIE ) ?\r
-                               'return v&&v.tagName' : // ie4 or MacIE5.23, v.all <- error\r
+                       ( X_UA.IE4 || X_UA.MacIE ) ?\r
+                               'return v&&v.tagName&&v.insertAdjacentHTML&&true' : // ie4 or MacIE5.23, v.all <- error\r
                        window[ 'HTMLElement' ] ?\r
                                'return v instanceof HTMLElement' :\r
                        //window[ 'Element' ] ?\r
                        //      'return v instanceof Element' : // error @ie8\r
-                               'return v&&v.nodeType===1&&v.appendChild'\r
+                               'return v&&v.appendChild&&v.nodeType===1'\r
                ),\r
        \r
        /*\r
@@ -64,7 +64,7 @@ X.Type = {
                function( v ){\r
                        if( v && v.constructor === window.Image ) return true;\r
                        if( v && window.HTMLImageElement && v.constructor === window.HTMLImageElement ) return true; // ie6- は constructor が undef、HTMLImageElement が undef なので、HTMLElement の存在確認が必要\r
-                       if( X.UA.WebKit < 525.13 ){ // Safari3-\r
+                       if( X_UA.WebKit < 525.13 ){ // Safari3-\r
                                if( v && v.src !== undefined && v.onload !== undefined && X.Type.isNumber( v.height ) && X.Type.isNumber( v.width ) && X.Type.isBoolean( v.complete ) ){\r
                                        return true;\r
                                };\r