1 class Pettanr.Views.Speech.Element extends Pettanr.View
\r
3 className: 'pettanr-comic-speech'
\r
5 initialize: (options) ->
\r
6 @element = options.element
\r
9 @parent = options.parent
\r
10 @listenTo(@parent, 'ready:balloon', @set_style)
\r
22 this.$el.html(@inner.render().el)
\r
25 add_element: (element) ->
\r
29 attr = {style: Pettanr.to_style(@style())}
\r
34 top: Pettanr.to_s(@element.get('y')) + '%',
\r
35 left: Pettanr.to_s(@element.get('x')) + '%',
\r
36 width: Pettanr.to_s(@element.get('width') + '%'),
\r
37 height: Pettanr.to_s(@element.get('height')) + '%',
\r
42 Pettanr.Views.Speech.Element.Inner
\r
44 class Pettanr.Views.Speech.Element.Inner extends Pettanr.View
\r
46 className: 'pettanr-comic-speech-inner'
\r
48 initialize: (options) ->
\r
49 @element = options.element
\r
50 @speech_view = options.parent
\r
51 @speech_balloon_view = @speech_view.parent
\r
55 this.$el.html(@element.scenario())
\r
59 attr = {style: Pettanr.to_style(@style())}
\r
64 'font-size': Pettanr.to_s(@element.get('font_size')) + 'em',
\r
65 'text-align': @element.text_align_text(),
\r
66 color: '#' + ('000000' + @element.get('fore_color').toString(16)).slice(-6)
\r
69 class Pettanr.Views.Speech.Element.Edit extends Pettanr.Views.Speech.Element
\r
71 initialize: (options) ->
\r
77 @inner.$el.mouseover ->
\r
78 sb_view.element.trigger('active')
\r
79 @inner.$el.mouseout ->
\r
80 sb_view.element.trigger('inactive')
\r
84 Pettanr.Views.Speech.Element.Inner.Edit
\r
86 class Pettanr.Views.Speech.Element.Inner.Edit extends Pettanr.Views.Speech.Element.Inner
\r
88 initialize: (options) ->
\r
90 @listenTo(@speech_balloon_view, 'input:r', @input_r)
\r
91 @listenTo(@element, 'input:content', @render)
\r
92 @listenTo(@element, 'input:font_size', @set_style)
\r
93 @listenTo(@element, 'input:text_align', @set_style)
\r
94 @listenTo(@element, 'input:fore_color', @set_style)
\r