square_speech_balloon 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,3 +2,9 @@
2
2
  Place all the styles related to the matching controller here.
3
3
  They will automatically be included in application.css.
4
4
  */
5
+ .square_speech_balloon-speech-scenario:before {
6
+ content:"「";
7
+ }
8
+ .square_speech_balloon-speech-scenario:after {
9
+ content:"」";
10
+ }
@@ -1,4 +1,3 @@
1
- <div id="<%= balloon.field_tag_id(:form) %>" classname="<%= balloon.classname %>">
2
1
 
3
2
  <div class="field">
4
3
  <%= f.label :x %><br />
@@ -20,7 +19,10 @@
20
19
  <%= f.number_field :height, :id => balloon.field_tag_id(:height), :panel_id => balloon.tag_panel_id, :element_id => balloon.tag_element_id, :element_type => balloon.tag_element_type, :element_part_id => balloon.tag_element_part_id, :element_part_type => balloon.tag_element_part_type, :column => :height, :tree => balloon.field_tree(:height) %>
21
20
  </div>
22
21
 
23
- <%= f.hidden_field :r, :id => balloon.field_tag_id(:r), :panel_id => balloon.tag_panel_id, :element_id => balloon.tag_element_id, :element_type => balloon.tag_element_type, :element_part_id => balloon.tag_element_part_id, :element_part_type => balloon.tag_element_part_type, :column => :r, :tree => balloon.field_tree(:r) %>
22
+ <div class="field">
23
+ <%= f.label :r %><br />
24
+ <%= f.number_field :r, :id => balloon.field_tag_id(:r), :panel_id => balloon.tag_panel_id, :element_id => balloon.tag_element_id, :element_type => balloon.tag_element_type, :element_part_id => balloon.tag_element_part_id, :element_part_type => balloon.tag_element_part_type, :column => :r, :tree => balloon.field_tree(:r) %>
25
+ </div>
24
26
 
25
27
  <%= f.hidden_field :system_picture_id, :id => balloon.field_tag_id(:system_picture_id), :panel_id => balloon.tag_panel_id, :element_id => balloon.tag_element_id, :element_type => balloon.tag_element_type, :element_part_id => balloon.tag_element_part_id, :element_part_type => balloon.tag_element_part_type, :column => :system_picture_id, :tree => balloon.field_tree(:system_picture_id) %>
26
28
  <%= f.hidden_field :settings, :id => balloon.field_tag_id(:settings), :panel_id => balloon.tag_panel_id, :element_id => balloon.tag_element_id, :element_type => balloon.tag_element_type, :element_part_id => balloon.tag_element_part_id, :element_part_type => balloon.tag_element_part_type, :column => :settings, :tree => balloon.field_tree(:settings) %>
@@ -28,4 +30,3 @@
28
30
  <% unless balloon.new_record? %>
29
31
  <%= f.hidden_field :id, :id => balloon.field_tag_id(:id), :panel_id => balloon.tag_panel_id, :element_id => balloon.tag_element_id, :element_type => balloon.tag_element_type, :element_part_id => balloon.tag_element_part_id, :element_part_type => balloon.tag_element_part_type, :column => :id, :tree => balloon.field_tree(:id) %>
30
32
  <% end %>
31
- </div>
@@ -0,0 +1,19 @@
1
+ <% if speech_balloon.speech.quotes.blank? -%>
2
+ <% else -%>
3
+ <style>
4
+ <!--
5
+ #<%= speech_balloon.speech.tag_id('scenario') -%>:before {
6
+ content:"<%= speech_balloon.speech.arrayed_quotes[0] -%>";
7
+ }
8
+ #<%= speech_balloon.speech.tag_id('scenario') -%>:after {
9
+ content:"<%= speech_balloon.speech.arrayed_quotes[1] -%>";
10
+ }
11
+ -->
12
+ </style>
13
+ <% end -%>
14
+ <div id="<%= speech_balloon.balloon.tag_id('scenario') -%>" class="square_speech_balloon-balloon-scenario">
15
+ <%= h(speech_balloon.caption) %>
16
+ </div>
17
+ <div id="<%= speech_balloon.speech.tag_id('scenario') -%>" class="square_speech_balloon-speech-scenario">
18
+ <%= h(speech_balloon.speech.content) %>
19
+ </div>
@@ -4,6 +4,11 @@
4
4
  <%= f.text_area :content, :id => speech.field_tag_id(:content), :panel_id => speech.tag_panel_id, :element_id => speech.tag_element_id, :element_type => speech.tag_element_type, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :content, :tree => speech.field_tree(:content) %>
5
5
  </div>
6
6
 
