Sha256: aaa36dddaa058c8c8b7d23c94f6eee4a80edee86e589aedfa6a08cdc67f3c044

Contents?: true

Size: 873 Bytes

Versions: 18

Compression:

Stored size: 873 Bytes

Contents

class Ckeditor::ApplicationController < ::ApplicationController
  respond_to :html, :json
  
  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]}, '#{Ckeditor::Utils.escape_single_quotes(asset.url_content)}');
        </script>"
        
        render :text => body
      else
        render :nothing => true
      end
    end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
glebtv-ckeditor-4.2.1.5 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.2.1.4 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.2.1.3 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.2.1.2 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.2.1.1 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.2.1 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1.7 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1.6 app/controllers/ckeditor/application_controller.rb
ckeditor-4.0.6 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1.5 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1.4 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1.3 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1.2 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1.1 app/controllers/ckeditor/application_controller.rb
glebtv-ckeditor-4.1.1 app/controllers/ckeditor/application_controller.rb
ckeditor-4.0.4 app/controllers/ckeditor/application_controller.rb
ckeditor-4.0.2 app/controllers/ckeditor/application_controller.rb
ckeditor-4.0.1 app/controllers/ckeditor/application_controller.rb