OSDN Git Service

version 0.5.33, post target iframes were visible.
authoritozyun <itozyun@gmail.com>
Sat, 15 Dec 2012 09:38:14 +0000 (18:38 +0900)
committeritozyun <itozyun@gmail.com>
Sat, 15 Dec 2012 09:38:14 +0000 (18:38 +0900)
0.5.x/javascripts/peta.apps.js
0.5.x/stylesheets/peta.apps.css
0.5.x/stylesheets/system.css

index e0cede0..509f337 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.32
+ *   version 0.5.33
  *   
  * author:
  *   itozyun
@@ -4239,12 +4239,13 @@ var Editor = gOS.registerApplication( function(){
 }, false, true, 'Panel Editor', 'paneleditor', null, '#2D89F0' );
 
 var FormApplicationHelper = function( app ){
-       app.isUploading = false;
-       app.elmProgress = null;
-       app.elmUploader = null;
-       app.elmScript   = null;
-       app.elmIframe   = null;
-       app.elmForm     = null;
+       app.isUploading   = false;
+       app.elmProgress   = null;
+       app.elmUploader   = null;
+       app.elmScript     = null;
+       app.elmIframeWrap = null;
+       app.elmIframe     = null;
+       app.elmForm       = null;
        app.fetchScript = function(){
                app.elmProgress = document.getElementById( app.elmProgressID );
                
@@ -4257,6 +4258,7 @@ var FormApplicationHelper = function( app ){
                        };                      
                };
                
+               app.elmIframeWrap    = document.getElementById( app.iframeWrapID );
                app.elmScript        = document.createElement( 'script' );
                document.body.appendChild( app.elmScript );
                app.elmScript.type   = 'text\/javascript';
@@ -4271,15 +4273,15 @@ var FormApplicationHelper = function( app ){
        app.detectForm = function(){
                app.elmForm = app.elmUploader.getElementsByTagName( 'form' )[ 0 ];
                if( !app.elmForm ) return;
-               
                app.removeTimer( app.detectForm );
+               
                Util.createIframe( 'targetFrame', app.onCreateIframe );
                app.elmProgress.innerHTML = 'create iframe';
-               
                delete app.detectForm;
        };
        app.onCreateIframe = function( _iframe ){
-               app.elmUploader.appendChild( _iframe );
+               app.elmIframeWrap.appendChild( _iframe );
+               _iframe.className         = 'form-iframe';
                app.elmIframe             = _iframe;
                app.elmForm.target        = _iframe.name;
                app.elmProgress.innerHTML = '';
@@ -4327,10 +4329,11 @@ var FormApplicationHelper = function( app ){
                app.elmIframe = null;
                app.elmProgress.innerHTML = 'success!';
                app.isUploading = false;
-               app.submitSuccess && app.submitSuccess();
+               // app.submitSuccess && app.submitSuccess();
                delete app.onIframeUpdate;
        };
        app.destroyHelper = function(){
+               app.elmUploader.parentNode.removeChild( app.elmUploader );
                app = null;
        };
 };
@@ -4376,6 +4379,7 @@ var ComicConsole = gOS.registerApplication( function(){
                                _select.selectedIndex = comboboxEditable.selectIndex();
                        } */;
                };
+               buttonSubmit.enabled( false );
                app.submit();
        };
        function clickCancel(){
@@ -4417,6 +4421,7 @@ var ComicConsole = gOS.registerApplication( function(){
                                        '<div id="comic-console-cancel-button" class="button console-cancel-button">cancel</div>',
                                '</div>',
                                '<div id="comic-console-progress" class="console-progress">&nbsp;</div>',
+                               '<div id="comic-console-iframe-container"></div>',
                        '</div>'
                ].join( '' );
                
@@ -4427,6 +4432,7 @@ var ComicConsole = gOS.registerApplication( function(){
        };
        this.elmProgressID   = 'comic-console-progress';
        this.elmUploaderID   = 'newcomic';
+       this.iframeWrapID    = 'comic-console-iframe-container';
        this.elmIframeName   = 'targetFrameCreateComic'
        this.scriptSrc       = pettanr.CONST.CREATE_COMIC_JS;
        this.hideUploader    = true;
@@ -4453,10 +4459,6 @@ var ComicConsole = gOS.registerApplication( function(){
        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(){
@@ -4483,7 +4485,7 @@ var ComicConsole = gOS.registerApplication( function(){
                };
                inputTitle.focus();
                
-               //node.mesure();
+               node.mesure();
                app.onPaneResize( windowW, windowH );
                
                delete app.onFormReady;
@@ -4507,6 +4509,7 @@ var UploadConsole = gOS.registerApplication( function(){
                if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
                if( elmFile.value.length === 0 ) return false;
                app.submit();
+               buttonSubmit.enabled( false );
                return false;
        };
        function clickCancel(){
@@ -4530,6 +4533,7 @@ var UploadConsole = gOS.registerApplication( function(){
                                        '<div id="upload-console-cancel-button" class="button console-cancel-button">cancel</div>',
                                '</div>',
                                '<div id="upload-console-progress" class="console-progress">&nbsp;</div>',
+                               '<div id="upload-console-iframe-container"></div>',
                        '</div>'
                ].join( '' );
                
@@ -4541,6 +4545,7 @@ var UploadConsole = gOS.registerApplication( function(){
        };
        this.elmProgressID   = 'upload-console-progress';
        this.elmUploaderID   = 'uploader';
+       this.iframeWrapID    = 'upload-console-iframe-container';
        this.elmIframeName   = 'targetFrameUpload';
        this.scriptSrc       = pettanr.CONST.UPLOAD_PICTURE_JS;
        this.hideUploader    = false;
@@ -4578,10 +4583,11 @@ var UploadConsole = gOS.registerApplication( function(){
                                _input.style.display = 'none';
                        };
                };
-               app.onPaneResize( windowW, windowH );
+               
                app.createUIForm( nodeForm, elmForm );
                node.mesure();
                node.mesureChildren();
+               app.onPaneResize( windowW, windowH );
                delete app.onFormReady;
        };
        this.submitError = function(){
@@ -4604,6 +4610,7 @@ var ArtistConsole = gOS.registerApplication( function(){
                if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
                inputUpdate();
                app.submit();
+               buttonSubmit.enabled( false );
                return false;
        };
        function clickCancel(){
@@ -4639,6 +4646,7 @@ var ArtistConsole = gOS.registerApplication( function(){
                                '</div>',
                                '<div id="artist-console-progress" class="console-progress">&nbsp;</div>',
                                '<div id="register" style="display:none;"></div>',
+                               '<div id="artist-console-iframe-container"></div>',
                        '</div>'
                ].join( '' );
                
@@ -4649,6 +4657,7 @@ var ArtistConsole = gOS.registerApplication( function(){
        };
        this.elmProgressID   = 'artist-console-progress';
        this.elmUploaderID   = 'register';
+       this.iframeWrapID    = 'artist-console-iframe-container';
        this.elmIframeName   = 'targetFrameArtistRegister'
        this.scriptSrc       = pettanr.CONST.REGISTER_ARTIST_JS;
        this.hideUploader    = false;
@@ -4711,7 +4720,7 @@ var ArtistConsole = gOS.registerApplication( function(){
 var PanelConsole = gOS.registerApplication( function(){
        var windowW, windowH,
                eventRoot, node, inputData,
-               comboboxPublish, buttonPost, buttonClose,
+               comboboxPublish, buttonSubmit, buttonClose,
                elmInput,
                app         = this,
                model       = null;
@@ -4723,6 +4732,7 @@ var PanelConsole = gOS.registerApplication( function(){
                if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
                inputData.value();
                app.submit();
+               buttonSubmit.enabled( false );
                return false;
        }
 
@@ -4764,6 +4774,7 @@ var PanelConsole = gOS.registerApplication( function(){
                                '</div>',
                                '<div id="panel-console-progress" class="console-progress">&nbsp;</div>',
                                '<div id="newpanel" style="display:none;"></div>',
+                               '<div id="panel-console-iframe-container"></div>',
                        '</div>'
                ].join( '' );
 
@@ -4774,36 +4785,12 @@ var PanelConsole = gOS.registerApplication( function(){
        };
        this.elmProgressID   = 'panel-console-progress';
        this.elmUploaderID   = 'newpanel';
-       this.elmIframeName   = 'targetFrameNewPanel'
+       this.iframeWrapID    = 'panel-console-iframe-container';
+       this.elmIframeName   = 'targetFrameNewPanel';
        this.scriptSrc       = pettanr.CONST.CREATE_PANEL_JS;
        this.hideUploader    = false;
        FormApplicationHelper( this );
-       this.onFormReady     = function(){
-               var _inputList = app.elmForm.getElementsByTagName( 'input' ),
-                       _input;
-               for( var i = _inputList.length; i; ){
-                       _input = _inputList[ --i ];
-                       if( _input.type === 'submit' ){
-                               _input.style.display = 'none';
-                       };
-                       if( _input.name === 'json' ){
-                               elmInput     = _input;
-                               publishUpdate();
-                       };
-               };
-               
-               node.mesure();
-               app.onPaneResize( windowW, windowH );
-               node.mesureChildren();
-               
-               delete app.onFormReady;
-       };
-       this.submitError = function(){
-               app.addTimer( clickCancel , 5000, true );
-       };
-       this.submitSuccess = function(){
-               app.addTimer( clickCancel , 5000, true );
-       };
+
        this.onOpen = function( w, h, _model ){
                node    = eventRoot.createNode( app.rootElement, true, true );
                var ui  = app.createUIGroup( node ),
@@ -4820,7 +4807,7 @@ var PanelConsole = gOS.registerApplication( function(){
                        elm.parentNode.removeChild( elm );
                };
                
-               buttonPost       = ui.createButton( document.getElementById( 'panel-console-post-button' ), clickOK );
+               buttonSubmit     = ui.createButton( document.getElementById( 'panel-console-post-button' ), clickOK );
                buttonClose      = ui.createButton( document.getElementById( 'panel-console-cancel-button' ), clickCancel );
                
                app.onPaneResize( w, h );
@@ -4829,16 +4816,38 @@ var PanelConsole = gOS.registerApplication( function(){
        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();
                model && model.destroy();
-               app = model = comboboxPublish = buttonPost = buttonClose = elmInput = null;
+               app = model = comboboxPublish = buttonSubmit = buttonClose = elmInput = null;
+       };
+       this.onFormReady     = function(){
+               var _inputList = app.elmForm.getElementsByTagName( 'input' ),
+                       _input;
+               for( var i = _inputList.length; i; ){
+                       _input = _inputList[ --i ];
+                       if( _input.type === 'submit' ){
+                               _input.style.display = 'none';
+                       };
+                       if( _input.name === 'json' ){
+                               elmInput     = _input;
+                               publishUpdate();
+                       };
+               };
+               
+               node.mesure();
+               node.mesureChildren();
+               app.onPaneResize( windowW, windowH );
+               
+               delete app.onFormReady;
+       };
+       this.submitError = function(){
+               app.addTimer( clickCancel , 5000, true );
+       };
+       this.submitSuccess = function(){
+               app.addTimer( clickCancel , 5000, true );
        };
 }, true, true, 'Panel Console', 'panelConsole', null, '#603CBA' );
 
@@ -5094,7 +5103,7 @@ var OutputConsole = gOS.registerApplication( function(){
        var elmOutputArea,
                eventRoot, node,
                comboboxFormat, inputOption,
-               buttonPost, buttonClose,
+               buttonSubmit, buttonClose,
                windowW, windowH,
                timing   = 0,
                comicID, panelID, panelTimming, panelW, panelH, borderSize, panelElementArray,
@@ -5108,10 +5117,10 @@ var OutputConsole = gOS.registerApplication( function(){
        function formatUpdate(){
                var i = comboboxFormat.selectIndex(),
                        text = 'sorry...';
-               // buttonPost.enabled( false );
+               // buttonSubmit.enabled( false );
                if( i === 0 ){
                        text = model.getJsonPostString();
-                       // buttonPost.enabled( true );
+                       // buttonSubmit.enabled( true );
                } else
                if( i === 1 ){
                        text = model.getJsonGetString();
@@ -5171,7 +5180,7 @@ var OutputConsole = gOS.registerApplication( function(){
                        comboboxFormat.createOption( FORMAT_LIST.shift(), null, i === 0 );
                };
                inputOption    = ui.createInputText( document.getElementById( 'output-console-option' ), null );
-               // buttonPost     = ui.createButton( document.getElementById( 'output-console-post-button' ), clickPost );
+               // buttonSubmit     = ui.createButton( document.getElementById( 'output-console-post-button' ), clickPost );
                buttonClose    = ui.createButton( document.getElementById( 'output-console-close-button' ), clickClose );
                
                app.onPaneResize( _w, _h );
@@ -5203,7 +5212,7 @@ var OutputConsole = gOS.registerApplication( function(){
        this.onClose = function(){
                elmOutputArea.value = '';
                model.destroy();
-               elmOutputArea = comboboxFormat = inputOption = buttonPost = buttonClose = panelElementArray = instance = model = null;
+               elmOutputArea = comboboxFormat = inputOption = buttonSubmit = buttonClose = panelElementArray = instance = model = null;
        };
 }, true, false, 'Output Console', 'outputConsole', null, '#2D89F0' );
 
index bd1b795..82ab1a3 100644 (file)
@@ -1,7 +1,7 @@
 @charset "UTF-8";\r
 \r
 /* pettanR peta.apps.css\r
- *   version 0.5.31\r
+ *   version 0.5.33\r
  * \r
  *   author:\r
  *     itozyun\r
@@ -64,7 +64,7 @@
                        .console-wrapper {\r
                                position:                       absolute;\r
                                width:                          320px;\r
-                               padding:                        20px 20px 0;\r
+                               padding:                        20px;\r
                                background-color:       #fff;\r
                        }\r
                                .console-header {\r
                                #upload-console {\r
                                }\r
 \r
-\r
+       .form-iframe {\r
+               width:100%;\r
+               height:100px;\r
+               border:1px solid #666;\r
+       }\r
 \r
 /*--------------------------------------------------------------------------------------\r
  * \r
index bfeb901..03f0adb 100644 (file)
@@ -1,7 +1,7 @@
 @charset "UTF-8";\r
 \r
 /* pettanR system.css\r
- *   version 0.5.32\r
+ *   version 0.5.33\r
  * \r
  *   author:\r
  *     itozyun\r
                                border           : 0;\r
                                display          : block;\r
                                position         : absolute;\r
-                               top              : 0;\r
-                               right            : 0;\r
+                               top              : -5px;\r
+                               right            : -10px;\r
                                font-size        : 999px;\r
                                line-height      : 1em;\r
                                color            : #fff;\r