hobo_ckeditor 0.0.8 → 0.0.9
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/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/hobo_ck_editor.rb +53 -0
- data/lib/hobo_ckeditor/railtie.rb +2 -2
- data/lib/hobo_ckeditor/types/ck_editor_text.rb +0 -13
- data/taglibs/inputs/input_for_cktext.dryml +9 -2
- data/test/dummy/config/application.rb +1 -1
- data/test/hobo_ckeditor_test.rb +1 -1
- metadata +4 -4
- data/lib/hobo_ckeditor.rb +0 -22
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'ckeditor'
|
2
|
+
require 'hobo_fields'
|
3
|
+
require 'hobo_rapid'
|
4
|
+
require 'hobo_ck_editor'
|
5
|
+
require 'hobo_ckeditor/types/ck_editor_text'
|
6
|
+
|
7
|
+
module HoboCKEditor
|
8
|
+
|
9
|
+
VERSION = File.read(File.expand_path('../../VERSION', __FILE__)).strip
|
10
|
+
|
11
|
+
DEFAULT_EDITOR_SETTINGS = {
|
12
|
+
:plugins => 'dialogui,dialog,about,a11yhelp,basicstyles,blockquote,clipboard,colordialog,colorbutton,panel,floatpanel,menu,contextmenu,resize,button,toolbar,elementspath,list,indent,enterkey,entities,popup,filebrowser,floatingspace,listblock,richcombo,format,htmlwriter,horizontalrule,wysiwygarea,image,fakeobjects,link,magicline,maximize,pastetext,pastefromword,removeformat,sourcearea,specialchar,menubutton,scayt,stylescombo,tab,table,tabletools,undo,wsc',
|
13
|
+
:skin => 'moono',
|
14
|
+
:preset => 'standard',
|
15
|
+
:toolbarGroups => [
|
16
|
+
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
17
|
+
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
|
18
|
+
{ name: 'links' },
|
19
|
+
{ name: 'insert' },
|
20
|
+
{ name: 'forms' },
|
21
|
+
{ name: 'tools' },
|
22
|
+
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
|
23
|
+
{ name: 'others' },
|
24
|
+
'/',
|
25
|
+
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
26
|
+
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
|
27
|
+
{ name: 'styles' },
|
28
|
+
{ name: 'colors' }
|
29
|
+
],
|
30
|
+
:removeButtons => 'Subscript,Superscript'
|
31
|
+
}
|
32
|
+
|
33
|
+
@@root = Pathname.new File.expand_path('../..', __FILE__)
|
34
|
+
def self.root; @@root; end
|
35
|
+
|
36
|
+
EDIT_LINK_BASE = 'https://github.com/my_github_username/hobo_ckeditor/edit/master'
|
37
|
+
|
38
|
+
if defined?(Rails)
|
39
|
+
require 'hobo_ckeditor/railtie'
|
40
|
+
|
41
|
+
class Engine < ::Rails::Engine
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.divide_string_into_two_from_end(the_string, separator = ' ')
|
46
|
+
the_string.split(separator)[-1].split().unshift(the_string.split(separator)[0..-2].join(separator))
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.default_editor_settings()
|
50
|
+
HoboCKEditor::DEFAULT_EDITOR_SETTINGS
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
@@ -1,20 +1,7 @@
|
|
1
1
|
module HoboFields
|
2
2
|
module Types
|
3
3
|
class CKEditorText < HtmlString
|
4
|
-
|
5
|
-
#def initialize(model, name, type, options={})
|
6
|
-
# super(model, name, type, options={})
|
7
|
-
# #raise ArgumentError, "you cannot provide a field spec for the primary key" if name == model.primary_key
|
8
|
-
# #self.model = model
|
9
|
-
# #self.name = name.to_sym
|
10
|
-
# #self.type = type.is_a?(String) ? type.to_sym : type
|
11
|
-
# #position = options.delete(:position)
|
12
|
-
# #self.options = options
|
13
|
-
# #self.position = position || model.field_specs.length
|
14
|
-
#end
|
15
|
-
|
16
4
|
HoboFields.register_type(:cktext, self)
|
17
|
-
|
18
5
|
end
|
19
6
|
end
|
20
7
|
end
|
@@ -1,3 +1,10 @@
|
|
1
|
-
<def tag="input" for="cktext">
|
2
|
-
|
1
|
+
<def tag="input" for="cktext" attribs="name, ckeditor">
|
2
|
+
<%
|
3
|
+
editor_settings = attributes['ckeditor'] || HoboCKEditor.default_editor_settings
|
4
|
+
object_name, method_name = HoboCKEditor.divide_string_into_two_from_end(attributes['name'], '[')
|
5
|
+
method_name = method_name.chomp(']') if method_name && !method_name.empty?
|
6
|
+
-%>
|
7
|
+
<div class="cktextarea textarea">
|
8
|
+
<%= cktext_area object_name.to_sym, method_name.to_sym, :ckeditor => editor_settings %>
|
9
|
+
</div>
|
3
10
|
</def>
|
data/test/hobo_ckeditor_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobo_ckeditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -75,7 +75,7 @@ files:
|
|
75
75
|
- VERSION
|
76
76
|
- app/helpers/hobo_ckeditor_helper.rb
|
77
77
|
- hobo_ckeditor.gemspec
|
78
|
-
- lib/
|
78
|
+
- lib/hobo_ck_editor.rb
|
79
79
|
- lib/hobo_ckeditor/railtie.rb
|
80
80
|
- lib/hobo_ckeditor/types/ck_editor_text.rb
|
81
81
|
- lib/tasks/hobo_ckeditor_tasks.rake
|
@@ -135,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
segments:
|
137
137
|
- 0
|
138
|
-
hash: -
|
138
|
+
hash: -3673019969455985801
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
none: false
|
141
141
|
requirements:
|
data/lib/hobo_ckeditor.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'ckeditor'
|
2
|
-
require 'hobo_fields'
|
3
|
-
require 'hobo_rapid'
|
4
|
-
require 'hobo_ckeditor'
|
5
|
-
require 'hobo_ckeditor/types/ck_editor_text'
|
6
|
-
|
7
|
-
module HoboCkeditor
|
8
|
-
|
9
|
-
VERSION = File.read(File.expand_path('../../VERSION', __FILE__)).strip
|
10
|
-
|
11
|
-
@@root = Pathname.new File.expand_path('../..', __FILE__)
|
12
|
-
def self.root; @@root; end
|
13
|
-
|
14
|
-
EDIT_LINK_BASE = 'https://github.com/my_github_username/hobo_ckeditor/edit/master'
|
15
|
-
|
16
|
-
if defined?(Rails)
|
17
|
-
require 'hobo_ckeditor/railtie'
|
18
|
-
|
19
|
-
class Engine < ::Rails::Engine
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|