7
+ <div class="field">
8
+ <%= f.label :quotes %><br />
9
+ <%= f.text_field :quotes, :id => speech.field_tag_id(:content), :panel_id => speech.tag_panel_id, :element_id => speech.tag_element_id, :element_type => speech.tag_element_type, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :content, :tree => speech.field_tree(:quotes) %>
10
+ </div>
11
+
7
12
  <%= f.hidden_field :x, :id => speech.field_tag_id(:x), :panel_id => speech.tag_panel_id, :element_id => speech.tag_element_id, :element_type => speech.tag_element_type, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :x, :tree => speech.field_tree(:x) %>
8
13
  <%= f.hidden_field :y, :id => speech.field_tag_id(:y), :panel_id => speech.tag_panel_id, :element_id => speech.tag_element_id, :element_type => speech.tag_element_type, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :y, :tree => speech.field_tree(:y) %>
9
14
  <%= f.hidden_field :width, :id => speech.field_tag_id(:width), :panel_id => speech.tag_panel_id, :element_id => speech.tag_element_id, :element_type => speech.tag_element_type, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :width, :tree => speech.field_tree(:width) %>
@@ -4,6 +4,7 @@
4
4
  "caption": "長方形",
5
5
  "settings": {
6
6
  "speech_balloon": {
7
+ "quotes": "「 」 『 』",
7
8
  "default_width": 150,
8
9
  "default_height": 150
9
10
  },
@@ -1 +1 @@
1
- {"square@pettan.com":{"classname":"SquareSpeechBalloon","caption":"長方形","settings":{"speech_balloon":{"default_width":150,"default_height":150},"all":{"balloon":{"system_picture_id":{"text":"iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAACXBIWXMAABcSAAAXEgFnn9JSAAABqUlEQVR4nO3UMQrDUAwFQSn4/lf+rnKCZDGYmUqliuXtzJyBP/s8/QDvdH2PcwwXv9vdmbFYRIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJHZmztNP8D4Wi8QNaTAGK2LVzWEAAAAASUVORK5CYII="}},"speech":{"x_rate":0,"y_rate":0,"width_rate":100,"height_rate":100}}}}}
1
+ {"square@pettan.com":{"classname":"SquareSpeechBalloon","caption":"長方形","settings":{"speech_balloon":{"quotes":"「 」 『 』","default_width":150,"default_height":150},"all":{"balloon":{"system_picture_id":{"text":"iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAACXBIWXMAABcSAAAXEgFnn9JSAAABqUlEQVR4nO3UMQrDUAwFQSn4/lf+rnKCZDGYmUqliuXtzJyBP/s8/QDvdH2PcwwXv9vdmbFYRIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJIRFQlgkhEVCWCSERUJYJHZmztNP8D4Wi8QNaTAGK2LVzWEAAAAASUVORK5CYII="}},"speech":{"x_rate":0,"y_rate":0,"width_rate":100,"height_rate":100}}}}}
@@ -63,10 +63,6 @@ module SquareSpeechBalloon
63
63
  self.system_picture_id
64
64
  end
65
65
 
66
- def classname
67
- get_speech_balloon.speech_balloon_template.classname
68
- end
69
-
70
66
  end
71
67
 
72
68
  module SpeechModule
@@ -82,13 +78,17 @@ module SquareSpeechBalloon
82
78
  self.speech_balloon || @new_speech_balloon
83
79
  end
84
80
 
81
+ def parsed_settings
82
+ @parsed_settings ||= get_speech_balloon.speech_balloon_template.parsed_settings
83
+ end
84
+
85
85
  def supply_default
86
- parsed_settings = get_speech_balloon.speech_balloon_template.parsed_settings
87
- s = parsed_settings['all']['speech']
86
+ s = self.parsed_settings['all']['speech']
88
87
  self.x = s['x_rate']
89
88
  self.y = s['y_rate']
90
89
  self.width = s['width_rate']
91
90
  self.height = s['height_rate']
91
+ self.quotes = ''
92
92
  end
93
93
 
94
94
  def extend_speech
@@ -98,6 +98,11 @@ module SquareSpeechBalloon
98
98
  def extend_speech= params
99
99
  @extend_speech = SquareSpeechBalloon::Speech.new params
100
100
  end
101
+
102
+ def arrayed_quotes
103
+ @arrayed_quotes ||= (self.quotes.blank? ? self.parsed_settings['speech_balloon']['quotes'].to_s : self.quotes).split(/ /)
104
+ end
105
+
101
106
  end
102
107
 
103
108
  end
@@ -1,3 +1,3 @@
1
1
  module SquareSpeechBalloon
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: square_speech_balloon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -74,6 +74,7 @@ files:
74
74
  - app/views/square_speech_balloon/speech_balloons/new.html.erb
75
75
  - app/views/square_speech_balloon/speech_balloons/show.html.erb
76
76
  - app/views/square_speech_balloon/speech_balloons/_form.html.erb
77
+ - app/views/square_speech_balloon/speech_balloons/_scenario.html.erb
77
78
  - app/views/square_speech_balloon/speech_balloons/_standard.html.erb
78
79
  - config/routes.rb
79
80
  - db/migrate/20130629042701_create_square_speech_balloon_speech_balloons.rb