• R/O
  • HTTP
  • SSH
  • HTTPS

clientJs: コミット

クライアント側 js 開発用


コミットメタ情報

リビジョン64e81e7eda1498e30f22ede8d5680f7cc3239fb0 (tree)
日時2012-11-23 22:58:24
作者itozyun <itozyun@gmai...>
コミッターitozyun

ログメッセージ

fixed around UI for PointingDeviceEventTree.

変更サマリ

差分

--- a/0.5.x/javascripts/peta.apps.js
+++ b/0.5.x/javascripts/peta.apps.js
@@ -1,6 +1,6 @@
11 /*
22 * pettanR peta.apps.js
3- * version 0.5.22
3+ * version 0.5.23
44 *
55 * author:
66 * itozyun
@@ -688,6 +688,7 @@ var PremiumSatge = gOS.registerApplication( function(){
688688 itemW, itemH, buttonW,
689689 onUpdate = null,
690690 onUpdateData = null,
691+ onUpdateContext = null,
691692 artistID = -1;
692693
693694 var ImageGroupIconClass = function( index, data ){
@@ -804,8 +805,8 @@ var PremiumSatge = gOS.registerApplication( function(){
804805 while( ICON_ARRAY.length > 0 ){
805806 ICON_ARRAY.shift().destroy();
806807 }
807- onUpdate !== null && onUpdateData !== null && onUpdate( onUpdateData );
808- onUpdate = onUpdateData = null;
808+ onUpdate !== null && onUpdateData !== null && onUpdate.call( onUpdateContext, onUpdateData );
809+ onUpdate = onUpdateData = onUpdateContext = null;
809810 PremiumSatge.shutdown();
810811 }
811812
@@ -826,7 +827,7 @@ var PremiumSatge = gOS.registerApplication( function(){
826827 tree = FileAPI.createTree( FILE_DATA_ARTIST_ROOT );
827828 rootFile = tree.getRootFile();
828829 };
829- this.onOpen = function( _windowW, _windowH, _ARTISTIDorFILE, _onUpdate ){
830+ this.onOpen = function( _windowW, _windowH, _ARTISTIDorFILE, _onUpdate, opt_thisObj ){
830831 elmContainer = document.getElementById( 'image-group-icon-container' );
831832 containerH = Util.getElementSize( elmContainer ).height;
832833
@@ -863,6 +864,7 @@ var PremiumSatge = gOS.registerApplication( function(){
863864 }
864865
865866 onUpdate = _onUpdate || null;
867+ onUpdateContext = opt_thisObj || null;
866868 onUpdateData = null;
867869
868870 drawIcons();
@@ -927,7 +929,7 @@ var PremiumSatge = gOS.registerApplication( function(){
927929 if( tree === null ) return true;
928930 $( elmContainer ).stop().animate( {
929931 height: 0,
930- top: Math.floor( winH /2 )
932+ top: Math.floor( winH / 2 )
931933 }, onFadeout );
932934 // onEnterInterval !== null && window.clearTimeout( onEnterInterval );
933935 // onEnterInterval = null;
@@ -995,7 +997,7 @@ var TextEditor = gOS.registerApplication( function(){
995997 onUpdate = _onUpdate || null;
996998
997999 self.onPaneResize( _w, _h );
998- elmTextarea.value = _textElement.text()
1000+ elmTextarea.value = _textElement.content;
9991001 elmTextarea.focus();
10001002
10011003 /*
@@ -2210,91 +2212,17 @@ var Editor = gOS.registerApplication( function(){
22102212 * - window
22112213 */
22122214 var INFOMATION_WINDOW = ( function(){
2213- var FADE_EFFECT_ENABLED = true, //UA.isIE === false || UA.ieVersion >= 8,
2214- FADE_IN_EFFECT = FADE_EFFECT_ENABLED === true ? 'fadeIn' : 'show',
2215- FADE_OUT_EFFECT = FADE_EFFECT_ENABLED === true ? 'fadeOut' : 'hide',
2216- backgroundInfomationElm,
2217- jqPanelElementInformation,
2218- ui, inputX, inputY, inputZ, inputA, inputW, inputH, inputAspectRatio,
2219- inputPercentW, inputPercentH,
2220- currentPanelElement = null,
2221- currentElementType = -1;
2215+ var backgroundInfomationElm;
22222216
22232217 return WINDOWS_CONTROL.createWindow(
22242218 {
22252219 onFirstOpen: function( _w, _h ){
22262220 backgroundInfomationElm = $( '#panel-background-information');
2227-
2228- jqPanelElementInformation = $( '#comic-element-infomation').hide().css( {
2229- height: _h
2230- });
2231- ui = app.createUIGroup();
2232- inputX = ui.createInputText( document.getElementById( 'comic-element-x' ), null );
2233- inputY = ui.createInputText( document.getElementById( 'comic-element-y' ), null );
2234- inputZ = ui.createInputText( document.getElementById( 'comic-element-z' ), null );
2235- inputA = ui.createInputText( document.getElementById( 'comic-element-a' ), null );
2236- inputW = ui.createInputText( document.getElementById( 'comic-element-w' ), null );
2237- inputH = ui.createInputText( document.getElementById( 'comic-element-h' ), null );
2238- inputPercentW = ui.createInputText( document.getElementById( 'comic-element-w-percent' ), null );
2239- inputPercentH = ui.createInputText( document.getElementById( 'comic-element-h-percent' ), null );
2240- inputAspectRatio = $( '#comic-element-keep-aspect' );
22412221 },
22422222 onResize: function( _w, _h ){
2243- jqPanelElementInformation.css( {
2244- height: _h
2245- });
22462223 },
22472224 update: function( currentElement ){
2248- var _elementType = currentElement === null ? -1 : currentElement.type,
2249- x = currentElement !== null ? currentElement.x : 0,
2250- y = currentElement !== null ? currentElement.y : 0,
2251- z = currentElement !== null ? currentElement.z : 0,
2252- a = _elementType === PANEL_ELEMENT_TYPE_TEXT ? Math.floor( currentElement.angle() ) : 0,
2253- w = currentElement !== null ? currentElement.w : 0,
2254- h = currentElement !== null ? currentElement.h : 0,
2255- actualW = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualW() : 1,
2256- actualH = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualH() : 1,
2257- wPercent = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( w / actualW *100 ) : 0,
2258- hPercent = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( h / actualH *100 ) : 0,
2259- keepAspect = currentElement !== null && currentElement.keepAspect === true;
2260-
2261- if( currentElementType !== _elementType ){
2262- if( _elementType !== -1 ){
2263- if( _elementType === 1 ){
2264- inputA.visible( true );
2265- inputPercentW.visible( false );
2266- inputPercentH.visible( false );
2267- inputAspectRatio.hide();
2268- } else {
2269- inputA.visible( false );
2270- inputPercentW.visible( true );
2271- inputPercentH.visible( true );
2272- inputAspectRatio.show();
2273- };
2274- currentElementType === -1 && jqPanelElementInformation.stop().css( {
2275- filter: '',
2276- opacity: ''
2277- })[ FADE_IN_EFFECT ]();
2278- } else {
2279- currentElementType !== -1 && jqPanelElementInformation.stop().css({
2280- filter: '',
2281- opacity: ''
2282- })[ FADE_OUT_EFFECT ]();
2283- };
2284- currentElementType = _elementType;
2285- };
2286- if( currentElementType !== -1){
2287- inputX.value( x );
2288- inputY.value( y );
2289- inputZ.value( z );
2290- _elementType === 1 && inputA.value( a );
2291- inputW.value( w );
2292- inputH.value( h );
2293- _elementType === 0 && inputPercentW.value( wPercent );
2294- _elementType === 0 && inputPercentH.value( hPercent );
2295- } else {
2296-
2297- };
2225+
22982226 }
22992227 },
23002228 'infomation-window', 'Infomation', 0, 30, 200, 180, true
@@ -2719,13 +2647,13 @@ var Editor = gOS.registerApplication( function(){
27192647 mousemove: function( _mouseX, _mouseY ){
27202648 if( isDraggable === true && isDragging === true ){
27212649 PANEL_CONTROL.resize( false, startX + _mouseX - offsetX, startY + _mouseY - offsetY );
2722- }
2650+ };
27232651 },
27242652 mouseup: function( _mouseX, _mouseY ){
27252653 if( isDraggable === true ){
27262654 isDragging = false;
27272655 app.updateCoursor( '' );
2728- }
2656+ };
27292657 },
27302658 mousedown: function( _mouseX, _mouseY ){
27312659 if( isDraggable === true ){
@@ -2736,188 +2664,12 @@ var Editor = gOS.registerApplication( function(){
27362664 isDragging = true;
27372665 app.updateCoursor( 'move' );
27382666 return true;
2739- }
2667+ };
27402668 },
27412669 busy: function(){
27422670 return isDragging === true;
27432671 }
2744- }
2745- })();
2746-
2747-
2748-/* --------------------------------------------------------------------------------------------
2749- * CONSOLE_CONTROLER
2750- */
2751- var CONSOLE_CONTROLER = ( function(){
2752- var LAYER_BACK_BUTTON, LAYER_FORWARD_BUTTON, DELETE_BUTTON, EDIT_BUTTON, CHANGE_BUTTON,
2753- elmConsoleWrapper, styleConsoleWrapper,
2754- layerWrapper,
2755- // elmConsoleParent,
2756- styleImgConsole, styleTextConsole,
2757- currentElement = null,
2758- currentType = -1,
2759- visible = false,
2760- imgConsoleWidth, imgConsoleHeight,
2761- textConsoleWidth, textConsoleHeight,
2762- tailSize = 10;
2763-
2764- function layerBack(){
2765- if( currentElement === null ) return;
2766- if( PANEL_ELEMENT_CONTROL.replace( currentElement, false ) === false ) return;
2767- INFOMATION_WINDOW.update( currentElement );
2768- HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.resplace, [ currentElement, true ], [ currentElement, false ] );
2769- var _z = currentElement.z;
2770- LAYER_BACK_BUTTON.visible( _z > 0 );
2771- LAYER_FORWARD_BUTTON.visible( _z < PANEL_ELEMENT_ARRAY.length - 1 );
2772- };
2773- function layerForward(){
2774- if( currentElement === null ) return;
2775- if( PANEL_ELEMENT_CONTROL.replace( currentElement, true ) === false ) return;
2776- INFOMATION_WINDOW.update( currentElement );
2777- HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.replace, [ currentElement, false ], [ currentElement, true ] );
2778- var _z = currentElement.z;
2779- LAYER_BACK_BUTTON.visible( _z > 0 );
2780- LAYER_FORWARD_BUTTON.visible( _z < PANEL_ELEMENT_ARRAY.length - 1 );
2781- };
2782- function del(){
2783- if( currentElement === null ) return;
2784- // buttonBackOrForward( true );
2785- HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.restore, [ true, currentElement ], [ false, currentElement ], false ); // true
2786- PANEL_ELEMENT_CONTROL.remove( currentElement );
2787- PANEL_ELEMENT_OPERATION_MANAGER.hide();
2788- };
2789- function edit(){
2790- if( currentElement === null || currentElement.type !== PANEL_ELEMENT_TYPE_TEXT ) return;
2791- TextEditor.boot( PANEL_CONTROL.x, PANEL_CONTROL.y, currentElement );
2792- // buttonBackOrForward( true );
2793- };
2794- function change(){
2795- if( currentElement === null) return;
2796- // buttonBackOrForward( true );
2797- PremiumSatge.boot( currentElement.getArtistID(), currentElement.resourcePicture );
27982672 };
2799- function onImageSelect( resourcePicture ){
2800- currentElement.resourcePicture( resourcePicture );
2801- };
2802- return {
2803- x: 0,
2804- y: 0,
2805- w: 0,
2806- h: 0,
2807- init: function(){
2808- app.addKeyEventListener( 'keydown', layerBack, 66, false, true );
2809- app.addKeyEventListener( 'keydown', layerForward, 70, false, true );
2810- app.addKeyEventListener( 'keydown', del, 68, false, true );
2811- app.addKeyEventListener( 'keydown', edit, 69, false, true );
2812- app.addKeyEventListener( 'keydown', change, 85, false, true );
2813-
2814- var elmImgConsole = document.getElementById( 'image-element-consol' ),
2815- imgConsoleSize = Util.getElementSize( elmImgConsole );
2816- imgConsoleWidth = imgConsoleSize.width;
2817- imgConsoleHeight = imgConsoleSize.height;
2818- styleImgConsole = elmImgConsole.style;
2819-
2820- var elmTextConsole = document.getElementById( 'text-element-consol' ),
2821- textConsoleSize = Util.getElementSize( elmTextConsole );
2822- textConsoleWidth = textConsoleSize.width;
2823- textConsoleHeight = textConsoleSize.height;
2824- styleTextConsole = elmTextConsole.style;
2825-
2826- elmConsoleWrapper = document.getElementById( 'comic-element-consol-wrapper' );
2827- styleConsoleWrapper = elmConsoleWrapper.style;
2828- // elmConsoleParent = elmConsoleWrapper.parentNode;
2829-
2830- elmImgConsole.style.display = styleTextConsole.display = styleConsoleWrapper.display = 'none';
2831-
2832- delete CONSOLE_CONTROLER.init;
2833- },
2834- open: function(){
2835- // layerWrapper = app.createInteractContainer( elmConsoleWrapper );
2836-
2837- LAYER_BACK_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'layer back', 'ctrl + B', layerBack, false, true, false );
2838- LAYER_FORWARD_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'layer forward', 'ctrl + F', layerForward, false, false, false );
2839- DELETE_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'delete', 'ctrl + D', del, false, true, true );
2840- EDIT_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'Edit Text', 'ctrl + E', edit, false, true, false );
2841- CHANGE_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'change', 'ctrl + U', change, false, false, true );
2842-
2843- delete CONSOLE_CONTROLER.open;
2844- },
2845- show: function( _currentElement, _w, _h ){
2846- if( visible === false ) styleConsoleWrapper.display = '';
2847- visible = true;
2848- currentElement = _currentElement;
2849- var _currentType = _currentElement.type,
2850- _z = _currentElement.z,
2851- imgEvent, txtEvent;
2852- if( currentType !== _currentType ){
2853- currentType = _currentType;
2854- styleImgConsole.display = _currentType === PANEL_ELEMENT_TYPE_IMAGE ? '' : 'none';
2855- styleTextConsole.display = _currentType === PANEL_ELEMENT_TYPE_TEXT ? '' : 'none';
2856- CONSOLE_CONTROLER.w = _currentType === PANEL_ELEMENT_TYPE_IMAGE ? imgConsoleWidth : textConsoleWidth;
2857- CONSOLE_CONTROLER.h = _currentType === PANEL_ELEMENT_TYPE_IMAGE ? imgConsoleHeight : textConsoleHeight;
2858-
2859- imgEvent = _currentType === PANEL_ELEMENT_TYPE_IMAGE ? 'addEventListener' : 'removeEventListener';
2860- txtEvent = _currentType === PANEL_ELEMENT_TYPE_TEXT ? 'addEventListener' : 'removeEventListener';
2861-
2862- app[ imgEvent ]( document.getElementById( 'change-image-button' ), 'click', change );
2863- app[ imgEvent ]( document.getElementById( 'layer-forward-button' ), 'click', layerForward );
2864- app[ imgEvent ]( document.getElementById( 'layer-back-button' ), 'click', layerBack );
2865- app[ imgEvent ]( document.getElementById( 'delete-image-button' ), 'click', del );
2866-
2867- app[ txtEvent ]( document.getElementById( 'edit-text-button' ), 'click', edit );
2868- app[ txtEvent ]( document.getElementById( 'forward-text-button' ), 'click', layerForward );
2869- app[ txtEvent ]( document.getElementById( 'back-text-button' ), 'click', layerBack );
2870- app[ txtEvent ]( document.getElementById( 'delete-text-button' ), 'click', del );
2871- };
2872- CONSOLE_CONTROLER.x = Math.floor( ( _w - CONSOLE_CONTROLER.w ) / 2 );
2873-
2874- LAYER_BACK_BUTTON.visible( _z > 0 );
2875- LAYER_FORWARD_BUTTON.visible( _z < PANEL_ELEMENT_ARRAY.length - 1 );
2876- DELETE_BUTTON.visible( true );
2877- EDIT_BUTTON.visible( _currentType === PANEL_ELEMENT_TYPE_TEXT );
2878- CHANGE_BUTTON.visible( false );
2879-
2880- if( _w > CONSOLE_CONTROLER.w * 1.5 && _h > CONSOLE_CONTROLER.h * 1.5 ){
2881- CONSOLE_CONTROLER.y = Math.floor( ( _h - CONSOLE_CONTROLER.h ) / 2 );
2882- elmConsoleWrapper.className = '';
2883- } else {
2884- CONSOLE_CONTROLER.y = _h + tailSize;
2885- elmConsoleWrapper.className = 'console-out';
2886- };
2887- styleConsoleWrapper.left = CONSOLE_CONTROLER.x + 'px';
2888- styleConsoleWrapper.top = CONSOLE_CONTROLER.y + 'px';
2889-
2890- // layerWrapper.mesure();
2891- },
2892- hide: function(){
2893- if( visible === true ) styleConsoleWrapper.display = 'none';
2894- visible = false;
2895- currentElement = null;
2896- LAYER_BACK_BUTTON.visible( false );
2897- LAYER_FORWARD_BUTTON.visible( false );
2898- DELETE_BUTTON.visible( false );
2899- EDIT_BUTTON.visible( false );
2900- CHANGE_BUTTON.visible( false );
2901- },
2902- hitTest : function( _mouseX, _mouseY ){
2903- if( currentElement === null ) return false;
2904- _mouseX -= currentElement.x;
2905- _mouseY -= currentElement.y;
2906- return visible === true &&
2907- CONSOLE_CONTROLER.x <= _mouseX && _mouseX <= CONSOLE_CONTROLER.x + CONSOLE_CONTROLER.w &&
2908- CONSOLE_CONTROLER.y <= _mouseY && _mouseY <= CONSOLE_CONTROLER.y + CONSOLE_CONTROLER.h;
2909- },
2910- mousemove: function(){
2911- /*
2912- if( CONSOLE_CONTROLER.x > _mouseX || CONSOLE_CONTROLER.y > _mouseY || CONSOLE_CONTROLER.x + CONSOLE_CONTROLER.w < _mouseX || CONSOLE_CONTROLER.y + CONSOLE_CONTROLER.h < _mouseY ){
2913- // buttonClickable === true && buttonBackOrForward( true );
2914- return false;
2915- }
2916- // buttonClickable === false && buttonBackOrForward( false ); */
2917- // layerWrapper.mesure();
2918- return false;
2919- }
2920- }
29212673 })();
29222674
29232675 /* --------------------------------------------------------------------------------------------
@@ -2962,7 +2714,7 @@ var Editor = gOS.registerApplication( function(){
29622714 * visibilityのほうがいい, display:none だと ie で描画が狂う
29632715 */
29642716 styleMover.visibility = '';
2965- TAIL_OPERATOR.update( _currentText.w, _currentText.h, _currentText.angle() );
2717+ TAIL_OPERATOR.update( _currentText.w, _currentText.h, _currentText.a );
29662718 currentText = _currentText;
29672719 },
29682720 hitTest: function( _mouseX, _mouseY ){
@@ -2984,7 +2736,7 @@ var Editor = gOS.registerApplication( function(){
29842736 w = _currentText.w;
29852737 h = _currentText.h;
29862738 currentText = _currentText;
2987- startA = _currentText.angle();
2739+ startA = _currentText.a;
29882740 return true;
29892741 }
29902742 return false;
@@ -2997,16 +2749,16 @@ var Editor = gOS.registerApplication( function(){
29972749 ATAN( _mouseY / _mouseX ) * RAD_TO_DEG + ( _mouseX > 0 ? 90 : 270 ) :
29982750 _mouseY > 0 ? 180 : 0
29992751 );
3000- currentText && currentText.angle( FLOOR( balloonA + 0.5 ));
3001- INFOMATION_WINDOW.update( currentText );
2752+ currentText && currentText.angle( FLOOR( balloonA + 0.5 ) );
2753+ CONSOLE_CONTROLER.update( currentText );
30022754 },
30032755 onFinish: function(){
3004- startA !== currentText.angle() && PANEL_ELEMENT_OPERATION_MANAGER.saveStatus( x, y, w, h, startA );
3005- startA !== currentText.angle() && PANEL_ELEMENT_OPERATION_MANAGER.resize( x, y, w, h, currentText.angle() );
2756+ startA !== currentText.a && PANEL_ELEMENT_OPERATION_MANAGER.saveStatus( x, y, w, h, startA );
2757+ startA !== currentText.a && PANEL_ELEMENT_OPERATION_MANAGER.resize( x, y, w, h, currentText.a );
30062758 currentText = null;
30072759 },
30082760 onCancel: function(){
3009- currentText.angle( startA);
2761+ currentText.angle( startA );
30102762 PANEL_ELEMENT_OPERATION_MANAGER.resize( x, y, w, h, startA );
30112763 currentText = null;
30122764 }
@@ -3064,8 +2816,8 @@ var Editor = gOS.registerApplication( function(){
30642816 w = _w = _w !== undefined ? _w : w;
30652817 h = _h = _h !== undefined ? _h : h;
30662818
3067- elmResizerContainerStyle.left = _x + 'px';
3068- elmResizerContainerStyle.top = _y + 'px';
2819+ elmResizerContainerStyle.left = ( PANEL_CONTROL.x + _x ) + 'px';
2820+ elmResizerContainerStyle.top = ( PANEL_CONTROL.y + _y ) + 'px';
30692821 elmResizerContainerStyle.width = _w + 'px';
30702822 elmResizerContainerStyle.height = _h + 'px';
30712823 elmResizerTopStyle.left = elmResizerBottomStyle.left = FLOOR( _w / 2 - 5 ) + 'px';
@@ -3100,14 +2852,14 @@ var Editor = gOS.registerApplication( function(){
31002852 __h = _h;
31012853 _h = FLOOR( _w / startAspect );
31022854 _y = _y + ( currentIndex <= 5 ? __h - _h : 0);
3103- }
3104- }
2855+ };
2856+ };
31052857 draw( x = _x, y = _y, w = _w, h = _h );
31062858 currentElement.resize( _x, _y, _w, _h );
31072859 currentIsTextElement === true && TAIL_OPERATOR.update( _w, _h );
31082860 CONSOLE_CONTROLER.show( currentElement, _w, _h );
3109- INFOMATION_WINDOW.update( currentElement);
3110- }
2861+ CONSOLE_CONTROLER.update( currentElement );
2862+ };
31112863
31122864 function flip( _flipH, _flipV ){
31132865 var p = CURSOR_AND_FLIP[ currentIndex ];
@@ -3117,7 +2869,7 @@ var Editor = gOS.registerApplication( function(){
31172869 app.updateCoursor( CURSOR_AND_FLIP[ currentIndex ].cursor );
31182870 elmResizerContainer.className = 'current-resizer-is-' + currentIndex;
31192871 currentElement.flip( _flipH, _flipV );
3120- }
2872+ };
31212873 return {
31222874 init: function(){
31232875 elmResizerContainer = document.getElementById( 'comic-element-resizer-container');
@@ -3140,16 +2892,16 @@ var Editor = gOS.registerApplication( function(){
31402892 app.updateCoursor( CURSOR_AND_FLIP[ i].cursor );
31412893 elmResizerContainer.className = 'current-resizer-is-' +i;
31422894 return currentIndex = i;
3143- }
3144- }
2895+ };
2896+ };
31452897 for( i=0; i<4; i++ ){
31462898 p = POSITION_ARRAY[ i ];
31472899 if( p.x <= _mouseX && p.y <= _mouseY && p.x + p.w >= _mouseX && p.y +p.h >= _mouseY){
31482900 app.updateCoursor( CURSOR_AND_FLIP[ i].cursor);
31492901 elmResizerContainer.className = 'current-resizer-is-' +i;
31502902 return currentIndex = i;
3151- }
3152- }
2903+ };
2904+ };
31532905 app.updateCoursor( '' );
31542906 elmResizerContainer.className = '';
31552907 return -1;
@@ -3176,16 +2928,16 @@ var Editor = gOS.registerApplication( function(){
31762928 startW = baseW = _currentElement.w;
31772929 startH = baseH = _currentElement.h;
31782930 if( _currentElement.type === PANEL_ELEMENT_TYPE_IMAGE){
3179- startFilpV = _currentElement.flipV();
3180- startFilpH = _currentElement.flipH();
3181- }
2931+ startFilpV = _currentElement.flipV;
2932+ startFilpH = _currentElement.flipH;
2933+ };
31822934 startAspect = startW /startH;
31832935 return true;
31842936 },
31852937 onDrag: function( _mouseX, _mouseY ){
3186- var com = RESIZE_WORK_ARRAY[ currentIndex],
3187- moveX = _mouseX -offsetX,
3188- moveY = _mouseY -offsetY,
2938+ var com = RESIZE_WORK_ARRAY[ currentIndex ],
2939+ moveX = _mouseX - offsetX,
2940+ moveY = _mouseY - offsetY,
31892941 _updated = moveX !== 0 || moveY !== 0,
31902942 _x, _y, _w, _h,
31912943 _thisError = 0;
@@ -3207,8 +2959,8 @@ var Editor = gOS.registerApplication( function(){
32072959 //alert( 'opera error' +error);
32082960 this.onCancel();
32092961 return;
3210- }
3211- }
2962+ };
2963+ };
32122964
32132965 if( _w >= MIN_ELEMENT_SIZE && _h >= MIN_ELEMENT_SIZE){
32142966
@@ -3239,7 +2991,7 @@ var Editor = gOS.registerApplication( function(){
32392991 baseW = _w = _memoryX -_x;
32402992 baseH = _h;
32412993 flip( true, false);
3242- flipV = currentElement.flipV();
2994+ flipV = currentElement.flipV;
32432995 } else
32442996 if( _w > MIN_ELEMENT_SIZE && _h < -MIN_ELEMENT_SIZE){
32452997 // flipV
@@ -3259,13 +3011,13 @@ var Editor = gOS.registerApplication( function(){
32593011 baseW = _w = _memoryX -_x;
32603012 baseH = _h = _memoryY -_y;
32613013 flip( true, true);
3262- flipV = currentElement.flipV();
3263- flipH = currentElement.flipH();
3264- }
3014+ flipV = currentElement.flipV;
3015+ flipH = currentElement.flipH;
3016+ };
32653017 _updated = true;
32663018 offsetX = _mouseX;
32673019 offsetY = _mouseY;
3268- }
3020+ };
32693021 currentX = _x;
32703022 currentY = _y;
32713023 currentW = _w;
@@ -3296,7 +3048,7 @@ var Editor = gOS.registerApplication( function(){
32963048 PANEL_ELEMENT_OPERATION_MANAGER.resize( startX, startY, startW, startH );
32973049 currentElement.type === PANEL_ELEMENT_TYPE_IMAGE ?
32983050 currentElement.animate( startX, startY, startW, startH, startFilpV, startFilpH) :
3299- currentElement.animate( startX, startY, startW, startH, angle);
3051+ currentElement.animate( startX, startY, startW, startH, angle );
33003052 },
33013053 onShiftUpdate: update,
33023054 onCtrlUpdate: update
@@ -3318,7 +3070,7 @@ var Editor = gOS.registerApplication( function(){
33183070 y = _y !== undefined ? _y : y;
33193071 RESIZE_OPERATOR.update( x, y );
33203072 currentElement.resize( x, y );
3321- INFOMATION_WINDOW.update( currentElement );
3073+ CONSOLE_CONTROLER.update( currentElement );
33223074 };
33233075 return {
33243076 init: function(){
@@ -3357,7 +3109,7 @@ var Editor = gOS.registerApplication( function(){
33573109 },
33583110 onShiftUpdate: update,
33593111 onCtrlUpdate: update
3360- }
3112+ };
33613113 })();
33623114
33633115
@@ -3369,25 +3121,26 @@ var Editor = gOS.registerApplication( function(){
33693121 currentIsTextElement = false,
33703122 currentOperator = null,
33713123 currentElement = null,
3124+ node = null,
33723125 currentX, currentY, currentW, currentH, angle, flipV, flipH;
33733126
3374- function show( _currentElement ){
3375- currentElement === null && RESIZE_OPERATOR.show( _currentElement );
3376- if( currentElement !== _currentElement ){
3377- currentElement = _currentElement;
3378-
3379- currentIsTextElement = ( _currentElement.type === PANEL_ELEMENT_TYPE_TEXT );
3380- currentIsTextElement === true ? TAIL_OPERATOR.show( _currentElement ) : TAIL_OPERATOR.hide();
3381-
3382- flipV = currentIsTextElement === false ? _currentElement.flipV() : 0;
3383- flipH = currentIsTextElement === false ? _currentElement.flipH() : 0;
3384-
3385- PANEL_ELEMENT_OPERATION_MANAGER.resize(
3386- _currentElement.x, _currentElement.y, _currentElement.w, _currentElement.h,
3387- currentIsTextElement === true ? _currentElement.angle() : 0
3388- );
3389- };
3127+ function show( _currentElement ){
3128+ currentElement === null && RESIZE_OPERATOR.show( _currentElement );
3129+ if( currentElement !== _currentElement ){
3130+ currentElement = _currentElement;
3131+
3132+ currentIsTextElement = ( _currentElement.type === PANEL_ELEMENT_TYPE_TEXT );
3133+ currentIsTextElement === true ? TAIL_OPERATOR.show( _currentElement ) : TAIL_OPERATOR.hide();
3134+
3135+ flipV = currentIsTextElement === false ? _currentElement.flipV : 0;
3136+ flipH = currentIsTextElement === false ? _currentElement.flipH : 0;
3137+
3138+ PANEL_ELEMENT_OPERATION_MANAGER.resize(
3139+ _currentElement.x, _currentElement.y, _currentElement.w, _currentElement.h,
3140+ currentIsTextElement === true ? _currentElement.a : 0
3141+ );
33903142 };
3143+ };
33913144
33923145 return {
33933146 init: function(){
@@ -3425,7 +3178,7 @@ var Editor = gOS.registerApplication( function(){
34253178 app.updateCoursor( '' );
34263179 TAIL_OPERATOR.hide();
34273180 CONSOLE_CONTROLER.hide();
3428- INFOMATION_WINDOW.update( null );
3181+ //CONSOLE_CONTROLER.update( null );
34293182 },
34303183 resize: function( _x, _y, _w, _h, _angle ){
34313184 currentX = _x = _x !== undefined ? _x : currentX;
@@ -3437,7 +3190,7 @@ var Editor = gOS.registerApplication( function(){
34373190 RESIZE_OPERATOR.update( _x, _y, _w, _h );
34383191 currentIsTextElement === true && TAIL_OPERATOR.update( _w, _h, angle );
34393192 CONSOLE_CONTROLER.show( currentElement, _w, _h );
3440- INFOMATION_WINDOW.update( currentElement );
3193+ //CONSOLE_CONTROLER.update( currentElement );
34413194 },
34423195 /* history */
34433196 restoreState: function( _currentElement, _x, _y, _w, _h, _a, _flipV, _flipH ){
@@ -3459,8 +3212,8 @@ var Editor = gOS.registerApplication( function(){
34593212 startFilpV = startFilpV !== undefined ? startFilpV : flipV;
34603213 startFilpH = startFilpH !== undefined ? startFilpH : flipH;
34613214 currentElement && HISTORY_CONTROL.saveState( PANEL_ELEMENT_OPERATION_MANAGER.restoreState,
3462- [ currentElement, startX, startY, startW, startH, startA, startFilpV, startFilpH],
3463- [ currentElement, currentX, currentY, currentW, currentH, angle, flipV, flipH]
3215+ [ currentElement, startX, startY, startW, startH, startA, startFilpV, startFilpH ],
3216+ [ currentElement, currentX, currentY, currentW, currentH, angle, flipV, flipH ]
34643217 );
34653218 },
34663219 busy: function(){
@@ -3479,34 +3232,34 @@ var Editor = gOS.registerApplication( function(){
34793232 } else {
34803233 _x = _panelElement.x - HIT_AREA;
34813234 _y = _panelElement.y - HIT_AREA;
3482- _w = _panelElement.w + HIT_AREA *2;
3483- _h = _panelElement.h + HIT_AREA *2;
3484- }
3235+ _w = _panelElement.w + HIT_AREA * 2;
3236+ _h = _panelElement.h + HIT_AREA * 2;
3237+ };
34853238 return _x <= _mouseX && _mouseX <= _x + _w && _y <= _mouseY && _mouseY <= _y + _h;
34863239 },
34873240 mousedown: function( _currentElement, _mouseX, _mouseY ){
34883241 //show( _currentElement);
3489- if( currentIsTextElement === true && TAIL_OPERATOR.onStart( _currentElement, _mouseX, _mouseY) === true){
3242+ if( currentIsTextElement === true && TAIL_OPERATOR.onStart( _currentElement, _mouseX, _mouseY ) === true ){
34903243 currentOperator = TAIL_OPERATOR;
34913244 } else
3492- if( RESIZE_OPERATOR.onStart( _currentElement, _mouseX, _mouseY) === true){
3245+ if( RESIZE_OPERATOR.onStart( _currentElement, _mouseX, _mouseY ) === true ){
34933246 currentOperator = RESIZE_OPERATOR;
34943247 } else {
3495- POSITION_OPERATOR.onStart( _currentElement, _mouseX, _mouseY)
3248+ POSITION_OPERATOR.onStart( _currentElement, _mouseX, _mouseY );
34963249 currentOperator = POSITION_OPERATOR;
3497- }
3250+ };
34983251 },
34993252 mousemove: function( _currentElement, _mouseX, _mouseY ){
35003253 show( _currentElement);
3501- if( currentOperator !== null){
3254+ if( currentOperator !== null ){
35023255 currentOperator.onDrag( _mouseX, _mouseY );
35033256 } else
3504- if( currentElement !== null){
3505- CONSOLE_CONTROLER.mousemove( _mouseX - currentX, _mouseY - currentY );
3506- if( currentIsTextElement === false || TAIL_OPERATOR.hitTest( _mouseX -currentX, _mouseY -currentY) === false){
3507- RESIZE_OPERATOR.index( _mouseX, _mouseY);
3508- }
3509- }
3257+ if( currentElement !== null ){
3258+ // CONSOLE_CONTROLER.mousemove( _mouseX - currentX, _mouseY - currentY );
3259+ if( currentIsTextElement === false || TAIL_OPERATOR.hitTest( _mouseX - currentX, _mouseY - currentY ) === false ){
3260+ RESIZE_OPERATOR.index( _mouseX, _mouseY );
3261+ };
3262+ };
35103263 },
35113264 mouseup: function( _currentElement, _mouseX, _mouseY ){
35123265 currentOperator !== null && currentOperator.onFinish();
@@ -3518,25 +3271,258 @@ var Editor = gOS.registerApplication( function(){
35183271 * // PANEL_ELEMENT_OPERATION_MANAGER
35193272 */
35203273
3274+/* --------------------------------------------------------------------------------------------
3275+ * CONSOLE_CONTROLER
3276+ */
3277+ var CONSOLE_CONTROLER = ( function(){
3278+ var LAYER_BACK_BUTTON, LAYER_FORWARD_BUTTON, DELETE_BUTTON, EDIT_BUTTON, CHANGE_BUTTON,
3279+ PUSH_OUT_RATIO = 0.5,
3280+ tailSize = 10,
3281+ elmRoot, elmContainer, elmPushout, elmTail,
3282+ pushoutW = 0,
3283+ pushoutH = 0,
3284+ pushout = false,
3285+ currentType = -1,
3286+ visible = false,
3287+ node = null,
3288+ ui, inputX, inputY, inputZ, inputA, inputW, inputH, inputAspectRatio,
3289+ buttonBack, buttonForward, buttonDel, buttonEdit, butonChange;
3290+
3291+ function layerBack(){
3292+ if( currentElement === null ) return;
3293+ if( PANEL_ELEMENT_CONTROL.replace( currentElement, false ) === false ) return;
3294+ CONSOLE_CONTROLER.update( currentElement );
3295+ HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.resplace, [ currentElement, true ], [ currentElement, false ] );
3296+ var _z = currentElement.z;
3297+ LAYER_BACK_BUTTON.visible( _z > 0 );
3298+ LAYER_FORWARD_BUTTON.visible( _z < PANEL_ELEMENT_ARRAY.length - 1 );
3299+ };
3300+ function layerForward(){
3301+ if( currentElement === null ) return;
3302+ if( PANEL_ELEMENT_CONTROL.replace( currentElement, true ) === false ) return;
3303+ CONSOLE_CONTROLER.update( currentElement );
3304+ HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.replace, [ currentElement, false ], [ currentElement, true ] );
3305+ var _z = currentElement.z;
3306+ LAYER_BACK_BUTTON.visible( _z > 0 );
3307+ LAYER_FORWARD_BUTTON.visible( _z < PANEL_ELEMENT_ARRAY.length - 1 );
3308+ };
3309+ function del(){
3310+ if( currentElement === null ) return;
3311+ HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.restore, [ true, currentElement ], [ false, currentElement ], false ); // true
3312+ PANEL_ELEMENT_CONTROL.remove( currentElement );
3313+ PANEL_ELEMENT_OPERATION_MANAGER.hide();
3314+ };
3315+ function edit(){
3316+ if( currentElement === null || currentElement.type !== PANEL_ELEMENT_TYPE_TEXT ) return;
3317+ TextEditor.boot( PANEL_CONTROL.x, PANEL_CONTROL.y, currentElement );
3318+ };
3319+ function change(){
3320+ if( currentElement === null ) return;
3321+ PremiumSatge.boot( currentElement.artistID, currentElement.resourcePicture, currentElement );
3322+ };
3323+
3324+ return {
3325+ x: 0,
3326+ y: 0,
3327+ w: 0,
3328+ h: 0,
3329+ init: function(){
3330+ app.addKeyEventListener( 'keydown', layerBack, 66, false, true );
3331+ app.addKeyEventListener( 'keydown', layerForward, 70, false, true );
3332+ app.addKeyEventListener( 'keydown', del, 68, false, true );
3333+ app.addKeyEventListener( 'keydown', edit, 69, false, true );
3334+ app.addKeyEventListener( 'keydown', change, 85, false, true );
3335+
3336+ elmContainer = document.getElementById( 'comic-element-consol-container' );
3337+ elmRoot = elmContainer.parentNode;
3338+ elmPushout = document.getElementById( 'comic-element-consol-pushout-wrapper' );
3339+ elmTail = document.getElementById( 'comic-element-consol-pushout-tail' );
3340+ delete CONSOLE_CONTROLER.init;
3341+ },
3342+ open: function(){
3343+ // layerWrapper = app.createInteractContainer( elmConsoleWrapper );
3344+
3345+ LAYER_BACK_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'layer back', 'ctrl + B', layerBack, false, true, false );
3346+ LAYER_FORWARD_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'layer forward', 'ctrl + F', layerForward, false, false, false );
3347+ DELETE_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'delete', 'ctrl + D', del, false, true, true );
3348+ EDIT_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'Edit Text', 'ctrl + E', edit, false, true, false );
3349+ CHANGE_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'change', 'ctrl + U', change, false, false, true );
3350+
3351+
3352+ // inputAspectRatio = $( '#comic-element-keep-aspect' );
3353+
3354+ delete CONSOLE_CONTROLER.open;
3355+ },
3356+ onMouseover : function( e ){
3357+ node.mesureChildren();
3358+ //node.mesure();
3359+ },
3360+ show: function( _currentElement, w, h ){
3361+ if( node === null ){
3362+ node = PANEL_CONTROL.node.createNode( elmContainer, false, false, 'comic-element-consol-container-hover' );
3363+ node.addEventListener( 'mouseover', CONSOLE_CONTROLER.onMouseover, CONSOLE_CONTROLER );
3364+ ui = app.createUIGroup( node );
3365+ inputX = ui.createInputText( document.getElementById( 'comic-element-x' ), null );
3366+ inputY = ui.createInputText( document.getElementById( 'comic-element-y' ), null );
3367+ inputZ = ui.createInputText( document.getElementById( 'comic-element-z' ), null );
3368+ inputA = ui.createInputText( document.getElementById( 'comic-element-a' ), null );
3369+ inputW = ui.createInputText( document.getElementById( 'comic-element-w' ), null );
3370+ inputH = ui.createInputText( document.getElementById( 'comic-element-h' ), null );
3371+ inputPercentW = ui.createInputText( document.getElementById( 'comic-element-w-percent' ), null );
3372+ inputPercentH = ui.createInputText( document.getElementById( 'comic-element-h-percent' ), null );
3373+ butonChange = ui.createButton( document.getElementById( 'change-image-button' ), change ),
3374+ buttonBack = ui.createButton( document.getElementById( 'layer-back-button' ), layerBack ),
3375+ buttonDel = ui.createButton( document.getElementById( 'delete-button' ), del ),
3376+ buttonForward = ui.createButton( document.getElementById( 'layer-forward-button' ), layerForward ),
3377+ buttonEdit = ui.createButton( document.getElementById( 'edit-text-button' ), edit );
3378+ };
3379+
3380+ currentElement = _currentElement;
3381+
3382+ var type = currentElement.type,
3383+ z = currentElement.z;
3384+
3385+ LAYER_BACK_BUTTON.visible( z > 0 );
3386+ buttonBack.enabled( z > 0 );
3387+ LAYER_FORWARD_BUTTON.visible( z < PANEL_ELEMENT_ARRAY.length - 1 );
3388+ buttonForward.enabled( z < PANEL_ELEMENT_ARRAY.length - 1 )
3389+ DELETE_BUTTON.visible( true );
3390+ EDIT_BUTTON.visible( type === PANEL_ELEMENT_TYPE_TEXT );
3391+ CHANGE_BUTTON.visible( false );
3392+
3393+ //CONSOLE_CONTROLER.x = Math.floor( ( _w - CONSOLE_CONTROLER.w ) / 2 );
3394+ CONSOLE_CONTROLER.w = w;
3395+ CONSOLE_CONTROLER.h = elmContainer.offsetHeight;
3396+ CONSOLE_CONTROLER.y = h - CONSOLE_CONTROLER.h;
3397+
3398+ if( h * PUSH_OUT_RATIO < CONSOLE_CONTROLER.h ){
3399+ if( pushout === false ){
3400+ pushout = true;
3401+ elmPushout.appendChild( elmContainer );
3402+ elmPushout.style.display = 'block';
3403+ pushoutW = elmPushout.offsetWidth;
3404+ pushoutH = elmPushout.offsetHeight;
3405+ elmTail.style.top = ( pushoutH / 2 - tailSize / 2 ) + 'px';
3406+ };
3407+ elmPushout.style.left = ( - pushoutW - tailSize ) + 'px';
3408+ elmPushout.style.top = ( h / 2 - pushoutH / 2 ) + 'px';
3409+ elmPushout.className = 'satellite-left';
3410+ } else
3411+ if( pushout === true ){
3412+ pushout = false;
3413+ elmRoot.insertBefore( elmContainer, elmRoot.firstChild );
3414+ elmPushout.style.cssText = '';
3415+ };
3416+
3417+ CONSOLE_CONTROLER.update( currentElement );
3418+ ui.visible( true );
3419+ node.mesure();
3420+ },
3421+ update : function( _currentElement ){
3422+ if( _currentElement === null ){
3423+ visible = false;
3424+ return;
3425+ };
3426+ currentElement = _currentElement;
3427+ var type = currentElement.type,
3428+ x = currentElement.x,
3429+ y = currentElement.y,
3430+ z = currentElement.z,
3431+ a = type === PANEL_ELEMENT_TYPE_TEXT ? Math.floor( currentElement.a ) : 0,
3432+ w = currentElement.w,
3433+ h = currentElement.h,
3434+ actualW = type === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualW : 1,
3435+ actualH = type === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualH : 1,
3436+ wPercent = type === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( w / actualW * 100 ) : 0,
3437+ hPercent = type === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( h / actualH * 100 ) : 0,
3438+ keepAspect = currentElement.keepAspect;
3439+
3440+ if( currentType !== type ){
3441+ if( type === PANEL_ELEMENT_TYPE_TEXT ){
3442+ inputA.visible( true );
3443+ inputPercentW.visible( false );
3444+ inputPercentH.visible( false );
3445+ buttonEdit.enabled( true );
3446+ //inputAspectRatio.hide();
3447+ } else {
3448+ inputA.visible( false );
3449+ inputPercentW.visible( true );
3450+ inputPercentH.visible( true );
3451+ buttonEdit.enabled( false );
3452+ //inputAspectRatio.show();
3453+ };
3454+ currentType = type;
3455+ };
3456+
3457+ inputX.value( x );
3458+ inputY.value( y );
3459+ inputZ.value( z );
3460+ type === 1 && inputA.value( a );
3461+ inputW.value( w );
3462+ inputH.value( h );
3463+ type === 0 && inputPercentW.value( wPercent );
3464+ type === 0 && inputPercentH.value( hPercent );
3465+ },
3466+ hide: function(){
3467+ // if( visible === true ) styleConsoleWrapper.display = 'none';
3468+ ui && ui.visible( false );
3469+ visible = false;
3470+ currentElement = null;
3471+ LAYER_BACK_BUTTON.visible( false );
3472+ LAYER_FORWARD_BUTTON.visible( false );
3473+ DELETE_BUTTON.visible( false );
3474+ EDIT_BUTTON.visible( false );
3475+ CHANGE_BUTTON.visible( false );
3476+ },
3477+ hitTest : function( x, y ){
3478+ if( visible === false ) return false;
3479+ x -= currentElement.x;
3480+ y -= currentElement.y;
3481+ if( pushout ){
3482+ return CONSOLE_CONTROLER.x <= x && x <= CONSOLE_CONTROLER.x + CONSOLE_CONTROLER.w &&
3483+ CONSOLE_CONTROLER.y <= y && y <= CONSOLE_CONTROLER.y + CONSOLE_CONTROLER.h;
3484+ };
3485+ return CONSOLE_CONTROLER.x <= x && x <= CONSOLE_CONTROLER.x + CONSOLE_CONTROLER.w &&
3486+ CONSOLE_CONTROLER.y <= y && y <= CONSOLE_CONTROLER.y + CONSOLE_CONTROLER.h;
3487+ }
3488+ };
3489+ })();
3490+
3491+
3492+
35213493 var AbstractPanelElement = function( COMIC_ELM_TYPE ){
35223494 this.type = COMIC_ELM_TYPE;
3523- this.hitTest = function( _mouseX, _mouseY ){
3524- return PANEL_ELEMENT_OPERATION_MANAGER.hitTest( _mouseX, _mouseY, this );
3525- }
3526- this.shift = function( _shiftX, _shiftY ){
3527- this.resize( this.x + _shiftX, this.y + _shiftY);
3528- }
3529- this.busy = function(){
3495+ };
3496+ AbstractPanelElement.prototype = {
3497+ $ : null,
3498+ data : null,
3499+ x : 0,
3500+ y : 0,
3501+ w : 0,
3502+ h : 0,
3503+ z : 0,
3504+ timing : 0,
3505+ actualW : 0,
3506+ actualH : 0,
3507+ flipV : 0,
3508+ flipH : 0,
3509+ hitTest : function( mouseX, mouseY ){
3510+ return PANEL_ELEMENT_OPERATION_MANAGER.hitTest( mouseX, mouseY, this );
3511+ },
3512+ shift : function( shiftX, shiftY ){
3513+ this.resize( this.x + shiftX, this.y + shiftY );
3514+ },
3515+ busy : function(){
35303516 return PANEL_ELEMENT_OPERATION_MANAGER.busy();
3531- }
3532- this.mousemove = function( _mouseX, _mouseY ){
3533- PANEL_ELEMENT_OPERATION_MANAGER.mousemove( this, _mouseX, _mouseY );
3534- }
3535- this.mouseup = function( _mouseX, _mouseY ){
3536- PANEL_ELEMENT_OPERATION_MANAGER.mouseup( this, _mouseX, _mouseY );
3537- }
3538- this.mousedown = function( _mouseX, _mouseY ){
3539- PANEL_ELEMENT_OPERATION_MANAGER.mousedown( this, _mouseX, _mouseY );
3517+ },
3518+ mousemove : function( mouseX, mouseY ){
3519+ PANEL_ELEMENT_OPERATION_MANAGER.mousemove( this, mouseX, mouseY );
3520+ },
3521+ mouseup : function( mouseX, mouseY ){
3522+ PANEL_ELEMENT_OPERATION_MANAGER.mouseup( this, mouseX, mouseY );
3523+ },
3524+ mousedown : function( mouseX, mouseY ){
3525+ PANEL_ELEMENT_OPERATION_MANAGER.mousedown( this, mouseX, mouseY );
35403526 }
35413527 };
35423528
@@ -3547,98 +3533,85 @@ var Editor = gOS.registerApplication( function(){
35473533 var ImageElementClass = function( data ){
35483534 jqImageElementOrigin = jqImageElementOrigin || $( app.fetchHTMLElement( 'imgElementTemplete' ) );
35493535
3550- var jqWrap = jqImageElementOrigin.clone( true ),
3551- flipH = data.width < 0 ? -1 : 1,
3552- flipV = data.height < 0 ? -1 : 1,
3553- resourcePicture = data.resource_picture,
3554- actualW = data.resource_picture.width,
3555- actualH = data.resource_picture.height,
3556- reversibleImage = null,
3557- self = this,
3558- x, y, z, w, h;
3559- function flipReversibleImage(){
3560- reversibleImage && reversibleImage.resize( flipH * w, flipV * h );
3561- };
3562- /* history */
3563- function updateResourcePicture( _resourcePicture ){
3564- resourcePicture = _resourcePicture;
3565-
3566- actualW = _resourcePicture.width;
3567- actualH = _resourcePicture.height;
3568-
3569- var _reversibleImage = pettanr.image.createReversibleImage(
3570- [ pettanr.CONST.RESOURCE_PICTURE_PATH, _resourcePicture.id, '.', _resourcePicture.ext ].join(''),
3571- flipH * w, flipV * h
3572- );
3573- if( reversibleImage !== null ){
3574- jqWrap.children( reversibleImage.elm ).replaceWith( _reversibleImage.elm );
3575- reversibleImage.destroy();
3576- } else {
3577- jqWrap.append( _reversibleImage.elm );
3578- }
3579- reversibleImage = _reversibleImage;
3580- };
3581- /* global methods */
3582- this.$ = jqWrap;
3583- //this.x = x;
3584- //this.y = y;
3585- //this.w = w;
3586- //this.h = h;
3587- this.z = data.z;
3588- this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1;
3536+ this.$ = jqImageElementOrigin.clone( true );
3537+ this.data = data;
3538+ this.z = data.z;
3539+ this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1;
35893540 this.keepSize = false;
3590- this.init = function(){
3591- updateResourcePicture( data.resource_picture );
3592- self.resize( data.x, data.y, Math.abs( data.width ), Math.abs( data.height ) );
3593- delete self.init;
3594- };
3595- this.flip = function( _updateH, _updateV ){
3596- if( _updateH !== true && _updateV !== true ) return;
3597- flipH = _updateH === true ? -flipH : flipH;
3598- flipV = _updateV === true ? -flipV : flipV;
3599- reversibleImage.resize( flipH * w, flipV * h );
3600- };
3601- this.flipV = function(){ return flipV;}
3602- this.flipH = function(){ return flipH;}
3603- this.resourcePicture = function( _resourcePicture ){
3604- if( _resourcePicture && _resourcePicture !== resourcePicture ){
3605- HISTORY_CONTROL.saveState( updateResourcePicture, resourcePicture, _resourcePicture );
3606- updateResourcePicture( _resourcePicture );
3607- };
3608- return resourcePicture;
3609- };
3610- this.getArtistID = function(){
3611- return resourcePicture.artist_id || resourcePicture.artist.id || -1;
3612- };
3613- this.actualW = function(){ return actualW;}
3614- this.actualH = function(){ return actualH;}
3615- this.resize = function( _x, _y, _w, _h, animate ){
3616- self.x = x = Type.isFinite( _x ) === true ? _x : x;
3617- self.y = y = Type.isFinite( _y ) === true ? _y : y;
3618- self.w = w = Type.isFinite( _w ) === true ? _w : w;
3619- self.h = h = Type.isFinite( _h ) === true ? _h : h;
3620- jqWrap[ animate === true ? 'animate' : 'css' ]( {
3621- left: x,
3622- top: y,
3623- width: w,
3624- height: h
3625- }, 250, flipReversibleImage );
3626- animate !== true && flipReversibleImage();
3627- };
3628- this.animate = function ( _x, _y, _w, _h, _flipH, _flipV ){
3629- flipH = _flipH !== undefined ? _flipH : flipH;
3630- flipV = _flipV !== undefined ? _flipV : flipV;
3631- self.resize( _x, _y, _w, _h, true );
3632- };
3633- this.destroy = function(){
3634- delete self.destroy;
3635-
3636- reversibleImage.destroy();
3637- jqWrap.stop().remove();
3638- jqWrap = reversibleImage = resourcePicture = data = self = null;
3639- };
3541+ this.flipV = data.height < 0 ? -1 : 1;
3542+ this.flipH = data.width < 0 ? -1 : 1;
3543+ this.rPicture = data.resource_picture;
3544+ this.artistID = this.rPicture.artist_id || this.rPicture.artist.id || -1;
3545+ this.reversibleImage = null;
36403546 };
3641- ImageElementClass.prototype = new AbstractPanelElement( PANEL_ELEMENT_TYPE_IMAGE );
3547+ ImageElementClass.prototype = Util.extend(
3548+ new AbstractPanelElement( PANEL_ELEMENT_TYPE_IMAGE ),
3549+ {
3550+ init : function(){
3551+ this._updateResourcePicture( this.rPicture );
3552+ this.resize( this.data.x, this.data.y, Math.abs( this.data.width ), Math.abs( this.data.height ) );
3553+ this.init = null;
3554+ },
3555+ flip : function( updateH, updateV ){
3556+ if( updateH !== true && updateV !== true ) return;
3557+ this.flipH = updateH === true ? -this.flipH : this.flipH;
3558+ this.flipV = updateV === true ? -this.flipV : this.flipV;
3559+ this.reversibleImage.resize( this.flipH * this.w, this.flipV * this.h );
3560+ },
3561+ resourcePicture : function( _rPicture ){
3562+ if( _rPicture && _rPicture !== this.rPicture ){
3563+ HISTORY_CONTROL.saveState( this._updateResourcePicture, this.rPicture, _rPicture, this );
3564+ this._updateResourcePicture( _rPicture );
3565+ };
3566+ return this.rPicture;
3567+ },
3568+ resize : function( x, y, w, h, animate ){
3569+ this.x = x = Type.isFinite( x ) === true ? x : this.x;
3570+ this.y = y = Type.isFinite( y ) === true ? y : this.y;
3571+ this.w = w = Type.isFinite( w ) === true ? w : this.w;
3572+ this.h = h = Type.isFinite( h ) === true ? h : this.h;
3573+ this.$[ animate === true ? 'animate' : 'css' ]( {
3574+ left: x,
3575+ top: y,
3576+ width: w,
3577+ height: h
3578+ }, 250 /*, flipReversibleImage */ );
3579+ /*animate !== true && */ this._flipReversibleImage();
3580+ },
3581+ animate : function ( x, y, w, h, flipH, flipV ){
3582+ this.flipH = flipH !== undefined ? flipH : this.flipH;
3583+ this.flipV = flipV !== undefined ? flipV : this.flipV;
3584+ this.resize( x, y, w, h, true );
3585+ },
3586+ destroy : function(){
3587+ this.reversibleImage.destroy();
3588+ this.$.stop().remove();
3589+ },
3590+ _updateResourcePicture : function( _rPicture ){
3591+ this.rPicture = _rPicture;
3592+
3593+ this.actualW = _rPicture.width;
3594+ this.actualH = _rPicture.height;
3595+
3596+ var _reversibleImage = pettanr.image.createReversibleImage(
3597+ [ pettanr.CONST.RESOURCE_PICTURE_PATH, _rPicture.id, '.', _rPicture.ext ].join(''),
3598+ this.flipH * this.w, this.flipV * this.h
3599+ );
3600+ if( this.reversibleImage !== null ){
3601+ this.$.children( this.reversibleImage.elm ).replaceWith( _reversibleImage.elm );
3602+ this.reversibleImage.destroy();
3603+ } else {
3604+ this.$.append( _reversibleImage.elm );
3605+ };
3606+ this.reversibleImage = _reversibleImage;
3607+ },
3608+ _flipReversibleImage : function(){
3609+ this.reversibleImage && this.reversibleImage.resize( this.flipH * this.w, this.flipV * this.h );
3610+ }
3611+ }
3612+ );
3613+
3614+
36423615 /*
36433616 * / ImageElementClass
36443617 * --------------------------------------------------------------------------------------------
@@ -3665,95 +3638,87 @@ var Editor = gOS.registerApplication( function(){
36653638 return UA.isIE === true && UA.ieRenderingVersion < 8 ? _OLD_IE : _MODERN;
36663639 })();
36673640
3668- var JQ_WRAPPER = jqTextElementOrigin.clone( true ),
3669- elmText = JQ_WRAPPER.find( 'td,.speach-inner' ).get( 0 ),
3670- type = data.balloon_template_id,
3671- text = ( function(){
3672- var _speachs = data.speeches_attributes;
3673- for( var k in _speachs ){
3674- return _speachs[ k ].content || '';
3675- }
3676- return '';
3677- })(),
3678- balloon = pettanr.balloon.createBalloon( data.width, data.height, data.tail, type ),
3679- x, y, w, h, a,
3680- self = this;
3681-
3682- JQ_WRAPPER.find( 'img' ).eq( 0 ).replaceWith( balloon.elm );
3683-
3684- function updateType( _type ){
3685- if( type !== _type ){
3686- type = _type || type;
3687- balloon.type( type );
3688- };
3689- };
3690- function updateAngle( _a ){
3691- if( _a !== undefined && a !== _a ){
3692- a = _a !== undefined ? _a : a;
3693- balloon.angle( a );
3694- };
3695- };
3696- /* history */
3697- function updateText( _text ){
3698- text = _text || text || '';
3699- elmText.firstChild.data = text;
3700- };
3701- function resizeBalloon(){
3702- balloon && balloon.resize( a, w, h );
3703- };
3641+ this.$ = jqTextElementOrigin.clone( true );
3642+ this.data = data;
3643+ this.elmText = this.$.find( 'td,.speach-inner' ).get( 0 );
3644+ this.type = data.balloon_template_id;
3645+ this.content = ( function(){
3646+ var _speachs = data.speeches_attributes;
3647+ for( var k in _speachs ){
3648+ return _speachs[ k ].content || '';
3649+ }
3650+ return '';
3651+ })();
3652+ this.balloon = pettanr.balloon.createBalloon( data.width, data.height, data.tail, this.type );
3653+ this.z = data.z;
3654+ this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1;
37043655
3705- /* global methods */
3706- this.$ = JQ_WRAPPER;
3707- //this.x = x;
3708- //this.y = y;
3709- //this.w = w;
3710- //this.h = h;
3711- this.z = data.z;
3712- this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1;
3713- this.init = function(){
3714- updateText();
3715- self.resize( data.x, data.y, data.width, data.height, data.tail );
3716- delete self.init;
3717- };
3718- this.angle = function( _a ){
3719- _a !== undefined && self.resize( x, y, w, h, _a );
3720- return a;
3721- };
3722- this.text = function( _text ){
3723- if( _text && text !== _text) {
3724- HISTORY_CONTROL.saveState( updateText, text || '', _text );
3725- updateText( _text );
3656+ this.$.find( 'img' ).eq( 0 ).replaceWith( this.balloon.elm );
3657+ };
3658+ TextElementClass.prototype = Util.extend(
3659+ new AbstractPanelElement( PANEL_ELEMENT_TYPE_TEXT ),
3660+ {
3661+ init : function(){
3662+ this._updateText();
3663+ this.resize( this.data.x, this.data.y, this.data.width, this.data.height, this.data.tail );
3664+ this.init = null;
3665+ },
3666+ _updateType : function( _type ){
3667+ if( this.type !== _type ){
3668+ this.type = _type || this.type;
3669+ this.balloon.type( this.type );
3670+ };
3671+ },
3672+ _updateAngle : function( _a ){
3673+ if( _a !== undefined && a !== _a ){
3674+ this.a = _a !== undefined ? _a : this.a;
3675+ this.balloon.angle( this.a );
3676+ };
3677+ },
3678+ /* history */
3679+ _updateText : function( _text ){
3680+ this.content = _text || this.content || '';
3681+ this.elmText.firstChild.data = this.content;
3682+ },
3683+ _resizeBalloon : function(){
3684+ this.balloon && this.balloon.resize( this.a, this.w, this.h );
3685+ },
3686+ angle : function( _a ){
3687+ _a !== undefined && this.resize( this.x, this.y, this.w, this.h, _a );
3688+ return this.a;
3689+ },
3690+ text : function( _text ){
3691+ if( _text && this.content !== _text ){
3692+ HISTORY_CONTROL.saveState( this._updateText, this.content || '', _text, this );
3693+ this._updateText( _text );
3694+ };
3695+ return this.content;
3696+ },
3697+ resize : function( x, y, w, h, a, animate ){
3698+ this.x = x = x !== undefined ? x : this.x;
3699+ this.y = y = y !== undefined ? y : this.y;
3700+ this.w = w = w !== undefined ? w : this.w;
3701+ this.h = h = h !== undefined ? h : this.h;
3702+ this.a = a !== undefined ? a : this.a;
3703+
3704+ this.$[ animate === true ? 'animate' : 'css']( {
3705+ left: x,
3706+ top: y,
3707+ width: w,
3708+ height: h
3709+ }, 250/*, resizeBalloon */
3710+ );
3711+ /*animate !== true && */ this._resizeBalloon();
3712+ },
3713+ animate : function ( _x, _y, _w, _h, _a ){
3714+ this.resize( _x, _y, _w, _h, _a, true );
3715+ },
3716+ destroy : function(){
3717+ this.$.stop().remove();
3718+ this.balloon.destroy();
37263719 }
3727- return text;
3728- };
3729- this.resize = function( _x, _y, _w, _h, _a, animate ){
3730- self.x = x = _x !== undefined ? _x : x;
3731- self.y = y = _y !== undefined ? _y : y;
3732- self.w = w = _w !== undefined ? _w : w;
3733- self.h = h = _h !== undefined ? _h : h;
3734- a = _a !== undefined ? _a : a;
3735-
3736- JQ_WRAPPER[ animate === true ? 'animate' : 'css']( {
3737- left: x,
3738- top: y,
3739- width: w,
3740- height: h
3741- }, 250, resizeBalloon
3742- );
3743- animate !== true && resizeBalloon();
3744- };
3745- this.animate = function ( _x, _y, _w, _h, _a ){
3746- self.resize( _x, _y, _w, _h, _a, true );
3747- };
3748- this.destroy = function(){
3749- delete self.destroy;
3750-
3751- JQ_WRAPPER.stop().remove();
3752- balloon.destroy();
3753- JQ_WRAPPER = elmText = data = balloon = self = null;
3754- };
3755- }
3756- TextElementClass.prototype = new AbstractPanelElement( PANEL_ELEMENT_TYPE_TEXT );
3720+ }
3721+ );
37573722
37583723 /* --------------------------------------------------------------------------------------------
37593724 * PANEL_ELEMENT_CONTROL
@@ -3786,7 +3751,7 @@ var Editor = gOS.registerApplication( function(){
37863751 * 1. remove
37873752 * 2. renumber z
37883753 */
3789- function appendPanelElement( _panelElement ) {
3754+ function appendPanelElement( _panelElement ){
37903755 var z = Type.isFinite( _panelElement.z ) === true ? _panelElement.z : -1,
37913756 l = PANEL_ELEMENT_ARRAY.length,
37923757 _jqElm = _panelElement.$.stop().css( {
@@ -3850,10 +3815,9 @@ var Editor = gOS.registerApplication( function(){
38503815 },
38513816 close: function(){
38523817 var _comicElm;
3853- while( PANEL_ELEMENT_ARRAY.length > 0 ){
3854- _comicElm = PANEL_ELEMENT_ARRAY.shift();
3855- _comicElm.destroy && _comicElm.destroy();
3856- }
3818+ while( _comicElm = PANEL_ELEMENT_ARRAY.shift() ){
3819+ _comicElm.destroy();
3820+ };
38573821 },
38583822 remove: function( _panelElement ){
38593823 var l = PANEL_ELEMENT_ARRAY.length;
@@ -3883,7 +3847,7 @@ var Editor = gOS.registerApplication( function(){
38833847 i = j;
38843848 break;
38853849 };
3886- }
3850+ };
38873851 if( i === -1) return false;
38883852 if( goForward === true ){
38893853 if( i === 0 ) return false;
@@ -3893,7 +3857,7 @@ var Editor = gOS.registerApplication( function(){
38933857 if( i === l - 1 ) return false;
38943858 PANEL_ELEMENT_ARRAY.splice( i, 1 );
38953859 PANEL_ELEMENT_ARRAY.splice( i + 1, 0, _panelElement );
3896- }
3860+ };
38973861 renumber( true );
38983862 return true;
38993863 },
@@ -3934,7 +3898,7 @@ var Editor = gOS.registerApplication( function(){
39343898 };
39353899 if( _elm.hitTest( _x, _y ) === true ){
39363900 _elm.mousemove( _x, _y ); // cursor
3937- return true;
3901+ return false;
39383902 };
39393903 };
39403904 for( i = 0; i < l; ++i ){
@@ -3943,7 +3907,7 @@ var Editor = gOS.registerApplication( function(){
39433907 if( _elm.hitTest( _x, _y ) === true ){
39443908 _elm.mousemove( _x, _y ); // cursor
39453909 currentElement = _elm;
3946- return true;
3910+ return false;
39473911 };
39483912 };
39493913 currentElement = null;
@@ -3975,7 +3939,7 @@ var Editor = gOS.registerApplication( function(){
39753939 PremiumSatge.boot( 1, PANEL_ELEMENT_CONTROL.onImageSelect );
39763940 } else {
39773941 PANEL_ELEMENT_CONTROL.onImageSelect( data, true );
3978- }
3942+ };
39793943 },
39803944 onImageSelect: function( data, isPanelPictureData ){
39813945 var _panelElement;
@@ -3996,7 +3960,7 @@ var Editor = gOS.registerApplication( function(){
39963960 _panelElement = new ImageElementClass( data );
39973961 _panelElement.init();
39983962 appendPanelElement( _panelElement );
3999- }
3963+ };
40003964 HISTORY_CONTROL.saveState( PANEL_ELEMENT_CONTROL.restore, [ false, _panelElement], [ true, _panelElement ], true );
40013965 },
40023966 createTextElement: function( data ){
@@ -4017,7 +3981,7 @@ var Editor = gOS.registerApplication( function(){
40173981 content: 'Hello'
40183982 }
40193983 }
4020- }
3984+ };
40213985 _panelElement = new TextElementClass( data );
40223986 _panelElement.init();
40233987 TextEditor.boot( PANEL_CONTROL.x, PANEL_CONTROL.y, _panelElement, onTextInput );
@@ -4025,7 +3989,7 @@ var Editor = gOS.registerApplication( function(){
40253989 _panelElement = new TextElementClass( data );
40263990 _panelElement.init();
40273991 onTextInput( _panelElement );
4028- }
3992+ };
40293993 }
40303994 };
40313995 })();
@@ -4056,42 +4020,90 @@ var Editor = gOS.registerApplication( function(){
40564020 '<div id="panel-tools-container">',
40574021 '<div id="panel-resizer-top">▲</div>',
40584022 '<div id="panel-resizer-bottom">▼</div>',
4059- '<div id="comic-element-resizer-container">',
4060- '<div class="comic-element-resizer" id="comic-element-resizer-top"></div>',
4061- '<div class="comic-element-resizer" id="comic-element-resizer-left"></div>',
4062- '<div class="comic-element-resizer" id="comic-element-resizer-right"></div>',
4063- '<div class="comic-element-resizer" id="comic-element-resizer-bottom"></div>',
4064- '<div class="comic-element-resizer" id="comic-element-resizer-top-left"></div>',
4065- '<div class="comic-element-resizer" id="comic-element-resizer-top-right"></div>',
4066- '<div class="comic-element-resizer" id="comic-element-resizer-bottom-left"></div>',
4067- '<div class="comic-element-resizer" id="comic-element-resizer-bottom-right"></div>',
4068- '<div id="balloon-tail-mover"></div>',
4069- '<div id="comic-element-consol-wrapper">',
4070- '<div id="comic-element-consol-tail"></div>',
4071- '<div id="comic-element-consol-wrapper-when-out">',
4072- '<div id="image-element-consol">',
4073- '<div id="change-image-button"></div>',
4074- '<div id="layer-back-button"></div>',
4075- '<div id="delete-image-button"></div>',
4076- '<div id="layer-forward-button"></div>',
4023+ '</div>',
4024+ '<div id="window-container"></div>',
4025+ '<div id="comic-element-resizer-container">',
4026+ '<div id="balloon-tail-mover"></div>',
4027+ '<div id="comic-element-consol-wrapper">',
4028+ '<div id="comic-element-consol-container" class="clearfix">',
4029+ '<div class="comic-element-consol-item">',
4030+ '<div id="comic-element-x">',
4031+ '<span class="comic-element-attribute-label">x:</span>',
4032+ '<span id="comic-element-x-value" class="comic-element-attribute-value editable-value">0</span>',
4033+ '</div>',
4034+ '<div id="comic-element-y">',
4035+ '<span class="comic-element-attribute-label">y:</span>',
4036+ '<span id="comic-element-y-value" class="comic-element-attribute-value editable-value">0</span>',
4037+ '</div>',
4038+ '</div>',
4039+ '<div class="comic-element-consol-item">',
4040+ '<div id="comic-element-z">',
4041+ '<span class="comic-element-attribute-label">z:</span>',
4042+ '<span id="comic-element-z-value" class="comic-element-attribute-value editable-value">0</span>',
4043+ '</div>',
4044+ '<div id="comic-element-a">',
4045+ '<span id="comic-element-a-value" class="comic-element-attribute-value editable-value">0</span>',
4046+ '<span class="comic-element-attribute-label">°</span>',
4047+ '</div>',
4048+ '</div>',
4049+ '<div class="comic-element-consol-item">',
4050+ '<div id="comic-element-w">',
4051+ '<span class="comic-element-attribute-label">w:</span>',
4052+ '<span id="comic-element-w-value" class="comic-element-attribute-value editable-value">0</span>',
4053+ '</div>',
4054+ '<div id="comic-element-h">',
4055+ '<span class="comic-element-attribute-label">h:</span>',
4056+ '<span id="comic-element-h-value" class="comic-element-attribute-value editable-value">0</span>',
4057+ '</div>',
4058+ '</div>',
4059+ '<div class="comic-element-consol-item">',
4060+ '<!-- <div id="comic-element-keep-aspect"></div> -->',
4061+ '<div id="comic-element-w-percent">',
4062+ '<span id="comic-element-w-percent-value" class="comic-element-attribute-value editable-value">0</span>',
4063+ '<span class="comic-element-attribute-label">%</span>',
40774064 '</div>',
4078- '<div id="text-element-consol">',
4079- '<div id="edit-text-button"></div>',
4080- '<div id="change-text-style-button"></div>',
4081- '<div id="back-text-button"></div>',
4082- '<div id="delete-text-button"></div>',
4083- '<div id="hide-text-tail-button"></div>',
4084- '<div id="forward-text-button"></div>',
4065+ '<div class="comic-element-consol-item" id="comic-element-h-percent">',
4066+ '<span id="comic-element-h-percent-value" class="comic-element-attribute-value editable-value">0</span>',
4067+ '<span class="comic-element-attribute-label">%</span>',
40854068 '</div>',
40864069 '</div>',
4070+ '<div class="comic-element-consol-item-small">',
4071+ '<div class="button" id="change-image-button">change</div>',
4072+ '</div>',
4073+ '<div class="comic-element-consol-item-small">',
4074+ '<div class="button" id="layer-back-button">back</div>',
4075+ '</div>',
4076+ '<div class="comic-element-consol-item-small">',
4077+ '<div class="button" id="delete-button">delete</div>',
4078+ '</div>',
4079+ '<div class="comic-element-consol-item-small">',
4080+ '<div class="button" id="layer-forward-button">forward</div>',
4081+ '</div>',
4082+ '<div class="comic-element-consol-item-small">',
4083+ '<div class="button" id="edit-text-button">edit</div>',
4084+ '</div>',
4085+ '<!-- <div class="comic-element-consol-item-small">',
4086+ '<div class="button" id="hide-text-tail-button">tail</div>',
4087+ '</div> -->',
40874088 '</div>',
4088- '</div>',
4089+ '</div>',
4090+ '<div class="comic-element-resizer" id="comic-element-resizer-top"></div>',
4091+ '<div class="comic-element-resizer" id="comic-element-resizer-left"></div>',
4092+ '<div class="comic-element-resizer" id="comic-element-resizer-right"></div>',
4093+ '<div class="comic-element-resizer" id="comic-element-resizer-bottom"></div>',
4094+ '<div class="comic-element-resizer" id="comic-element-resizer-top-left"></div>',
4095+ '<div class="comic-element-resizer" id="comic-element-resizer-top-right"></div>',
4096+ '<div class="comic-element-resizer" id="comic-element-resizer-bottom-left"></div>',
4097+ '<div class="comic-element-resizer" id="comic-element-resizer-bottom-right"></div>',
4098+ '<div id="comic-element-consol-pushout-wrapper">',
4099+ '<div id="comic-element-consol-pushout-tail"></div>',
4100+ '</div>',
40894101 '</div>',
4090- '<div id="window-container"></div>',
40914102 '<div id="menu-bar"></div>',
40924103
40934104 '<div id="templete-container" style="display: none;">',
40944105
4106+
40954107 '<div id="imgElementTemplete" class="comic-element-wrapper image-element"></div>',
40964108
40974109 '<div id="textElementTemplete" class="comic-element-wrapper text-element">',
@@ -4136,42 +4148,6 @@ var Editor = gOS.registerApplication( function(){
41364148 '<div id="bg-pattern-repeat-x"></div>',
41374149 '<div id="bg-pattern-repeat-y"></div> -->',
41384150 '</div>',
4139-
4140- '<div id="comic-element-infomation">',
4141- '<div id="comic-element-x">',
4142- '<span class="comic-element-attribute-label">x:</span>',
4143- '<span id="comic-element-x-value" class="comic-element-attribute-value editable-value">0</span>',
4144- '</div>',
4145- '<div id="comic-element-y">',
4146- '<span class="comic-element-attribute-label">y:</span>',
4147- '<span id="comic-element-y-value" class="comic-element-attribute-value editable-value">0</span>',
4148- '</div>',
4149- '<div id="comic-element-z">',
4150- '<span class="comic-element-attribute-label">z:</span>',
4151- '<span id="comic-element-z-value" class="comic-element-attribute-value editable-value">0</span>',
4152- '</div>',
4153- '<div id="comic-element-a">',
4154- '<span id="comic-element-a-value" class="comic-element-attribute-value editable-value">0</span>',
4155- '<span class="comic-element-attribute-label">°</span>',
4156- '</div>',
4157- '<div id="comic-element-w">',
4158- '<span class="comic-element-attribute-label">w:</span>',
4159- '<span id="comic-element-w-value" class="comic-element-attribute-value editable-value">0</span>',
4160- '</div>',
4161- '<div id="comic-element-h">',
4162- '<span class="comic-element-attribute-label">h:</span>',
4163- '<span id="comic-element-h-value" class="comic-element-attribute-value editable-value">0</span>',
4164- '</div>',
4165- '<div id="comic-element-w-percent">',
4166- '<span id="comic-element-w-percent-value" class="comic-element-attribute-value editable-value">0</span>',
4167- '<span class="comic-element-attribute-label">%</span>',
4168- '</div>',
4169- '<div id="comic-element-h-percent">',
4170- '<span id="comic-element-h-percent-value" class="comic-element-attribute-value editable-value">0</span>',
4171- '<span class="comic-element-attribute-label">%</span>',
4172- '</div>',
4173- '<div id="comic-element-keep-aspect"></div>',
4174- '</div>',
41754151 '</div>',
41764152
41774153 '<div id="toolbox-window">',
@@ -4781,7 +4757,7 @@ var Model = ( function(){
47814757 isXHTML !== true ? '>' : ' \/>'
47824758 ].join( '');
47834759 } else {
4784- url = pettanr.balloon.getBalloonUrl( _panelElement.w, _panelElement.h, _panelElement.angle() );
4760+ url = pettanr.balloon.getBalloonUrl( _panelElement.w, _panelElement.h, _panelElement.a );
47854761 return [
47864762 '<img ',
47874763 'src="', isAbsoluteUrl !== true ? url : Util.getAbsolutePath( url ), '" ',
@@ -4800,7 +4776,7 @@ var Model = ( function(){
48004776 'width:', _panelElement.w, 'px;',
48014777 'height:', _panelElement.h, 'px;',
48024778 'z-index:', _panelElement.z,
4803- '"><span>', _panelElement.text(), '<\/span>', '<\/div>'
4779+ '"><span>', _panelElement.content, '<\/span>', '<\/div>'
48044780
48054781 ].join( '');
48064782 };
@@ -4816,8 +4792,8 @@ var Model = ( function(){
48164792 '"x": ', _imageElement.x, ',', cr,
48174793 '"y": ', _imageElement.y, ',', cr,
48184794 '"z": ', _imageElement.z, ',', cr,
4819- '"width": ', _imageElement.flipH() * _imageElement.w, ',', cr,
4820- '"height": ', _imageElement.flipV() * _imageElement.h, ',', cr,
4795+ '"width": ', _imageElement.flipH * _imageElement.w, ',', cr,
4796+ '"height": ', _imageElement.flipV * _imageElement.h, ',', cr,
48214797 '"t": ', timing, cr,
48224798 '}'
48234799 ].join( '');
@@ -4831,8 +4807,8 @@ var Model = ( function(){
48314807 '"y": ', _imageElement.y, ',', cr,
48324808 '"z": ', _imageElement.z + 1, ',', cr,
48334809 '"t": ', _timing, ',', cr,
4834- '"width": ', _imageElement.flipH() * _imageElement.w, ',', cr,
4835- '"height": ', _imageElement.flipV() * _imageElement.h, cr,
4810+ '"width": ', _imageElement.flipH * _imageElement.w, ',', cr,
4811+ '"height": ', _imageElement.flipV * _imageElement.h, cr,
48364812 '}'
48374813 ].join( '');
48384814 };
@@ -4844,7 +4820,7 @@ var Model = ( function(){
48444820 '"balloon_template_id": ', 1, ',', cr,
48454821 '"system_picture_id": ', 1, ',', cr,
48464822 '"size": ', 1, ',', cr,
4847- '"tail": ', _textElement.angle(), ',', cr,
4823+ '"tail": ', _textElement.a, ',', cr,
48484824 '"x": ', _textElement.x, ',', cr,
48494825 '"y": ', _textElement.y, ',', cr,
48504826 '"z": ', _textElement.z + 1, ',', cr,
@@ -4853,7 +4829,7 @@ var Model = ( function(){
48534829 '"height": ', _textElement.h, ',', cr,
48544830 '"speeches_attributes": {', cr,
48554831 '"newf', timing, '": {', cr,
4856- '"content": "', _textElement.text(), '",', cr,
4832+ '"content": "', _textElement.content, '",', cr,
48574833 '"x": ', _textElement.x, ',', cr,
48584834 '"y": ', _textElement.y, ',', cr,
48594835 '"t": ', timing, ',', cr,
--- a/0.5.x/javascripts/system.js
+++ b/0.5.x/javascripts/system.js
@@ -1,6 +1,6 @@
11 /*
22 * pettanR system.js
3- * version 0.5.22
3+ * version 0.5.23
44 *
55 * gadgetOS
66 * author:
@@ -1185,9 +1185,9 @@ AbstractApplication.prototype = {
11851185 var list = ApplicationPrivateData.list;
11861186 list.splice( Util.getIndex( list, data ), 1 );
11871187 },
1188- createUIGroup : function(){
1188+ createUIGroup : function( node ){
11891189 var data = ApplicationPrivateData.get( this ),
1190- ui = UI.createUIGroup( this );
1190+ ui = UI.createUIGroup( this, node );
11911191 if( data.uiList === null ) data.uiList = [];
11921192 data.uiList.push( ui );
11931193 return ui;
@@ -1367,6 +1367,9 @@ var PointingDeviceEventTree = ( function(){
13671367 mesure : function(){
13681368 NodePrivateData.get( this ).mesure();
13691369 },
1370+ mesureChildren : function(){
1371+ NodePrivateData.get( this ).mesureChildren();
1372+ },
13701373 update : function( x, y, w, h ){
13711374 NodePrivateData.get( this ).update( x, y, w, h );
13721375 },
@@ -1474,7 +1477,7 @@ var PointingDeviceEventTree = ( function(){
14741477 this.node = node;
14751478 this.through = through;
14761479 this.clip = !!clip;
1477- this._cursor = cursor;
1480+ if( cursor ) this._cursor = cursor;
14781481
14791482 if( Type.isHTMLElement( rangeOrElm ) === true ){
14801483 this.elm = rangeOrElm;
@@ -1490,7 +1493,7 @@ var PointingDeviceEventTree = ( function(){
14901493 NodePrivateData.dataList.push( this );
14911494 },
14921495 mesure : function(){
1493- var x, y, w, h, _this, _parent;
1496+ var x, y, w, h, parent, _this, _parent;
14941497 if( this.elm ){
14951498 w = this.elm.offsetWidth;
14961499 h = this.elm.offsetHeight;
@@ -1504,12 +1507,22 @@ var PointingDeviceEventTree = ( function(){
15041507 this.w = w;
15051508 this.h = h;
15061509 console.log( ' ---- mesure' + this.elm.id + ' x:' + this.x + ' y:' + this.y + ' w:' + w + ' h:' + h )
1510+ parent = this.parentData;
1511+ parent && this._updateAbsoluteXY( parent.absoluteX, parent.absoluteY, parent.scrollingX, parent.scrollingY );
15071512 this._updateRectangle();
15081513 };
15091514 } else {
15101515 this._updateRectangle();
15111516 };
15121517 },
1518+ mesureChildren : function(){
1519+ var nodes, i;
1520+ if( nodes = this.childData ){
1521+ for( i = nodes.length; i; ){
1522+ nodes[ --i ].mesure();
1523+ };
1524+ };
1525+ },
15131526 update : function( x, y, w, h ){
15141527 var updateXY = false,
15151528 _this, _parent,
@@ -3786,16 +3799,6 @@ var UI = ( function(){
37863799
37873800 var CLASSNAME_COMBOBOX_OPTION = 'combobox-option',
37883801 CLASSNAME_COMBOBOX_OPTION_CURRENT = CLASSNAME_COMBOBOX_OPTION + ' combobox-option-current',
3789- ELM_A_ORIGIN = ( function(){
3790- var ret = document.createElement( 'a' );
3791- ret.href = '#';
3792- return ret;
3793- })(),
3794- ELM_INPUT_TEXT = ( function(){
3795- var ret = document.createElement( 'input' );
3796- ret.type = 'text';
3797- return ret;
3798- })(),
37993802 ELM_COMBOBOX = ( function(){
38003803 var ret = document.createElement( 'a' ),
38013804 elmToggle = document.createElement( 'span' ),
@@ -3810,212 +3813,309 @@ var UI = ( function(){
38103813 elmValue.appendChild( document.createTextNode( 'null' ));
38113814 return ret;
38123815 })();
3816+
3817+ var UIItemPrivateData = function(){};
3818+ UIItemPrivateData.prototype = {
3819+ groupData : null,
3820+ item : null,
3821+ elm : null,
3822+ node : null,
3823+ focus : false,
3824+ visible : true,
3825+ enabled : true,
3826+ value : null,
3827+ onUpdate : null,
3828+ validator : null,
3829+ elmValue : null,
3830+ elmBox : null,
3831+ elmA : null,
3832+ elmToggle : null,
3833+ elmValue : null,
3834+ selectIndex : 0,
3835+ optionList : null,
3836+ init : function( groupData, item, elm, value, onUpdate, validator, focus, visible, enabled ){
3837+ this.groupData = groupData;
3838+ this.item = item;
3839+ this.elm = elm;
3840+ this.value = value;
3841+ this.onUpdate = onUpdate;
3842+ this.validator = validator;
3843+ this.focus = !!focus;
3844+ this.visible = !!visible;
3845+ this.enabled = !!enabled;
3846+ UIItemPrivateData.list.push( this );
3847+ },
3848+ destroy : function(){
3849+ var list = UIItemPrivateData.list;
3850+ list.splice( Util.getIndex( list, this ), 1 );
3851+
3852+ this.node && this.node.remove();
3853+ }
3854+ };
3855+ UIItemPrivateData.list = [];
3856+ UIItemPrivateData.get = function( item ){
3857+ var list = UIItemPrivateData.list;
3858+ for( i = list.length; i; ){
3859+ if( list[ --i ].item === item ) return list[ i ];
3860+ };
3861+ return null;
3862+ };
3863+
3864+/* --------------------------------
3865+ * TextInputManager
3866+ */
3867+ var TextInputManager = ( function(){
3868+ var elmInput = ( function(){
3869+ var ret = document.createElement( 'input' );
3870+ ret.type = 'text';
3871+ ret.id = 'ui-textinput';
3872+ return ret;
3873+ })();
38133874
3814- var InputTextClass = function( apiuser, uiGroup, elmWrapper, elmValue, onUpdate, validater ){
3815- var elmA = ELM_A_ORIGIN.cloneNode( true ),
3816- instance = this,
3817- focus = false,
3818- visible = true,
3819- enabled = true,
3820- value = elmValue.innerHTML;
3821- elmValue.innerHTML = '';
3822- elmValue.className += ' editable-text';
3823- elmValue.appendChild( elmA );
3824-
3825- this.value = function( _value ){
3826- if( Type.isString( _value ) === true || Type.isNumber( _value ) === true ){
3827- value = '' + _value;
3828- elmA.innerHTML = '' + _value;
3829- if( focus === true ){
3830- ELM_INPUT_TEXT.value = '' + value;
3831- };
3832- };
3833- focus === true && instance.blur();
3834- return value;
3875+ return {
3876+ show: function( data ){
3877+ // this.groupData.node.addEventListener( 'mouseout' );
3878+ var p = Position.cumulativeOffset( data.elmValue ),
3879+ w = data.elmValue.offsetWidth - 2,
3880+ _w;
3881+ elmInput.style.cssText = [
3882+ 'left:', p[ 0 ], 'px;',
3883+ 'top:', p[ 1 ], 'px;',//,
3884+ 'width:', w, 'px;'//,
3885+ //'height:', data.elmValue.offsetHeight, 'px;',
3886+ //'position:absolute;'
3887+ ].join( '' );
3888+ elmInput.value = data.value;
3889+ body.appendChild( elmInput );
3890+ _w = elmInput.offsetWidth;
3891+ if( w !== _w ) elmInput.style.width = ( w - ( _w - w ) ) + 'px;';
3892+
3893+ elmInput.focus();
3894+ elmInput.select();
3895+ },
3896+ hide : function( data ){
3897+ body.removeChild( elmInput );
3898+ var ret = elmInput.value;
3899+ elmInput.value = '';
3900+ return ret;
3901+ },
3902+ update : function( data ){
3903+ elmInput.value = data.value;
3904+ }
38353905 };
3836- this.focus = function( e ){
3837- focus = true;
3838- start( apiuser, uiGroup, instance );
3839- elmA.style.display = 'none';
3840-
3841- elmValue.appendChild( ELM_INPUT_TEXT );
3842- ELM_INPUT_TEXT.value = value;
3843- ELM_INPUT_TEXT.focus();
3844- ELM_INPUT_TEXT.select();
3845-
3906+ })();
3907+
3908+ var InputTextClass = function( groupData, elmWrapper, elmValue, onUpdate, validater ){
3909+ var data = new UIItemPrivateData();
3910+ data.init( groupData, this, elmWrapper, elmValue.innerHTML, onUpdate, validater, false, true, true );
3911+ Util.addClass( elmValue, 'editable-text' );
3912+ data.elmValue = elmValue;
3913+ this.value( data.value );
3914+ data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-inpittext-hover', 'pointer' );
3915+ data.node.addEventListener( 'click', this.focus, this );
3916+ //MouseEvent.add( groupData.apiuser, elmWrapper, 'click', instance.focus );
3917+ };
3918+ InputTextClass.prototype = {
3919+ value : function( value ){
3920+ var data = UIItemPrivateData.get( this );
3921+ if( Type.isString( value ) === true || Type.isNumber( value ) === true ){
3922+ data.elmValue.innerHTML = data.value = '' + value;
3923+ data.focus === true && TextInputManager.update( data );
3924+ };
3925+ data.focus === true && this.blur();
3926+ return data.value;
3927+ },
3928+ focus : function( e ){
3929+ var data = UIItemPrivateData.get( this );
3930+ data.focus = true;
3931+ start( data );
3932+ TextInputManager.show( data );
38463933 return false;
3847- };
3848- this.blur = function( keep ){
3849- var _newValue = ELM_INPUT_TEXT.value,
3850- _validated = Type.isFunction( validater ) === true ? '' + validater( _newValue ) : _newValue;
3851- _newValue = keep !== 27 ? _validated : value; // 27:ESC
3934+ },
3935+ blur : function( keep ){
3936+ var data = UIItemPrivateData.get( this ),
3937+ newValue;
3938+ if( data.focus === false ) return;
3939+ newValue = TextInputManager.hide( data );
3940+ newValue = keep !== 27 ? ( data.validater ? '' + data.validater( newValue ) : newValue ) : value; // 27:ESC
38523941
3853- elmValue.removeChild( ELM_INPUT_TEXT );
3854-
3855- elmA.innerHTML = _newValue;
3856- elmA.style.display = 'block';
3942+ data.elmValue.innerHTML = newValue;
38573943
3858- onUpdate && _newValue !== value && AsyncCall.add( apiuser, onUpdate, [ _newValue, value ], instance );
3944+ data.onUpdate && newValue !== data.value && AsyncCall.add( data.groupData.apiuser, data.onUpdate, [ newValue, data.value ], this );
38593945
3860- value = _newValue;
3861- focus = false;
3862- finish( apiuser, uiGroup, instance );
3863- };
3864- this.enabled = function(){
3865- return enabled;
3866- };
3867- this.visible = function( _visible ){
3946+ data.value = newValue;
3947+ data.focus = false;
3948+ finish( data );
3949+ },
3950+ enabled : function(){
3951+ var data = UIItemPrivateData.get( this );
3952+ return data.enabled;
3953+ },
3954+ visible : function( _visible ){
3955+ var data = UIItemPrivateData.get( this );
38683956 if( Type.isBoolean( _visible ) === true ){
3869- elmWrapper.style.display = _visible ? '' : 'none';
3870- visible = _visible;
3871- }
3872- return visible;
3873- };
3874- this.destroy = function(){
3875- if( focus === true ){
3876- elmValue.removeChild( ELM_INPUT_TEXT );
3877- }
3878- MouseEvent.remove( apiuser, elmWrapper );
3879-
3880- apiuser = uiGroup = elmWrapper = elmValue = elmA = onUpdate = validater = instance = null;
3881- };
3882- instance.value( value );
3883- MouseEvent.add( apiuser, elmWrapper, 'click', instance.focus );
3957+ data.elm.style.display = _visible ? '' : 'none';
3958+ data.visible = _visible;
3959+ };
3960+ return data.visible;
3961+ },
3962+ destroy : function(){
3963+ var data = UIItemPrivateData.get( this );
3964+ if( data.focus === true ){
3965+ data.elmValue.removeChild( ELM_INPUT_TEXT );
3966+ };
3967+ data.destroy();
3968+ }
38843969 };
38853970
3886- var ButtonClass = function( apiuser, uiGroup, elmWrapper, onUpdate ){
3887- var instance = this,
3888- focus = false,
3889- visible = true,
3890- enabled = true;
3891- MouseEvent.add( apiuser, elmWrapper, 'click', onClick );
3892-
3893- function onClick(){
3894- focus = true;
3895- // onUpdate();
3896- AsyncCall.add( apiuser, onUpdate, null, instance );
3897- return false;
3898- };
3899- this.focus = function(){
3900- focus = true;
3901- Util.addClass( elmWrapper, 'button-has-focus' );
3902- start( apiuser, uiGroup, instance );
3903- };
3904- this.blur = function( keyCode ){
3905- keyCode === 13 && onClick();
3906- Util.removeClass( elmWrapper, 'button-has-focus' );
3907- focus = false;
3908- finish( apiuser, uiGroup, instance );
3909- };
3910- this.enabled = function( _enabled ){
3911- if( Type.isBoolean( _enabled ) === true && enabled !== _enabled ){
3912- _enabled === true ? Util.removeClass( elmWrapper, 'button-disabled' ) : Util.addClass( elmWrapper, 'button-disabled' );
3913- enabled = _enabled;
3971+ var ButtonClass = function( groupData, elmWrapper, onUpdate ){
3972+ var data = new UIItemPrivateData();
3973+ data.init( groupData, this, elmWrapper, null, onUpdate, null, false, true, true );
3974+ data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-inpittext-hover', 'pointer' );
3975+ data.node.addEventListener( 'click', onUpdate );
3976+ //MouseEvent.add( groupData.apiuser, elmWrapper, 'click', onUpdate );
3977+ };
3978+ ButtonClass.prototype = {
3979+ focus : function(){
3980+ var data = UIItemPrivateData.get( this );
3981+ data.focus = true;
3982+ Util.addClass( data.elm, 'button-has-focus' );
3983+ start( data );
3984+ },
3985+ blur : function( keyCode ){
3986+ var data = UIItemPrivateData.get( this );
3987+ keyCode === 13 && data.onUpdate && data.onUpdate();
3988+ Util.removeClass( data.elm, 'button-has-focus' );
3989+ data.focus = false;
3990+ finish( data );
3991+ },
3992+ enabled : function( _enabled ){
3993+ var data = UIItemPrivateData.get( this );
3994+ if( Type.isBoolean( _enabled ) === true && data.enabled !== _enabled ){
3995+ _enabled === true ? Util.removeClass( data.elm, 'button-disabled' ) : Util.addClass( data.elm, 'button-disabled' );
3996+ data.enabled = _enabled;
39143997 };
3915- return enabled;
3916- };
3917- this.visible = function( _visible ){
3998+ return data.enabled;
3999+ },
4000+ visible : function( _visible ){
4001+ var data = UIItemPrivateData.get( this );
39184002 if( Type.isBoolean( _visible ) === true ){
3919- elmWrapper.style.display = _visible ? '' : 'none';
3920- visible = _visible;
4003+ data.elm.style.display = _visible ? '' : 'none';
4004+ data.visible = _visible;
39214005 };
3922- return visible;
3923- };
3924- this.destroy = function(){
3925- MouseEvent.remove( apiuser, elmWrapper );
3926- apiuser = uiGroup = elmWrapper = onUpdate = instance = null;
3927- };
4006+ return data.visible;
4007+ },
4008+ destroy : function(){
4009+ var data = UIItemPrivateData.get( this );
4010+ // MouseEvent.remove( data.groupData.apiuser, data.elm );
4011+ data.destroy();
4012+ }
39284013 };
39294014
3930- var ComboBoxClass = function( apiuser, uiGroup, elmWrapper, onUpdate ){
3931- var elmBox = Util.getElementsByClassName( elmWrapper, 'combobox' )[ 0 ],
3932- elmA = ELM_COMBOBOX.cloneNode( true ),
3933- elmToggle = Util.getElementsByClassName( elmA, 'combobox-toggle' )[ 0 ],
3934- elmValue = Util.getElementsByClassName( elmA, 'combobox-value' )[ 0 ].firstChild,
3935- index = 0,
3936- optionList = [],
3937- instance = this,
3938- focus = false,
3939- visible = true,
3940- enabled = true,
3941- value;
3942- elmBox.appendChild( elmA );
4015+ var ComboBoxClass = function( groupData, elmWrapper, onUpdate ){
4016+ var elmA = ELM_COMBOBOX.cloneNode( true ),
4017+ data = new UIItemPrivateData();
4018+ data.init( groupData, this, elmWrapper, null, onUpdate, null, false, true, true );
4019+
4020+ data.elmBox = Util.getElementsByClassName( elmWrapper, 'combobox' )[ 0 ];
4021+ data.elmBox.appendChild( elmA );
4022+ data.elmA = elmA;
4023+ data.elmToggle = Util.getElementsByClassName( elmA, 'combobox-toggle' )[ 0 ];
4024+ data.elmValue = Util.getElementsByClassName( elmA, 'combobox-value' )[ 0 ].firstChild;
4025+ data.selectIndex = 0;
4026+ data.optionList = [];
39434027
3944- this.elm = elmBox;
3945- this.focus = function( e ){
3946- MouseEvent.remove( apiuser, elmWrapper, 'click', instance.focus );
3947- focus = true;
3948- elmA.className = 'combobox-has-focus';
3949- start( apiuser, uiGroup, instance );
3950- OptionControl.show( apiuser, instance, optionList );
4028+ data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-inpittext-hover', 'pointer' );
4029+ data.node.addEventListener( 'click', this.focus, this );
4030+ // MouseEvent.add( groupData.apiuser, data.elm, 'click', this.focus );
4031+ };
4032+ ComboBoxClass.prototype = {
4033+ focus : function( e ){
4034+ var data = UIItemPrivateData.get( this );
4035+ // MouseEvent.remove( data.groupData.apiuser, data.elm, 'click', this.focus );
4036+ data.node.removeEventListener( 'click', this.focus );
4037+ data.focus = true;
4038+ data.elmA.className = 'combobox-has-focus';
4039+ start( data );
4040+ OptionControl.show( data.groupData.apiuser, this, data.optionList );
39514041 return false;
3952- };
3953- this.blur = function( keyCode ){
3954- OptionControl.hide( instance );
3955- focus = false;
3956- elmA.className = '';
3957- finish( apiuser, uiGroup, instance );
3958- MouseEvent.add( apiuser, elmWrapper, 'click', instance.focus );
3959- };
3960- this.enabled = function(){
3961- return enabled;
3962- };
3963- this.visible = function( _visible ){
4042+ },
4043+ blur : function( keyCode ){
4044+ var data = UIItemPrivateData.get( this );
4045+ OptionControl.hide( this );
4046+ data.focus = false;
4047+ data.elmA.className = '';
4048+ finish( data );
4049+ data.node.addEventListener( 'click', this.focus, this );
4050+ // MouseEvent.add( data.groupData.apiuser, data.elm, 'click', this.focus );
4051+ },
4052+ enabled : function(){
4053+ var data = UIItemPrivateData.get( this );
4054+ return data.enabled;
4055+ },
4056+ visible : function( _visible ){
4057+ var data = UIItemPrivateData.get( this );
39644058 if( Type.isBoolean( _visible ) === true ){
3965- elmWrapper.style.display = _visible ? '' : 'none';
3966- visible = _visible;
4059+ data.elm.style.display = _visible ? '' : 'none';
4060+ data.visible = _visible;
39674061 };
3968- return visible;
3969- };
3970- this.value = function( _value ){
3971- if( Type.isString( _value ) === true && value !== _value ){
3972- for( var i=0, l = optionList.length, _option; i<l; ++i ){
3973- _option = optionList[ i ];
4062+ return data.visible;
4063+ },
4064+ value : function( _value ){
4065+ var data = UIItemPrivateData.get( this ),
4066+ i = 0,
4067+ list = data.optionList,
4068+ l = list.length,
4069+ _option;
4070+ if( Type.isString( _value ) === true && data.value !== _value ){
4071+ for( ; i < l; ++i ){
4072+ _option = list[ i ];
39744073 if( _value === _option.value ){
3975- value = _value;
3976- index = i;
3977- elmValue.data = _option.displayValue;
3978- if( focus === true ){
3979- OptionControl.update( instance, _value );
4074+ data.value = _value;
4075+ data.index = i;
4076+ data.elmValue.data = _option.displayValue;
4077+ if( data.focus === true ){
4078+ OptionControl.update( this, _value );
39804079 };
3981- Type.isFunction( onUpdate ) === true && AsyncCall.add( apiuser, onUpdate, _value, instance );
4080+ data.onUpdate && AsyncCall.add( data.groupData.apiuser, data.onUpdate, _value, this );
39824081 break;
39834082 };
39844083 };
39854084 };
3986- return value;
3987- };
3988- this.selectIndex = function(){
3989- return index;
3990- };
3991- this.createOption = function( _displayValue, _value, _isSelected ){
3992- var option = null,
4085+ return data.value;
4086+ },
4087+ selectIndex : function(){
4088+ var data = UIItemPrivateData.get( this );
4089+ return data.selectIndex;
4090+ },
4091+ createOption : function( _displayValue, _value, _isSelected ){
4092+ var data = UIItemPrivateData.get( this ),
4093+ option = null,
4094+ list = data.optionList,
4095+ i = list.length,
39934096 _option, i;
39944097 _value = _value || _displayValue;
39954098 _isSelected = !!_isSelected;
3996- for( i = optionList.length; i; ){
3997- _option = optionList[ --i ];
4099+ for( ; i; ){
4100+ _option = list[ --i ];
39984101 if( _value === _option.value ){
39994102 option = _option;
40004103 break;
40014104 };
40024105 };
40034106 if( _isSelected === true ){
4004- index = optionList.length;
4005- elmValue.data = _displayValue;
4107+ data.selectIndex = list.length;
4108+ data.elmValue.data = _displayValue;
40064109 };
4007- if( option === null ){
4008- option = new OptionDataClass( _displayValue, _value, _isSelected );
4009- optionList.push( option );
4010- };
4011- };
4012- this.destroy = function(){
4013- instance.blur();
4014- MouseEvent.remove( apiuser, elmWrapper );
4015- optionList.length = 0;
4016- apiuser = uiGroup = elmWrapper = onUpdate = elmBox = elmA = elmToggle = elmValue = optionList = instance = null;
4017- };
4018- MouseEvent.add( apiuser, elmWrapper, 'click', instance.focus );
4110+ option === null && list.push( new OptionDataClass( _displayValue, _value, _isSelected ) );
4111+ },
4112+ destroy : function(){
4113+ var data = UIItemPrivateData.get( this );
4114+ this.blur();
4115+ // MouseEvent.remove( data.groupData.apiuser, data.elm );
4116+ data.optionList.length = 0;
4117+ data.destroy();
4118+ }
40194119 };
40204120 var OptionDataClass = function( displayValue, value, isCurrent ){
40214121 this.displayValue = displayValue;
@@ -4064,10 +4164,13 @@ var UI = ( function(){
40644164 };
40654165
40664166 function onOptionSelect( e ){
4067- for( var i = 0, l = OPTION_LIST.length, _option; i < l; ++i){
4167+ var i = 0,
4168+ l = OPTION_LIST.length,
4169+ _option;
4170+ for( ; i < l; ++i ){
40684171 _option = OPTION_LIST[ i ];
40694172 if( this === _option.elm ){
4070- updateCurrrentOption( _option.data.value, true );
4173+ updateCurrrentOption( _option.data.value, true );
40714174 currentCombobox.blur();
40724175 break;
40734176 };
@@ -4083,8 +4186,9 @@ var UI = ( function(){
40834186 currentIndex;
40844187
40854188 function updateCurrrentOption( _value, _updateCombobox ){
4086- var _option;
4087- for( var i = OPTION_LIST.length; i; ){
4189+ var _option,
4190+ i = OPTION_LIST.length;
4191+ for( ; i; ){
40884192 _option = OPTION_LIST[ --i ];
40894193 if( _value === _option.data.value ){
40904194 currentOption && currentOption.current( false );
@@ -4092,7 +4196,6 @@ var UI = ( function(){
40924196 currentOption = _option;
40934197 currentIndex = i;
40944198 _updateCombobox === true && currentCombobox.value( _value );
4095-
40964199 break;
40974200 };
40984201 };
@@ -4105,10 +4208,10 @@ var UI = ( function(){
41054208 var position = Util.getAbsolutePosition( elm );
41064209
41074210 ELM_OPTION_WRAPPER.style.cssText = [
4108- 'width:', elm.offsetWidth - 2, 'px;',
4109- 'left:', position.x, 'px;',
4110- 'top:', position.y + elm.offsetHeight, 'px;'
4111- ].join( '' );
4211+ 'width:', elm.offsetWidth - 2, 'px;',
4212+ 'left:', position.x, 'px;',
4213+ 'top:', position.y + elm.offsetHeight, 'px;'
4214+ ].join( '' );
41124215 };
41134216 function change( e ){
41144217 var l = OPTION_LIST.length,
@@ -4121,16 +4224,20 @@ var UI = ( function(){
41214224 return false;
41224225 };
41234226 return {
4124- show: function( _apiuser, _combobox, _optionList ){
4125- if( currentItem !== _combobox || currentCombobox === _combobox ) return;
4227+ show: function( data ){
4228+ var combobox = data.item,
4229+ list = data.optionList,
4230+ i = 0,
4231+ l = list.length;
4232+ if( currentItem !== combobox || currentCombobox === combobox ) return;
41264233 currentCombobox && currentCombobox.blur();
41274234
4128- apiuser = _apiuser;
4129- currentCombobox = _combobox;
4130- elm = _combobox.elm;
4235+ apiuser = data.groupData.apiuser;
4236+ currentCombobox = combobox;
4237+ elm = data.elmBox;
41314238
4132- for( var i = 0, l = _optionList.length; i<l; ++i ){
4133- OPTION_LIST.unshift( new OptionClass( _optionList[ i ] ) );
4239+ for( ; i < l; ++i ){
4240+ OPTION_LIST.unshift( new OptionClass( list[ i ] ) );
41344241 };
41354242 MouseEvent.add( SUPER_USER_KEY, document, 'mouseup', bodyMouseupHandler );
41364243 KeyEvent.add( SUPER_USER_KEY, Const.KEY.EVENT.KEY_DOWN, change, 38 );
@@ -4140,13 +4247,13 @@ var UI = ( function(){
41404247
41414248 body.appendChild( ELM_OPTION_WRAPPER );
41424249
4143- updateCurrrentOption( _combobox.value(), false );
4250+ updateCurrrentOption( combobox.value(), false );
41444251 updateWrapperPosition();
41454252
41464253 SystemTimer.add( SUPER_USER_KEY, updateWrapperPosition, 500 );
41474254 },
41484255 hide: function( _combobox ){
4149- if( currentCombobox !== _combobox || currentCombobox === null ) return;
4256+ if( currentCombobox !== data.item || currentCombobox === null ) return;
41504257
41514258 var _option;
41524259 while( _option = OPTION_LIST.shift() ){
@@ -4173,8 +4280,8 @@ var UI = ( function(){
41734280 //currentCombobox.blur();
41744281 //OptionControl.hide( currentCombobox );
41754282 },
4176- update: function( _combobox, _value ){
4177- if( currentCombobox !== _combobox || currentItem !== _combobox ) return;
4283+ update: function( data, _value ){
4284+ if( currentCombobox !== data.item || currentItem !== data.item ) return;
41784285 if( currentOption.data.value === _value ) return;
41794286 updateCurrrentOption( _value, true );
41804287 },
@@ -4183,13 +4290,42 @@ var UI = ( function(){
41834290 }
41844291 };
41854292 })();
4186-
4187- var UIGroupClass = function( apiuser ){
4188- var self = this,
4189- itemList = [],
4190- windowW, windowH;
4191-
4192- this.focus = function( _value ){
4293+
4294+ var UIGroupPrivateData = function(){};
4295+ UIGroupPrivateData.prototype = {
4296+ apiuser : null,
4297+ node : null,
4298+ uigroup : null,
4299+ itemList : null,
4300+ visible : true,
4301+ enabled : true,
4302+ init : function( apiuser, node, uigroup ){
4303+ this.apiuser = apiuser;
4304+ this.node = node;
4305+ this.uigroup = uigroup;
4306+ this.itemList = [];
4307+ UIGroupPrivateData.list.push( this );
4308+ },
4309+ destroy : function(){
4310+
4311+ }
4312+ };
4313+ UIGroupPrivateData.list = [];
4314+ UIGroupPrivateData.get = function( uigroup ){
4315+ var list = UIGroupPrivateData.list,
4316+ i = list.length;
4317+ for( ; i; ){
4318+ if( list[ --i ].uigroup === uigroup ) return list[ i ];
4319+ };
4320+ return null;
4321+ };
4322+
4323+ var UIGroupClass = function( apiuser, node ){
4324+ ( new UIGroupPrivateData() ).init( apiuser, node, this );
4325+ };
4326+ UIGroupClass.prototype = {
4327+ focus : function( _value ){
4328+ var data = UIGroupPrivateData.get( this );
41934329 /*
41944330 if( _value === true ){
41954331 if( currentItem ){
@@ -4203,76 +4339,96 @@ var UI = ( function(){
42034339 finish( apiuser, self, currentItem );
42044340 } else
42054341 */
4206- if( _value && Util.getIndex( itemList, _value ) !== -1 ){
4342+ if( _value && Util.getIndex( data.itemList, _value ) !== -1 ){
42074343 // currentItem = _value;
4208- currentList = itemList;
4344+ currentList = data.itemList;
42094345 };
4210- return currentUi === self;
4211- };
4212- this.blur = function(){
4213- if( currentList === itemList ){
4346+ return currentUi === this;
4347+ },
4348+ blur : function(){
4349+ var data = UIGroupPrivateData.get( this );
4350+ if( currentList === data.itemList ){
42144351 currentList = null;
42154352 };
4216- };
4217- this.createInputText = function( _elmWrapper, _onUpdate, _validater ){
4218- var _elmValue = Util.getElementsByClassName( _elmWrapper, 'editable-value' )[ 0 ];
4219- if( _elmValue ){
4220- var ret = new InputTextClass( apiuser, self, _elmWrapper, _elmValue, _onUpdate, _validater );
4221- itemList.push( ret );
4353+ },
4354+ createInputText : function( elmWrapper, onUpdate, validater ){
4355+ var data = UIGroupPrivateData.get( this ),
4356+ elmValue = Util.getElementsByClassName( elmWrapper, 'editable-value' )[ 0 ],
4357+ ret;
4358+ if( elmValue ){
4359+ ret = new InputTextClass( data, elmWrapper, elmValue, onUpdate, validater );
4360+ data.itemList.push( ret );
42224361 return ret;
4223- }
4362+ };
42244363 alert( 'error createInputText' );
4225- };
4226- this.createButton = function( _elm, _onClick ){
4227- var ret = new ButtonClass( apiuser, self, _elm, _onClick );
4228- itemList.push( ret );
4364+ },
4365+ createButton : function( elm, onClick ){
4366+ var data = UIGroupPrivateData.get( this ),
4367+ ret = new ButtonClass( data, elm, onClick );
4368+ data.itemList.push( ret );
42294369 return ret;
4230- };
4231- this.createFileInput = function( _elm, _onUpdate, _validater, _elmFileInput ){
4232- var ret = FileInputClass( apiuser, self, _elm, _onUpdate, _validater, _elmFileInput );
4233- itemList.push( ret );
4370+ },
4371+ createFileInput : function( elm, onUpdate, validater, elmFileInput ){
4372+ var data = UIGroupPrivateData.get( this ),
4373+ ret = new FileInputClass( data, elm, onUpdate, validater, elmFileInput );
4374+ data.itemList.push( ret );
42344375 return ret;
4235- };
4236- this.createCombobox = function( _elm, _onUpdate, _optionList ){
4237- var ret = new ComboBoxClass( apiuser, self, _elm, _onUpdate, _optionList );
4238- itemList.push( ret );
4376+ },
4377+ createCombobox : function( elm, onUpdate, optionList ){
4378+ var data = UIGroupPrivateData.get( this ),
4379+ ret = new ComboBoxClass( data, elm, onUpdate, optionList );
4380+ data.itemList.push( ret );
42394381 return ret;
4240- };
4241- this.createCheckBox = function(){
4382+ },
4383+ createCheckBox : function(){
42424384
4243- };
4244- this.createRadio = function(){
4385+ },
4386+ createRadio : function(){
42454387
4246- };
4247- this.createSlider = function(){
4388+ },
4389+ createSlider : function(){
42484390
4249- };
4250- this.destroy = function(){
4251- var _item;
4252- while( _item = itemList.shift() ){
4391+ },
4392+ visible : function( v ){
4393+ var data = UIGroupPrivateData.get( this );
4394+ if( Type.isBoolean( v ) === true && data.visible !== v ){
4395+ data.node.disabled( !v );
4396+ data.visible = v;
4397+ if( v === false && currentUi === this ){
4398+ currentItem.blur();
4399+ // finish( UIItemPrivateData.get( currentItem ) );
4400+ };
4401+ };
4402+ return data.visible;
4403+ },
4404+ enabled : function( v ){
4405+
4406+ },
4407+ destroy : function(){
4408+ var data = UIGroupPrivateData.get( this ),
4409+ _item;
4410+ while( _item = data.itemList.shift() ){
42534411 _item.destroy();
42544412 };
42554413 if( currentUi === this ){
4256- currentItem = null;
4257- currentUi = null;
4258- currentUser = null;
4259- currentList = null;
4414+ currentItem.blur();
4415+ // finish( UIItemPrivateData.get( currentItem ) );
42604416 };
4261- apiuser = self = null;
4262- };
4417+ data.destroy();
4418+ }
42634419 };
42644420
4265- function start( _apiuser, _uigroup, _item ){
4266- if( currentItem !== _item ){
4267- currentUi !== _uigroup && currentUi && currentUi.blur();
4421+ function start( data ){
4422+ if( currentItem !== data.item ){
4423+ currentUi !== data.groupData.uigroup && currentUi && currentUi.blur();
42684424
42694425 currentItem !== null && currentItem.blur();
42704426
4271- currentUser = _apiuser;
4272- currentUi = _uigroup;
4273- currentItem = _item;
4427+ currentUser = data.groupData.apiuser;
4428+ currentUi = data.groupData.uigroup;
4429+ currentItem = data.item;
42744430
4275- _uigroup.focus( _item );
4431+ currentUi.focus( currentItem );
42764432
42774433 // if( currentUser !== _apiuser ) {
42784434 KeyEvent.add( SUPER_USER_KEY, Const.KEY.EVENT.KEY_DOWN, onKeyDown, 13 );
@@ -4282,9 +4438,9 @@ var UI = ( function(){
42824438 // };
42834439 };
42844440 }
4285- function finish( _apiuser, _uigroup, _item ){
4286- if( currentItem === _item ){
4287- _uigroup.blur();
4441+ function finish( data ){
4442+ if( currentItem === data.item ){
4443+ currentUi.blur();
42884444
42894445 currentUser = null;
42904446 currentUi = null;
@@ -4294,51 +4450,51 @@ var UI = ( function(){
42944450 KeyEvent.remove( SUPER_USER_KEY, Const.KEY.EVENT.KEY_DOWN, onKeyDown, 13 );
42954451 KeyEvent.remove( SUPER_USER_KEY, Const.KEY.EVENT.KEY_DOWN, onKeyDown, 27 );
42964452 KeyEvent.remove( SUPER_USER_KEY, Const.KEY.EVENT.KEY_DOWN, onKeyDown, 9 );
4297- KeyEvent.updateCurrentListener( _apiuser );
4453+ KeyEvent.updateCurrentListener( data.groupData.apiuser );
42984454 };
42994455 };
43004456
43014457 function onKeyDown( e ){
43024458 if( currentItem === null ) return true;
43034459 var keyCode = e.keyCode,
4304- _index = Util.getIndex( currentList, currentItem );
4460+ index = Util.getIndex( currentList, currentItem );
43054461 if( keyCode === 13 || keyCode === 27 || keyCode === 9 || keyCode === 18 || e.altKey === true ){ // 13.return 27.esc 9.tab 18.alt
4306- keyCode === 9 && tabShift( _index, e.shiftKey === true ? -1 : 1 );
4462+ keyCode === 9 && tabShift( index, e.shiftKey === true ? -1 : 1 );
43074463 keyCode === 13 && currentItem instanceof ComboBoxClass && OptionControl.onEnter();
4308- keyCode === 13 && tabShift( _index, 1 );
4464+ keyCode === 13 && tabShift( index, 1 );
43094465 currentItem && currentItem.blur( keyCode );
43104466 };
43114467 return false;
43124468 };
43134469
4314- function tabShift( _index, _way ){
4470+ function tabShift( index, way ){
43154471 var l = currentList.length,
4316- i = _index + _way,
4317- _item;
4472+ i = index + way,
4473+ item;
43184474 if( l < 2 ) return;
4319- while( i !== _index ){
4475+ while( i !== index ){
43204476 i = i < 0 ?
43214477 l - 1 :
43224478 i < l ? i : 0; // 0 < i < l
4323- _item = currentList[ i ];
4324- if( _item.enabled() === true && _item.visible() === true ){
4325- AsyncCall.add( currentUser, _item.focus, null, _item );
4479+ item = currentList[ i ];
4480+ if( item.enabled() === true && item.visible() === true ){
4481+ AsyncCall.add( currentUser, item.focus, null, item );
43264482 return;
43274483 };
4328- i += _way;
4484+ i += way;
43294485 };
43304486 };
43314487
43324488 return {
4333- createUIGroup: function( _apiuser ){
4334- var _uid = _apiuser.getUID(),
4335- _list = UI_LIST[ _uid ],
4336- _ui = new UIGroupClass( _apiuser );
4337- if( Type.isArray( _list ) === false ){
4338- _list = UI_LIST[ _uid ] = [];
4339- }
4340- _list.push( _ui );
4341- return _ui;
4489+ createUIGroup: function( apiuser, node ){
4490+ var uid = apiuser.getUID(),
4491+ list = UI_LIST[ uid ],
4492+ ui = new UIGroupClass( apiuser, node );
4493+ if( Type.isArray( list ) === false ){
4494+ list = UI_LIST[ uid ] = [];
4495+ };
4496+ list.push( ui );
4497+ return ui;
43424498 },
43434499 onWindowResize: function( w, h ){
43444500 windowW = w;
--- a/0.5.x/stylesheets/peta.apps.css
+++ b/0.5.x/stylesheets/peta.apps.css
@@ -1,7 +1,7 @@
11 @charset "UTF-8";
22
33 /* pettanR peta.apps.css
4- * version 0.5.19
4+ * version 0.5.23
55 *
66 * author:
77 * itozyun
@@ -669,74 +669,115 @@
669669 --------------------------------------------------------------------------------------*/
670670 #comic-element-consol-wrapper {
671671 position: absolute;
672+ bottom: 0;
673+ left: 0;
672674 }
673- #image-element-consol {
674- width: 50px;
675- overflow: auto;
675+ #comic-element-consol-container {
676+ background: transparent url( "../images/white_70pct.png" ) repeat 0 0;
677+ padding: 0.5em;
676678 }
677- #text-element-consol {
678- width: 75px;
679- overflow: auto;
679+ .comic-element-consol-container-hover {
680+ background: #fff !important;
680681 }
681-
682- #change-image-button,
683- #layer-back-button,
684- #layer-forward-button,
685- #delete-image-button,
686- #edit-text-button,
687- #change-text-style-button,
688- #hide-text-tail-button,
689- #back-text-button,
690- #forward-text-button,
691- #delete-text-button {
692- text-indent: -9999px;
693- width: 25px;
694- height: 25px;
695- line-height: 25px;
696- float: left;
697- background-image: url('../images/sprite.gif');
698- background-repeat: no-repeat;
699- background-position: 0 0;
700- cursor: pointer;
701- }
702- #hide-text-tail-button {
703- background-position: -30px -30px;
704- }
705- #change-image-button,
706- #change-text-style-button {
707- background-position: -30px 0;
708- }
709- #layer-back-button,
710- #back-text-button {
711- background-position: -60px 0;
712- }
713- #layer-forward-button,
714- #forward-text-button {
715- background-position: -60px -30px;
716- }
717- #delete-image-button,
718- #delete-text-button {
719- background-position: 0 -30px;
720- }
721-
722- .console-out #comic-element-consol-wrapper-when-out {
723- padding: 5px;
724- background-color: #333;
725- }
726- .console-out #comic-element-consol-tail {
727- border-width: 0 5px 10px 5px;
728- border-color: transparent transparent #333 transparent;
729- _border-color: #fff #fff #333 #fff;
730- border-style: solid;
731- width: 0;
732- height: 0;
733- font-size: 0;
734- line-height: 0;
682+
683+ #comic-element-consol-pushout-wrapper {
684+ display: none;
735685 position: absolute;
736- top: -10px;
737- left: 50%;
686+ top: -10px;
687+ width: 240px;
688+ border: 1px solid #999;
738689 }
739-
690+ #comic-element-consol-pushout-tail {
691+ border-style: solid;
692+ width: 0;
693+ height: 0;
694+ font-size: 0;
695+ line-height: 0;
696+ position: absolute;
697+ }
698+ .satellite-left #comic-element-consol-pushout-tail {
699+ border-width: 5px 0 5px 10px;
700+ border-color: transparent transparent transparent #999;
701+ _border-color: #fff #fff #fff #999;
702+ top: 50%;
703+ right: -10px;
704+ }
705+ .satellite-right #comic-element-consol-pushout-tail {
706+ border-width: 5px 10px 5px 0;
707+ border-color: transparent #999 transparent transparent;
708+ _border-color: #fff #999 #fff #fff;
709+ top: 50%;
710+ left: -10px;
711+ }
712+ .satellite-top #comic-element-consol-pushout-tail {
713+ border-width: 10px 5px 0 5px;
714+ border-color: #333 transparent transparent transparent;
715+ _border-color: #333 #fff #fff #fff;
716+ bottom: -10px;
717+ left: 50%;
718+ }
719+ .satellite-bottom #comic-element-consol-pushout-tail {
720+ border-width: 0 5px 10px 5px;
721+ border-color: transparent transparent #333 transparent;
722+ _border-color: #fff #fff #333 #fff;
723+ top: -10px;
724+ left: 50%;
725+ }
726+
727+
728+ .comic-element-consol-item {
729+ float: left;
730+ width: 70px;
731+ height: 70px;
732+ }
733+ .comic-element-consol-item-small {
734+ float: left;
735+ width: 70px;
736+ height: 35px;
737+ }
738+ .comic-element-consol-item div {
739+ height: 35px;
740+ }
741+ .comic-element-consol-item-small .button {
742+ width: 60px;
743+ height: 24px;
744+ line-height: 24px;
745+ margin-top: 5px;
746+ margin-left: 5px;
747+ }
748+ .comic-element-attribute-label {
749+ display: inline-block;
750+ width: 14px;
751+ line-height: 22px;
752+ color: #666;
753+ text-align: center;
754+ cursor: pointer;
755+ }
756+ .comic-element-attribute-value {
757+ width: 40px;
758+ text-align: right;
759+ }
760+
761+ #comic-element-z-value,
762+ #comic-element-a-value {
763+ width: 35px;
764+ }
765+ #comic-element-w-percent-value,
766+ #comic-element-h-percent-value {
767+ width: 30px;
768+ }
769+
770+ #comic-element-keep-aspect {
771+ position: relative;
772+ top: 24px;
773+ left: 0;
774+ width: 12px;
775+ height: 22px;
776+ font-size: 22px;
777+ line-height: 22px;
778+ border: 1px solid #ccc;
779+ }
780+
740781
741782
742783 /* Panel > speach
@@ -890,79 +931,6 @@
890931 display: none;
891932 }
892933
893- /* Information Window
894- --------------------------------------------------------------------------------------*/
895- #comic-element-infomation {
896- background-color: #fff;
897- position: absolute;
898- width: 100%;
899- }
900- #comic-element-x, #comic-element-z,
901- #comic-element-y, #comic-element-a,
902- #comic-element-w, #comic-element-w-percent,
903- #comic-element-h, #comic-element-h-percent {
904- position: absolute;
905- }
906-
907- #comic-element-x,
908- #comic-element-y,
909- #comic-element-w,
910- #comic-element-h {
911- left: 30px;
912- }
913- #comic-element-z,
914- #comic-element-a {
915- left: 115px;
916- }
917- #comic-element-w-percent,
918- #comic-element-h-percent {
919- left: 124px;
920- }
921- #comic-element-x, #comic-element-z {
922- top: 10px;
923- }
924- #comic-element-y, #comic-element-a {
925- top: 40px;
926- }
927- #comic-element-w, #comic-element-w-percent {
928- top: 80px;
929- }
930- #comic-element-h, #comic-element-h-percent {
931- top: 110px;
932- }
933- .comic-element-attribute-label {
934- display: inline-block;
935- width: 14px;
936- line-height: 22px;
937- color: #666;
938- text-align: center;
939- cursor: pointer;
940- }
941- .comic-element-attribute-value {
942- width: 40px;
943- text-align: right;
944- }
945-
946- #comic-element-z-value,
947- #comic-element-a-value {
948- width: 35px;
949- }
950- #comic-element-w-percent-value,
951- #comic-element-h-percent-value {
952- width: 30px;
953- }
954-
955- #comic-element-keep-aspect {
956- position: absolute;
957- top: 96px;
958- left: 100px;
959- width: 12px;
960- height: 22px;
961- font-size: 22px;
962- line-height: 22px;
963- border: 1px solid #ccc;
964- }
965-
966934 /* Background Window
967935 --------------------------------------------------------------------------------------*/
968936 #bg-pattern,
--- a/0.5.x/stylesheets/system.css
+++ b/0.5.x/stylesheets/system.css
@@ -1,7 +1,7 @@
11 @charset "UTF-8";
22
33 /* pettanR system.css
4- * version 0.5.18
4+ * version 0.5.23
55 *
66 * author:
77 * itozyun
@@ -141,39 +141,29 @@
141141
142142 /* editable-text
143143 --------------------------------------------------------------------------------------*/
144-
144+ #ui-textinput {
145+ position: absolute;
146+ outline: 0;
147+ padding: 3px 0;
148+ background-color: #aDf0FE;
149+ margin: 0;
150+ border-color: #4D90FE;
151+ }
152+ #ui-textinput,
153+ .editable-text {
154+ border-style: solid;
155+ border-width: 1px;
156+ font-size: 14px;
157+ line-height: 16px;
158+ }
145159 .editable-text {
160+ border-color: #666 #aaa #bbb #777;
146161 display: inline-block;
147162 color: #333;
148- border: 1px solid #ccc;
149- font-size: 14px;
150- line-height: 16px;
163+ zoom: 1;
164+ background-color: #fff;
165+ padding: 3px;
151166 }
152- .editable-text a,
153- .editable-text a:link,
154- .editable-text a:visited,
155- .editable-text a:hover,
156- .editable-text a:active {
157- padding: 3px;
158- color: #333;
159- text-decoration: none;
160- display: block;
161- zoom: 1;
162- outline: 0;
163- background-color: #fff;
164- }
165- .editable-text a:hover {
166- background-color: #ccf;
167- }
168- .editable-text input {
169- padding: 3px 0;
170- width: 100%;
171- font-family: Arial,Helvetica,sans-serif;
172- background-color: #ccf;
173- border: 0;
174- margin: 0;
175- outline: 0;
176- }
177167
178168 /* combobox
179169 --------------------------------------------------------------------------------------*/
旧リポジトリブラウザで表示