OSDN Git Service

Version 0.6.194, X.UI.Page working.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 21_XViewPort.js
index c83d9de..02ec900 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( X_Type_isString( href ) && !href.toLowerCase().indexOf( 'javascript:' ) ) return X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_STOP_PROPAGATION;
                                        
                                        return X_ViewPort[ 'dispatch' ]( X_EVENT_BEFORE_UNLOAD );
                                        
@@ -51,7 +51,7 @@ X_ViewPort = X_Class_override(
                                        X_ViewPort[ 'dispatch' ]( X_EVENT_UNLOAD );
                                //alert('unload');
                                        X_ViewPort_document[ 'kill' ]();
-                                       this[ 'kill' ]();
+                                       X_ViewPort[ 'kill' ]();
                                        
                                        //X_System[ 'dispatch' ]( X_EVENT_SHUT_DOWN );
                                        break;
@@ -136,6 +136,7 @@ function X_ViewPort_changeFocus(){
 };
 
 
+// TODO EventDispatcherProxy
 /**
  * window に相当する ViewPort 情報を提供するオブジェクト。
  * @namespace X.ViewPort
@@ -415,7 +416,7 @@ X[ 'ViewPort' ] = {
                };
 
                X_TEMP.onDomContentLoaded = function(){
-                       var s, size, html, head, body;
+                       var html, head, body;
                        
                        console.log( '> X_TEMP.onDomContentLoaded rs:' + X_ViewPort_readyState );
                        
@@ -431,7 +432,7 @@ X[ 'ViewPort' ] = {
                        X_ViewPort_rootElement = document.compatMode !== 'CSS1Compat' ? X_elmBody : X_elmHtml || X_elmBody;
 
        /**
-        * Node( documentElement )
+        * X.Node( documentElement )
         * @alias X.Doc.html
         * @type {Node}
         */
@@ -439,14 +440,14 @@ X[ 'ViewPort' ] = {
                        html[ '_flags' ] |= X_NodeFlags_IN_TREE;
 
        /**
-        * Node( head )
+        * X.Node( head )
         * @alias X.Doc.head
         * @type {Node}
         */                     
                        X[ 'Doc' ][ 'head' ] = head = X_Node_head = X_elmHead && Node( X_elmHead );
 
        /**
-        * Node( documentElement )
+        * X.Node( body )
         * @alias X.Doc.body
         * @type {Node}
         */             
@@ -537,13 +538,10 @@ X[ 'ViewPort' ] = {
 console.log( '------------------->' );
 
                        if( document[ 'webkitHidden' ] !== undefined ){
-                               console.log( '--> has webkitvisibilitychange' );
                                X_EventDispatcher_systemListen( X_ViewPort_document, 'webkitvisibilitychange', X_ViewPort );
                        } else
                        if( document[ 'hidden' ] !== undefined ){// iOS 7+
-                               console.log( '--> has visibilitychange' );
                                X_EventDispatcher_systemListen( X_ViewPort_document, 'visibilitychange', X_ViewPort );
-                               document.onvisibilitychange = function(){ console.log( '!!!!!!!!!!!!!!!!' ) };
                        } else
                        if( document[ 'msHidden' ] !== undefined ){
                                X_EventDispatcher_systemListen( X_ViewPort_document, 'msvisibilitychange', X_ViewPort );
@@ -553,12 +551,10 @@ console.log( '------------------->' );
                        };
                        
                        if( window[ 'onpageshow' ] !== undefined ){
-                               console.log( '-------------------> pageshow, pagehide' );
                                X_EventDispatcher_systemListen( X_ViewPort, [ 'pageshow', 'pagehide' ] );
                        };
                        
                        if( document[ 'onfocusin' ] !== undefined ){
-                               console.log( '-------------------> focusin, focusout' );
                                // https://github.com/ai/visibilityjs/blob/master/lib/visibility.fallback.js
                                X_EventDispatcher_systemListen( X_ViewPort_document, [ 'focusin', 'focusout' ], X_ViewPort );
                        };