active_scaffold_signaturepad 0.1.0 → 0.1.1

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
- SHA1:
3
- metadata.gz: 4b3a77257acfa207f530fdc6e13bc6827c17d271
4
- data.tar.gz: 1a0a9e09316379b470003688299a55c48fdb1e08
2
+ SHA256:
3
+ metadata.gz: 6f03a9df6347ad508446f4bef170e2acee2b7cae1b4d53d4469c33d5826cba62
4
+ data.tar.gz: 686482d4a95dd96487fedb622941cfb3e407b366b25ee3c821ede604b4f1bbae
5
5
  SHA512:
6
- metadata.gz: 6f4aa2a858d94aa0c7a0aa7820c6509621bf00e61edbca0adfa7f156160cfe804b9a40cffa957a0fdd0a218e4ed66f87c3166ecf412c26f3381a67311729ce2f
7
- data.tar.gz: 1701260421b9d6443112936081816723b87f51ce41e5885fc406a664d1a49d253ccb5d1c97f326e6b445b808ad05c28bac6e9fb0558cd5036ea7f1060841a81c
6
+ metadata.gz: 03e789c264c8112ab0868c12474ba81ee2629daf203c39c3dad193ca7f92c48a5de26fedbdc8cffb1a5a5e81701d4d409617749b60a5c9e72e04a192fd5bb55f
7
+ data.tar.gz: 367787ed2c7241486029088c2da3a261cebef9b654eac69d3d8f0e82ebee2136f7638f8ef6e1124400fddbcf70e578154375fb3c8641e684b91180446bfd15e8
@@ -2,7 +2,7 @@ module ActiveScaffoldSignaturepad
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -1,37 +1,38 @@
1
1
  module ActiveScaffoldSignaturepad
2
2
  module ViewHelpers
3
3
  ATTRIBUTES = [:line_colour, :line_width, :line_margin, :line_top, :bg_colour, :pen_colour, :pen_width, :pen_cap, :display_only, :error_message_draw]
4
- def signaturepad_attributes(column)
5
- attributes = ATTRIBUTES.map{ |attr| [attr, column.options[attr]] if column.options[attr] }
4
+ def signaturepad_attributes(column, ui_options: column.options)
5
+ attributes = ATTRIBUTES.map{ |attr| [attr, ui_options[attr]] if ui_options[attr] }
6
6
  attributes = Hash[attributes].reverse_merge(:error_message_draw => :sign_document)
7
- attributes[:type] = column.options[:type] if column.options[:type]
7
+ attributes[:type] = ui_options[:type] if ui_options[:type]
8
8
  attributes[:error_message_draw] = as_(attributes[:error_message_draw]) if attributes[:error_message_draw].is_a? Symbol
9
9
  attributes
10
10
  end
11
11
 
12
- def active_scaffold_input_signaturepad(column, html_options)
13
- content_tag(:div, :class => "sigPad #{html_options[:class]}", :data => signaturepad_attributes(column)) do
14
- content_tag(:ul, :class => 'sigNav') do
15
- if column.options[:type]
16
- content_tag(:li, link_to(as_(:type_it), '#type-it'), :class => 'typeIt') <<
17
- content_tag(:li, link_to(as_(:draw_it), '#draw-it'), :class => 'drawIt')
12
+ def active_scaffold_input_signaturepad(column, html_options, ui_options: column.options)
13
+ content_tag(:div, class: "sigPad #{html_options[:class]}", data: signaturepad_attributes(column, ui_options: ui_options)) do
14
+ content_tag(:ul, class: 'sigNav') do
15
+ if ui_options[:type]
16
+ content_tag(:li, link_to(as_(:type_it), '#type-it'), class: 'typeIt') <<
17
+ content_tag(:li, link_to(as_(:draw_it), '#draw-it'), class: 'drawIt')
18
18
  else
19
19
  ''.html_safe
20
20
  end <<
21
- content_tag(:li, link_to(as_(:clear), '#clear'), :class => 'clearButton')
21
+ content_tag(:li, link_to(as_(:clear), '#clear'), class: 'clearButton')
22
22
  end <<
