OSDN Git Service

Version 0.6.169, add doc comment.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 21_XViewPort.js
index 2fe61fa..b4f53b8 100644 (file)
@@ -41,7 +41,7 @@ X_ViewPort = X_Class_override(
                                case 'beforeunload' :
                                        // ie では a href='javascript' な要素でも beforeunload が起こる
                                        href = e.target && e.target[ 'attr' ] && e.target[ 'attr' ]( 'href' );
-                                       if( href && href.indexOf && href.indexOf( 'javascript:' ) === 0 ) return X_Callback_PREVENT_DEFAULT | X_Callback_STOP_PROPAGATION;
+                                       if( href && href.indexOf && href.indexOf( 'javascript:' ) === 0 ) return X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_STOP_PROPAGATION;
                                        
                                        return X_ViewPort[ 'dispatch' ]( X_EVENT_BEFORE_UNLOAD );
                                        
@@ -101,7 +101,10 @@ function X_ViewPort_changeFocus(){
  * @alias X.ViewPort
  */
 X[ 'ViewPort' ] = {
-       
+       /**
+        * 
+        * @alias X.ViewPort.listen
+        */
        'listen' : function( type, arg1, arg2, arg3 ){
                if( type <= X_ViewPort_readyState ){
                        /*
@@ -114,7 +117,10 @@ X[ 'ViewPort' ] = {
                return X[ 'ViewPort' ];
        },
        
-       
+       /**
+        * 
+        * @alias X.ViewPort.listenOnce
+        */
        'listenOnce' : function( type, arg1, arg2, arg3 ){
                if( type <= X_ViewPort_readyState ){
                        /*
@@ -126,16 +132,27 @@ X[ 'ViewPort' ] = {
                return X[ 'ViewPort' ];
        },
        
+       /**
+        * 
+        * @alias X.ViewPort.unlisten
+        */
        'unlisten' : function( type, arg1, arg2, arg3 ){
                type && arg1 && X_ViewPort[ 'unlisten' ]( type, arg1, arg2, arg3 );
                return X[ 'ViewPort' ];
        },
        
+       /**
+        * 
+        * @alias X.ViewPort.listening
+        */
        'listening' : function( type, arg1, arg2, arg3 ){
                return X_ViewPort[ 'listening' ]( type, arg1, arg2, arg3 );
        },
-       
-       // hammer のテストファイルだけが使用
+
+       /**
+        * hammer のテストファイルだけが使用
+        * @alias X.ViewPort.asyncDispatch
+        */
        'asyncDispatch' : function(){
                return X_ViewPort[ 'asyncDispatch' ].apply( X_ViewPort, arguments );
        },
@@ -151,6 +168,10 @@ X[ 'ViewPort' ] = {
                
        },
        
+       /**
+        * 
+        * @alias X.ViewPort.getSize
+        */
        'getSize' : function(){
                return [ X_ViewPort_width, X_ViewPort_height ];
        },
@@ -159,6 +180,10 @@ X[ 'ViewPort' ] = {
 //(((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.ScrollLeft == 'number' ? t : document.body).ScrollLeft;
 //(((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.ScrollTop == 'number' ? t : document.body).ScrollTop
        
+       /**
+        * 
+        * @alias X.ViewPort.getDocumentSize
+        */
        'getDocumentSize' : function(){
                // Opera は互換モードでは document.body.scrollHeight、標準モードでは document.documentElement.scrollHeight でページの高さが取れる。と思ってたんだけど、例外があった。
                // http://orera.g.hatena.ne.jp/edvakf/20100515/1273908051
@@ -177,6 +202,10 @@ X[ 'ViewPort' ] = {
                ];
        },
        
+       /**
+        * 
+        * @alias X.ViewPort.getScrollPosition
+        */
        'getScrollPosition' :
                window.pageXOffset !== undefined ?
                        ( function(){
@@ -194,10 +223,18 @@ X[ 'ViewPort' ] = {
                                return[ X_ViewPort_scrollX = X_ViewPort_rootElement.scrollLeft || document.body.scrollLeft, X_ViewPort_scrollY = X_ViewPort_rootElement.scrollTop || document.body.scrollTop ];
                        } ),
 
+       /**
+        * 
+        * @alias X.ViewPort.getScrollbarSize
+        */
        'getScrollbarSize' : function(){
                return [ X_ViewPort_vScrollbarSize, X_ViewPort_hScrollbarSize ];        
        },
        
+       /**
+        * 
+        * @alias X.ViewPort.getBaseFontSize
+        */
        'getBaseFontSize' : function(){
                if( X_Node_updateTimerID ){
                        X_Node_startUpdate();
@@ -261,7 +298,7 @@ X[ 'ViewPort' ] = {
                                        console.log( '-- resize : ' + X_Timer_now() );
                                        
                                        !X_ViewPort_lock && ( X_ViewPort_lock = true ) && X_Timer_once( 100, X_ViewPort_detectFinishResizing );
-                                       return X_Callback_PREVENT_DEFAULT | X_Callback_STOP_PROPAGATION;
+                                       return X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_STOP_PROPAGATION;
                                });
                
                function X_ViewPort_detectFinishResizing(){
@@ -287,7 +324,7 @@ X[ 'ViewPort' ] = {
                        
                        console.log( '> X_TEMP.onDomContentLoaded rs:' + X_ViewPort_readyState );
                        
-                       if( X_EVENT_PRE_INIT <= X_ViewPort_readyState ) return X_Callback_UN_LISTEN;
+                       if( X_EVENT_PRE_INIT <= X_ViewPort_readyState ) return X_CALLBACK_UN_LISTEN;
                        X_ViewPort_readyState = X_EVENT_PRE_INIT;
                        
                        // DOMContentLoaded の無いブラウザで X_TEMP.onDomContentLoaded への参照が残り続けるのを回避
@@ -430,7 +467,7 @@ X[ 'ViewPort' ] = {
                                X_EventDispatcher_systemListen( X_ViewPort, [ 'focus', 'blur' ] );
                        };
 
-                       return X_Callback_UN_LISTEN;
+                       return X_CALLBACK_UN_LISTEN;
                };
 
                function X_ViewPort_getWindowSize(){
@@ -481,7 +518,7 @@ if( 6 <= X_UA[ 'IE' ] && X[ 'inHead' ] ){
 // http://lists.apple.com/archives/web-dev/2003/Oct/msg00036.html
 if( X_UA[ 'WebKit' ] || X_UA[ 'Safari' ]  < 3 ){ // sniff
        X_Timer_add( 16, function(){
-               if( !X_TEMP.onDomContentLoaded ) return X_Callback_UN_LISTEN;
+               if( !X_TEMP.onDomContentLoaded ) return X_CALLBACK_UN_LISTEN;
                if( document.readyState === 'loaded' || document.readyState === 'complete' ) return X_TEMP.onDomContentLoaded();
        });
 };