cama_contact_form 0.0.29 → 0.1.0

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
  SHA256:
3
- metadata.gz: b6082e2604be18df94bc6784fc888e85820f0551c6603697222e7caefe414bea
4
- data.tar.gz: cc68ccf6eef8400f82ad9f73eb8200482c00630bf86af99323f6a5a11243616e
3
+ metadata.gz: a8f3c768c126ee5bc5444636a26f1aa0423bf74f7e6851ce8d0c656330a137ea
4
+ data.tar.gz: c52eea668803c03487b09a4a5af1a21c17b30f18339f899dc5cad06cab79909b
5
5
  SHA512:
6
- metadata.gz: 050f66d7e034b0cca5bafbd3675c412b727fb5c45fda86b9e214c3e6839af15722d50378cf6c51897f1e7b3aeb45b0459cf956d8574a2e0531f6434b62615339
7
- data.tar.gz: 13b1bca38968438b4f423cfe7ad7a2d41aeef16c8fb5bd179597a9f7dd3293d40e05fcb5df7bf73098586ca40e52af0bef79379bdb3becf122e0b1c0c773d0aa
6
+ metadata.gz: 6dcf81c9421fc18ea88be664ba52d3f5471eeb59fc0aeeb7c1f942a4e7e4eaddfa2823c55d236373c2f0ff206b038116ceb907d52b392f2bfe64d8b66ea37143
7
+ data.tar.gz: faca0df162e1a7ca43824b172b41c26ce9b5d86c83b83d75bc5ffa74f925e0fc985705edb46f655bd6a623fe7854567869e5b729a0f54331514eba24b9de974c
@@ -0,0 +1,57 @@
1
+ /* eslint-env jquery */
2
+ $(function() {
3
+ const panel = $('#contact_form_editor')
4
+ const myFields = panel.find('#my_fields')
5
+
6
+ myFields.sortable({ handle: '.panel-sortable' })
7
+ panel.find('#fields_available a').click(function() {
8
+ showLoading()
9
+ myFields.attr('data-cid', parseInt(myFields.attr('data-cid')) + 1)
10
+ $.get(
11
+ panel.find('#fields_available').attr('data-remote_url'),
12
+ { kind: $(this).attr('data-field-type'), cid: 'c' + myFields.attr('data-cid') },
13
+ function(res) {
14
+ res = $(res)
15
+ myFields.append(res)
16
+ res.find('.options_sortable').sortable({ handle: '.options-sortable' })
17
+ res.find('.add_option').click().click()
18
+ res.find('.translatable').Translatable(ADMIN_TRANSLATIONS)
19
+ return hideLoading()
20
+ })
21
+ return false
22
+ })
23
+
24
+ panel.on('click', '.add_option', function() {
25
+ const list = $(this).prev('ul')
26
+ list.attr('data-options-count', parseInt(list.attr('data-options-count')) + 1)
27
+
28
+ const clone = list.children().first().clone().removeClass('hidden')
29
+ clone.find('input').prop('disabled', false).each(function() {
30
+ return $(this).attr('name', $(this).attr('name').replace('[0]', '[' + list.attr('data-options-count') + ']'))
31
+ })
32
+
33
+ list.append(clone)
34
+ clone.find('.translatable').Translatable(ADMIN_TRANSLATIONS)
35
+ return false
36
+ })
37
+
38
+ panel.on('click', '.option-delete', function() {
39
+ $(this).closest('li').remove()
40
+ return false
41
+ })
42
+
43
+ panel.on('click', '.panel-delete', function() {
44
+ $(this).closest('li.panel').fadeOut('slow', function() {
45
+ return $(this).remove()
46
+ })
47
+ return false
48
+ })
49
+
50
+ panel.on('click', '.html_btn', function() {
51
+ $(this).hide().next().hide().removeClass('hidden').fadeIn()
52
+ return false
53
+ })
54
+
55
+ myFields.find('.options_sortable').sortable({ handle: '.options-sortable' })
56
+ return panel.find('.translatable').Translatable(ADMIN_TRANSLATIONS)
57
+ })
@@ -1,3 +1,3 @@
1
1
  module CamaContactForm
2
- VERSION = "0.0.29"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  // This is a manifest file that'll be compiled into application.js, which will include all the files
2
2
  // listed below.
3
3
  //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
4
+ // Any JavaScript file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
5
  // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cama_contact_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-18 00:00:00.000000000 Z
11
+ date: 2022-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -61,7 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - MIT-LICENSE
63
63
  - Rakefile
64
- - app/assets/javascripts/plugins/cama_contact_form/admin_editor.js.coffee
64
+ - app/assets/javascripts/plugins/cama_contact_form/admin_editor.js
65
65
  - app/controllers/concerns/plugins/cama_contact_form/contact_form_controller_concern.rb
66
66
  - app/controllers/plugins/cama_contact_form/admin_forms_controller.rb
67
67
  - app/controllers/plugins/cama_contact_form/front_controller.rb
@@ -125,7 +125,7 @@ homepage: ''
125
125
  licenses:
126
126
  - MIT
127
127
  metadata: {}
128
- post_install_message:
128
+ post_install_message:
129
129
  rdoc_options: []
130
130
  require_paths:
131
131
  - lib
@@ -140,46 +140,45 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubyforge_project:
144
- rubygems_version: 2.7.7
145
- signing_key:
143
+ rubygems_version: 3.1.2
144
+ signing_key:
146
145
  specification_version: 4
