OSDN Git Service

version 0.5.25, fixed PenelElement.ConsoleControler
authoritozyun <itozyun@gmail.com>
Thu, 29 Nov 2012 23:58:41 +0000 (08:58 +0900)
committeritozyun <itozyun@gmail.com>
Thu, 29 Nov 2012 23:58:41 +0000 (08:58 +0900)
0.5.x/javascripts/peta.apps.js
0.5.x/javascripts/system.js
0.5.x/stylesheets/peta.apps.css

index b132e1d..7f05761 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.24
+ *   version 0.5.25
  *   
  * author:
  *   itozyun
@@ -2706,8 +2706,8 @@ var Editor = gOS.registerApplication( function(){
                                radA = ( balloonA - 90 ) * DEG_TO_RAD;
                                tailX = FLOOR( ( ( COS( radA ) / 2 + 0.5 ) * ( balloonW + SIZE )) - SIZE / 2 );
                                tailY = FLOOR( ( ( SIN( radA ) / 2 + 0.5 ) * ( balloonH + SIZE )) - SIZE / 2 );
-                               styleMover.left = tailX +'px';
-                               styleMover.top  = tailY +'px';
+                               styleMover.left = tailX + 'px';
+                               styleMover.top  = tailY + 'px';
                        },
                        show: function( _currentText ){
                                /**
@@ -2846,12 +2846,12 @@ var Editor = gOS.registerApplication( function(){
                        if( currentIsTextElement === false && currentIndex > 3 && app.shiftEnabled() === true){
                                if( startAspect >= 1 ){
                                        __w = _w;
-                                       _w = FLOOR( startAspect * _h );
-                                       _x = _x +( currentIndex % 2 === 0 ? __w - _w : 0);
+                                       _w  = FLOOR( startAspect * _h );
+                                       _x  = _x +( currentIndex % 2 === 0 ? __w - _w : 0);
                                } else {
                                        __h = _h;
-                                       _h = FLOOR( _w / startAspect );
-                                       _y = _y + ( currentIndex <= 5 ? __h - _h : 0);
+                                       _h  = FLOOR( _w / startAspect );
+                                       _y  = _y + ( currentIndex <= 5 ? __h - _h : 0);
                                };
                        };
                        draw( x = _x, y = _y, w = _w, h = _h );
@@ -2918,16 +2918,16 @@ var Editor = gOS.registerApplication( function(){
                        onStart: function( _currentElement, _mouseX, _mouseY ){
                                currentElement = _currentElement;
                                currentIsTextElement = _currentElement.type === PANEL_ELEMENT_TYPE_TEXT;
-                               if( _currentElement.keepSize === true) return false;
-                               currentIndex = this.index( _mouseX, _mouseY);
-                               if( currentIndex === -1) return false;
+                               if( _currentElement.keepSize === true ) return false;
+                               currentIndex = this.index( _mouseX, _mouseY );
+                               if( currentIndex === -1 ) return false;
                                offsetX = _mouseX;
                                offsetY = _mouseY;
                                startX = baseX = _currentElement.x;
                                startY = baseY = _currentElement.y;
                                startW = baseW = _currentElement.w;
                                startH = baseH = _currentElement.h;
-                               if( _currentElement.type === PANEL_ELEMENT_TYPE_IMAGE){
+                               if( _currentElement.type === PANEL_ELEMENT_TYPE_IMAGE ){
                                        startFilpV = _currentElement.flipV;
                                        startFilpH = _currentElement.flipH;                                                     
                                };
@@ -3147,6 +3147,7 @@ var Editor = gOS.registerApplication( function(){
                                TAIL_OPERATOR.init();
                                RESIZE_OPERATOR.init();
                                POSITION_OPERATOR.init();
+                               CONSOLE_CONTROLER.init();
                                
                                app.addKeyEventListener( 'keychange', function( e ){
                                        currentOperator !== null && currentOperator.onShiftUpdate && currentOperator.onShiftUpdate();
@@ -3165,6 +3166,7 @@ var Editor = gOS.registerApplication( function(){
                                delete PANEL_ELEMENT_OPERATION_MANAGER.init;
                        },
                        open: function(){
+                               CONSOLE_CONTROLER.open();
                                PANEL_ELEMENT_OPERATION_MANAGER.hide();
                                
                                delete PANEL_ELEMENT_OPERATION_MANAGER.open;
@@ -3357,10 +3359,15 @@ var Editor = gOS.registerApplication( function(){
                                node.mesureChildren();
                                //node.mesure();
                        },
+                       onMousemove : function( e ){
+                               // 無理やりな実装になってしまうけど
+                               return true;
+                       },
                        show: function( _currentElement, w, h ){
                                if( node === null ){
-                                       node = PANEL_CONTROL.node.createNode( elmContainer, false, false, 'comic-element-consol-container-hover' );
+                                       node = eventRoot.createNode( elmContainer, false, false, 'comic-element-consol-container-hover' );
                                        node.addEventListener( 'mouseover', CONSOLE_CONTROLER.onMouseover, CONSOLE_CONTROLER );
+                                       node.addEventListener( 'mousemove', CONSOLE_CONTROLER.onMousemove, CONSOLE_CONTROLER );
                                        ui            = app.createUIGroup( node );
                                        inputX        = ui.createInputText( document.getElementById( 'comic-element-x' ), null );
                                        inputY        = ui.createInputText( document.getElementById( 'comic-element-y' ), null );
@@ -3398,13 +3405,13 @@ var Editor = gOS.registerApplication( function(){
                                if( h * PUSH_OUT_RATIO < CONSOLE_CONTROLER.h ){
                                        if( pushout === false ){
                                                pushout = true;
-                                               elmPushout.appendChild( elmContainer );
+                                               elmPushout.lastChild.appendChild( elmContainer );
                                                elmPushout.style.display = 'block';
                                                pushoutW = elmPushout.offsetWidth;
                                                pushoutH = elmPushout.offsetHeight;
                                                elmTail.style.top = ( pushoutH / 2 - tailSize / 2 ) + 'px';
                                        };
-                                       elmPushout.style.left = ( - pushoutW - tailSize ) + 'px';
+                                       elmPushout.style.left = ( -pushoutW ) + 'px';
                                        elmPushout.style.top  = ( h / 2 - pushoutH / 2 ) + 'px';
                                        elmPushout.className  = 'satellite-left';
                                } else
@@ -3799,7 +3806,7 @@ var Editor = gOS.registerApplication( function(){
        
                return {
                        id : 'PANEL_ELEMENT_CONTROL',
-                       init: function(){
+                       init : function(){
                                elmContainer  = document.getElementById( 'comic-element-container' );
                                nodeWorkarea  = eventRoot.createNode( { x: 0, y:0, w:9999, h:9999 }, false, true );
                                nodeWorkarea.addEventListener( 'mousemove', PANEL_ELEMENT_CONTROL.mousemove, PANEL_ELEMENT_CONTROL );
@@ -3810,16 +3817,16 @@ var Editor = gOS.registerApplication( function(){
                                //eventRoot.addEventListener( 'mouseup',   PANEL_ELEMENT_CONTROL.mouseup,   PANEL_ELEMENT_CONTROL );
                                delete PANEL_ELEMENT_CONTROL.init;
                        },
-                       open: function(){
+                       open : function(){
 
                        },
-                       close: function(){
+                       close : function(){
                                var panelElm;
                                while( panelElm = PANEL_ELEMENT_ARRAY.shift() ){
                                        panelElm.destroy();
                                };
                        },
-                       remove: function( _panelElement ){
+                       remove : function( _panelElement ){
                                var l = PANEL_ELEMENT_ARRAY.length;
                                for( var i=0; i<l; ++i ){
                                        if( PANEL_ELEMENT_ARRAY[ i ] === _panelElement ){
@@ -3835,7 +3842,7 @@ var Editor = gOS.registerApplication( function(){
                                };
                        },
                        /* history */
-                       restore: function( isAppend, panelElement ){
+                       restore : function( isAppend, panelElement ){
                                isAppend === true ? appendPanelElement( panelElement ) :  PANEL_ELEMENT_CONTROL.remove( panelElement );
                        },
                        replace: function( _panelElement, goForward ){
@@ -3879,7 +3886,7 @@ var Editor = gOS.registerApplication( function(){
                                        'top:',    panelY = _panelY, 'px'
                                ].join( '' );
                        },
-                       mousemove: function( e ){
+                       mousemove : function( e ){
                                var l    = PANEL_ELEMENT_ARRAY.length,
                                        mX   = e.layerX,
                                        mY   = e.layerY,
@@ -3889,7 +3896,7 @@ var Editor = gOS.registerApplication( function(){
                                        i;
                                console.log( 'x:' + _x + ' y:' + _y )
                                // mouse が コンソールに乗ったらフォーカスを外す.
-                               if(  CONSOLE_CONTROLER.hitTest( _x, _y ) === true ) return false;
+                               //if(  CONSOLE_CONTROLER.hitTest( _x, _y ) === true ) return false;
                                
                                if( _elm !== null ){
                                        if( _elm.busy() === true ){
@@ -3918,7 +3925,7 @@ var Editor = gOS.registerApplication( function(){
                                var x   = e.layerX,
                                        y   = e.layerY,
                                        ret = currentElement !== null && currentElement.busy() === true;
-                               ret === true && currentElement.mouseup( x -startX || panelX, y -startY || panelY );
+                               ret === true && currentElement.mouseup( x - startX || panelX, y - startY || panelY );
                                return ret;
                        },
                        mousedown: function( e ){
@@ -4025,7 +4032,7 @@ var Editor = gOS.registerApplication( function(){
                        '<div id="comic-element-resizer-container">',
                                '<div id="balloon-tail-mover"></div>',
                                '<div id="comic-element-consol-wrapper">',
-                                       '<div  id="comic-element-consol-container" class="clearfix">',
+                                       '<div id="comic-element-consol-container" class="clearfix">',
                                                '<div class="comic-element-consol-item">',
                                                        '<div id="comic-element-x">',
                                                                '<span class="comic-element-attribute-label">x:</span>',
@@ -4097,13 +4104,12 @@ var Editor = gOS.registerApplication( function(){
                                '<div class="comic-element-resizer" id="comic-element-resizer-bottom-right"></div>',
                                '<div id="comic-element-consol-pushout-wrapper">',
                                        '<div id="comic-element-consol-pushout-tail"></div>',
+                                       '<div id="comic-element-consol-pushout-inner"></div>',
                                '</div>',                                       
                        '</div>',
                        '<div id="menu-bar"></div>',
                        
                        '<div id="templete-container" style="display: none;">',
-                       
-                       
                                '<div id="imgElementTemplete" class="comic-element-wrapper image-element"></div>',
                                
                                '<div id="textElementTemplete" class="comic-element-wrapper text-element">',
@@ -4181,7 +4187,6 @@ var Editor = gOS.registerApplication( function(){
                SAVE_CONTROL.init();
                GRID_CONTROL.init();
                WHITE_GLASS_CONTROL.init();
-               CONSOLE_CONTROLER.init();
                PANEL_ELEMENT_OPERATION_MANAGER.init();
                
                comicID      = -1;
@@ -4223,7 +4228,6 @@ var Editor = gOS.registerApplication( function(){
                
                GRID_CONTROL.open();
                PANEL_CONTROL.open( panelW, panelH, borderSize );
-               CONSOLE_CONTROLER.open();
                PANEL_ELEMENT_OPERATION_MANAGER.open();
                PANEL_ELEMENT_CONTROL.open();
                
index b822f41..5a72c73 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.5.24
+ *   version 0.5.25
  *
  * gadgetOS
  *   author:
@@ -4959,15 +4959,15 @@ var Finder = ( function(){
 
 var DHTML = ( function(){
        
-       var ANIMATION_TICKET_ARRAY = [],
-               fpms                   = 50,
-               round                  = Math.round,
-               cround                 = function ( v ){ return round( v * 100 ) / 100 };
+       var TICKET_ARRAY = [],
+               fpms         = 50,
+               round        = Math.round,
+               cround       = function( v ){ return round( v * 100 ) / 100 };
        
        function startAnimation( _elm, _cssObject, _onComplete, _onEnterFrame, _numFrames ){
-               var _ticket, i = ANIMATION_TICKET_ARRAY.length;
+               var _ticket, i = TICKET_ARRAY.length;
                for( ; i; ){
-                       _ticket = ANIMATION_TICKET_ARRAY[ --i ];
+                       _ticket = TICKET_ARRAY[ --i ];
                        if( _ticket.elm === _elm ){
                                return;
                        };
@@ -5015,18 +5015,18 @@ var DHTML = ( function(){
                        current.clear();
                };
                
-               var i, _cssTextArray = [];
+               var i, cssTexts = [];
                for( i = 0; i < _numFrames; ++i ){
                        if( i < _numFrames - 1 ){
                                tickValue( _currentValues, _offsetValues, _numFrames );
-                               createCssText( _currentValues, _targetProperties, targetStyle, inlineStyle, _cssTextArray );
+                               cssTexts.push( createCssText( _currentValues, _targetProperties, targetStyle, inlineStyle ) );
                        } else {
-                               createCssText( _endValues, _targetProperties, targetStyle, inlineStyle, _cssTextArray );
+                               cssTexts.push( createCssText( _endValues, _targetProperties, targetStyle, inlineStyle ) );
                        };
                };
                
-               ANIMATION_TICKET_ARRAY.push( new AnimationTaskClass(
-                       _elm, _cssTextArray,
+               TICKET_ARRAY.push( new AnimationTaskClass(
+                       _elm, cssTexts,
                        Type.isFunction( _onComplete ) === true   ? _onComplete   : null,
                        Type.isFunction( _onEnterFrame ) === true ? _onEnterFrame : null,
                        _numFrames
@@ -5049,7 +5049,7 @@ var DHTML = ( function(){
                        return current + offset / numFrames;
                };
        };
-       function createCssText( update, props, style, inline, cssTextArray ){
+       function createCssText( update, props, style, inline ){
                var prop;
                for( var i = props.length; i; ){
                        prop = style.get( props[ --i ] );
@@ -5058,14 +5058,14 @@ var DHTML = ( function(){
                        //if( prop.name === 'backgroundColor' ) alert( prop.getValueText() + '|' + update[ i ].join( ',') )
                        prop.clear();
                };
-               cssTextArray.push( CSS.toCssText( inline ) );
+               return CSS.toCssText( inline );
        };
        
        function onEnterFrame(){
                var _ticket, l,
                        i = 0;
-               while( i < ANIMATION_TICKET_ARRAY.length ){
-                       _ticket = ANIMATION_TICKET_ARRAY[ i ];
+               while( i < TICKET_ARRAY.length ){
+                       _ticket = TICKET_ARRAY[ i ];
                        l       = _ticket.cssTexts.length;
                        _ticket.elm.style.cssText = _ticket.cssTexts.shift();
                        if( l === 1 ){
@@ -5075,13 +5075,13 @@ var DHTML = ( function(){
                                delete _ticket.onComplete;
                                delete _ticket.onEnterFrame;
                                delete _ticket.numFrame;
-                               ANIMATION_TICKET_ARRAY.splice( i, 1 );
+                               TICKET_ARRAY.splice( i, 1 );
                        } else {
                                _ticket.onEnterFrame && _ticket.onEnterFrame( l / _ticket.numFrame );
                                ++i;
                        };
                };
-               if( ANIMATION_TICKET_ARRAY.length === 0 ){
+               if( TICKET_ARRAY.length === 0 ){
                        SystemTimer.remove( SUPER_USER_KEY, onEnterFrame );
                };
        };
@@ -5095,27 +5095,22 @@ var DHTML = ( function(){
        };
        
        var VisualEffectClass = function( elm ){
-               var isHtmlElement;
-               
-               function registerAnime( _cssObject, _onComplete, _onEnterFrame, _time ){
+               this.elm = elm;
+       };
+       VisualEffectClass.prototype = {
+               anime : function( _cssObject, _onComplete, _onEnterFrame, _time ){
                        var _numFrames = Math.floor( _time / fpms );
-                       startAnimation( elm, _cssObject, _onComplete, _onEnterFrame, _numFrames );
-               };
-               function startFadeIn(){
-                       
-               };
-               function startFadeOut(){
+                       startAnimation( this.elm, _cssObject, _onComplete, _onEnterFrame, _numFrames );
+               },
+               fadeIn : function(){
                        
-               };
-               function update( _x, _y, _w, _h ){
-                       var _cssText = elm.style.cssText;
+               },
+               fadeOut : function(){
                        
-               };
-               
-               this.anime   = registerAnime;
-               this.fadeIn  = startFadeIn;
-               this.fadeOut = startFadeOut;
-               this.update  = update;
+               },
+               update : function( x, y, w, h ){
+                       var _cssText = this.elm.style.cssText;
+               }
        };
        
        return {
index cd80c28..254a9ca 100644 (file)
@@ -1,7 +1,7 @@
 @charset "UTF-8";\r
 \r
 /* pettanR peta.apps.css\r
- *   version 0.5.23\r
+ *   version 0.5.25\r
  * \r
  *   author:\r
  *     itozyun\r
                #comic-element-consol-pushout-wrapper {\r
                        display:                        none;\r
                        position:                       absolute;\r
-                       top:                -10px;\r
-                       width:                          240px;\r
-                       border:                         1px solid #999;\r
+                       width:                          250px;\r
+                       \r
                }\r
+                       #comic-element-consol-pushout-inner {\r
+                               border:                         1px solid #999;\r
+                       }\r
+                       .satellite-left #comic-element-consol-pushout-inner {\r
+                               top:                            0;\r
+                               left:                           0;\r
+                       }\r
+                       \r
                        #comic-element-consol-pushout-tail {\r
                                border-style:           solid;\r
                                width:                          0;\r
                                border-color:           transparent transparent transparent #999;\r
                                _border-color:          #fff #fff #fff #999;\r
                                top:                            50%;\r
-                               right:                          -10px;\r
+                               right:                          0;\r
                        }\r
                        .satellite-right #comic-element-consol-pushout-tail {\r
                                border-width:           5px 10px 5px 0;\r