OSDN Git Service

Version 0.6.147, fix X.UA & X.URL & X.EventDispatcher & X.XHR.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 06_XURL.js
index 7d395f4..daa6a8e 100644 (file)
@@ -39,6 +39,10 @@ X[ 'URL' ] = {
        \r
        'isSameDomain'   : X_URL_isSameDomain,\r
        \r
+       'isSameProtocol' : X_URL_isSameProtocol,\r
+       \r
+       'isLocal'        : X_URL_isLocal,\r
+       \r
        'cleanup'        : X_URL_cleanup,\r
        \r
        'getEXT'         : X_URL_getEXT\r
@@ -81,6 +85,14 @@ function X_URL_isSameDomain( path ){
        return path === X_URL_BASE_URL || path.indexOf( X_URL_BASE_URL + '/' ) === 0;\r
 };\r
 \r
+function X_URL_isSameProtocol( path ){\r
+       return X_URL_toAbsolutePath( path ).indexOf( location.protocol ) === 0;\r
+};\r
+\r
+function X_URL_isLocal( path ){\r
+       return X_URL_toAbsolutePath( path ).indexOf( 'file:' ) === 0;\r
+};\r
+\r
 function X_URL_cleanup( path ){\r
        return path.split( '?' )[ 0 ].split( '#' )[ 0 ];\r
 };\r