annex-cms 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b919cfc450b91c75d48eba5304989a08d56a4fc
4
- data.tar.gz: 853fff764c4c474609b1c529e59648d3570581e4
3
+ metadata.gz: a8f69a821f45830bf1fa66c26814788f517dcc38
4
+ data.tar.gz: 7b3d98f589ba2c6047eca88e37d73b3924a5ea76
5
5
  SHA512:
6
- metadata.gz: 6efb784e0654626c8e0021fa2894d9fae950873ac17733a814aad51a5d7f24058519b7cada34de3a0fa9dafcc31bbee3c2399bd8ea0d9f33aed631e99e32499e
7
- data.tar.gz: 188d9e16925bdb701c0da08c455c7217b79a084ada08372dd9d66e3772709b991ed95194a24fc9355b4f4111b2a220ea62a1b480c36b25b279cd08f23182d710
6
+ metadata.gz: 417eb1a5aab60bb1db2974732fbfd1a0aae8ef261c18248d9cf0e59bd7d6453c9cdd04b91cdc9c717b0a01a3ad6b236916141cf76afe1a6b6fc769213b9365d6
7
+ data.tar.gz: 6bb70f67f562040802917ecfb83283bd343b6ba68776c4c78929ed89ee7b74e1108f78af0702a71b3df6a9d693fb0d2b106bcba76d4fe3d2135ff32bcf704a2b
@@ -0,0 +1,32 @@
1
+ ready = ->
2
+ post_url = "/annex/blocks"
3
+ $(window).keydown (e) ->
4
+ $(".redactor").addClass "active" if (e.which is "17") and (e.ctrlKey or e.metaKey)
5
+ return
6
+
7
+ $(".redactor").click ->
8
+ unless $(this).hasClass("redactor_editor")
9
+ $(this).redactor
10
+ focus: true
11
+ plugins: [
12
+ "clips"
13
+ "fullscreen"
14
+ "save"
15
+ ]
16
+ toolbarFixed: false
17
+
18
+ return
19
+
20
+ $("textarea.redactor").redactor
21
+ focus: true
22
+ plugins: [
23
+ "clips"
24
+ "fullscreen"
25
+ "save"
26
+ ]
27
+ toolbarFixed: false
28
+
29
+ return
30
+
31
+ $(document).ready(ready)
32
+ $(document).on('page:load', ready)
data/lib/annex/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Annex
2
- VERSION = "0.1.2"
3
- end
2
+ VERSION = "0.1.5"
3
+ end
@@ -3,6 +3,8 @@ require 'active_support/hash_with_indifferent_access'
3
3
  module Annex
4
4
  module ViewHelpers
5
5
  def annex_block(identifier, opts = {})
6
+ opts[:default] ||= ''
7
+
6
8
  if opts.try(:route)
7
9
  route = opts[:route]
8
10
  opts[:route].delete
@@ -13,9 +15,9 @@ module Annex
13
15
  doc = Annex::Block.where(:route => route.to_s).first_or_create
14
16
 
15
17
  if doc.content
16
- content = doc.content[identifier.to_s] || ''
18
+ content = doc.content[identifier.to_s] || opts[:default]
17
19
  else
18
- content = ''
20
+ content = opts[:default]
19
21
  end
20
22
 
21
23
  render partial: 'annex/block', locals: { content: content, route: route, identifier: identifier, opts: opts }
@@ -29,4 +31,4 @@ module Annex
29
31
  "#{I18n.locale}_#{params[:controller]}_#{params[:action]}".to_sym
30
32
  end
31
33
  end
32
- end
34
+ end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annex-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay McIlrath
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-17 00:00:00.000000000 Z
11
+ date: 2014-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mongoid
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: An inline editor CMS powered by redactor, devise and mongodb. Up and
@@ -46,14 +46,16 @@ executables: []
46
46
  extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
- - app/assets/javascripts/annex/cms.js
49
+ - MIT-LICENSE
50
+ - Rakefile
51
+ - app/assets/javascripts/annex.js.coffee
52
+ - app/assets/javascripts/annex/cms.js.coffee
50
53
  - app/assets/javascripts/annex/jquery.redactor.clips.js
