Sha256: 2441858bb59dbbc6d6f002b74a3a35dbb83142d4ffb19bbed7f00c8b9104ccd4
Contents?: true
Size: 918 Bytes
Versions: 8
Compression:
Stored size: 918 Bytes
Contents
class Ckeditor::ApplicationController < ::ApplicationController respond_to :html, :json layout 'ckeditor/application' before_filter :find_asset, :only => [:destroy] before_filter :ckeditor_authorize! before_filter :authorize_resource protected def respond_with_asset(asset) file = params[:CKEditor].blank? ? params[:qqfile] : params[:upload] asset.data = Ckeditor::Http.normalize_param(file, request) callback = ckeditor_before_create_asset(asset) if callback && asset.save body = params[:CKEditor].blank? ? asset.to_json(:only=>[:id, :type]) : %Q"<script type='text/javascript'> window.parent.CKEDITOR.tools.callFunction(#{params[:CKEditorFuncNum]}, '#{config.relative_url_root}#{Ckeditor::Utils.escape_single_quotes(asset.url_content)}'); </script>" render :text => body else render :nothing => true end end end
Version data entries
8 entries across 8 versions & 2 rubygems