OSDN Git Service

client is version0.4.19, bug-fix & updated around application.
authoritozyun <itozyun@gmail.com>
Sun, 15 Apr 2012 01:34:20 +0000 (10:34 +0900)
committeritozyun <itozyun@gmail.com>
Sun, 15 Apr 2012 01:34:20 +0000 (10:34 +0900)
app/assets/stylesheets/work.css
public/assets/common.js
public/assets/system.js
public/assets/work.js

index 9514fbd..6d599c6 100644 (file)
        \r
        /*  View Container\r
        --------------------------------------------------------------------------------------*/        \r
-               #editor {\r
-                       display:                        none;\r
-                       position:                       absolute;\r
-                       left:                           0;\r
-                       top:                            0;\r
-                       width:                          100%;\r
-                       height:                         100%;\r
-               }\r
                .console-page {\r
-                       display:                        none;\r
+\r
                }\r
        \r
 /*--------------------------------------------------------------------------------------\r
  *  \r
  -------------------------------------------------------------------------------------*/\r
                #editor {\r
+                       position:                       absolute;\r
+                       left:                           0;\r
+                       top:                            0;\r
+                       width:                          100%;\r
+                       height:                         100%;\r
                        overflow:                       hidden;\r
                        background-color:       #f5f5f5;\r
                }\r
                                        position:                               absolute;\r
                                        top:                                    0;\r
                                        right:                                  0;\r
-                                       background-image:               url('sprite.gif');\r
+                                       background-image:               url('/sprite.gif');\r
                                        background-repeat:              no-repeat;\r
                                        background-position:    -70px -60px;\r
                                        width:                                  20px;\r
index eb8e270..5f5e132 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR common.js\r
- *   version 0.4.18\r
+ *   version 0.4.19\r
  * \r
  * author: itozyun\r
  */\r
@@ -105,10 +105,10 @@ var pettanr = ( function(){
                    }\r
                    return {};\r
                })(),\r
