OSDN Git Service

Client is version 0.5.54, working circle balloon.
[pettanr/pettanr.git] / app / assets / javascripts / peta-apps.js
index ba248bb..0759a53 100644 (file)
@@ -3862,15 +3862,16 @@ var Editor = gOS.registerApplication( function(){
                        return UA.isIE === true && UA.ieRenderingVersion < 8 ? _OLD_IE : _MODERN;
                })();
                
-               this.$       = jqTextElementOrigin.clone( true );
-               this.data    = data;
-               this.elmText = this.$.find( 'td,.speach-inner' ).get( 0 );
-               this.type    = data.balloon_template_id || data.balloon_template.id;
-               this.content = '';
-               
-               var speachs = data.speeches;
-               for( var k in speachs ){
-                       this.content += speachs[ k ].content || '';
+               this.$        = jqTextElementOrigin.clone( true );
+               this.data     = data;
+               this.elmText  = this.$.find( 'td,.speach-inner' ).get( 0 );
+               this.templete = data.balloon_template_id || data.balloon_template.id;
+               this.tempName = data.classname;
+               this.content  = '';
+               
+               var speaches = data.speeches;
+               for( var k in speaches ){
+                       this.content += speaches[ k ].content || '';
                };
                
                var balloons = data.balloons,
@@ -3881,8 +3882,9 @@ var Editor = gOS.registerApplication( function(){
                                break;
                        };
                };
-               // this.balloon = pettanr.balloon.createBalloon( data.width, data.height, data.tail, this.type );
-               this.balloon = pettanr.newBalloon.create( this.type, balloonData.width, balloonData.height, balloonData.settings );
+
+               this.balloon = pettanr.newBalloon.create( this.templete, balloonData.width, balloonData.height, data.settings || balloonData.settings );
+               this.a       = this.balloon.a;
                data.x       = balloonData.x;
                data.y       = balloonData.y;
                data.width   = balloonData.width;
@@ -3910,13 +3912,6 @@ var Editor = gOS.registerApplication( function(){
                                this.resize( this.data.x, this.data.y, this.data.width, this.data.height, this.data.tail );
                                this.init = null;
                        },
-                       /*
-                       _updateType : function( _type ){
-                               if( this.type !== _type ){
-                                       this.type = _type || this.type;
-                                       this.balloon.type( this.type );
-                               };
-                       }, */
                        _updateAngle : function( _a ){
                                if( _a !== undefined && a !== _a ){
                                        this.a = _a !== undefined ? _a : this.a;
@@ -4179,6 +4174,7 @@ var Editor = gOS.registerApplication( function(){
                                if( data.classname ){
                                        data = {
                                                balloon_template_id : data.id,
+                                               classname           : data.classname,
                                                z                   : -1,
                                                t                   : 0,      
                                                balloons : {
@@ -4187,7 +4183,7 @@ var Editor = gOS.registerApplication( function(){
                                                                height   : 200,
                                                                x        : Math.floor( panelW / 2 - 100 + Math.random() * 10 ),
                                                                y        : Math.floor( panelH / 2 - 100 + Math.random() * 10 ),
-                                                               settings : {}                                                                                                           
+                                                               settings : '0'                                                                                                          
                                                        }
                                                },
                                                speeches : {
@@ -5212,18 +5208,18 @@ var Model = ( function(){
                                        '"width": ',      _imageElement.flipH * _imageElement.w, ',', cr,
                                        '"height": ',     _imageElement.flipV * _imageElement.h, cr,
                                '}'
-                       ].join( '');
+                       ].join( '' );
                };
 
                function balloonToJson( _textElement, t ){
                        var cr = pettanr.LINE_FEED_CODE_TEXTAREA;
                        return [
                                '{', cr,
-                                       '"speech_balloon_template_id": ', _textElement.type, ',', cr,
-                                       '"classname": "Square",',
+                                       '"speech_balloon_template_id": ', _textElement.templete, ',', cr,
+                                       '"classname": "', _textElement.tempName, '",', cr,
                                        '"z": ',                _textElement.z + 1, ',', cr,
                                        '"t": ',                t, ',', cr,
-                                       '"settings": "{\'tail\':' + _textElement.a + '}",',
+                                       '"settings": "', _textElement.a, '",', cr,
                            '"balloons_attributes": {', cr,
                                '"newb', t, '": {', cr,
                                                        '"system_picture_id": ',  _textElement.balloon.src, ',', cr,
@@ -5268,6 +5264,7 @@ var Model = ( function(){
                        return [
                                '{', cr,
                                        panelID !== -1 ? ( '"id": ' + panelID + ',' + cr ) : '',
+                                       //panelID !== -1 ? ( '"panel_id": ' + panelID + ',' + cr ) : '',
                                        // comicID !== -1 ? ( '"comic_id": ' + comicID + ',' + cr ) : '',
                                    '"width": ',            panelW, ',', cr,
                                    '"height": ',           panelH, ',', cr,