51
54
  - app/assets/javascripts/annex/jquery.redactor.fullscreen.js
52
55
  - app/assets/javascripts/annex/jquery.redactor.js
53
56
  - app/assets/javascripts/annex/jquery.redactor.save.js
54
- - app/assets/javascripts/annex.js
55
- - app/assets/stylesheets/annex/redactor.css.scss
56
57
  - app/assets/stylesheets/annex.css.scss
58
+ - app/assets/stylesheets/annex/redactor.css.scss
57
59
  - app/controllers/annex/application_controller.rb
58
60
  - app/controllers/annex/blocks_controller.rb
59
61
  - app/controllers/annex/files_controller.rb
@@ -62,21 +64,21 @@ files:
62
64
  - app/views/annex/_block.html.haml
63
65
  - app/views/annex/_clips.html.haml
64
66
  - config/routes.rb
67
+ - lib/annex-cms.rb
65
68
  - lib/annex/config.rb
66
69
  - lib/annex/engine.rb
67
70
  - lib/annex/extension.rb
68
- - lib/annex/extensions/cancan/authorization_adapter.rb
69
71
  - lib/annex/extensions/cancan.rb
72
+ - lib/annex/extensions/cancan/authorization_adapter.rb
70
73
  - lib/annex/railtie.rb
71
74
  - lib/annex/version.rb
72
75
  - lib/annex/view_helpers.rb
73
- - lib/annex-cms.rb
74
76
  - lib/tasks/annex_tasks.rake
75
- - MIT-LICENSE
76
- - Rakefile
77
77
  - test/annex_test.rb
78
78
  - test/controllers/annex/block_controller_test.rb
79
79
  - test/controllers/annex/blocks_controller_test.rb
80
+ - test/dummy/README.rdoc
81
+ - test/dummy/Rakefile
80
82
  - test/dummy/app/assets/javascripts/application.js
81
83
  - test/dummy/app/assets/stylesheets/application.css
82
84
  - test/dummy/app/controllers/application_controller.rb
@@ -85,6 +87,7 @@ files:
85
87
  - test/dummy/bin/bundle
86
88
  - test/dummy/bin/rails
87
89
  - test/dummy/bin/rake
90
+ - test/dummy/config.ru
88
91
  - test/dummy/config/application.rb
89
92
  - test/dummy/config/boot.rb
90
93
  - test/dummy/config/environment.rb
@@ -101,13 +104,10 @@ files:
101
104
  - test/dummy/config/locales/en.yml
102
105
  - test/dummy/config/mongoid.yml
103
106
  - test/dummy/config/routes.rb
104
- - test/dummy/config.ru
105
107
  - test/dummy/public/404.html
106
108
  - test/dummy/public/422.html
107
109
  - test/dummy/public/500.html
108
110
  - test/dummy/public/favicon.ico
109
- - test/dummy/Rakefile
110
- - test/dummy/README.rdoc
111
111
  - test/fixtures/annex/blocks.yml
112
112
  - test/helpers/annex/block_helper_test.rb
113
113
  - test/helpers/annex/blocks_helper_test.rb
@@ -123,17 +123,17 @@ require_paths:
123
123
  - lib
124
124
  required_ruby_version: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - '>='
126
+ - - ">="
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - '>='
131
+ - - ">="
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.0.3
136
+ rubygems_version: 2.2.2
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: The simplest implentation of a CMS
@@ -1,22 +0,0 @@
1
- $(function(){
2
- var post_url = '/annex/blocks';
3
-
4
- $(window).keydown(function(e){
5
- if ((e.which == '17') && (e.ctrlKey || e.metaKey))
6
- {
7
- $('.redactor').addClass('active');
8
- }
9
- });
10
-
11
- $('.redactor')
12
- .click(function(){
13
- if ( ! $(this).hasClass('redactor_editor') )
14
- {
15
- $(this).redactor({
16
- focus: true,
17
- plugins: ['clips', 'fullscreen', 'save'],
18
- toolbarFixed: false
19
- });
20
- }
21
- });
22
- });