diff --git a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb index f5c85677f..c3252ed1c 100644 --- a/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb +++ b/lib/rails_kindeditor/lib/rails_kindeditor/helper.rb @@ -6,7 +6,7 @@ module RailsKindeditor input_html = { :id => id }.merge(options.delete(:input_html) || {}) output = ActiveSupport::SafeBuffer.new output << text_area_tag(name, content, input_html) - output << javascript_tag(js_replace(id, options)) + output << javascript_tag(js_replace(id, options.merge(window_onload: 'true'))) end def kindeditor(name, method, options = {}) @@ -14,7 +14,7 @@ module RailsKindeditor input_html = (options.delete(:input_html) || {}).stringify_keys output_buffer = ActiveSupport::SafeBuffer.new output_buffer << build_text_area_tag(name, method, self, options, input_html) - output_buffer << javascript_tag(js_replace(input_html['id'], options)) + output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true'))) end def kindeditor_upload_json_path(*args) @@ -50,13 +50,13 @@ module RailsKindeditor "var old_onload_#{random_name}; if(typeof window.onload == 'function') old_onload_#{random_name} = window.onload; window.onload = function() { - #{editor_id}KindEditor.create('##{dom_id}', #{get_options(options).to_json}); + #{editor_id}KindEditor.create('##{dom_id}', #{get_options(options).to_json}).loadPlugin('paste'); if(old_onload_#{random_name}) old_onload_#{random_name}(); }" else - "$(function(){KindEditor.ready(function(K){ + "KindEditor.ready(function(K){ #{editor_id}K.create('##{dom_id}', #{get_options(options).to_json}).loadPlugin('paste'); - });});" + });" end end diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 1d7b9293a..8a651b863 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2773,4 +2773,4 @@ div.repos_explain{ padding-top: 20px; padding-bottom: 20px; } -img{max-width: 100%;} +.upload_img img{max-width: 580px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 3e8dbb641..4624b26c9 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -423,3 +423,4 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} /*文本左对齐*/ .tl{text-align: left;} img{max-width: 100%;} +.attachments {clear: both;} diff --git a/spec/requests/zipdown_request_spec.rb b/spec/requests/zipdown_request_spec.rb new file mode 100644 index 000000000..e69de29bb