tkh_content 0.1.15 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.2
6
+
7
+ * Removed the tkh_inline_editor dependency
8
+ * Customize with javascript which fields are seen in the pages form according to whether the page is of static content page or is a blog post
9
+ * Implemented, customized, and internationalized the CKEditor html inline editor
10
+
11
+
5
12
  ## 0.1.15
6
13
 
7
14
  * Debugged pages migrations. short_title attribute was missing in pages table
@@ -0,0 +1,18 @@
1
+ CKEDITOR.editorConfig = (config) ->
2
+ config.language = tkh_locale
3
+ config.uiColor = "#AADC6E"
4
+ config.width = '575'
5
+ config.height = '450'
6
+
7
+ config.toolbar_Pure = [
8
+ { name: 'styles', items: [ 'Format' ] },
9
+ { name: 'basicstyles', items: [ 'Bold','Italic','Strike','-','RemoveFormat' ] },
10
+ { name: 'paragraph', items: [ 'BulletedList','NumberedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ] },
11
+ '/',
12
+ { name: 'clipboard', items: [ 'Undo','Redo' ] },
13
+ { name: 'links', items: [ 'Link','Unlink' ] },
14
+ { name: 'insert', items: [ 'Image','Table','HorizontalRule','SpecialChar' ] },
15
+ { name: 'document', items: [ 'Source','-','Save' ] },
16
+ ]
17
+ config.toolbar = 'Pure'
18
+ true
@@ -0,0 +1,18 @@
1
+ jQuery ->
2
+ # Some fields should be shown only for blog posts, others only for static content pages
3
+ if $('input#page_for_blog:checked').length>0
4
+ $('#page-short-title').hide()
5
+ $('#parent-page-title').hide()
6
+ else
7
+ $('#page-tag-list').hide()
8
+
9
+ # Toggle fields to be shown when user changes page to/from static content to/from blog post
10
+ $("input#page_for_blog").change ->
11
+ if $('input#page_for_blog:checked').length>0
12
+ $('#page-short-title').hide(450)
13
+ $('#parent-page-title').hide(450)
14
+ $('#page-tag-list').show(450)
15
+ else
16
+ $('#page-tag-list').hide(450)
17
+ $('#page-short-title').show(450)
18
+ $('#parent-page-title').show(450)
@@ -4,17 +4,18 @@
4
4
  <div class="form-inputs">
5
5
  <%= f.input :title, hint: 'nice and descriptive' %>
6
6
  <%= f.input :for_blog %>
7
- <%= f.input :tag_list, hint: 'space separated' %>
8
- <%= f.input :short_title, hint: 'ideally one word only, used for the menu' %>
7
+ <%= f.input :tag_list, hint: 'space separated', :wrapper_html => { :id => 'page-tag-list' } %>
8
+ <%= f.input :short_title, hint: 'ideally one word only, used for the menu', :wrapper_html => { :id => 'page-short-title' } %>
9
9
  <%= f.input :parent_page_title,
10
10
  as: :string,
11
+ :wrapper_html => { :id => 'parent-page-title' },
11
12
  label: 'parent page title',
12
13
  :input_html => { class: 'typeahead',
13
14
  :data => { provide: 'typeahead',
14
15
  source: Page.not_for_blog.by_title.map(&:title).to_json }
15
16
  } %>
16
17
  <%= f.input :description, :input_html => { :rows => 3 } %>
17
- <%= f.input :body, :input_html => { :rows => 35 } %>
18
+ <%= f.input :body, :input_html => { :rows => 35, :class => 'ckeditor' } %>
18
19
  </div>
19
20
 
20
21
  <div class="form-actions">
@@ -1,3 +1,3 @@
1
1
  module TkhContent
2
- VERSION = "0.1.15"
2
+ VERSION = "0.2"
3
3
  end
data/lib/tkh_content.rb CHANGED
@@ -6,7 +6,8 @@ require 'globalize3'
6
6
  require 'will_paginate'
7
7
  require 'bootstrap-will_paginate'
8
8
  # require 'bootstrap-wysihtml5-rails'
9
- require 'tkh_inline_editor'
9
+ # require 'tkh_inline_editor'
10
+ require 'ckeditor_rails'
10
11
 
11
12
  module TkhContent
12
13
  class Engine < ::Rails::Engine
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: '0.2'
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-01-25 00:00:00.000000000 Z
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -123,6 +123,22 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: ckeditor_rails
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
126
142
  - !ruby/object:Gem::Dependency
127
143
  name: sqlite3
128
144
  requirement: !ruby/object:Gem::Requirement
@@ -146,6 +162,8 @@ executables: []
146
162
  extensions: []
147
163
  extra_rdoc_files: []
148
164
  files:
165
+ - app/assets/javascripts/ckeditor/config.js.coffee
166
+ - app/assets/javascripts/pages.js.coffee
149
167
  - app/controllers/blog_controller.rb
150
168
  - app/controllers/contacts_controller.rb
151
169
  - app/controllers/pages_controller.rb
@@ -238,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
256
  version: '0'
239
257
  segments:
240
258
  - 0
241
- hash: -3943227022752667587
259
+ hash: 2372878787033962995
242
260
  required_rubygems_version: !ruby/object:Gem::Requirement
243
261
  none: false
244
262
  requirements:
@@ -247,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
265
  version: '0'
248
266
  segments:
249
267
  - 0
250
- hash: -3943227022752667587
268
+ hash: 2372878787033962995
251
269
  requirements: []
252
270
  rubyforge_project:
253
271
  rubygems_version: 1.8.23