OSDN Git Service

Version 0.6.58, X.UI.HBox is working.
[pettanr/clientJs.git] / 0.5.x / javascripts / peta-apps.js
index 08ae46d..16cabfe 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.48
+ *   version 0.5.49
  *   
  * author:
  *   itozyun
@@ -92,6 +92,8 @@
                                        case FILE_DATA_BALLOON_ROOT :
                                        case BALLOON_TEMPLETE_ARRAY :
                                                json.type = FILE_TYPE.BALLOON_TEMPLETE;
+                                               // register pettanr.balloon
+                                               pettanr.newBalloon.register( json.settings );
                                                data = createFileData( json, BALLOON_TEMPLETE_ARRAY, 'name,caption,classname,settings' );
                                                addChildData( FILE_DATA_BALLOON_ROOT, data );
                                                break;
@@ -3697,7 +3699,7 @@ var Editor = gOS.registerApplication( function(){
                this.$        = jqImageElementOrigin.clone( true );
                this.data     = data;
                this.z        = data.z;
-               this.timing   = data.t || PANEL_ELEMENT_ARRAY.length + 1;
+               this.timing   = data.t || PANEL_ELEMENT_ARRAY.length;
                this.keepSize = false;
                this.flipV    = data.height < 0 ? -1 : 1;
                this.flipH    = data.width  < 0 ? -1 : 1;
@@ -3829,7 +3831,7 @@ var Editor = gOS.registerApplication( function(){
                })();
                this.balloon = pettanr.balloon.createBalloon( data.width, data.height, data.tail, this.type );
                this.z       = data.z;
-               this.timing  = data.t || PANEL_ELEMENT_ARRAY.length + 1;
+               this.timing  = data.t || PANEL_ELEMENT_ARRAY.length;
                
                this.$.find( 'img' ).eq( 0 ).replaceWith( this.balloon.elm );
                
@@ -4090,7 +4092,7 @@ var Editor = gOS.registerApplication( function(){
                                                x       : Math.floor( panelW / 2 - data.width / 2 ),
                                                y       : Math.floor( panelH / 2 - data.height / 2 ),
                                                z       : -1,
-                                               t       : PANEL_ELEMENT_ARRAY.length + 1,
+                                               t       : 0,
                                                width   : 1,
                                                height  : 1
                                        });
@@ -4114,7 +4116,7 @@ var Editor = gOS.registerApplication( function(){
                                                x:                                      Math.floor( panelW / 2 - 100 + Math.random() * 10 ),
                                                y:                  Math.floor( panelH / 2 - 100 + Math.random() * 10 ),
                                                z:                  -1,
-                                               t:                  PANEL_ELEMENT_ARRAY.length + 1,
+                                               t:                  0,
                                                width:              200,
                                                height:             200,
                                                speeches_attributes: {
@@ -5127,7 +5129,7 @@ var Model = ( function(){
                                '}'
                        ].join( '');
                };
-               function imageToJson( _imageElement, _timing ){
+               function imageToJson( _imageElement, t ){
                        var cr = pettanr.LINE_FEED_CODE_TEXTAREA;
                        return [
                                '{', cr,
@@ -5135,36 +5137,40 @@ var Model = ( function(){
                                        '"x": ',          _imageElement.x, ',', cr,
                                        '"y": ',          _imageElement.y, ',', cr,
                                        '"z": ',          _imageElement.z + 1, ',', cr,
-                                       '"t": ',          _timing, ',', cr,
+                                       '"t": ',          t, ',', cr,
                                        '"width": ',      _imageElement.flipH * _imageElement.w, ',', cr,
                                        '"height": ',     _imageElement.flipV * _imageElement.h, cr,
                                '}'
                        ].join( '');
                };
 
-               function balloonToJson( _textElement, _timing ){
+               function balloonToJson( _textElement, t ){
                        var cr = pettanr.LINE_FEED_CODE_TEXTAREA;
                        return [
                                '{', cr,
-                                       '"balloon_template_id": ', 1, ',', cr,
-                                       '"system_picture_id": ',   1, ',', cr,
-                                       '"size": ',                1, ',', cr,
-                                       '"tail": ',                _textElement.a, ',', cr,
-                                       '"x": ',                   _textElement.x, ',', cr,
-                                       '"y": ',                   _textElement.y, ',', cr,
-                                       '"z": ',                   _textElement.z + 1, ',', cr,
-                                       '"t": ',                   timing, ',', cr,
-                                       '"width": ',               _textElement.w, ',', cr,
-                                       '"height": ',              _textElement.h, ',', cr,
-                                       '"speeches_attributes": {', cr,
-                                               '"newf', timing, '": {', cr,
-                                               '"content": "', _textElement.content, '",', cr,
+                                       '"speech_balloon_template_id": ', 1, ',', cr,
+                                       '"classname": "Square",',
+                                       '"z": ',                _textElement.z + 1, ',', cr,
+                                       '"t": ',                t, ',', cr,
+                                       '"settings": "{\'tail\':' + _textElement.a + '}",',
+                           '"balloons_attributes": {', cr,
+                               '"newb', t, '": {', cr,
+                                                       '"system_picture_id": ',  2, ',', cr,
+                                               '"caption": "alt text",', cr,
                                                        '"x": ',        _textElement.x, ',', cr,
                                                        '"y": ',        _textElement.y, ',', cr,
-                                                       '"t": ',        timing, ',', cr,
                                                        '"width": ',    _textElement.w, ',', cr,
                                                        '"height": ',   _textElement.h, cr,
                                                '}', cr,
+                                       '},', cr,
+                                       '"speeches_attributes": {', cr,
+                                               '"news', t, '": {', cr,
+                                               '"content": "', _textElement.content, '",', cr,
+                                                       '"x": ',        Math.floor( _textElement.w * 0.16 ), ',', cr,
+                                                       '"y": ',        Math.floor( _textElement.w * 0.16 ), ',', cr,
+                                                       '"width": ',    Math.floor( _textElement.w * 0.66 ), ',', cr,
+                                                       '"height": ',   Math.floor( _textElement.h * 0.66 ), cr,
+                                               '}', cr,
                                        '}', cr,
                                '}'
                        ].join( '');
@@ -5296,7 +5302,6 @@ var OutputConsole = gOS.registerApplication( function(){
                comboboxFormat, inputOption,
                buttonSubmit, buttonClose,
                windowW, windowH,
-               timing   = 0,
                comicID, panelID, panelTimming, panelW, panelH, borderSize, panelElementArray,
                app      = this,
                model    = null;