ueditor-rails 1.2.5.1 → 1.2.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -14,4 +14,4 @@ rdoc
14
14
  spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
- tmp
17
+ tmp
data/README.md CHANGED
@@ -1,49 +1,52 @@
1
- ueditor-rails
2
- ======
1
+ Rails 3.1 Integration for Ueditor
2
+ =================================
3
3
 
4
- Ueditor is a great rich text editor from [Baidu Ueditor ](http://ueditor.baidu.com/website/). This gem integrates Ueditor for Rails project.
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
- Installation
7
+ Instructions
8
8
  ------------
9
9
 
10
- Add `ueditor-rails` to you Gemfile.
10
+ **1. Add `ueditor-rails` to your Gemfile**
11
11
 
12
- ``` ruby
13
- gem 'ueditor-rails'
14
- ```
12
+ gem 'ueditor-rails'
15
13
 
16
- **Sync ueditor**
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
- ``` ruby
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
- Example Rails Helper
31
- --------------------
23
+ //= require ueditor
32
24
 
33
- This would allow emojifying content such as: `it's raining :cats: and :dogs:!`
34
25
 
35
- See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.
26
+ (2) The Ueditor assets can be included on a per-page basis using js:
36
27
 
37
- ```ruby
38
- module EmojiHelper
39
- def emojify(content)
40
- h(content).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
41
- if Emoji.names.include?($1)
42
- '<img alt="' + $1 + '" height="20" src="' + asset_path("emoji/#{$1}.png") + '" style="vertical-align:middle" width="20" />'
43
- else
44
- match
45
- end
46
- end.html_safe if content.present?
47
- end
48
- end
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`).
@@ -1,9 +1,6 @@
1
1
  module Ueditor
2
2
  module Rails
3
3
  require 'ueditor/rails/engine'
4
- require 'ueditor/rails/version'
5
- require "ueditor/rails/configuration"
6
- require "ueditor/rails/helper"
7
-
4
+ require 'ueditor/rails/version'
8
5
  end
9
6
  end
@@ -1,6 +1,6 @@
1
1
  module Ueditor
2
2
  module Rails
3
- VERSION = "1.2.5.1"
3
+ VERSION = "1.2.5.3"
4
4
  TINYMCE_VERSION = "1.2.5.0"
5
5
  end
6
6
  end
@@ -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.1
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: []