Module: Ckeditor

Defined in:
lib/ckeditor.rb,
lib/ckeditor/http.rb,
lib/ckeditor/utils.rb,
lib/ckeditor/engine.rb,
lib/ckeditor/version.rb,
lib/ckeditor/orm/base.rb,
lib/ckeditor/orm/mongoid.rb,
lib/ckeditor/backend/dragonfly.rb,
lib/ckeditor/backend/paperclip.rb,
lib/ckeditor/orm/active_record.rb,
lib/ckeditor/backend/carrierwave.rb,
lib/ckeditor/helpers/controllers.rb,
lib/ckeditor/helpers/form_helper.rb,
lib/ckeditor/helpers/view_helper.rb,
lib/ckeditor/helpers/form_builder.rb,
lib/generators/ckeditor/install_generator.rb

Defined Under Namespace

Modules: Backend, Generators, Helpers, Hooks, Http, Orm, Utils, Version Classes: ApplicationController, Asset, AttachmentFile, AttachmentFilesController, Engine, Picture, PicturesController

Constant Summary collapse

IMAGE_TYPES =
['image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/pjpeg', 'image/tiff', 'image/x-png']
@@image_file_types =
["jpg", "jpeg", "png", "gif", "tiff"]
@@attachment_file_types =
["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "tar.gz", "swf"]
@@relative_path =
'/assets/ckeditor'
@@assets =
nil

Class Method Summary collapse

Class Method Details

.assetsObject



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/ckeditor.rb', line 55

def self.assets
  @@assets ||= begin
    Dir[root_path.join('vendor/assets/javascripts/ckeditor/**', '*.{js,css}')].inject([]) do |list, path|
      unless path.include?("/ckeditor/filebrowser/")
        list << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/javascripts'))
      end
      
      list
    end
  end
end

.attachment_file_modelObject



71
72
73
# File 'lib/ckeditor.rb', line 71

def self.attachment_file_model
  Ckeditor::AttachmentFile.to_adapter
end

.picture_modelObject



67
68
69
# File 'lib/ckeditor.rb', line 67

def self.picture_model
  Ckeditor::Picture.to_adapter
end

.root_pathObject



51
52
53
# File 'lib/ckeditor.rb', line 51

def self.root_path
  @root_path ||= Pathname.new( File.dirname(File.expand_path('../', __FILE__)) )
end

.setup {|_self| ... } ⇒ Object

Default way to setup Ckeditor. Run rails generate ckeditor to create a fresh initializer with all configuration values.

Yields:

  • (_self)

Yield Parameters:

  • _self (Ckeditor)

    the object that the method was called on



47
48
49
# File 'lib/ckeditor.rb', line 47

def self.setup
  yield self
end