/*
* pettanR peta.apps.js
- * version 0.5.24
+ * version 0.5.25
*
* author:
* itozyun
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 ){
/**
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 );
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;
};
TAIL_OPERATOR.init();
RESIZE_OPERATOR.init();
POSITION_OPERATOR.init();
+ CONSOLE_CONTROLER.init();
app.addKeyEventListener( 'keychange', function( e ){
currentOperator !== null && currentOperator.onShiftUpdate && currentOperator.onShiftUpdate();
delete PANEL_ELEMENT_OPERATION_MANAGER.init;
},
open: function(){
+ CONSOLE_CONTROLER.open();
PANEL_ELEMENT_OPERATION_MANAGER.hide();
delete PANEL_ELEMENT_OPERATION_MANAGER.open;
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 );
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
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 );
//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 ){
};
},
/* history */
- restore: function( isAppend, panelElement ){
+ restore : function( isAppend, panelElement ){
isAppend === true ? appendPanelElement( panelElement ) : PANEL_ELEMENT_CONTROL.remove( panelElement );
},
replace: function( _panelElement, goForward ){
'top:', panelY = _panelY, 'px'
].join( '' );
},
- mousemove: function( e ){
+ mousemove : function( e ){
var l = PANEL_ELEMENT_ARRAY.length,
mX = e.layerX,
mY = e.layerY,
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 ){
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 ){
'<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>',
'<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">',
SAVE_CONTROL.init();
GRID_CONTROL.init();
WHITE_GLASS_CONTROL.init();
- CONSOLE_CONTROLER.init();
PANEL_ELEMENT_OPERATION_MANAGER.init();
comicID = -1;
GRID_CONTROL.open();
PANEL_CONTROL.open( panelW, panelH, borderSize );
- CONSOLE_CONTROLER.open();
PANEL_ELEMENT_OPERATION_MANAGER.open();
PANEL_ELEMENT_CONTROL.open();
/*
* pettanR system.js
- * version 0.5.24
+ * version 0.5.25
*
* gadgetOS
* author:
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;
};
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
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 ] );
//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 ){
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 );
};
};
};
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 {