active_scaffold_signaturepad 0.0.1 → 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
  SHA1:
3
- metadata.gz: f4e79f674fe254f1706e6aa02c2e850b0752a9d6
4
- data.tar.gz: 157ad8d3523717241b774d62df6eed74cc21902b
3
+ metadata.gz: 4b3a77257acfa207f530fdc6e13bc6827c17d271
4
+ data.tar.gz: 1a0a9e09316379b470003688299a55c48fdb1e08
5
5
  SHA512:
6
- metadata.gz: 5f27772edad9aa856f3733d27f94bae470d5c0369abbbedcad05e69db6ca05e54066543f3a7fd65c646eddcd34f88d888a25e3f9ef9599f63fb75555f9f44147
7
- data.tar.gz: 0cdd63478ce959a0d8c982eba153cff2d59228d1937df4adcd8543a39547177ec2782cd9b0f1fbe750b7e1bcf62a2abd2fefe7efc689fea944f196a4ecd892c6
6
+ metadata.gz: 6f4aa2a858d94aa0c7a0aa7820c6509621bf00e61edbca0adfa7f156160cfe804b9a40cffa957a0fdd0a218e4ed66f87c3166ecf412c26f3381a67311729ce2f
7
+ data.tar.gz: 1701260421b9d6443112936081816723b87f51ce41e5885fc406a664d1a49d253ccb5d1c97f326e6b445b808ad05c28bac6e9fb0558cd5036ea7f1060841a81c
data/README.textile CHANGED
@@ -34,12 +34,18 @@ class VisitorsController < ApplicationController
34
34
  config.columns[:signature].options = {
35
35
  :width => 150, # canvas width, default 250
36
36
  :height => 55, # canvas height, default 100
37
- :lineColour => 'transparent' # colour for signature line on canvas, transparent for none
37
+ :line_colour => 'transparent' # colour for signature line on canvas, transparent for none
38
38
  }
39
39
  end
40
40
  end
41
41
  </pre>
42
42
 
43
+ Available options: line_colour, line_width, line_margin, line_top, bg_colour, pen_colour, pen_width, pen_cap, error_message_draw
44
+
45
+ See "jquery.signaturepad doc":http://thomasjbradley.ca/lab/signature-pad/#options-ref for reference about options
46
+
47
+ If error_message_draw is a symbol it will be translated (using as_ method, so it must be on active_scaffold namespace)
48
+
43
49
  h4. Save image
44
50
 
45
51
  Signaturepad sends a JSON representation to signature. It can be converted to image on server, adding some code to model:
@@ -15,8 +15,9 @@ ActiveScaffold.signaturepad = function(selector_or_elements, parent) {
15
15
  if (val != null) options[opt] = val;
16
16
  });
17
17
  if (!options.displayOnly) options.drawOnly = !$pad.data('type');
18
- var api = $pad.signaturePad(options);
18
+ var signature = $('input', $pad).val(), api = $pad.signaturePad(options);
19
19
  if (options.displayOnly) api.regenerate($pad.data('signature'));
20
+ else if (signature) api.regenerate(signature);
20
21
  });
21
22
  };
22
23
 
@@ -1,8 +1,8 @@
1
1
  module ActiveScaffoldSignaturepad
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 0
5
- PATCH = 1
4
+ MINOR = 1
5
+ PATCH = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_signaturepad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-15 00:00:00.000000000 Z
12
+ date: 2014-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda