Skip to content

Commit

Permalink
Update ckeditor
Browse files Browse the repository at this point in the history
  • Loading branch information
madyankin committed Jun 9, 2014
1 parent 02cec78 commit 7cc5d1a
Show file tree
Hide file tree
Showing 339 changed files with 8,610 additions and 1,470 deletions.
56 changes: 28 additions & 28 deletions lib/rich.rb
Expand Up @@ -20,28 +20,28 @@ def self.image_styles=(image_styles)

mattr_accessor :convert_options
@@convert_options = {}

mattr_accessor :allowed_styles
@@allowed_styles = :all

mattr_accessor :default_style
@@default_style = :thumb

mattr_accessor :authentication_method
@@authentication_method = :none

mattr_accessor :insert_many
@@insert_many = false

mattr_accessor :allow_document_uploads
@@allow_document_uploads = false

mattr_accessor :allow_embeds
@@allow_embeds = false

mattr_accessor :allowed_image_types
@@allowed_image_types = ['image/jpeg', 'image/png', 'image/gif', 'image/jpg']

mattr_accessor :allowed_document_types
@@allowed_document_types = :all

Expand All @@ -67,7 +67,7 @@ def self.image_styles=(image_styles)
@@editor = {
:height => 400,
:stylesSet => [],
:extraPlugins => 'stylesheetparser,richfile,MediaEmbed',
:extraPlugins => 'stylesheetparser,richfile,MediaEmbed,showblocks',
:removePlugins => 'scayt,menubutton,image,forms',
:contentsCss => :default,
:removeDialogTabs => 'link:advanced;link:target',
Expand All @@ -83,17 +83,17 @@ def self.image_styles=(image_styles)

mattr_accessor :paginates_per
@@paginates_per = 34

def self.options(overrides={}, scope_type=nil, scope_id=nil)
# merge in editor settings configured elsewhere

if(self.allowed_styles == :all)
# replace :all with a list of the actual styles that are present
all_styles = Rich.image_styles.keys
all_styles.push(:original)
self.allowed_styles = all_styles
end

base = {
:allowed_styles => self.allowed_styles,
:default_style => self.default_style,
Expand All @@ -106,7 +106,7 @@ def self.options(overrides={}, scope_type=nil, scope_id=nil)
:paginates_per => self.paginates_per
}
editor_options = self.editor.merge(base)

# merge in local overrides
editor_options.merge!(overrides) if overrides

Expand All @@ -116,33 +116,33 @@ def self.options(overrides={}, scope_type=nil, scope_id=nil)

# update the language to the currently selected locale
editor_options[:language] = I18n.locale

# remove the filebrowser if allow_document_uploads is false (the default)
unless editor_options[:allow_document_uploads]
editor_options[:toolbar].map{|a| a.delete 'richFile'; a}
end

unless editor_options[:allow_embeds]
editor_options[:toolbar].map{|a| a.delete 'MediaEmbed'; a}
end

# object scoping
# todo: support scoped=string to scope to collections, set id to 0
unless editor_options[:scoped] == nil

# true signifies object level scoping
if editor_options[:scoped] == true

if(scope_type != nil && scope_id != nil)
editor_options[:scope_type] = scope_type
editor_options[:scope_id] = scope_id
else
# cannot scope new objects
editor_options[:scoped] = false
end

else

# not true (but also not nil) signifies scoping to a collection
if(scope_type != nil)
editor_options[:scope_type] = editor_options[:scoped]
Expand All @@ -151,20 +151,20 @@ def self.options(overrides={}, scope_type=nil, scope_id=nil)
else
editor_options[:scoped] = false
end

end
end

editor_options

end

def self.validate_mime_type(mime, simplified_type)
# does the mimetype match the given simplified type?
#puts "matching:" + mime + " TO " + simplified_type

false # assume the worst

if simplified_type == "image"
if allowed_image_types.include?(mime)
true
Expand All @@ -175,11 +175,11 @@ def self.validate_mime_type(mime, simplified_type)
end
end
end

def self.setup
yield self
end

def self.insert
# manually inject into Formtastic 1. V2 is extended autmatically.
if Object.const_defined?("Formtastic")
Expand All @@ -195,5 +195,5 @@ def self.insert
require 'rich/backends/carrierwave'
end
end

end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vendor/assets/images/ckeditor/plugins/icons.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vendor/assets/images/ckeditor/plugins/link/images/anchor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 25 additions & 26 deletions vendor/assets/javascripts/ckeditor/build-config.js
@@ -1,28 +1,27 @@

/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/

/**
* This file was added automatically by CKEditor builder.
* You may re-use it at any time at http://ckeditor.com/builder to build CKEditor again.
*
* NOTE:
* This file is not used by CKEditor, you may remove it.
* Changing this file will not change your CKEditor configuration.
*/

var CKBUILDER_CONFIG = {
skin: 'moono',
preset: 'full',
ignore: [
'dev',
'.gitignore',
'.gitattributes',
'README.md',
'.mailmap'
],
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/

/**
* This file was added automatically by CKEditor builder.
* You may re-use it at any time at http://ckeditor.com/builder to build CKEditor again.
*
* NOTE:
* This file is not used by CKEditor, you may remove it.
* Changing this file will not change your CKEditor configuration.
*/

var CKBUILDER_CONFIG = {
skin: 'moono',
preset: 'full',
ignore: [
'dev',
'.gitignore',
'.gitattributes',
'README.md',
'.mailmap'
],
plugins : {
'about' : 1,
'a11yhelp' : 1,
Expand Down Expand Up @@ -100,4 +99,4 @@ var CKBUILDER_CONFIG = {
languages : {
'en' : 1,
}
};
};

0 comments on commit 7cc5d1a

Please sign in to comment.