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,
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;
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;
if( data.classname ){
data = {
balloon_template_id : data.id,
+ classname : data.classname,
z : -1,
t : 0,
balloons : {
height : 200,
x : Math.floor( panelW / 2 - 100 + Math.random() * 10 ),
y : Math.floor( panelH / 2 - 100 + Math.random() * 10 ),
- settings : {}
+ settings : '0'
}
},
speeches : {
'"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,
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,