ueditor-rails 1.2.5.1 → 1.2.5.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/.gitignore +1 -1
- data/README.md +37 -34
- data/lib/ueditor/rails.rb +1 -4
- data/lib/ueditor/rails/version.rb +1 -1
- data/ueditor-rails.gemspec +1 -1
- data/vendor/assets/javascripts/ueditor/editor_config.js +1 -1
- metadata +2 -2
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,49 +1,52 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
Rails 3.1 Integration for Ueditor
|
2
|
+
=================================
|
3
3
|
|
4
|
-
|
4
|
+
The `ueditor-rails` gem integrates the [Ueditor](http://ueditor.baidu.com/website/) editor with the Rails 3.1 asset pipeline.
|
5
5
|
|
6
6
|
|
7
|
-
|
7
|
+
Instructions
|
8
8
|
------------
|
9
9
|
|
10
|
-
Add `ueditor-rails` to
|
10
|
+
**1. Add `ueditor-rails` to your Gemfile**
|
11
11
|
|
12
|
-
|
13
|
-
gem 'ueditor-rails'
|
14
|
-
```
|
12
|
+
gem 'ueditor-rails'
|
15
13
|
|
16
|
-
|
14
|
+
Be sure to add to the global group, not the `assets` group. Then run `bundle install`.
|
17
15
|
|
18
|
-
Ueditor has many js, css, image files, so this gem doesn't follow the Rails 3.1 Asset Pipeline design, it will just copy Ueditor to your public directory with `rake ueditor` in your app.
|
19
16
|
|
20
|
-
|
21
|
-
# Rakefile
|
22
|
-
load 'tasks/ueditor.rake'
|
23
|
-
```
|
17
|
+
**2. Include the Ueditor assets**
|
24
18
|
|
25
|
-
|
26
|
-
$ rake ueditor
|
27
|
-
```
|
19
|
+
Use *one* of the following options to include Ueditor assets.
|
28
20
|
|
21
|
+
(1) Add to your application.js:
|
29
22
|
|
30
|
-
|
31
|
-
--------------------
|
23
|
+
//= require ueditor
|
32
24
|
|
33
|
-
This would allow emojifying content such as: `it's raining :cats: and :dogs:!`
|
34
25
|
|
35
|
-
|
26
|
+
(2) The Ueditor assets can be included on a per-page basis using js:
|
36
27
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
28
|
+
<script type="text/javascript" src="/assets/ueditor.js">
|
29
|
+
|
30
|
+
|
31
|
+
**3. Initialize Ueditor**
|
32
|
+
|
33
|
+
For each textarea that you want to use with Ueditor, add the "ueditor" with a unique ID:
|
34
|
+
|
35
|
+
<%= text_area_tag :editor, "", :id => "myEditor", :rows => 40, :cols => 120 %>
|
36
|
+
|
37
|
+
<script type="text/javascript">
|
38
|
+
UE.getEditor('myEditor', {initialFrameWidth:650})
|
39
|
+
</script>
|
40
|
+
|
41
|
+
Ueditor has many options and plugins, the document is here [Ueditor document](http://ueditor.baidu.com/website/document.html) .
|
42
|
+
|
43
|
+
Using ueditor-rails as an Engine Dependency
|
44
|
+
-------------------------------------------
|
45
|
+
|
46
|
+
Ensure that you explicitly require `ueditor-rails` within your engine file. Including ueditor-rails as a dependency in your gemspec is not enough.
|
47
|
+
|
48
|
+
|
49
|
+
Updating
|
50
|
+
--------
|
51
|
+
|
52
|
+
When new versions of Ueditor are released, simply update the `ueditor-rails` gem to the latest version. There is no need to run any extra rake tasks (apart from `rake assets:precompile`).
|
data/lib/ueditor/rails.rb
CHANGED
data/ueditor-rails.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["dave@liageren.com"]
|
11
11
|
gem.description = %q{Seamlessly integrates Ueditor into the Rails asset pipeline introduced in Rails 3.1.}
|
12
12
|
gem.summary = %q{Rails asset pipeline integration for Ueditor.}
|
13
|
-
gem.homepage = ""
|
13
|
+
gem.homepage = "https://github.com/daveliu/ueditor-rails"
|
14
14
|
|
15
15
|
|
16
16
|
gem.files = `git ls-files`.split($/)
|
@@ -25,7 +25,7 @@
|
|
25
25
|
* 此处配置写法适用于UEditor小组成员开发使用,外部部署用户请按照上述说明方式配置即可,建议保留下面两行,以兼容可在具体每个页面配置window.UEDITOR_HOME_URL的功能。
|
26
26
|
*/
|
27
27
|
var tmp = location.protocol.indexOf("file")==-1 ? location.pathname : location.href;
|
28
|
-
URL = window.UEDITOR_HOME_URL||tmp.substr(0,tmp.lastIndexOf("\/")+1).replace("_examples/","").replace("website/","");//这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径)
|
28
|
+
URL = "/ueditor/"; //window.UEDITOR_HOME_URL||tmp.substr(0,tmp.lastIndexOf("\/")+1).replace("_examples/","").replace("website/","");//这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径)
|
29
29
|
|
30
30
|
/**
|
31
31
|
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ueditor-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.5.
|
4
|
+
version: 1.2.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -132,7 +132,7 @@ files:
|
|
132
132
|
- vendor/assets/javascripts/ueditor/themes/default/images/wordpaste.png
|
133
133
|
- vendor/assets/javascripts/ueditor/themes/iframe.css
|
134
134
|
- vendor/assets/javascripts/ueditor/uparse.js
|
135
|
-
homepage:
|
135
|
+
homepage: https://github.com/daveliu/ueditor-rails
|
136
136
|
licenses: []
|
137
137
|
post_install_message:
|
138
138
|
rdoc_options: []
|