kindeditor 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +65 -0
- data/Rakefile +20 -0
- data/VERSION +1 -0
- data/init.rb +2 -0
- data/install.rb +1 -0
- data/kindeditor.gemspec +234 -0
- data/lib/generators/USAGE +8 -0
- data/lib/generators/kindeditor/install_generator.rb +56 -0
- data/lib/generators/kindeditor/templates/README +20 -0
- data/lib/generators/kindeditor/templates/app/controllers/kindeditor_controller.rb +39 -0
- data/lib/generators/kindeditor/templates/app/models/kindeditor_image.rb +13 -0
- data/lib/generators/kindeditor/templates/create_kindeditor_images.rb +15 -0
- data/lib/generators/kindeditor/templates/kindeditor/kindeditor-min.js +168 -0
- data/lib/generators/kindeditor/templates/kindeditor/kindeditor.js +4442 -0
- data/lib/generators/kindeditor/templates/kindeditor/kindeditor_config.js +5 -0
- data/lib/generators/kindeditor/templates/kindeditor/license.txt +1 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/about.html +53 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/advtable/advtable.html +233 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/0.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/1.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/10.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/100.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/101.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/102.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/103.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/104.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/105.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/106.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/107.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/108.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/109.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/11.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/110.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/111.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/112.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/113.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/114.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/115.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/116.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/117.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/118.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/119.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/12.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/120.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/121.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/122.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/123.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/124.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/125.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/126.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/127.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/128.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/129.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/13.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/130.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/131.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/132.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/133.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/134.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/14.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/15.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/16.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/17.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/18.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/19.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/2.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/20.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/21.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/22.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/23.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/24.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/25.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/26.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/27.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/28.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/29.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/3.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/30.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/31.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/32.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/33.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/34.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/35.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/36.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/37.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/38.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/39.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/4.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/40.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/41.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/42.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/43.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/44.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/45.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/46.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/47.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/48.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/49.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/5.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/50.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/51.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/52.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/53.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/54.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/55.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/56.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/57.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/58.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/59.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/6.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/60.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/61.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/62.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/63.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/64.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/65.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/66.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/67.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/68.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/69.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/7.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/70.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/71.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/72.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/73.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/74.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/75.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/76.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/77.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/78.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/79.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/8.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/80.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/81.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/82.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/83.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/84.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/85.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/86.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/87.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/88.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/89.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/9.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/90.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/91.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/92.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/93.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/94.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/95.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/96.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/97.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/98.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/99.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/qq.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/file_manager.css +64 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/file_manager.html +29 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/file_manager.js +220 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/file-16.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/file-64.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/folder-16.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/folder-64.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/go-up.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/flash.html +72 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/image/image.html +268 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/image/images/align_left.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/image/images/align_right.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/image/images/align_top.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/image/images/refresh.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/link/link.html +86 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/media.html +76 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/plainpaste.html +43 -0
- data/lib/generators/kindeditor/templates/kindeditor/plugins/wordpaste.html +50 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/common/blank.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/common/editor.css +47 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/common/flash.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/common/loading.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/common/media.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/common/rm.gif +0 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/default.css +918 -0
- data/lib/generators/kindeditor/templates/kindeditor/skins/default/default.gif +0 -0
- data/lib/generators/kindeditor/templates/mongoid/kindeditor_image.rb +21 -0
- data/lib/kindeditor.rb +9 -0
- data/pkg/kindeditor-0.0.1.gem +0 -0
- data/pkg/kinkdeditor-0.0.1.gem +0 -0
- data/spec/generators/install_generaor_spec.rb +9 -0
- data/spec/kindeditor_spec.rb +7 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +11 -0
- data/uninstall.rb +1 -0
- metadata +269 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 [doabit]
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
Rails KindEditor integration plugin with paperclip support for rails3 Rc,it supports active_record and mongoid!
|
2
|
+
--------------
|
3
|
+
[Kindeditor](http://www.kindsoft.net "Kindeditor") is a open source HTML visual editor ,it can work good in IE, Firefox, Chrome, Safari.and it has become one of the most popular editor in China.
|
4
|
+
|
5
|
+
KindEditor version: 3.5.1 [Kindeditor](http://kindeditor.googlecode.com/files/kindeditor-3.5.1-zh_CN.zip "Kindeditor")
|
6
|
+
|
7
|
+
|
8
|
+
Require:
|
9
|
+
---------------
|
10
|
+
- Rails3
|
11
|
+
- Paperclip(if you use mongoid,make sure your paperclip can work in mongoid,you can edit paperclip.rb in config/initializers)
|
12
|
+
Paperclip.options[:log] = false
|
13
|
+
|
14
|
+
Install
|
15
|
+
---------------
|
16
|
+
- As a plugin
|
17
|
+
rails plugin install git://github.com/doabit/kinkdeditor.git
|
18
|
+
|
19
|
+
- copy files .
|
20
|
+
rails g kindeditor:install
|
21
|
+
|
22
|
+
Usage
|
23
|
+
--------------
|
24
|
+
- kindeditor helper to layout that you want to use it
|
25
|
+
<%=kindeditor_javacript_include_tag%>
|
26
|
+
|
27
|
+
- add a id "kindeditor" to your textarea
|
28
|
+
|
29
|
+
Support options
|
30
|
+
--------------
|
31
|
+
:orm ,default 'active_record'
|
32
|
+
|
33
|
+
Custom
|
34
|
+
--------------
|
35
|
+
The install generator will copy kindeditor_controller.rb to app/controllers , kindeditor_image.rb to app/mondels and kindeditor folder to public/javascripts.
|
36
|
+
|
37
|
+
If you want to mondify the Kindeditor items,you can open public/javascripts/kindeditor/kindeditor_config.js,and modify it for yourself.
|
38
|
+
|
39
|
+
TODOs
|
40
|
+
--------------
|
41
|
+
Add images paginate
|
42
|
+
|
43
|
+
Support CarrierWave
|
44
|
+
|
45
|
+
Example Use:
|
46
|
+
---------------
|
47
|
+
1. Create CRUD for post
|
48
|
+
rails generate scaffold post title:string body:text
|
49
|
+
Run Migrations
|
50
|
+
|
51
|
+
2. rake db:migrate
|
52
|
+
|
53
|
+
3. Add following line to application.html.erb
|
54
|
+
|
55
|
+
<%=kindeditor_javacript_include_tag%>
|
56
|
+
|
57
|
+
4. Modify views/posts/_form.html.erb
|
58
|
+
<%= f.text_area :body,:id => "kindeditor" %>
|
59
|
+
|
60
|
+
|
61
|
+
Contributors
|
62
|
+
---------------------
|
63
|
+
any sugestions? doinsist at gmail.com
|
64
|
+
|
65
|
+
released under the MIT license
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "kindeditor"
|
8
|
+
gem.summary = %Q{Rails KindEditor plugin}
|
9
|
+
gem.description = %Q{Rails KindEditor integration plugin with paperclip support for rails3 Rc,it supports active_record and mongoid!}
|
10
|
+
gem.email = "doinsist@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/doabit/kinkdeditor"
|
12
|
+
gem.authors = ["doabit"]
|
13
|
+
gem.add_development_dependency "paperclip", ">= 2.3.3"
|
14
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
+
end
|
16
|
+
Jeweler::GemcutterTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
|
+
end
|
20
|
+
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.2
|
data/init.rb
ADDED
data/install.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Install hook code here
|
data/kindeditor.gemspec
ADDED
@@ -0,0 +1,234 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{kindeditor}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["doabit"]
|
12
|
+
s.date = %q{2010-08-27}
|
13
|
+
s.description = %q{Rails KindEditor integration plugin with paperclip support for rails3 Rc,it supports active_record and mongoid!}
|
14
|
+
s.email = %q{doinsist@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.md"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
"MIT-LICENSE",
|
20
|
+
"README.md",
|
21
|
+
"Rakefile",
|
22
|
+
"VERSION",
|
23
|
+
"init.rb",
|
24
|
+
"install.rb",
|
25
|
+
"kindeditor.gemspec",
|
26
|
+
"lib/generators/USAGE",
|
27
|
+
"lib/generators/kindeditor/install_generator.rb",
|
28
|
+
"lib/generators/kindeditor/templates/README",
|
29
|
+
"lib/generators/kindeditor/templates/app/controllers/kindeditor_controller.rb",
|
30
|
+
"lib/generators/kindeditor/templates/app/models/kindeditor_image.rb",
|
31
|
+
"lib/generators/kindeditor/templates/create_kindeditor_images.rb",
|
32
|
+
"lib/generators/kindeditor/templates/kindeditor/kindeditor-min.js",
|
33
|
+
"lib/generators/kindeditor/templates/kindeditor/kindeditor.js",
|
34
|
+
"lib/generators/kindeditor/templates/kindeditor/kindeditor_config.js",
|
35
|
+
"lib/generators/kindeditor/templates/kindeditor/license.txt",
|
36
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/about.html",
|
37
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/advtable/advtable.html",
|
38
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/0.gif",
|
39
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/1.gif",
|
40
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/10.gif",
|
41
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/100.gif",
|
42
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/101.gif",
|
43
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/102.gif",
|
44
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/103.gif",
|
45
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/104.gif",
|
46
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/105.gif",
|
47
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/106.gif",
|
48
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/107.gif",
|
49
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/108.gif",
|
50
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/109.gif",
|
51
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/11.gif",
|
52
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/110.gif",
|
53
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/111.gif",
|
54
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/112.gif",
|
55
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/113.gif",
|
56
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/114.gif",
|
57
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/115.gif",
|
58
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/116.gif",
|
59
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/117.gif",
|
60
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/118.gif",
|
61
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/119.gif",
|
62
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/12.gif",
|
63
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/120.gif",
|
64
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/121.gif",
|
65
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/122.gif",
|
66
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/123.gif",
|
67
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/124.gif",
|
68
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/125.gif",
|
69
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/126.gif",
|
70
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/127.gif",
|
71
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/128.gif",
|
72
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/129.gif",
|
73
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/13.gif",
|
74
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/130.gif",
|
75
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/131.gif",
|
76
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/132.gif",
|
77
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/133.gif",
|
78
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/134.gif",
|
79
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/14.gif",
|
80
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/15.gif",
|
81
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/16.gif",
|
82
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/17.gif",
|
83
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/18.gif",
|
84
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/19.gif",
|
85
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/2.gif",
|
86
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/20.gif",
|
87
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/21.gif",
|
88
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/22.gif",
|
89
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/23.gif",
|
90
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/24.gif",
|
91
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/25.gif",
|
92
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/26.gif",
|
93
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/27.gif",
|
94
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/28.gif",
|
95
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/29.gif",
|
96
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/3.gif",
|
97
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/30.gif",
|
98
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/31.gif",
|
99
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/32.gif",
|
100
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/33.gif",
|
101
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/34.gif",
|
102
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/35.gif",
|
103
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/36.gif",
|
104
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/37.gif",
|
105
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/38.gif",
|
106
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/39.gif",
|
107
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/4.gif",
|
108
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/40.gif",
|
109
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/41.gif",
|
110
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/42.gif",
|
111
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/43.gif",
|
112
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/44.gif",
|
113
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/45.gif",
|
114
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/46.gif",
|
115
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/47.gif",
|
116
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/48.gif",
|
117
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/49.gif",
|
118
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/5.gif",
|
119
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/50.gif",
|
120
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/51.gif",
|
121
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/52.gif",
|
122
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/53.gif",
|
123
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/54.gif",
|
124
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/55.gif",
|
125
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/56.gif",
|
126
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/57.gif",
|
127
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/58.gif",
|
128
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/59.gif",
|
129
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/6.gif",
|
130
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/60.gif",
|
131
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/61.gif",
|
132
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/62.gif",
|
133
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/63.gif",
|
134
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/64.gif",
|
135
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/65.gif",
|
136
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/66.gif",
|
137
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/67.gif",
|
138
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/68.gif",
|
139
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/69.gif",
|
140
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/7.gif",
|
141
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/70.gif",
|
142
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/71.gif",
|
143
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/72.gif",
|
144
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/73.gif",
|
145
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/74.gif",
|
146
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/75.gif",
|
147
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/76.gif",
|
148
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/77.gif",
|
149
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/78.gif",
|
150
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/79.gif",
|
151
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/8.gif",
|
152
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/80.gif",
|
153
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/81.gif",
|
154
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/82.gif",
|
155
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/83.gif",
|
156
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/84.gif",
|
157
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/85.gif",
|
158
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/86.gif",
|
159
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/87.gif",
|
160
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/88.gif",
|
161
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/89.gif",
|
162
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/9.gif",
|
163
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/90.gif",
|
164
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/91.gif",
|
165
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/92.gif",
|
166
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/93.gif",
|
167
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/94.gif",
|
168
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/95.gif",
|
169
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/96.gif",
|
170
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/97.gif",
|
171
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/98.gif",
|
172
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/99.gif",
|
173
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/emoticons/qq.gif",
|
174
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/file_manager.css",
|
175
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/file_manager.html",
|
176
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/file_manager.js",
|
177
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/file-16.gif",
|
178
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/file-64.gif",
|
179
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/folder-16.gif",
|
180
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/folder-64.gif",
|
181
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/file_manager/images/go-up.gif",
|
182
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/flash.html",
|
183
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/image/image.html",
|
184
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/image/images/align_left.gif",
|
185
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/image/images/align_right.gif",
|
186
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/image/images/align_top.gif",
|
187
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/image/images/refresh.gif",
|
188
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/link/link.html",
|
189
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/media.html",
|
190
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/plainpaste.html",
|
191
|
+
"lib/generators/kindeditor/templates/kindeditor/plugins/wordpaste.html",
|
192
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/common/blank.gif",
|
193
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/common/editor.css",
|
194
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/common/flash.gif",
|
195
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/common/loading.gif",
|
196
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/common/media.gif",
|
197
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/common/rm.gif",
|
198
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/default.css",
|
199
|
+
"lib/generators/kindeditor/templates/kindeditor/skins/default/default.gif",
|
200
|
+
"lib/generators/kindeditor/templates/mongoid/kindeditor_image.rb",
|
201
|
+
"lib/kindeditor.rb",
|
202
|
+
"pkg/kindeditor-0.0.1.gem",
|
203
|
+
"pkg/kinkdeditor-0.0.1.gem",
|
204
|
+
"spec/generators/install_generaor_spec.rb",
|
205
|
+
"spec/kindeditor_spec.rb",
|
206
|
+
"spec/spec.opts",
|
207
|
+
"spec/spec_helper.rb",
|
208
|
+
"uninstall.rb"
|
209
|
+
]
|
210
|
+
s.homepage = %q{http://github.com/doabit/kinkdeditor}
|
211
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
212
|
+
s.require_paths = ["lib"]
|
213
|
+
s.rubygems_version = %q{1.3.7}
|
214
|
+
s.summary = %q{Rails KindEditor plugin}
|
215
|
+
s.test_files = [
|
216
|
+
"spec/generators/install_generaor_spec.rb",
|
217
|
+
"spec/kindeditor_spec.rb",
|
218
|
+
"spec/spec_helper.rb"
|
219
|
+
]
|
220
|
+
|
221
|
+
if s.respond_to? :specification_version then
|
222
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
223
|
+
s.specification_version = 3
|
224
|
+
|
225
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
226
|
+
s.add_development_dependency(%q<paperclip>, [">= 2.3.3"])
|
227
|
+
else
|
228
|
+
s.add_dependency(%q<paperclip>, [">= 2.3.3"])
|
229
|
+
end
|
230
|
+
else
|
231
|
+
s.add_dependency(%q<paperclip>, [">= 2.3.3"])
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Kindeditor
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
include Rails::Generators::Migration
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
desc "Copies all kindeditor files to your Rails.root/public/kindeditor."
|
6
|
+
class_option :orm, :type => :string, :aliases => "-o", :default => "active_record",
|
7
|
+
:desc => "Orm for rails,'active_record' or 'mongoid'."
|
8
|
+
|
9
|
+
def copy_kindeditor
|
10
|
+
src_dir = File.join(self.class.source_root, 'kindeditor')
|
11
|
+
dst_dir="#{Rails.root}/public/javascripts/kindeditor"
|
12
|
+
directory src_dir, dst_dir
|
13
|
+
end
|
14
|
+
|
15
|
+
def copy_app
|
16
|
+
copy_controller
|
17
|
+
copy_model
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_rotes
|
21
|
+
route "post 'kindeditor/upload'"
|
22
|
+
route "get 'kindeditor/images_list'"
|
23
|
+
end
|
24
|
+
|
25
|
+
def read_me
|
26
|
+
readme "README" if behavior == :invoke
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.next_migration_number(dirname)
|
30
|
+
if ActiveRecord::Base.timestamped_migrations
|
31
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S")
|
32
|
+
else
|
33
|
+
"%.3d" % (current_migration_number(dirname) + 1)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
protected
|
38
|
+
def copy_controller
|
39
|
+
template 'app/controllers/kindeditor_controller.rb',"app/controllers/kindeditor_controller.rb"
|
40
|
+
end
|
41
|
+
|
42
|
+
def copy_model
|
43
|
+
case options[:orm].to_s
|
44
|
+
when "active_record"
|
45
|
+
template 'app/models/kindeditor_image.rb',"app/models/kindeditor_image.rb"
|
46
|
+
copy_migration
|
47
|
+
when "mongoid"
|
48
|
+
template 'mongoid/kindeditor_image.rb','app/models/kindeditor_image.rb'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def copy_migration
|
53
|
+
migration_template "create_kindeditor_images.rb", "db/migrate/create_kindeditor_images.rb"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
===============================================================================
|
2
|
+
|
3
|
+
The generator had installed kindeditor to your application's public path:
|
4
|
+
|
5
|
+
1. If you want to use kindeditor,you can add kindeditor helper to layout,and add a id "kindeditor" to your textarea:
|
6
|
+
For example:
|
7
|
+
in application.html.erb
|
8
|
+
<%=kindeditor_javacript_include_tag%>
|
9
|
+
|
10
|
+
in _form.html.erb
|
11
|
+
<%= f.text_area :body,:id => "kindeditor" %>
|
12
|
+
|
13
|
+
2. Because the kindeditor use paperclip to upload image,so make sure your Gemfile have add paperclip.
|
14
|
+
For example:
|
15
|
+
|
16
|
+
gem 'paperclip'
|
17
|
+
|
18
|
+
3. If you want to modify the kindeditor config,you can find it in public/kindeditor/kindeditor_config.js:
|
19
|
+
|
20
|
+
===============================================================================
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class KindeditorController < ApplicationController
|
2
|
+
protect_from_forgery :except => :upload
|
3
|
+
|
4
|
+
def upload
|
5
|
+
@image = KindeditorImage.new(:data => params[:imgFile])
|
6
|
+
if @image.save
|
7
|
+
render :text => {"error" => 0, "url" => @image.data.url}.to_json
|
8
|
+
else
|
9
|
+
render :text => {"error" => 1}
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def images_list
|
14
|
+
<%
|
15
|
+
case options[:orm].to_s
|
16
|
+
when 'active_record'
|
17
|
+
order="@images=KindeditorImage.order(order_param)"
|
18
|
+
when 'mongoid'
|
19
|
+
order="@images=KindeditorImage.asc(order_param)"
|
20
|
+
end
|
21
|
+
%>
|
22
|
+
<%=order%>
|
23
|
+
@json = []
|
24
|
+
for image in @images
|
25
|
+
temp = %Q/{"filesize" : #{image.data.size},
|
26
|
+
"filename" : "#{image.data_file_name}",
|
27
|
+
"dir_path" : "#{image.data.url}",
|
28
|
+
"datetime" : "#{image.created_at}"}/
|
29
|
+
@json << temp
|
30
|
+
end
|
31
|
+
render :text => ("{\"file_list\":[" << @json.join(", ") << "]}")
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def order_param
|
37
|
+
params[:order] || "data_file_name"
|
38
|
+
end
|
39
|
+
end
|