From e07c38d4648452cf6e4cbe9035d7dad7eb94542a Mon Sep 17 00:00:00 2001 From: songgz Date: Thu, 1 Jun 2017 09:51:08 +0800 Subject: [PATCH 01/43] fixed project root path is changed! change Controller prepend_view_path method return value, missing template errors. --- app/controllers/kindeditor/assets_controller.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/kindeditor/assets_controller.rb b/app/controllers/kindeditor/assets_controller.rb index 4f682f1..c4986b6 100644 --- a/app/controllers/kindeditor/assets_controller.rb +++ b/app/controllers/kindeditor/assets_controller.rb @@ -46,17 +46,17 @@ def list return end - Dir.chdir(Rails.public_path) + upload_path = Rails.public_path RailsKindeditor.upload_store_dir.split('/').each do |dir| - Dir.mkdir(dir) unless Dir.exist?(dir) - Dir.chdir(dir) - end - - Dir.mkdir(@dir) unless Dir.exist?(@dir) - + upload_path += dir + Dir.mkdir(upload_path) unless Dir.exist?(upload_path) + end + @root_path += @dir + "/" @root_url += @dir + "/" + Dir.mkdir(@root_path) unless Dir.exist?(@root_path) + @path = params[:path].strip || "" if @path.empty? @current_path = @root_path @@ -124,4 +124,4 @@ def show_error(msg) render :plain => ({:error => 1, :message => msg}.to_json) end -end \ No newline at end of file +end From 226b5b7675c3cb32bb6f54ee3aea5031c540f78d Mon Sep 17 00:00:00 2001 From: wzxia <280008163@qq.com> Date: Wed, 7 Jun 2017 16:13:03 +0800 Subject: [PATCH 02/43] modify video --- lib/rails_kindeditor.rb | 2 +- .../assets/javascripts/kindeditor/kindeditor.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/rails_kindeditor.rb b/lib/rails_kindeditor.rb index 876e2f1..6513101 100644 --- a/lib/rails_kindeditor.rb +++ b/lib/rails_kindeditor.rb @@ -16,7 +16,7 @@ module RailsKindeditor @@upload_flash_ext = %w[swf flv] mattr_accessor :upload_media_ext - @@upload_media_ext = %w[swf flv mp3 wav wma wmv mid avi mpg asf rm rmvb] + @@upload_media_ext = %w[f4v flv mp3 mp4 ogg webm] mattr_accessor :upload_file_ext @@upload_file_ext = %w[doc docx xls xlsx ppt htm html txt zip rar gz bz2] diff --git a/vendor/assets/javascripts/kindeditor/kindeditor.js b/vendor/assets/javascripts/kindeditor/kindeditor.js index 51dd03a..9416a17 100755 --- a/vendor/assets/javascripts/kindeditor/kindeditor.js +++ b/vendor/assets/javascripts/kindeditor/kindeditor.js @@ -930,7 +930,7 @@ function _mediaType(src) { if (/\.(rm|rmvb)(\?|$)/i.test(src)) { return 'audio/x-pn-realaudio-plugin'; } - if (/\.(swf|flv)(\?|$)/i.test(src)) { + if (/\.(swf|flv|mp4|ogg|mp3|webm|f4v)(\?|$)/i.test(src)) { return 'application/x-shockwave-flash'; } return 'video/x-ms-asf-plugin'; @@ -949,7 +949,7 @@ function _mediaAttrs(srcTag) { return _getAttrList(unescape(srcTag)); } function _mediaEmbed(attrs) { - var html = ' Date: Thu, 8 Jun 2017 09:08:18 +0800 Subject: [PATCH 03/43] modify video --- vendor/assets/javascripts/kindeditor/kindeditor.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vendor/assets/javascripts/kindeditor/kindeditor.js b/vendor/assets/javascripts/kindeditor/kindeditor.js index 9416a17..b674aa1 100755 --- a/vendor/assets/javascripts/kindeditor/kindeditor.js +++ b/vendor/assets/javascripts/kindeditor/kindeditor.js @@ -949,11 +949,18 @@ function _mediaAttrs(srcTag) { return _getAttrList(unescape(srcTag)); } function _mediaEmbed(attrs) { - var html = '"; + } + html += ' Date: Thu, 8 Jun 2017 09:15:44 +0800 Subject: [PATCH 04/43] modify video --- vendor/assets/javascripts/kindeditor/kindeditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/assets/javascripts/kindeditor/kindeditor.js b/vendor/assets/javascripts/kindeditor/kindeditor.js index b674aa1..3300686 100755 --- a/vendor/assets/javascripts/kindeditor/kindeditor.js +++ b/vendor/assets/javascripts/kindeditor/kindeditor.js @@ -951,7 +951,7 @@ function _mediaAttrs(srcTag) { function _mediaEmbed(attrs) { var html = ''; if (/\.(mp4|ogg|mp3|webm)(\?|$)/i.test(attrs.flashvars)) { - html += "" + var html = "