-               IS_DEBUG = typeof URL_PARAMS.debug === 'boolean' ? URL_PARAMS.debug : IS_LOCAL === true,\r
+               IS_DEBUG = Type.isBoolean( URL_PARAMS.debug ) ? URL_PARAMS.debug : IS_LOCAL === true,\r
                jqWindow , jqDocument , jqBody;\r
        return {\r
-               version: '0.4.17',\r
+               version: '0.4.19',\r
                init: function(){\r
                        jqWindow = $( window);\r
                        jqDocument = $( document);\r
@@ -118,7 +118,7 @@ var pettanr = ( function(){
                                _fn;\r
                        for( var i=0; i<l; i++){\r
                                _fn = FUNCTION_ARRAY[ i];\r
-                               _fn.init && _fn.init( _fn === pettanr.view ? FUNCTION_ARRAY : undefined);\r
+                               _fn.init && _fn.init( _fn === pettanr.view ? FUNCTION_ARRAY : undefined );\r
                        }\r
                        \r
                        delete pettanr.init;\r
@@ -316,7 +316,6 @@ pettanr.util = ( function(){
                        } else {\r
                                parentElm && parentElm.appendChild( img);\r
                        }\r
-                       return size;\r
                        \r
                /* LICENSE: MIT\r
                 * AUTHOR: uupaa.js@gmail.com\r
@@ -359,6 +358,8 @@ pettanr.util = ( function(){
                                // HTMLCanvasElement\r
                                return { width: image.width, height: image.height };\r
                        }\r
+                       \r
+                       return size;\r
                },\r
                loadImage: function( URLorELM, onLoad, onError, delay, timeout){\r
                        delay = delay || 250;\r
@@ -794,15 +795,16 @@ pettanr.view = ( function(){
        /* create iframe overlay for user console */\r
        var location = document.location.pathname,\r
                isWorkPage =    document.location.href.indexOf( 'http:\/\/localhost:3000\/' ) === 0 ||\r
-                                               location.indexOf( pettanr.CONST.PETTANR_ROOT_PATH ) === 0 ||\r
-                                               location.indexOf( '\/work.html') !== -1,\r
+                                               document.location.href.indexOf( pettanr.CONST.PETTANR_ROOT_PATH ) === 0 ||\r
+                                               location.indexOf( '\/work.html') !== -1 ||\r
+                                               location.indexOf( '\work.html') !== -1, // for ie6\r
                deep =  location.indexOf( '\/diary\/') !== -1 ||\r
                                location.indexOf( '\/test\/') !== -1 ||\r
                                location.indexOf( '\/help\/') !== -1 ||\r
                                location.indexOf( '\/sitemap\/') !== -1 ||\r
                                location.indexOf( '\/wiki\/') !== -1,\r
                LoginUserNavi;\r
-       \r
+\r
        if( isWorkPage === false){\r
                LoginUserNavi = {\r
                        show: function(){\r
@@ -844,6 +846,8 @@ pettanr.view = ( function(){
        \r
        var AbstractBasicPane = function(){\r
                this.rootElement = null;\r
+               this.parentElement = null;\r
+               this.nextSibling = null;\r
                this.onOpen = function( _w, _h /*, _option */ ){\r
                        // overrride\r
                };\r
@@ -853,13 +857,25 @@ pettanr.view = ( function(){
                } // false の場合、close の拒否 \r
                this.onPaneResize = function( _w, _h ){}\r
                this.open = function( _w, _h /*, _option */ ){\r
+                       if( this.nextSibling && this.nextSibling.parentNode === this.parentElement ){\r
+                               this.parentElement.insertBefore( this.rootElement, this.nextSibling );\r
+                       } else\r
+                       if( this.parentElement ){\r
+                               this.parentElement.appendChild( this.rootElement );\r
+                       } else {\r
+                               this.rootElement && document.body.appendChild( this.rootElement );\r
+                       }\r
+                       if( this.rootElement === null ){\r
+                               alert( this.ID )\r
+                       }\r
                        if( this.MIN_WIDTH > _w || this.MIN_HEIGHT > _h ){\r
                                if( Type.isHTMLElement( this.rootElement ) === true ){\r
                                        // 小さすぎる!、と表示\r
                                }\r
                        }\r
                        if( arguments.length > 2){\r
-                               argumentsRellay( this.onOpen, arguments );\r
+                               // argumentsRellay( this.onOpen, arguments );\r
+                               this.onOpen.apply( this, arguments );\r
                        } else {\r
                                this.onOpen( _w, _h );\r
                        }\r
@@ -868,6 +884,9 @@ pettanr.view = ( function(){
                        if( this.onClose() === false ){\r
                                \r
                        }\r
+                       if( this.rootElement && this.rootElement.parentNode ){\r
+                               this.rootElement.parentNode.removeChild( this.rootElement );\r
+                       }\r
                }\r
                this.resize = function( _w, _h ){\r
                        if( this.MIN_WIDTH > _w || this.MIN_HEIGHT > _h ){\r
@@ -935,9 +954,9 @@ pettanr.view = ( function(){
 \r
        function bootApplication( APPLICATIONorINDEX, _arguments ){\r
                if( isWorkPage === false ) return;\r
-               \r
+\r
                var _application,\r
-                       _elm, i, l,\r
+                       i, j, l, \r
                        nodesA = document.getElementById('global-navi').getElementsByTagName( 'a') || [],\r
                        _index = -1;\r
                if( typeof APPLICATIONorINDEX === 'number' && APPLICATIONorINDEX < LUNCHER_APPLICATION_LIST.length){\r
@@ -964,7 +983,7 @@ pettanr.view = ( function(){
                \r
                for( i=0, l=LUNCHER_APPLICATION_LIST.length; i<l; ++i ){\r
                        if( _application === LUNCHER_APPLICATION_LIST[ i ] ){\r
-                               for(var j=0, l=nodesA.length; j<l; ++j ){\r
+                               for( j=0, l=nodesA.length; j<l; ++j ){\r
                                        nodesA[ j ].className = i === j ? 'current' : '';\r
                                }                                       \r
                                break;\r
@@ -973,24 +992,14 @@ pettanr.view = ( function(){
                \r
                if( currentApplication === _application ) return;\r
                \r
-               if( currentApplication ){\r
-                       _elm = currentApplication.rootElement;\r
-                       if( _elm ){\r
-                               _elm.style.display = 'none';\r
-                       }\r
-                       currentApplication.close();\r
-               }\r
+               currentApplication && currentApplication.close();\r
+\r
                currentApplication = _application;\r
                \r
-               _elm = _application.rootElement;\r
-               if( _elm ){\r
-                       _elm.style.display = 'block';\r
-               }\r
-               \r
                if( _arguments ){\r
                        _arguments.unshift( jqWindow.width(), jqWindow.height() );\r
                        _application.open.apply( _application, _arguments );\r
-                       // argumentsRellay( _application.open, _arguments );                    \r
+                       // argumentsRellay( _application.open, _arguments );\r
                } else {\r
                        _application.open( jqWindow.width(), jqWindow.height() );\r
                }\r
@@ -998,15 +1007,18 @@ pettanr.view = ( function(){
        }\r
        \r
        function argumentsRellay( _method, _arguments ){\r
+               alert( typeof _method )\r
                l = _arguments.length;\r
                if( l > 0 ){\r
                        var _arg = [];\r
                        for( i=0; i<l; ++i ){\r
-                               _arg.push( '_arguments[' + i + ']' );\r
+                               _arg.push( 'a[' + i + ']' );\r
                        }\r
                        window['_method'] = _method;\r
-                       eval( '_method(' + _arg.join(',') + ')' );\r
-                       delete window['_method'];\r
+                       //eval( '_method(' + _arg.join(',') + ')' );\r
+                       var f = new Function( 'a', '_method(' + _arg.join(',') + ')' );\r
+                       f( _arguments );\r
+                       window['_method'] = undefined;\r
                } else {\r
                        _method();\r
                }               \r
@@ -1025,10 +1037,7 @@ pettanr.view = ( function(){
                        jqWindow.resize( onWindowResize );\r
                        \r
                        var _option = {}; // urlパラメータ\r
-                       \r
-                       for( var i=0, l=APPLICATION_LIST.length; i<l; ++i){\r
-                               APPLICATION_LIST[ i ].init && APPLICATION_LIST[ i ].init();\r
-                       }\r
+\r
                        bootApplication( pettanr.URL_PARAMS.view || 0 );\r
                        \r
                        delete pettanr.view.init;\r
@@ -1037,12 +1046,22 @@ pettanr.view = ( function(){
                        _class.prototype = new AbstractBasicPane();\r
                        return new _class( _options );\r
                },\r
-               registerAsBasicPane: function( _class ){\r
-                       _class.prototype = new AbstractBasicPane();\r
+               _getAbstractApplication: function(){\r
+                       return new AbstractApplication();\r
                },\r
                registerApplication: function( _class, _options ){\r
                        _class.prototype = new AbstractApplication();\r
                        _application = new _class( _options );\r
+                       \r
+                       var elm = _application.rootElement;\r
+                       if( Type.isHTMLElement( elm ) === false ) return null;\r
+                        \r
+                       _application.parentElement = elm.parentNode;\r
+                       _application.nextSibling = elm.nextSibling;\r
+                       \r
+                       if( elm.parentNode ){\r
+                               elm.parentNode.removeChild( elm );\r
+                       }\r
                        APPLICATION_LIST.push( _application );\r
                        return new ApplicationReference( _application );\r
                },\r
@@ -1063,6 +1082,7 @@ pettanr.view = ( function(){
 \r
 pettanr.overlay = ( function(){\r
        var SHADOW_OPACITY = 0.5,\r
+               ELM_CONTAINER = document.getElementById( 'overlay-container' ),\r
                jqConteiner, jqShadow, jqCloseButton,// jqBody, \r
                currentOverlay = null,\r
                visible = false,\r
@@ -1081,40 +1101,48 @@ pettanr.overlay = ( function(){
                return false;           \r
        }\r
        function onFadeInComplete(){\r
-               \r
+               ELM_CONTAINER.insertBefore( currentOverlay.rootElement, document.getElementById( 'overlay-close-button' ));\r
+       }\r
+       function onFadeOutComplete(){\r
+               if( currentOverlay.rootElement && currentOverlay.rootElement.parentNode === ELM_CONTAINER ){\r
+                       ELM_CONTAINER.removeChild( currentOverlay.rootElement );\r
+               }\r
+               currentOverlay = null;\r
        }\r
        return {\r
                init: function(){\r
                        //jqBody = pettanr.jqBody();\r
                        jqConteiner = $( '#overlay-container');\r
                        jqShadow = $( '#overlay-shadow');\r
-                       jqCloseButton = $( '#overlay-close-button').click( onCloseClick);\r
+                       jqCloseButton = $( '#overlay-close-button').click( onCloseClick );\r
                        \r
                        pettanr.key.addKeyDownEvent( pettanr.view.OVERLAY, 27, false, false, close); // 27.esc\r
                        \r
                        delete pettanr.overlay.init;\r
                },\r
-               show: function( _currentOverlay ){\r
-                       if( visible === true && currentOverlay === _currentOverlay ) return;\r
+               show: function( _overlay ){\r
+                       if( visible === true && currentOverlay === _overlay ) return;\r
+                       if( pettanr.view.isApplicationInstance( _overlay ) === false ) return;\r
+                       \r
                        document.body.style.overflow = 'hidden';\r
                        jqConteiner.stop().css( {\r
                                filter:         '',\r
                                opacity:        '',\r
                                top:            document.documentElement.scrollTop || document.body.scrollTop\r
                        }).fadeIn( onFadeInComplete );\r
+                       \r
                        this.visible = visible = true;\r
-                       currentOverlay = _currentOverlay;\r
-                       this.currentID = _currentOverlay.ID;\r
-                       jqCloseButton.toggle( !!_currentOverlay.onClose );\r
+                       currentOverlay = _overlay;\r
+                       this.currentID = _overlay.ID;\r
+                       // jqCloseButton.toggle( !!_overlay.onClose );\r
                },\r
                hide: function(){\r
-                       currentOverlay = null;\r
                        if( visible === false) return;\r
                        document.body.style.overflow = '';\r
                        jqConteiner.stop().css( {\r
                                filter:         '',\r
                                opacity:        ''\r
-                       }).fadeOut();\r
+                       }).fadeOut( onFadeOutComplete );\r
                        this.visible = visible = false;\r
                        this.currentID = null;\r
                },\r
@@ -1311,14 +1339,14 @@ pettanr.form = ( function(){
        var InputTextClass = function( WRAPPER_ELM, ON_UPDATE_FUNCTION, GROUP_ID, validater){\r
                validater = typeof validater === 'function' ? validater : null;\r
                \r
-               var elmValue = pettanr.util.getElementsByClassName( WRAPPER_ELM, 'editable-value')[ 0],\r
+               var elmValue = pettanr.util.getElementsByClassName( WRAPPER_ELM, 'editable-value' )[ 0],\r
                        value,\r
                        index = GROUP_ID ? FORM_GROUP_TABLE[ GROUP_ID].length : -1,\r
                        instance,\r
                        focus = false,\r
                        visible = true,\r
                        enabled = true,\r
-                       elmA = ELM_A_ORIGIN.cloneNode( true);\r
+                       elmA = ELM_A_ORIGIN.cloneNode( true );\r
                \r
                if( elmValue === undefined){\r
                        alert( 'error!');\r
@@ -1326,9 +1354,13 @@ pettanr.form = ( function(){
                value = elmValue.innerHTML;\r
                elmValue.innerHTML = '';\r
                elmValue.className += ' editable-text';\r
+               try {\r
+                       elmA.innerHTML = value;\r
+               } catch(e){\r
+                       alert( value + elmA)\r
+               }\r
                \r
-               elmA.innerHTML = value;\r
-               elmValue.appendChild( elmA);\r
+               elmValue.appendChild( elmA );\r
                WRAPPER_ELM.onclick = onClick;\r
                \r
                function onClick( e){\r
@@ -1406,8 +1438,8 @@ pettanr.form = ( function(){
                        instance,\r
                        focus = false,\r
                        visible = true,\r
-                       enabled = true,\r
-                       elmFileInput = WRAPPER_ELM.getElementsByTagName('input')[0] || elmFileInput || document.createElement( 'input');\r
+                       enabled = true;\r
+               elmFileInput = WRAPPER_ELM.getElementsByTagName('input')[0] || elmFileInput || document.createElement( 'input');\r
                elmFileInput.type = 'file';\r
                elmFileInput.style.visivility = 'hidden';\r
 \r
@@ -2278,16 +2310,16 @@ var VisualEffect = ( function(){
                return {\r
                        elm:    ELM,\r
                        onEnterFrame: function(){\r
-                               var _updateCss = {};\r
+                               var _updateCss = {}, i;\r
                                if( numFrames === 1){\r
-                                       for( var i=0; i<l; ++i){\r
+                                       for( i=0; i<l; ++i){\r
                                                _updateCss[ targetAttributes[ i]] = endParameters[ i];\r
                                                ++i;\r
                                        }\r
                                        updateCss( ELM, currentParameters, targetAttributes, l);\r
                                        onComplete !== null && onComplete();\r
                                } else {\r
-                                       for( var i=0; i<l; ++i){\r
+                                       for( i=0; i<l; ++i){\r
                                                _updateCss[ targetAttributes[ i]] = currentParameters[ i] = Math.floor( currentParameters[ i] + offsetParameters[ i]);\r
                                                ++i;\r
                                        }\r
index f3fb48d..698180e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.4.18
+ *   version 0.4.19
  *   
  * author:
  *   itozyun
@@ -969,7 +969,7 @@ pettanr.finder = ( function(){
                function draw( _w, _h ){
                        w = Type.isFinite( _w ) === true ? _w : w;
                        h = Type.isFinite( _h ) === true ? _h : h;
-                       bodyH = _h - headH;
+                       bodyH = h - headH;
                        var     l = tree.hierarchy() +1,
                                m = BREAD_ARRAY.length,
                                _file, _bread;
@@ -1000,7 +1000,12 @@ pettanr.finder = ( function(){
                        } else {
                                elmBody.className = 'finder-body';
                        }
-                       elmBody.style.height = bodyH + 'px';
+                       try {
+                               elmBody.style.height = bodyH + 'px';
+                       } catch(e){
+                               alert( bodyH)
+                       }
+                       
                        
                        while( l < ICON_ARRAY.length){
                                ICON_ARRAY.pop().destroy();
@@ -1035,9 +1040,13 @@ pettanr.finder = ( function(){
                function onAction( _file ){
 
                }
+               this.rootElement = elmContainer;
+               this.parentElement = ELM_CONTAINER;
+               this.displayName = 'finder';
                this.ID = 'finder';
+               this.MIN_WIDTH = 240;
+               this.MIN_HEIGHT = 240;
                this.init = function(){
-                       ELM_CONTAINER.appendChild( elmContainer);
                        //$( elmLocation).click( onHeadClick);
                        //$( elmContainer).click( onBodyClick);
                        var position = pettanr.util.getAbsolutePosition( elmLocation);
@@ -1062,11 +1071,8 @@ pettanr.finder = ( function(){
                                ICON_ARRAY[ i].onResize( _w );
                        }
                }
-               this.MIN_WIDTH = 240;
-               this.MIN_HEIGHT = 240;
        }
-       
-       pettanr.view.registerAsBasicPane( FinderClass );
+       FinderClass.prototype = pettanr.view._getAbstractApplication();
        
        function getFinderIcon( _file, _elmContainer, w, index, style, onDown, onEditor, onViwer, onAction){
                var _icon;
@@ -1800,6 +1806,7 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
        // this.rootElement = elmWrap;
        this.displayName = 'premiumStage';
        this.ID          = 'premiumStage';
+       this.rootElement = document.getElementById( 'image-gruop-wrapper' );
        this.MIN_WIDTH   = 320;
        this.MIN_HEIGHT  = 320;
        this.init = function(){
@@ -1826,7 +1833,10 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
                        _g_onUpdateFunction = null;
                }
                
-               var _index = ARTIST_ROOT_FILE.search( { id: _artistID } )[ 0 ],
+               var _index = ARTIST_ROOT_FILE.search( {
+                               id:   _artistID,
+                               type: pettanr.driver.FILE_TYPE.ARTIST
+                       } )[ 0 ],
                        _artistFile = ARTIST_ROOT_FILE.getChildFileByIndex( _index ),
                        i, l = 0;
                if( _artistFile !== null ){
@@ -1940,6 +1950,7 @@ pettanr.textEditor = pettanr.view.registerApplication( function(){
        // this.rootElement = elmWrap;
        this.displayName = 'textEditor';
        this.ID          = 'textEditor';
+       this.rootElement = document.getElementById( 'speach-editor-wrapper' );
        this.MIN_WIDTH   = 320;
        this.MIN_HEIGHT  = 320;
        this.init = function(){
index 7a978f4..84e4a21 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR work.js\r
- *   version 0.4.18\r
+ *   version 0.4.19\r
  *   \r
  * author:\r
  *   itozyun\r
@@ -1775,8 +1775,8 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                return {\r
                        update: draw,\r
                        index: function( _mouseX, _mouseY){\r
-                               var     p;\r
-                               for( var i=4; i<8; i++){\r
+                               var     p, i;\r
+                               for( i=4; i<8; i++){\r
                                        p = POSITION_ARRAY[ i];\r
                                        if( p.x <= _mouseX && p.y <= _mouseY && p.x + p.w >= _mouseX && p.y +p.h >= _mouseY){\r
                                                MOUSE_CURSOR( CURSOR_AND_FLIP[ i].cursor);\r
@@ -1784,7 +1784,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                                                return currentIndex = i;\r
                                        }\r
                                }\r
-                               for( var i=0; i<4; i++){\r
+                               for( i=0; i<4; i++){\r
                                        p = POSITION_ARRAY[ i];\r
                                        if( p.x <= _mouseX && p.y <= _mouseY && p.x + p.w >= _mouseX && p.y +p.h >= _mouseY){\r
                                                MOUSE_CURSOR( CURSOR_AND_FLIP[ i].cursor);\r
@@ -2742,6 +2742,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                                }\r
                        },\r
                        createTextElement: function( data ){\r
+                               var _comicElement;\r
                                if( Type.isObject( data ) === false ){\r
                                        data = {\r
                                                balloon_template_id:1,\r
@@ -2759,11 +2760,11 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                                                        }\r
                                                }\r
                                        }\r
-                                       var _comicElement = new TextElementClass( data );\r
+                                       _comicElement = new TextElementClass( data );\r
                                        _comicElement.init();\r
                                        pettanr.textEditor.bootInOverlay( PANEL_CONTROL.x(), PANEL_CONTROL.y(), _comicElement, onTextInput );\r
                                } else {\r
-                                       var _comicElement = new TextElementClass( data );\r
+                                       _comicElement = new TextElementClass( data );\r
                                        _comicElement.init();\r
                                        onTextInput( _comicElement );\r
                                }\r
@@ -3030,7 +3031,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){
 });\r
 \r
 \r
-pettanr.comicConsole =pettanr.view.registerApplication( function(){\r
+pettanr.comicConsole = pettanr.view.registerApplication( function(){\r
        var jqWrap,\r
                ID = 'comicConsole',\r
                elmWrap = document.getElementById( 'comic-console-wrapper' ),\r
@@ -3038,7 +3039,7 @@ pettanr.comicConsole =pettanr.view.registerApplication( function(){
                elmProgress = document.getElementById( 'comic-console-progress' ),\r
                inputTitle, inputW, inputH, inputVisible, inputEditable,\r
                elmUploader = null,\r
-               elmScript = null\r
+               elmScript = null,\r
                elmIframe = null,\r
                elmForm = null,\r
                timer = null,\r
@@ -3071,7 +3072,7 @@ pettanr.comicConsole =pettanr.view.registerApplication( function(){
                                }\r
                        }\r
                        var _selectList = elmForm.getElementsByTagName( 'select' ),\r
-                               _select, _name, _optionList;\r
+                               _select, _optionList;\r
                        for( i=0, l= _selectList.length; i<l; ++i){\r
                                _select = _selectList[ i ];\r
                                _name = _select.name;\r
@@ -3138,13 +3139,13 @@ pettanr.comicConsole =pettanr.view.registerApplication( function(){
        }\r
 \r
        /* grobal method */\r
-       // this.rootElement = elmWrap;\r
+       this.rootElement = document.getElementById( 'comic-console-wrapper' );\r
        this.displayName = ID;\r
        this.ID          = ID;\r
        this.MIN_WIDTH   = 320;\r
        this.MIN_HEIGHT  = 320;\r
        this.init = function(){\r
-               this.jqWrap = jqWrap = $( '#comic-console-wrapper').hide();\r
+               instance.jqWrap = jqWrap = $( '#comic-console-wrapper').hide();\r
                $( '#comic-console-post-button').click( clickOK );\r
                $( '#comic-console-cancel-button').click( clickCancel );\r
                \r
@@ -3165,8 +3166,8 @@ pettanr.comicConsole =pettanr.view.registerApplication( function(){
                \r
                inputTitle.start();\r
                \r
-               elmUploader = document.createElement( 'div');\r
-               elmUploader.id = "newcomic";\r
+               elmUploader = document.createElement( 'div' );\r
+               elmUploader.id = 'newcomic';\r
                elmUploader.style.cssText = 'height:1px;line-height:1px;visibility:hidden;overflow:hidden;';\r
                elmWrap.appendChild( elmUploader);\r
                \r
@@ -3308,13 +3309,13 @@ pettanr.uploadConsole = pettanr.view.registerApplication( function(){
        }\r
 \r
        /* grobal method */\r
-       // this.rootElement = elmWrap;\r
+       this.rootElement = document.getElementById( 'upload-console-wrapper' );\r
        this.displayName = ID;\r
        this.ID          = ID;\r
        this.MIN_WIDTH   = 320;\r
        this.MIN_HEIGHT  = 320;\r
        this.init = function(){\r
-               this.jqWrap = jqWrap = $( '#upload-console-wrapper').hide();\r
+               instance.jqWrap = jqWrap = $( '#upload-console-wrapper').hide();\r
                $( '#upload-console-post-button').click( clickOK );\r
                $( '#upload-console-cancel-button').click( clickCancel );\r
 \r
@@ -3462,7 +3463,7 @@ pettanr.panelConsole = pettanr.view.registerApplication( function(){
        }\r
 \r
        /* grobal method */\r
-       // this.rootElement = elmWrap;\r
+       this.rootElement = document.getElementById( 'panel-console-wrapper' );\r
        this.displayName = ID;\r
        this.ID          = ID;\r
        this.MIN_WIDTH   = 320;\r
@@ -3616,13 +3617,13 @@ pettanr.artistConsole = pettanr.view.registerApplication( function(){
        }\r
 \r
        /* grobal method */\r
-       // this.rootElement = elmWrap;\r
+       this.rootElement = document.getElementById( 'artist-console-wrapper' );\r
        this.displayName = ID;\r
        this.ID          = ID;\r
        this.MIN_WIDTH   = 320;\r
        this.MIN_HEIGHT  = 320;\r
        this.init = function(){\r
-               this.jqWrap = jqWrap = $( '#artist-console-wrapper').hide();\r
+               instance.jqWrap = jqWrap = $( '#artist-console-wrapper').hide();\r
                $( '#artist-console-post-button').click( clickOK );\r
                $( '#artist-console-cancel-button').click( clickCancel );\r
 \r
@@ -3684,17 +3685,18 @@ pettanr.outputConsole = pettanr.view.registerApplication( function(){
        \r
        function clickOK(){\r
                pettanr.overlay.hide();\r
-               instance.onClose();\r
+               pettanr.outputConsole.shutdown();\r
        }\r
        \r
        /* grobal method */\r
-       // this.rootElement = elmWrap;\r
+       this.rootElement = document.getElementById( 'output-console-wrapper' );\r
        this.displayName = ID;\r
        this.ID          = ID;\r
+       \r
        this.MIN_WIDTH   = 320;\r
        this.MIN_HEIGHT  = 320;\r
        this.init = function(){\r
-               this.jqWrap = jqWrap = $( '#output-console-wrapper').hide();\r
+               instance.jqWrap = jqWrap = $( '#output-console-wrapper').hide();\r
                jqOutputArea = $( '#output-area');\r
                delete instance.init;\r
        }\r