147
146
  summary: Contact Form Plugin for Camaleon CMS
148
147
  test_files:
149
- - test/cama_contact_form_test.rb
148
+ - test/dummy/app/controllers/application_controller.rb
149
+ - test/dummy/app/views/layouts/application.html.erb
150
150
  - test/dummy/app/assets/javascripts/application.js
151
151
  - test/dummy/app/assets/stylesheets/application.css
152
- - test/dummy/app/controllers/application_controller.rb
153
152
  - test/dummy/app/helpers/application_helper.rb
154
- - test/dummy/app/views/layouts/application.html.erb
155
- - test/dummy/bin/bundle
156
- - test/dummy/bin/rails
157
153
  - test/dummy/bin/rake
158
154
  - test/dummy/bin/setup
159
- - test/dummy/config/application.rb
160
- - test/dummy/config/boot.rb
161
- - test/dummy/config/database.yml
162
- - test/dummy/config/environment.rb
163
- - test/dummy/config/environments/development.rb
155
+ - test/dummy/bin/bundle
156
+ - test/dummy/bin/rails
157
+ - test/dummy/config/secrets.yml
158
+ - test/dummy/config/routes.rb
159
+ - test/dummy/config/locales/en.yml
164
160
  - test/dummy/config/environments/production.rb
161
+ - test/dummy/config/environments/development.rb
165
162
  - test/dummy/config/environments/test.rb
166
- - test/dummy/config/initializers/assets.rb
163
+ - test/dummy/config/environment.rb
164
+ - test/dummy/config/application.rb
165
+ - test/dummy/config/database.yml
166
+ - test/dummy/config/boot.rb
167
167
  - test/dummy/config/initializers/backtrace_silencers.rb
168
- - test/dummy/config/initializers/cookies_serializer.rb
169
- - test/dummy/config/initializers/filter_parameter_logging.rb
170
- - test/dummy/config/initializers/inflections.rb
171
168
  - test/dummy/config/initializers/mime_types.rb
169
+ - test/dummy/config/initializers/filter_parameter_logging.rb
172
170
  - test/dummy/config/initializers/session_store.rb
173
171
  - test/dummy/config/initializers/wrap_parameters.rb
174
- - test/dummy/config/locales/en.yml
175
- - test/dummy/config/routes.rb
176
- - test/dummy/config/secrets.yml
172
+ - test/dummy/config/initializers/assets.rb
173
+ - test/dummy/config/initializers/cookies_serializer.rb
174
+ - test/dummy/config/initializers/inflections.rb
177
175
  - test/dummy/config.ru
178
- - test/dummy/public/404.html
176
+ - test/dummy/Rakefile
177
+ - test/dummy/public/favicon.ico
179
178
  - test/dummy/public/422.html
180
179
  - test/dummy/public/500.html
181
- - test/dummy/public/favicon.ico
182
- - test/dummy/Rakefile
180
+ - test/dummy/public/404.html
183
181
  - test/dummy/README.rdoc
182
+ - test/cama_contact_form_test.rb
184
183
  - test/integration/navigation_test.rb
185
184
  - test/test_helper.rb
@@ -1,48 +0,0 @@
1
- $ ->
2
- panel = $('#contact_form_editor')
3
- my_fields = panel.find('#my_fields')
4
- my_fields.sortable({handle: ".panel-sortable"})
5
- panel.find('#fields_available a').click ->
6
- showLoading()
7
- my_fields.attr('data-cid', parseInt(my_fields.attr('data-cid')) + 1)
8
- $.get(panel.find('#fields_available').attr('data-remote_url'), {kind: $(this).attr('data-field-type'), cid: 'c'+my_fields.attr('data-cid')}, (res)->
9
- res = $(res)
10
- my_fields.append(res)
11
- res.find('.options_sortable').sortable({handle: ".options-sortable"})
12
- res.find('.add_option').click().click()
13
- res.find('.translatable').Translatable(ADMIN_TRANSLATIONS)
14
- hideLoading()
15
- )
16
- return false
17
-
18
- panel.on('click', '.add_option', ->
19
- list = $(this).prev('ul')
20
- list.attr('data-options-count', parseInt(list.attr('data-options-count'))+1)
21
- clone = list.children().first().clone().removeClass('hidden')
22
- clone.find('input').prop('disabled', false).each(->
23
- $(this).attr('name', $(this).attr('name').replace('[0]', '['+list.attr('data-options-count')+']'))
24
- )
25
- list.append(clone)
26
- clone.find('.translatable').Translatable(ADMIN_TRANSLATIONS)
27
- return false
28
- )
29
-
30
- panel.on('click', '.option-delete', ->
31
- $(this).closest('li').remove()
32
- return false
33
- )
34
-
35
- panel.on('click', '.panel-delete', ->
36
- $(this).closest('li.panel').fadeOut('slow', ->
37
- $(this).remove()
38
- )
39
- return false
40
- )
41
-
42
- panel.on('click', '.html_btn', ->
43
- $(this).hide().next().hide().removeClass('hidden').fadeIn()
44
- return false
45
- )
46
-
47
- my_fields.find('.options_sortable').sortable({handle: ".options-sortable"})
48
- panel.find('.translatable').Translatable(ADMIN_TRANSLATIONS)