OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
authoryasushiito <yas@pen-chan.jp>
Tue, 10 Jun 2014 08:59:05 +0000 (17:59 +0900)
committeryasushiito <yas@pen-chan.jp>
Tue, 10 Jun 2014 08:59:05 +0000 (17:59 +0900)
Gemfile
app/models/balloon.rb
app/models/ground_picture.rb
app/models/panel_picture.rb
app/models/speech.rb
app/views/scrolls/_summary.html.erb
app/views/sheet_panels/_element.html.erb
config/application.rb
config/initializers/mime_types.rb

diff --git a/Gemfile b/Gemfile
index d9887dd..a6f9b75 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
 source 'https://rubygems.org'
 
-gem 'rails', '3.1.1'
+gem 'rails', '~> 3.2.0'
 gem 'devise', '=1.5.2'
 gem 'rest-client'
 gem 'underscore-rails'
@@ -21,6 +21,7 @@ gem 'circle_speech_balloon'
 gem 'plain_speech_balloon'
 gem 'square_speech_balloon'
 gem 'test_speech_balloon'
+gem 'square_speech_balloon'
 gem 'pettanr_simple_format'
 
 # Bundle edge Rails instead:
@@ -30,8 +31,8 @@ gem 'pettanr_simple_format'
 # Gems used only for assets and not required
 # in production environments by default.
 group :assets do
-  gem 'sass-rails',   '~> 3.1.4'
-  gem 'coffee-rails', '~> 3.1.1'
+  gem 'sass-rails',   '~> 3.0'
+  gem 'coffee-rails', '~> 3.0'
   gem 'uglifier', '>= 1.0.3'
 end
 
@@ -63,7 +64,7 @@ end
 group :development, :test do
   gem 'sqlite3'
   gem 'webrat'
-  gem 'rspec', '~> 2.13.0'
+  gem 'rspec',   '~> 2.0'
    gem 'rspec-rails'
    gem 'cucumber'
    gem 'cucumber-rails'
index af41ab4..dc5fa3c 100644 (file)
@@ -16,6 +16,10 @@ class Balloon < Peta::Element
 #  validates :caption, :presence => true
   validates :speech_balloon_template_settings, :boost => {:boost_name => :speech_balloon_template}
 
+  def _y
+    self.attributes['y']
+  end
+  
   def url
     '/system_pictures/' + self.system_picture.filename
   end
@@ -54,7 +58,7 @@ self.system_picture_id = 1
   def style
     {
       'width' => self.width.to_s + 'px','height' => self.height.to_s + 'px',
-      'top' => self.y.to_s + 'px','left' => self.x.to_s + 'px'
+      'top' => self._y.to_s + 'px','left' => self.x.to_s + 'px'
     }
   end
   
index 36461d3..1f303ec 100644 (file)
@@ -13,6 +13,10 @@ class GroundPicture < Peta::Element
   
   @@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
   
+  def _y
+    self.attributes['y']
+  end
+  
   def self.by_author_list_includes
     {
       :panel => {
@@ -44,7 +48,7 @@ class GroundPicture < Peta::Element
       'position' => 'absolute', 'top' => '0px', 'left' => '0px', 'z-index' => self.z, 
       'background-image' => "url(#{self.picture.url})", 
       'background-repeat' => self.repeat_text, 
-      'background-position' => "#{self.x}px #{self.y}px"
+      'background-position' => "#{self.x}px #{self._y}px"
     }
     self.merge_opacity(r, opacity) if spot and spot != self
     r
index df7df24..38995ab 100644 (file)
@@ -13,6 +13,10 @@ class PanelPicture < Peta::Element
   validates :z, :presence => true, :numericality => {:greater_than => 0}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
+  def _y
+    self.attributes['y']
+  end
+  
   def self.by_author_list_includes
     {
       :panel => {
@@ -58,7 +62,7 @@ class PanelPicture < Peta::Element
   end
   
   def opt_div_style
-    "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;"
+    "top:#{self._y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;"
   end
   
   def opt_img_tag spot = nil, opacity = 20
index 0d1134b..b780aa7 100644 (file)
@@ -35,7 +35,7 @@ class Speech < Peta::Element
   
   def outer_style
     {
-      'top' => self.y, 'left' => self.x, 
+      'top' => self._y, 'left' => self.x, 
       'width' => self.width, 'height' => self.height
     }
   end
index 38b81b3..c8b4c41 100644 (file)
@@ -1,6 +1,5 @@
 <div>
   <%= t_selected_item('scroll_visible_items', item.visible) %>
-  <%= t('scrolls.scroll_panels_count', :c => item.scroll_panels_count) %>
 </div>
 <div>
   <%= link_to h(truncate(item.author.name, :length => 12)), author_path(item.author) %>
index ce76f9d..1bd4f61 100644 (file)
@@ -1,4 +1,4 @@
-<div class="sheet_panel" style="top:<%= elm.y %>px; left:<%= elm.x %>px; z-index:<%= elm.z %>;">
+<div class="sheet_panel" style="top:<%= elm._y %>px; left:<%= elm.x %>px; z-index:<%= elm.z %>;">
   <% if elm.panel -%>
     <%# blocked in panels/body panel = Panel.show elm.panel, author -%>
     <%= render 'panels/body', :panel => elm.panel, :operators => operators, :spot => nil %>
index 1fe4db4..17af8a0 100644 (file)
@@ -39,6 +39,7 @@ config.assets.initialize_on_precompile = false
     # config.time_zone = 'Central Time (US & Canada)'
 
     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+    I18n.enforce_available_locales = false
     config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
     config.i18n.default_locale = :ja
 
index 0876b14..fa0c5cd 100644 (file)
@@ -3,8 +3,5 @@
 # Add new mime types for use in respond_to blocks:
 # Mime::Type.register "text/richtext", :rtf
 # Mime::Type.register_alias "text/html", :iphone
-Mime::Type.register_alias "image/png", :png
-Mime::Type.register_alias "image/gif", :gif
-Mime::Type.register_alias "image/jpeg", :jpeg
 Mime::Type.register_alias "application/javascript", :jsonp
 Mime::Type.register_alias "text/html", :prof