OSDN Git Service

Version 0.6.209, bug fixes X.Net.* & X.URL.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 09_XURL.js
index 0eaccab..1be41ad 100644 (file)
@@ -4,6 +4,7 @@
 // ------------------------------------------------------------------------- //\r
 var X_URL_BASE_URL = ( function( parts ){\r
                var last = 1 < parts.length && parts[ parts.length - 1 ];\r
+               \r
                if( last !== false && ( last === '' || //末尾が/で終わるとき\r
                        last.indexOf( '.' ) !== -1 ) ){    //末尾がファイル名で終わる時\r
                        --parts.length;\r
@@ -11,6 +12,8 @@ var X_URL_BASE_URL = ( function( parts ){
                return parts.join( '/' );\r
        })( X_URL_cleanup( location.href ).split( '/' ) ),\r
        \r
+       X_URL_HOST     = location.protocol + '//' + location.hostname,\r
+       \r
        X_URL_IS_FILE  = location.protocol === 'file:',\r
        \r
        X_URL_IS_LOCAL = X_URL_IS_FILE || location.hostname === 'localhost' || location.hostname === '127.0.0.1',\r
@@ -109,7 +112,7 @@ function X_URL_toAbsolutePath( path ){
  */\r
 function X_URL_isSameDomain( path ){\r
        path = X_URL_cleanup( X_URL_toAbsolutePath( path ) );\r
-       return path === X_URL_BASE_URL || path.indexOf( X_URL_BASE_URL + '/' ) === 0;\r
+       return path === X_URL_HOST || path.indexOf( X_URL_HOST + '/' ) === 0;\r
 };\r
 /**\r
  * 同一プロトコルか?\r