OSDN Git Service

version 0.5.32, UI.FileInput was fixed for Opera9.
authoritozyun <itozyun@gmail.com>
Thu, 13 Dec 2012 21:46:04 +0000 (06:46 +0900)
committeritozyun <itozyun@gmail.com>
Thu, 13 Dec 2012 21:46:04 +0000 (06:46 +0900)
0.5.x/javascripts/peta.apps.js
0.5.x/javascripts/system.js
0.5.x/stylesheets/system.css

index 6bfa509..e0cede0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.31
+ *   version 0.5.32
  *   
  * author:
  *   itozyun
@@ -4313,7 +4313,7 @@ var FormApplicationHelper = function( app ){
                this.onreadystatechange = null;
                app.onIframeUpdate();
                delete app.detectIframe;
-               };              
+               };
        };
        app.onIframeUpdate = function(){
                app.elmIframe.onload = null;
@@ -4541,7 +4541,7 @@ var UploadConsole = gOS.registerApplication( function(){
        };
        this.elmProgressID   = 'upload-console-progress';
        this.elmUploaderID   = 'uploader';
-       this.elmIframeName   = 'targetFrameUpload'
+       this.elmIframeName   = 'targetFrameUpload';
        this.scriptSrc       = pettanr.CONST.UPLOAD_PICTURE_JS;
        this.hideUploader    = false;
        FormApplicationHelper( this );
@@ -4565,7 +4565,7 @@ var UploadConsole = gOS.registerApplication( function(){
                app.destroyHelper();
                app = elmFile = buttonSubmit = buttonCancel = null;
        };
-       this.onFormReady     = function(){
+       this.onFormReady = function(){
                var elmForm    = app.elmForm,
                        _inputList = elmForm.getElementsByTagName( 'input' ),
                        _input;
@@ -4578,9 +4578,9 @@ var UploadConsole = gOS.registerApplication( function(){
                                _input.style.display = 'none';
                        };
                };
-               node.mesure();
                app.onPaneResize( windowW, windowH );
                app.createUIForm( nodeForm, elmForm );
+               node.mesure();
                node.mesureChildren();
                delete app.onFormReady;
        };
index 0e68aad..94a908b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.5.31
+ *   version 0.5.32
  *
  * gadgetOS
  *   author:
@@ -3801,6 +3801,7 @@ var Image = ( function(){
 
 var Overlay = ( function(){
        var elmContainer, elmShadow, elmCloseButton,
+               bootParams,
                application    = null,
                visible        = false,
                bodyOverflow   = '',
@@ -3813,18 +3814,22 @@ var Overlay = ( function(){
        function asyncInit( /* arguments */ ){
                application.init();
                //application.rootElement.style.display = 'none';
-       };
-       function asyncOpen( /* arguments */ ){
-               var _arg = Util.copyArray( arguments );
-               _arg.unshift( windowW, windowH );
-               application.open.apply( application, _arg );
                
                elmContainer.style.cssText = "top:" + body.scrollTop + 'px;display:none;';
                $( elmContainer ).stop().fadeIn( onFadeInComplete );            
        };
+       function asyncOpen( /* arguments */ ){
+
+               
+               
+       };
        function onFadeInComplete(){
                KeyEvent.add( application, Const.KEY.EVENT.KEY_DOWN, Overlay.hide, 27 ); // 27.esc
                MouseEvent.add( application, elmCloseButton, 'click', onCloseClick );
+               
+               var _arg = bootParams; //Util.copyArray( arguments );
+               _arg.unshift( windowW, windowH );
+               application.open.apply( application, _arg );            
        };
        function onFadeOutComplete(){   
                Util.removeAllChildren( elmContainer );
@@ -3861,7 +3866,9 @@ var Overlay = ( function(){
                        //asyncInit();
                        elmContainer.insertBefore( application.rootElement, elmCloseButton );
                        _application.addAsyncCall( asyncInit );
-                       _application.addAsyncCall( asyncOpen, _bootParams );                    
+                       // _application.addAsyncCall( asyncOpen,  );
+                       
+                       bootParams = _bootParams;                       
                },
                hide: function(){
                        if( visible === false ) return;
@@ -4109,6 +4116,7 @@ var UI = ( function(){
        var FileInputManager = ( function(){
                var currentData,
                        elmForm,
+                       elmFileInput,
                        elmWrap,
                        evt;
                
@@ -4142,31 +4150,36 @@ var UI = ( function(){
                function asyncMouseout(){
                        currentData && currentData.item.blur();
                };
-               
+               function onClick(){
+                       MouseEvent.remove( currentUser, elmFileInput, 'mouseout', asyncMouseout );
+                       MouseEvent.remove( currentUser, elmFileInput, 'click', onClick );       
+               };
                return {
                        show : function( data ){
                                currentData = data;
-
-                               elmWrap = data.elmFileInputReal.parentNode;
+                               
+                               elmFileInput = data.elmFileInputReal;
+                               elmWrap      = elmFileInput.parentNode;
                                // 
                                
                                updateWrapperPosition();
-                               data.elmFileInputReal.focus();
+                               elmFileInput.focus();
                                //data.node.addEventListener( 'change', change, data );
-                               evt = new EventTicketClass( data.elmFileInputReal, 'change', change );
-                               // MouseEvent.add( currentUser, data.elmFileInputReal, 'mouseout', asyncMouseout );
-                               // MouseEvent.add( elmWrap, 'click', data.elmFileInputReal.focus, data.elmFileInputReal );
-                               currentData.elmFileInputReal.onchange = change;
+                               evt = new EventTicketClass( elmFileInput, 'change', change );
+                               MouseEvent.add( currentUser, elmFileInput, 'mouseout', asyncMouseout );
+                               MouseEvent.add( currentUser, elmFileInput, 'click', onClick );
+                               // currentData.elmFileInputReal.onchange = change;
                                SystemTimer.add( SUPER_USER_KEY, updateWrapperPosition, 500 );
                        },
                        hide : function( data ){
                                if( currentData !== data ) return;
                                // data.node.removeEventListener( 'change', change );
                                evt.destroy();
-                               MouseEvent.remove( currentUser, currentData.elmFileInputReal, 'mouseout', asyncMouseout );
-                               currentData.elmFileInputReal.onchange = null;
+                               // MouseEvent.remove( currentUser, elmFileInput, 'mouseout', asyncMouseout );
+                               onClick();
+                               //currentData.elmFileInputReal.onchange = null;
                                elmWrap.style.display = 'none';
-                               currentData = null;
+                               currentData = elmFileInput = null;
                                SystemTimer.remove( SUPER_USER_KEY, updateWrapperPosition );
                        },
                        onWindowResize: function( _w, _h ){
@@ -4803,9 +4816,12 @@ var UIForm = ( function(){
        FormItemData.prototype = {
                formData : null,
                uiItem   : null,
-               init: function( formData, uiItem ){
+               init : function( formData, uiItem ){
                        this.formData = formData;
                        this.uiItem   = uiItem;
+               },
+               onUpdate : function( v ){
+                       // var index = Util.getIndex( this.formData.itemList, this );
                }
        };
        
@@ -4843,14 +4859,21 @@ var UIForm = ( function(){
                                                        case 'text':
                                                                break;
                                                        case 'file':
-                                                               el = Util.pullHtmlAsTemplete( '<div class="uiform-file-container"><div class="uiform-label"></div><div class="uiform-file fileinput-value"></div></div>' );
+                                                               el = document.createElement( 'div' );
+                                                               el.className = 'uiform-file-container';
+                                                               el.appendChild( document.createElement( 'div' ) );
+                                                               el.appendChild( document.createElement( 'div' ) );
+                                                               el.firstChild.className = 'uiform-label';
+                                                               el.lastChild.className  = 'uiform-file fileinput-value';
+                                                               // opera9 don't work for opera9;
+                                                               //el = Util.pullHtmlAsTemplete( '<div class="uiform-file-container"><div class="uiform-label"></div><div class="uiform-file fileinput-value"></div></div>' );
                                                                elm.appendChild( el );
                                                                data = new FormItemData();
                                                                wrap = document.createElement( 'div' );
                                                                form.parentNode.insertBefore( wrap, form );
                                                                wrap.className = CLASSNAME_FILE_WRAP;
                                                                wrap.appendChild( form );
-                                                               data.init( this, this.ui.createFileInput( el, null, null, form ) );
+                                                               data.init( this, this.ui.createFileInput( el, data.onUpdate, null, form ) );
                                                                this.itemList.push( data );
                                                                // alert( i )
                                                                break;
index b93e626..bfeb901 100644 (file)
@@ -1,7 +1,7 @@
 @charset "UTF-8";\r
 \r
 /* pettanR system.css\r
- *   version 0.5.31\r
+ *   version 0.5.32\r
  * \r
  *   author:\r
  *     itozyun\r