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 CHANGED
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  RDoc::Task.new(:rdoc) do |rdoc|
17
17
  rdoc.rdoc_dir = 'rdoc'
18
- rdoc.title = 'HoboCkeditor'
18
+ rdoc.title = 'HoboCKEditor'
19
19
  rdoc.options << '--line-numbers'
20
20
  rdoc.rdoc_files.include('README.rdoc')
21
21
  rdoc.rdoc_files.include('lib/**/*.rb')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
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,7 +1,7 @@
1
- require 'hobo_ckeditor'
1
+ require 'hobo_ck_editor'
2
2
  require 'rails'
3
3
 
4
- module HoboCkeditor
4
+ module HoboCKEditor
5
5
  class Railtie < Rails::Railtie
6
6
  end
7
7
  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
- <%= cktext_area :custom_page, :contents, :ckeditor => {:uiColor => "#AADC6E", :toolbar => "mini"} %>
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>
@@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__)
3
3
  require 'rails/all'
4
4
 
5
5
  Bundler.require
6
- require "hobo_ckeditor"
6
+ require "hobo_ck_editor"
7
7
 
8
8
  module Dummy
9
9
  class Application < Rails::Application
@@ -2,6 +2,6 @@ require 'test_helper'
2
2
 
3
3
  class HoboCkeditorTest < ActiveSupport::TestCase
4
4
  test "truth" do
5
- assert_kind_of Module, HoboCkeditor
5
+ assert_kind_of Module, HoboCKEditor
6
6
  end
7
7
  end
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.8
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-27 00:00:00.000000000 Z
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/hobo_ckeditor.rb
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: -2023241071729751571
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