plain_speech_balloon 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/plain_speech_balloon/speech_balloons.css +6 -0
- data/app/views/plain_speech_balloon/balloons/_form.html.erb +0 -2
- data/app/views/plain_speech_balloon/speech_balloons/_scenario.html.erb +19 -0
- data/app/views/plain_speech_balloon/speeches/_form.html.erb +5 -0
- data/db/plain_speech_balloon_templates.json +1 -0
- data/db/work/plain_speech_balloon_templates.json +1 -1
- data/lib/plain_speech_balloon/version.rb +1 -1
- data/lib/plain_speech_balloon.rb +11 -2
- metadata +2 -4
- data/app/assets/stylesheets/plain_speech_balloon/balloon.css +0 -4
- data/app/assets/stylesheets/plain_speech_balloon/speech.css +0 -4
- data/app/assets/stylesheets/plain_speech_balloon/speech_balloon.css +0 -4
@@ -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 />
|
@@ -28,4 +27,3 @@
|
|
28
27
|
<% unless balloon.new_record? %>
|
29
28
|
<%= 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
29
|
<% 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="plain_speech_balloon-balloon-scenario">
|
15
|
+
<%= h(speech_balloon.caption) %>
|
16
|
+
</div>
|
17
|
+
<div id="<%= speech_balloon.speech.tag_id('scenario') -%>" class="plain_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) %>
|
@@ -1 +1 @@
|
|
1
|
-
{"plain@pettan.com":{"classname":"PlainSpeechBalloon","caption":"透明","settings":{"speech_balloon":{"default_width":150,"default_height":150},"all":{"balloon":{"system_picture_id":{"text":"iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAABl0lEQVR4nO3SwQ3AIBDAsNL9dz6WIEJC9gR5ZM3MB6f9twN4k7FIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi8QGS9IEKe20OQwAAAAASUVORK5CYII="}},"speech":{"x_rate":0,"y_rate":0,"width_rate":100,"height_rate":100}}}}}
|
1
|
+
{"plain@pettan.com":{"classname":"PlainSpeechBalloon","caption":"透明","settings":{"speech_balloon":{"quotes":"「 」 『 』","default_width":150,"default_height":150},"all":{"balloon":{"system_picture_id":{"text":"iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAABl0lEQVR4nO3SwQ3AIBDAsNL9dz6WIEJC9gR5ZM3MB6f9twN4k7FIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi8QGS9IEKe20OQwAAAAASUVORK5CYII="}},"speech":{"x_rate":0,"y_rate":0,"width_rate":100,"height_rate":100}}}}}
|
data/lib/plain_speech_balloon.rb
CHANGED
@@ -82,13 +82,17 @@ module PlainSpeechBalloon
|
|
82
82
|
self.speech_balloon || @new_speech_balloon
|
83
83
|
end
|
84
84
|
|
85
|
+
def parsed_settings
|
86
|
+
@parsed_settings ||= get_speech_balloon.speech_balloon_template.parsed_settings
|
87
|
+
end
|
88
|
+
|
85
89
|
def supply_default
|
86
|
-
|
87
|
-
s = parsed_settings['all']['speech']
|
90
|
+
s = self.parsed_settings['all']['speech']
|
88
91
|
self.x = s['x_rate']
|
89
92
|
self.y = s['y_rate']
|
90
93
|
self.width = s['width_rate']
|
91
94
|
self.height = s['height_rate']
|
95
|
+
self.quotes = ''
|
92
96
|
end
|
93
97
|
|
94
98
|
def extend_speech
|
@@ -98,6 +102,11 @@ module PlainSpeechBalloon
|
|
98
102
|
def extend_speech= params
|
99
103
|
@extend_speech = PlainSpeechBalloon::Speech.new params
|
100
104
|
end
|
105
|
+
|
106
|
+
def arrayed_quotes
|
107
|
+
@arrayed_quotes ||= (self.quotes.blank? ? self.parsed_settings['speech_balloon']['quotes'].to_s : self.quotes).split(/ /)
|
108
|
+
end
|
109
|
+
|
101
110
|
end
|
102
111
|
|
103
112
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plain_speech_balloon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -53,11 +53,8 @@ files:
|
|
53
53
|
- app/assets/javascripts/plain_speech_balloon/application.js
|
54
54
|
- app/assets/javascripts/plain_speech_balloon/balloons.js.coffee
|
55
55
|
- app/assets/stylesheets/plain_speech_balloon/application.css
|
56
|
-
- app/assets/stylesheets/plain_speech_balloon/balloon.css
|
57
56
|
- app/assets/stylesheets/plain_speech_balloon/balloons.css
|
58
|
-
- app/assets/stylesheets/plain_speech_balloon/speech.css
|
59
57
|
- app/assets/stylesheets/plain_speech_balloon/speeches.css
|
60
|
-
- app/assets/stylesheets/plain_speech_balloon/speech_balloon.css
|
61
58
|
- app/assets/stylesheets/plain_speech_balloon/speech_balloons.css
|
62
59
|
- app/controllers/plain_speech_balloon/application_controller.rb
|
63
60
|
- app/controllers/plain_speech_balloon/balloons_controller.rb
|
@@ -77,6 +74,7 @@ files:
|
|
77
74
|
- app/views/plain_speech_balloon/speech_balloons/new.html.erb
|
78
75
|
- app/views/plain_speech_balloon/speech_balloons/show.html.erb
|
79
76
|
- app/views/plain_speech_balloon/speech_balloons/_form.html.erb
|
77
|
+
- app/views/plain_speech_balloon/speech_balloons/_scenario.html.erb
|
80
78
|
- app/views/plain_speech_balloon/speech_balloons/_standard.html.erb
|
81
79
|
- config/routes.rb
|
82
80
|
- db/migrate/20130628082138_create_plain_speech_balloon_speech_balloons.rb
|