module Ckeditor
Constants
- AUTHORIZATION_ADAPTERS
- DEFAULT_AUTHORIZE
- DEFAULT_CURRENT_USER
- IMAGE_TYPES
Public Class Methods
assets()
click to toggle source
All css and js files from ckeditor folder
# File lib/ckeditor.rb, line 119 def self.assets @@assets ||= if Ckeditor.cdn_enabled? ["ckeditor/config.js"] else Utils.select_assets("ckeditor", "vendor/assets/javascripts") << "ckeditor/init.js" end end
attachment_file_adapter()
click to toggle source
# File lib/ckeditor.rb, line 177 def self.attachment_file_adapter attachment_file_model.to_adapter end
attachment_file_model(&block)
click to toggle source
# File lib/ckeditor.rb, line 158 def self.attachment_file_model(&block) if block_given? self.attachment_file_model = block else @@attachment_file_model_class ||= begin if @@attachment_file_model.respond_to? :call @@attachment_file_model.call else @@attachment_file_model || Ckeditor::AttachmentFile end end end end
attachment_file_model=(value)
click to toggle source
# File lib/ckeditor.rb, line 172 def self.attachment_file_model=(value) @@attachment_file_model_class = nil @@attachment_file_model = value end
base_path()
click to toggle source
# File lib/ckeditor.rb, line 114 def self.base_path @base_path ||= (asset_path || File.join([Rails.application.config.assets.prefix, '/ckeditor/'])) end
cdn_enabled?()
click to toggle source
# File lib/ckeditor.rb, line 131 def self.cdn_enabled? !@@cdn_url.nil? end
current_user_method(&block)
click to toggle source
Setup a different method to determine the current user or admin logged in. This is run inside the controller instance and made available as a helper.
By default, request.env.user or current_user will be used.
@example Custom
Ckeditor.setup do |config| config.current_user_method do current_account end end
# File lib/ckeditor.rb, line 227 def self.current_user_method(&block) @current_user = block if block @current_user || DEFAULT_CURRENT_USER end
picture_adapter()
click to toggle source
# File lib/ckeditor.rb, line 154 def self.picture_adapter picture_model.to_adapter end
picture_model(&block)
click to toggle source
# File lib/ckeditor.rb, line 135 def self.picture_model(&block) if block_given? self.picture_model = block else @@picture_model_class ||= begin if @@picture_model.respond_to? :call @@picture_model.call else @@picture_model || Ckeditor::Picture end end end end
picture_model=(value)
click to toggle source
# File lib/ckeditor.rb, line 149 def self.picture_model=(value) @@picture_model_class = nil @@picture_model = value end
root_path()
click to toggle source
# File lib/ckeditor.rb, line 110 def self.root_path @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__))) end
run_on_precompile?()
click to toggle source
# File lib/ckeditor.rb, line 127 def self.run_on_precompile? @@run_on_precompile end
setup() { |self| ... }
click to toggle source
Default way to setup Ckeditor
. Run rails generate ckeditor to create a fresh initializer with all configuration values.
@example
Ckeditor.setup do |config| config.parameterize_filenames = false config.attachment_file_types += ["xml"] end
# File lib/ckeditor.rb, line 106 def self.setup yield self end