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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b3a77257acfa207f530fdc6e13bc6827c17d271
|
4
|
+
data.tar.gz: 1a0a9e09316379b470003688299a55c48fdb1e08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
:
|
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
|
|
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
|
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-
|
12
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: shoulda
|