OSDN Git Service

version 0.5.28, fixed system.UI & ComicConsole.
authoritozyun <itozyun@gmail.com>
Wed, 5 Dec 2012 00:06:08 +0000 (09:06 +0900)
committeritozyun <itozyun@gmail.com>
Wed, 5 Dec 2012 00:06:08 +0000 (09:06 +0900)
0.5.x/javascripts/peta.apps.js
0.5.x/javascripts/system.js

index da5d5a0..40f7a5f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.27
+ *   version 0.5.28
  *   
  * author:
  *   itozyun
@@ -20,7 +20,7 @@
                        
                        function onLoadJson( _file, _json ){
                                var _access = FileAPI.getFileDataAccess( _file ),
-                                       _data = _access !== null ? _access.DATA : null;
+                                       _data   = _access !== null ? _access.DATA : null;
                                if( _data === null ){
                                        onErrorJson( _file );
                                        return;
@@ -4242,7 +4242,7 @@ var FormApplicationHelper = function( app ){
        app.elmIframe   = null;
        app.elmForm     = null;
        app.fetchScript = function(){
-               app.elmProgress    = document.getElementById( app.elmProgressID );
+               app.elmProgress = document.getElementById( app.elmProgressID );
                
                if( !( app.elmUploader = document.getElementById( app.elmUploaderID ) ) ){
                        app.elmUploader    = document.createElement( 'div' );
@@ -4335,6 +4335,7 @@ var ComicConsole = gOS.registerApplication( function(){
        var elmHeader, elmProgress,
                windowW, windowH,
                inputTitle, inputW, inputH,
+               eventRoot, node,
                comboboxVisible, // comboboxEditable,
                buttonSubmit, buttonCancel,
                app         = this;
@@ -4416,6 +4417,7 @@ var ComicConsole = gOS.registerApplication( function(){
                ].join( '' );
                
                app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
+               eventRoot = app.getPointingDeviceEventTreeRoot();
                
                delete app.onInit;
        };
@@ -4424,10 +4426,40 @@ var ComicConsole = gOS.registerApplication( function(){
        this.elmIframeName   = 'targetFrameCreateComic'
        this.scriptSrc       = pettanr.CONST.CREATE_COMIC_JS;
        this.hideUploader    = true;
+       
        FormApplicationHelper( this );
-       this.onFormReady     = function(){
-               app.onPaneResize( windowW, windowH );
+       
+       this.onOpen = function( w, h ){
+               node             = eventRoot.createNode( app.rootElement, true, true );
+               
+               var ui           = app.createUIGroup( node );
                
+               inputTitle       = ui.createInputText( document.getElementById( 'comic-console-title') );
+               inputW           = ui.createInputText( document.getElementById( 'comic-console-width') );
+               inputH           = ui.createInputText( document.getElementById( 'comic-console-height') );
+               comboboxVisible  = ui.createCombobox( document.getElementById( 'comic-console-visible') );
+               // comboboxEditable = ui.createCombobox( document.getElementById( 'comic-console-editable') );
+               buttonSubmit     = ui.createButton( document.getElementById( 'comic-console-post-button'), clickOK );
+               buttonCancel     = ui.createButton( document.getElementById( 'comic-console-cancel-button'), clickCancel );
+               
+               app.onPaneResize( w, h );
+               app.fetchScript();
+               delete app.onOpen;
+       };
+       this.onPaneResize = function( w, h ){
+               windowW = w;
+               windowH = h;
+               //app.rootElement.style.cssText = [
+               //      'left:', Math.floor( ( _w - app.rootElement.offsetWidth  ) /2 ), 'px;',
+               //      'top:',  Math.floor( ( _h- app.rootElement.offsetHeight ) /2 ), 'px;'
+               //].join( '' );
+               node.update( w / 2 - node.width() / 2, h / 2 - node.height() / 2 );
+       };
+       this.onClose = function(){
+               app.destroyHelper();
+               app = inputTitle = inputW = inputH = comboboxVisible = buttonSubmit = buttonCancel = null;
+       };
+       this.onFormReady     = function(){
                var selectList = app.elmForm.getElementsByTagName( 'select' ),
                        select,
                        j, m,
@@ -4447,6 +4479,10 @@ var ComicConsole = gOS.registerApplication( function(){
                };
                inputTitle.focus();
                
+               //node.mesure();
+               app.onPaneResize( windowW, windowH );
+               
+               
                delete app.onFoemReady;
        };
        this.submitError = function(){
@@ -4455,33 +4491,6 @@ var ComicConsole = gOS.registerApplication( function(){
        this.submitSuccess = function(){
                app.addTimer( clickCancel , 5000, true );
        };
-       this.onOpen = function( w, h ){
-               var ui           = app.createUIGroup();
-               
-               inputTitle       = ui.createInputText( document.getElementById( 'comic-console-title') );
-               inputW           = ui.createInputText( document.getElementById( 'comic-console-width') );
-               inputH           = ui.createInputText( document.getElementById( 'comic-console-height') );
-               comboboxVisible  = ui.createCombobox( document.getElementById( 'comic-console-visible') );
-               // comboboxEditable = ui.createCombobox( document.getElementById( 'comic-console-editable') );
-               buttonSubmit     = ui.createButton( document.getElementById( 'comic-console-post-button'), clickOK );
-               buttonCancel     = ui.createButton( document.getElementById( 'comic-console-cancel-button'), clickCancel );
-               
-               app.onPaneResize( w, h );
-               app.fetchScript();
-               delete app.onOpen;
-       };
-       this.onPaneResize = function( _w, _h ){
-               windowW = _w;
-               windowH = _h;
-               app.rootElement.style.cssText = [
-                       'left:', Math.floor( ( _w - app.rootElement.offsetWidth  ) /2 ), 'px;',
-                       'top:',  Math.floor( ( _h- app.rootElement.offsetHeight ) /2 ), 'px;'
-               ].join( '' );
-       };
-       this.onClose = function(){
-               app.destroyHelper();
-               app = inputTitle = inputW = inputH = comboboxVisible = buttonSubmit = buttonCancel = null;
-       };
 }, true, true, 'Comic Console', 'comicConsole', null, '#D44A26' );
 
 var UploadConsole = gOS.registerApplication( function(){
index 2c2f112..a33b501 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.5.26
+ *   version 0.5.28
  *
  * gadgetOS
  *   author:
@@ -3939,9 +3939,7 @@ var UI = ( function(){
                },
                destroy : function(){
                        var data = UIItemPrivateData.get( this );
-                       if( data.focus === true ){
-                               data.elmValue.removeChild( ELM_INPUT_TEXT );
-                       };
+                       data.focus === true && TextInputManager.hide( data );
                        data.destroy();
                }
        };
@@ -4015,7 +4013,7 @@ var UI = ( function(){
                        data.focus = true;
                        data.elmA.className = 'combobox-has-focus';
                        start( data );
-                       OptionControl.show( data.groupData.apiuser, this, data.optionList );
+                       OptionControl.show( data );
                        return false;
                },
                blur : function( keyCode ){
@@ -4089,7 +4087,8 @@ var UI = ( function(){
                },
                destroy : function(){
                        var data   = UIItemPrivateData.get( this );
-                       this.blur();
+                       data.focus === true && OptionControl.hide( this );
+                       // this.blur();
                        // MouseEvent.remove( data.groupData.apiuser, data.elm );
                        data.optionList.length = 0;
                        data.destroy();
@@ -4231,7 +4230,7 @@ var UI = ( function(){
                                SystemTimer.add( SUPER_USER_KEY, updateWrapperPosition, 500 );
                        },
                        hide: function( _combobox ){
-                               if( currentCombobox !== data.item || currentCombobox === null ) return;
+                               if( currentCombobox !== _combobox || currentCombobox === null ) return;
 
                                var _option;
                                while( _option = OPTION_LIST.shift() ){
@@ -4385,12 +4384,12 @@ var UI = ( function(){
                destroy : function(){
                        var data = UIGroupPrivateData.get( this ),
                                _item;
-                       while( _item = data.itemList.shift() ){
-                               _item.destroy();
-                       };
                        if( currentUi === this ){
                                currentItem.blur();
                                // finish( UIItemPrivateData.get( currentItem ) );
+                       };                      
+                       while( _item = data.itemList.shift() ){
+                               _item.destroy();
                        };
                        data.destroy();
                }