rich 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc
CHANGED
@@ -149,7 +149,7 @@ Rich also includes a few settings that manipulate CKEditor settings, but are a b
|
|
149
149
|
|
150
150
|
When you run the generator a css file is created for you in <tt>app/assets/stylesheets/rich/editor.css</tt>. Use this stylesheet to define the contents of the Styles drop down in CKEditor.
|
151
151
|
|
152
|
-
=== Image configuration
|
152
|
+
=== Image configuration & (re)processing
|
153
153
|
|
154
154
|
The styles you define in the initializer are passed to Paperclip directly, so the syntax is identical. See https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation for more information.
|
155
155
|
|
@@ -30,7 +30,7 @@ rich.Browser.prototype = {
|
|
30
30
|
initStyles: function(opt, def) {
|
31
31
|
opt=opt.split(',');
|
32
32
|
$.each(opt, function(index, value) {
|
33
|
-
|
33
|
+
if(value != 'rich_thumb') $('#styles').append("<li class='scope' id='style-"+value+"' data-rich-style='"+value+"'>"+value+"</li>");
|
34
34
|
});
|
35
35
|
|
36
36
|
browser.selectStyle(def);
|
@@ -10,13 +10,12 @@ if Object.const_defined?("Rich")
|
|
10
10
|
#
|
11
11
|
# For example, the elements available in the formats
|
12
12
|
# dropdown are defined like this:
|
13
|
-
# config.editor[:
|
13
|
+
# config.editor[:format_tags] = "h3;p;pre"
|
14
14
|
#
|
15
15
|
# By default, Rich visualizes what type of element
|
16
16
|
# you are editing. To disable this:
|
17
17
|
# config.editor[:startupOutlineBlocks] = false
|
18
18
|
|
19
|
-
|
20
19
|
# == Image styles
|
21
20
|
#
|
22
21
|
# Rich uses paperclip for image processing. You can
|
@@ -25,8 +24,8 @@ if Object.const_defined?("Rich")
|
|
25
24
|
# See: https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation
|
26
25
|
#
|
27
26
|
# When you change these after uploading some files,
|
28
|
-
# remember to
|
29
|
-
# rake
|
27
|
+
# remember to re-generate your styles by running:
|
28
|
+
# rake rich:refresh_assets
|
30
29
|
config.image_styles = {
|
31
30
|
:thumb => "100x100#"
|
32
31
|
}
|
@@ -49,36 +48,36 @@ if Object.const_defined?("Rich")
|
|
49
48
|
# the unprocessed file. Make sure this style exists.
|
50
49
|
config.default_style = :thumb
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
# == Upload non-image files
|
52
|
+
#
|
53
|
+
# Setting this option to true will add a second Rich filebrowser icon to
|
54
|
+
# the editor toolbar. In this filebrowser you can upload non-image files.
|
55
|
+
# Inserting these files into your editor will result in a direct (A) link.
|
56
|
+
#
|
57
|
+
# Default:
|
58
|
+
# config.allow_document_uploads = false
|
60
59
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
60
|
+
# == Set allowed filetypes for non-image files
|
61
|
+
#
|
62
|
+
# If you want, you can restrict the types of documents that users can upload.
|
63
|
+
# Default behavior is to allow any kind of file to be uploaded. You can set
|
64
|
+
# the accepted types by providing an array of mimetypes to check against.
|
65
|
+
# Note that for this to have any effect, you first need to enable document
|
66
|
+
# uploads using the setting above.
|
67
|
+
#
|
68
|
+
# Default, allow any file to be uploaded:
|
69
|
+
# config.allowed_document_types = :all
|
70
|
+
#
|
71
|
+
# Example, only allow PDF uploads:
|
72
|
+
# config.allowed_document_types = ['application/pdf']
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
74
|
+
# == Asset insertion
|
75
|
+
#
|
76
|
+
# Set this to true to keep the filebrowser open after inserting an asset.
|
77
|
+
# Also configurable per-use from within the filebrowser.
|
78
|
+
#
|
79
|
+
# Default:
|
80
|
+
# config.insert_many = false
|
82
81
|
|
83
82
|
# == User Authentication
|
84
83
|
#
|
data/lib/rich.rb
CHANGED
@@ -7,12 +7,18 @@ require "rich/engine"
|
|
7
7
|
|
8
8
|
module Rich
|
9
9
|
|
10
|
-
#
|
11
|
-
|
10
|
+
# configure image styles
|
11
|
+
def self.image_styles
|
12
|
+
@@image_styles.merge({ :rich_thumb => "100x100#" })
|
13
|
+
end
|
14
|
+
def self.image_styles=(image_styles)
|
15
|
+
@@image_styles = image_styles
|
16
|
+
end
|
12
17
|
@@image_styles = {
|
13
18
|
:thumb => "100x100#"
|
14
19
|
}
|
15
20
|
|
21
|
+
|
16
22
|
mattr_accessor :allowed_styles
|
17
23
|
@@allowed_styles = :all
|
18
24
|
|
@@ -122,10 +128,10 @@ module Rich
|
|
122
128
|
editor_options
|
123
129
|
|
124
130
|
end
|
125
|
-
|
131
|
+
|
126
132
|
def self.validate_mime_type(mime, simplified_type)
|
127
133
|
# does the mimetype match the given simplified type?
|
128
|
-
puts "matching:" + mime + " TO " + simplified_type
|
134
|
+
#puts "matching:" + mime + " TO " + simplified_type
|
129
135
|
|
130
136
|
false # assume the worst
|
131
137
|
|
data/lib/rich/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rich
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bastiaan Terhorst
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-02-
|
18
|
+
date: 2012-02-12 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|