23
- content_tag(:div, :class => 'sig sigWrapper') do
24
- (column.options[:type] ? content_tag(:div, '', :class => 'typed') : ''.html_safe) <<
25
- content_tag(:canvas, '', :width => column.options[:width] || 250, :height => column.options[:height] || 100) <<
26
- hidden_field(:record, column.name, html_options.merge(:class => 'output'))
23
+ content_tag(:div, class: 'sig sigWrapper') do
24
+ (ui_options[:type] ? content_tag(:div, '', class: 'typed') : ''.html_safe) <<
25
+ content_tag(:canvas, '', width: ui_options[:width] || 250, height: ui_options[:height] || 100) <<
26
+ hidden_field(:record, column.name, html_options.merge(class: 'output'))
27
27
  end
28
28
  end
29
29
  end
30
30
 
31
- def active_scaffold_column_signaturepad(record, column)
32
- content_tag :div, :class => 'sigPad', :data => signaturepad_attributes(column).merge(:display_only => true, :signature => record.send(column.name)) do
33
- content_tag :div, :class => 'sigWrapper' do
34
- content_tag :canvas, '', :width => column.options[:width] || 250, :height => column.options[:height] || 100
31
+ def active_scaffold_column_signaturepad(record, column, ui_options: column.options)
32
+ data = signaturepad_attributes(column, ui_options: ui_options).merge(display_only: true, signature: record.send(column.name))
33
+ content_tag :div, class: 'sigPad', data: data do
34
+ content_tag :div, class: 'sigWrapper' do
35
+ content_tag :canvas, '', width: ui_options[:width] || 250, height: ui_options[:height] || 100
35
36
  end
36
37
  end
37
38
  end
metadata CHANGED
@@ -1,56 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_signaturepad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
8
  - Volker Hochstein
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-16 00:00:00.000000000 Z
12
+ date: 2024-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: shoulda
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - '>='
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :development
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - '>='
26
- - !ruby/object:Gem::Version
27
- version: '0'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: bundler
30
16
  requirement: !ruby/object:Gem::Requirement
31
17
  requirements:
32
- - - ~>
18
+ - - "~>"
33
19
  - !ruby/object:Gem::Version
34
- version: '1.0'
20
+ version: '2.0'
35
21
  type: :development
36
22
  prerelease: false
37
23
  version_requirements: !ruby/object:Gem::Requirement
38
24
  requirements:
39
- - - ~>
25
+ - - "~>"
40
26
  - !ruby/object:Gem::Version
41
- version: '1.0'
27
+ version: '2.0'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: active_scaffold
44
30
  requirement: !ruby/object:Gem::Requirement
45
31
  requirements:
46
- - - '>='
32
+ - - ">="
47
33
  - !ruby/object:Gem::Version
48
34
  version: 3.4.0
49
35
  type: :runtime
50
36
  prerelease: false
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
- - - '>='
39
+ - - ">="
54
40
  - !ruby/object:Gem::Version
55
41
  version: 3.4.0
56
42
  description: Helper to display a signature zone on ActiveScaffold forms, using jquery.signaturepad
@@ -78,24 +64,23 @@ homepage: http://github.com/activescaffold/active_scaffold_signaturepad
78
64
  licenses:
79
65
  - MIT
80
66
  metadata: {}
81
- post_install_message:
67
+ post_install_message:
82
68
  rdoc_options: []
83
69
  require_paths:
84
70
  - lib
85
71
  required_ruby_version: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
75
  version: '0'
90
76
  required_rubygems_version: !ruby/object:Gem::Requirement
91
77
  requirements:
92
- - - '>='
78
+ - - ">="
93
79
  - !ruby/object:Gem::Version
94
80
  version: '0'
95
81
  requirements: []
96
- rubyforge_project:
97
- rubygems_version: 2.4.5
98
- signing_key:
82
+ rubygems_version: 3.2.3
83
+ signing_key:
99
84
  specification_version: 4
100
85
  summary: Signaturepad form_ui using jquery.signaturepad
101
86
  test_files: []