From: yasushiito Date: Sun, 7 Jul 2013 01:10:57 +0000 (+0900) Subject: t#31652:Speech br X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=commitdiff_plain;h=380c188a8c952978628efb6b13eefa8996b43f87 t#31652:Speech br --- diff --git a/Gemfile b/Gemfile index 62889738..f654fe9a 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ gem 'jquery-rails' gem 'jquery-ui-rails' # To use ActiveModel has_secure_password -# gem 'bcrypt-ruby', '~> 3.0.0' +gem 'bcrypt-ruby', '~> 3.0.0' # Use unicorn as the web server # gem 'unicorn' diff --git a/app/assets/javascripts/panels.js.coffee b/app/assets/javascripts/panels.js.coffee index 1c483a67..10e38fdc 100644 --- a/app/assets/javascripts/panels.js.coffee +++ b/app/assets/javascripts/panels.js.coffee @@ -19,6 +19,10 @@ $ -> if $(@).attr('tree') keys = $(@).attr('tree').split('-') set_tree_value(keys, attr, $(this).val()) + $('textarea').map -> + if $(@).attr('tree') + keys = $(@).attr('tree').split('-') + set_tree_value(keys, attr, $(this).val()) $('select').map -> if $(@).attr('tree') keys = $(@).attr('tree').split('-') @@ -181,6 +185,15 @@ $ -> $(trace).height(v) else else + $('textarea').map -> + if $(@).attr('element_type') and $(@).attr('element_type') == 'speech_balloon' + $(@).focusout -> + switch $(@).attr('column') + when 'content' + trace = element_tag_id($(@)) + speech_trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'speech' + $(@).attr('element_part_id') + v = $(@).val() + $(speech_trace).html(v) # ground-picture # sync view diff --git a/app/views/panels/_body.html.erb b/app/views/panels/_body.html.erb index 05b9a6e6..3af6fc13 100644 --- a/app/views/panels/_body.html.erb +++ b/app/views/panels/_body.html.erb @@ -9,7 +9,7 @@
<%= elm.caption -%>

- <%= h elm.speech.content -%> + <%= sanitize(h(elm.speech.content).gsub(/\n/, '
'), :tags => %w(a p br)) -%>

<% when 'GroundPicture' %>