redactor-rails 0.2.4 → 0.2.5
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.md +10 -3
- data/lib/redactor-rails/configuration.rb +2 -13
- data/lib/redactor-rails/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -26,10 +26,17 @@ Or install it yourself as:
|
|
26
26
|
$ rails generate redactor:install
|
27
27
|
|
28
28
|
$ rake db:migrate
|
29
|
-
Create a `config/redactor.yml` file with your global configuration options:
|
29
|
+
Create a `config/redactor.yml` file with your global configuration options, like:
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
lang: 'zh_tw'
|
32
|
+
autoresize: true
|
33
|
+
buttons:
|
34
|
+
- html
|
35
|
+
- '|'
|
36
|
+
- formatting
|
37
|
+
- '|'
|
38
|
+
- bold
|
39
|
+
- italic
|
33
40
|
|
34
41
|
If You Want To setup a new language in Redactor you should do two things:
|
35
42
|
|
@@ -19,20 +19,9 @@ module RedactorRails
|
|
19
19
|
@options = options
|
20
20
|
end
|
21
21
|
|
22
|
-
def options_for_redactor
|
23
|
-
result = {}
|
24
|
-
|
25
|
-
options.each do |key, value|
|
26
|
-
if value.is_a?(Array) && value.all? { |v| v.is_a?(String) }
|
27
|
-
result[key] = value.join(",")
|
28
|
-
elsif value.to_s.starts_with?("function(")
|
29
|
-
result[key] = Function.new(value)
|
30
|
-
else
|
31
|
-
result[key] = value
|
32
|
-
end
|
33
|
-
end
|
34
22
|
|
35
|
-
|
23
|
+
def options_for_redactor
|
24
|
+
options
|
36
25
|
end
|
37
26
|
|
38
27
|
def merge(options)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redactor-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 5
|
10
|
+
version: 0.2.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sammy
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-17 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: mime-types
|