forked from galetahub/ckeditor
/
ckeditor.rb
52 lines (41 loc) · 1.56 KB
/
ckeditor.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require 'orm_adapter'
module Ckeditor
IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/pjpeg', 'image/tiff', 'image/x-png']
autoload :Utils, 'ckeditor/utils'
autoload :Http, 'ckeditor/http'
module Helpers
autoload :ViewHelper, 'ckeditor/helpers/view_helper'
autoload :FormHelper, 'ckeditor/helpers/form_helper'
autoload :FormBuilder, 'ckeditor/helpers/form_builder'
autoload :Controllers, 'ckeditor/helpers/controllers'
end
module Hooks
autoload :FormtasticBuilder, 'ckeditor/hooks/formtastic'
autoload :SimpleFormBuilder, 'ckeditor/hooks/simple_form'
end
module Backend
autoload :Paperclip, 'ckeditor/backend/paperclip'
autoload :CarrierWave, 'ckeditor/backend/carrierwave'
end
# Allowed image file types for upload.
# Set to nil or [] (empty array) for all file types
mattr_accessor :image_file_types
@@image_file_types = ["jpg", "jpeg", "png", "gif", "tiff"]
# Allowed attachment file types for upload.
# Set to nil or [] (empty array) for all file types
mattr_accessor :attachment_file_types
@@attachment_file_types = ["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "tar.gz", "swf"]
# Default way to setup Ckeditor. Run rails generate ckeditor to create
# a fresh initializer with all configuration values.
def self.setup
yield self
end
def self.picture_model
Ckeditor::Picture.to_adapter
end
def self.attachment_file_model
Ckeditor::AttachmentFile.to_adapter
end
end
require 'ckeditor/engine'
require 'ckeditor/version'