}) + ");"
}
# format.json { render :json => @frame.to_json(include: {
-# :comic => {:only => :title}, :panel_pictures => {:include => {:image => {:only => [:width]}},:only => [:width, :height, :zindex, :image_id]}
+# :comic => {:only => :title}, :panel_pictures => {:include => {:image => {:only => [:width]}},:only => [:width, :height, :z, :image_id]}
# }, only: [:border]) }
end
end
def validate_param(ft)
res = nil
- bl = ft[:border_limit].to_i
- tl = ft[:tail_limit].to_i
+ bl = ft[:size_count].to_i
+ tl = ft[:tail_count].to_i
if bl * tl == ft[:balloon_templates_attributes].size
flag = []
bl.times do |i|
end
end
ft[:balloon_templates_attributes].each do |k, t|
- flag[t[:border].to_i - 1][t[:tail].to_i - 1] = nil
+ flag[t[:size].to_i - 1][t[:tail].to_i - 1] = nil
end
if flag.flatten.compact.size == 0
else
belongs_to :resource_picture
def flip
- res = (self.v == 0 ? '' : 'v') + (self.h == 0 ? '' : 'h')
+ res = (self.flipv == 0 ? '' : 'v') + (self.fliph == 0 ? '' : 'h')
res += '/' unless res.empty?
res
end
<th>speach balloon</th>
<th>system_picture</th>
<th>Tail</th>
- <th>Border</th>
+ <th>size</th>
<th>MinWidth</th>
<th>MinHeight</th>
<th>MaxWidth</th>
<td><%= balloon_template.speach_balloon_id %></td>
<td><%= balloon_template.system_picture_id %></td>
<td><%= balloon_template.tail %></td>
- <td><%= balloon_template.border %></td>
+ <td><%= balloon_template.size %></td>
<td><%= balloon_template.min_width %></td>
<td><%= balloon_template.min_height %></td>
<td><%= balloon_template.max_width %></td>
<th>balloonTemplate</th>
<th>system_picture</th>
<th>Tail</th>
- <th>Border</th>
- <th>Zindex</th>
+ <th>size</th>
+ <th>z</th>
<th>Top offset</th>
<th>Left offset</th>
<th>Width</th>
<td><%= balloon.balloon_template_id %></td>
<td><%= balloon.system_picture_id %></td>
<td><%= balloon.tail %></td>
- <td><%= balloon.border %></td>
- <td><%= balloon.zindex %></td>
- <td><%= balloon.top_offset %></td>
- <td><%= balloon.left_offset %></td>
+ <td><%= balloon.size %></td>
+ <td><%= balloon.z %></td>
+ <td><%= balloon.y %></td>
+ <td><%= balloon.x %></td>
<td><%= balloon.width %></td>
<td><%= balloon.height %></td>
</tr>
<tr>
<td><%= comic.id %></td>
<td><%= h comic.title %></td>
- <td><%= comic.default_width %></td>
- <td><%= comic.default_height %></td>
+ <td><%= comic.width %></td>
+ <td><%= comic.height %></td>
<td><%= comic.author_id%></td>
<td><%= comic.updated_at %></td>
<td><%= link_to 'Show', comic %></td>
<p>
<b>Default width:</b>
- <%= @comic.default_width %>
+ <%= @comic.width %>
</p>
<p>
<b>Default height:</b>
- <%= @comic.default_height %>
+ <%= @comic.height %>
</p>
<% @comic.panels.each do |panel| %>
<% @panel = panel %>
<p>
<b>Default width:</b>
- <%= @comic.default_width %>
+ <%= @comic.width %>
</p>
<p>
<b>Default height:</b>
- <%= @comic.default_height %>
+ <%= @comic.height %>
</p>
<%= link_to 'Back', comics_path %>
<th>Height</th>
<th>Top offset</th>
<th>Left offset</th>
- <th>Zindex</th>
+ <th>z</th>
<th>flip</th>
<th>updated_at</th>
</tr>
<td><%= panel_picture.resource_picture_id %></td>
<td><%= panel_picture.width %></td>
<td><%= panel_picture.height %></td>
- <td><%= panel_picture.top_offset %></td>
- <td><%= panel_picture.left_offset %></td>
- <td><%= panel_picture.zindex %></td>
+ <td><%= panel_picture.y %></td>
+ <td><%= panel_picture.x %></td>
+ <td><%= panel_picture.z %></td>
<td><%= panel_picture.flip %></td>
<td><%= panel_picture.updated_at %></td>
</tr>
</span>
<div class="panel" style="width:<%= @panel.width %>px;height:<%= @panel.height %>px;overflow:hidden; border:solid black <%= @panel.border %>px; background:white;">
<% @panel.panel_pictures.each do |panel_picture| %>
- <div id="vPicture<%= panel_picture.id -%>" class="panel_picture" style="position:relative; top:<%= panel_picture.top_offset -%>px; left:<%= panel_picture.left_offset -%>px; z-index:<%= panel_picture.zindex -%>; ">
+ <div id="vPicture<%= panel_picture.id -%>" class="panel_picture" style="position:relative; top:<%= panel_picture.y -%>px; left:<%= panel_picture.x -%>px; z-index:<%= panel_picture.z -%>; ">
<img style=" position:absolute; width:<%= panel_picture.width -%>px; height:<%= panel_picture.height -%>px; " src="<%= panel_picture.url -%>">
</div>
<% end %>
<% @panel.balloons.each do |balloon| %>
- <div id="vballoon<%= balloon.id -%>" class="balloon" style="position:relative; top:<%= balloon.top_offset -%>px; left:<%= balloon.left_offset -%>px; z-index:<%= balloon.zindex -%>; ">
+ <div id="vballoon<%= balloon.id -%>" class="balloon" style="position:relative; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= balloon.z -%>; ">
<img style=" position:absolute; width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; " src="<%= balloon.system_picture.url -%>">
<% balloon.speaches.each do |speach| %>
- <div style="position:relative; top:<%= speach.top_offset -%>px; left:<%= speach.left_offset -%>px;width:<%= speach.width -%>px; height:<%= speach.height -%>px; top:1px; left:1px; z-index:1; ">
+ <div style="position:relative; top:<%= speach.y -%>px; left:<%= speach.x -%>px;width:<%= speach.width -%>px; height:<%= speach.height -%>px; top:1px; left:1px; z-index:1; ">
<%= h speach.content -%>
</div>
<% end %>
<tr>
<th>Name</th>
<th>Tail limit</th>
- <th>Border limit</th>
+ <th>size limit</th>
<th></th>
<th></th>
</tr>
<% @speach_balloons.each do |speach_balloon| %>
<tr>
<td><%= h speach_balloon.name %></td>
- <td><%= speach_balloon.tail_limit %></td>
- <td><%= speach_balloon.border_limit %></td>
+ <td><%= speach_balloon.tail_count %></td>
+ <td><%= speach_balloon.size_count %></td>
<td><%= link_to 'show', speach_balloon %></td>
<td>
<% if admin_signed_in? -%>
<p>
<b>Tail limit:</b>
- <%= @speach_balloon.tail_limit %>
+ <%= @speach_balloon.tail_count %>
</p>
<p>
- <b>Border limit:</b>
- <%= @speach_balloon.border_limit %>
+ <b>size limit:</b>
+ <%= @speach_balloon.size_count %>
</p>
<% @speach_balloon.balloon_templates.each do |balloon_template| -%>\r
<div>\r
<p>\r
Tail:<%= balloon_template.tail -%>\r
- Border:<%= balloon_template.border -%>\r
+ Size:<%= balloon_template.size -%>\r
</p>\r
<img src="<%= balloon_template.system_picture.url -%>" />\r
</div>\r
<% @speach_templates.each do |speach_template| %>
<tr>
<td><%= speach_template.balloon_template_id %></td>
- <td><%= speach_template.top_offset %></td>
- <td><%= speach_template.left_offset %></td>
+ <td><%= speach_template.y %></td>
+ <td><%= speach_template.x %></td>
<td><%= speach_template.width %></td>
<td><%= speach_template.height %></td>
</tr>
<tr>
<td><%= speach.balloon_id %></td>
<td><%= h speach.content %></td>
- <td><%= speach.top_offset %></td>
- <td><%= speach.left_offset %></td>
+ <td><%= speach.y %></td>
+ <td><%= speach.x %></td>
<td><%= speach.width %></td>
<td><%= speach.height %></td>
</tr>