Change ckeditor gem and kaminari in gemfile
This commit is contained in:
1 parent
92faeccdb6
commit
6cf249ccfb
12 files changed
+141
-9
No files matched your search
@@ -8,4 +8,4 @@
|
||||
//= require basic/jquery.nanoscroller.js
|
||||
//= require basic/jquery.easing.1.3.js
|
||||
|
||||
//= require ckeditor-jquery
|
||||
//= require ckeditor/init
|
||||
+6
-2
@@ -22,9 +22,13 @@ CKEDITOR.editorConfig = function( config ) {
|
||||
];
|
||||
config.autoGrow_onStartup = true;
|
||||
config.forcePasteAsPlainText = false;
|
||||
config.filebrowserBrowseUrl = '/browser/browse.php';
|
||||
// config.filebrowserBrowseUrl = '/browser/browse.php';
|
||||
// config.filebrowserImageBrowseUrl = '/browser/browse.php?type=Images';
|
||||
config.filebrowserUploadUrl = '/uploader/upload.php';
|
||||
// config.filebrowserUploadUrl = '/uploader/upload.php';
|
||||
|
||||
config.filebrowserBrowseUrl = "<%= Rails.application.routes.url_helpers.file_upload_admin_assets_path %>"
|
||||
config.filebrowserUploadUrl = "<%= Rails.application.routes.url_helpers.file_upload_admin_assets_path %>"
|
||||
|
||||
config.contentsCss = '/orbit_4.0.1/assets/javascripts/lib/ckeditor/plugins/stylesheetparser/samples/assets/sample.css';
|
||||
|
||||
// Load from a list of definitions.
|
||||
@@ -0,0 +1,7 @@
|
||||
class Ckeditor::Asset
|
||||
include Ckeditor::Orm::Mongoid::AssetBase
|
||||
|
||||
delegate :url, :current_path, :size, :content_type, :filename, :to => :data
|
||||
|
||||
validates_presence_of :data
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
class Ckeditor::AttachmentFile < Ckeditor::Asset
|
||||
mount_uploader :data, CkeditorAttachmentFileUploader, :mount_on => :data_file_name
|
||||
|
||||
def url_thumb
|
||||
@url_thumb ||= Ckeditor::Utils.filethumb(filename)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
class Ckeditor::Picture < Ckeditor::Asset
|
||||
mount_uploader :data, CkeditorPictureUploader, :mount_on => :data_file_name
|
||||
|
||||
def url_content
|
||||
url(:content)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,36 @@
|
||||
# encoding: utf-8
|
||||
class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base
|
||||
include Ckeditor::Backend::CarrierWave
|
||||
|
||||
# Include RMagick or ImageScience support:
|
||||
# include CarrierWave::RMagick
|
||||
# include CarrierWave::MiniMagick
|
||||
# include CarrierWave::ImageScience
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"uploads/ckeditor/attachments/#{model.id}"
|
||||
end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process :scale => [200, 300]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_white_list
|
||||
Ckeditor.attachment_file_types
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,47 @@
|
||||
# encoding: utf-8
|
||||
class CkeditorPictureUploader < CarrierWave::Uploader::Base
|
||||
include Ckeditor::Backend::CarrierWave
|
||||
|
||||
# Include RMagick or ImageScience support:
|
||||
# include CarrierWave::RMagick
|
||||
include CarrierWave::MiniMagick
|
||||
# include CarrierWave::ImageScience
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"uploads/ckeditor/pictures/#{model.id}"
|
||||
end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
# def default_url
|
||||
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
# end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process :scale => [200, 300]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
process :read_dimensions
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
version :thumb do
|
||||
process :resize_to_fill => [118, 100]
|
||||
end
|
||||
|
||||
version :content do
|
||||
process :resize_to_limit => [800, 800]
|
||||
end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
def extension_white_list
|
||||
Ckeditor.image_file_types
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user