signature-pad-rails 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ if(!this.JSON){this.JSON={};}
2
+ (function(){function f(n){return n<10?'0'+n:n;}
3
+ if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
4
+ f(this.getUTCMonth()+1)+'-'+
5
+ f(this.getUTCDate())+'T'+
6
+ f(this.getUTCHours())+':'+
7
+ f(this.getUTCMinutes())+':'+
8
+ f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
9
+ var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
10
+ function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
11
+ if(typeof rep==='function'){value=rep.call(holder,key,value);}
12
+ switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
13
+ gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
14
+ v=partial.length===0?'[]':gap?'[\n'+gap+
15
+ partial.join(',\n'+gap)+'\n'+
16
+ mind+']':'['+partial.join(',')+']';gap=mind;return v;}
17
+ if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
18
+ v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
19
+ mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
20
+ if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
21
+ rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
22
+ return str('',{'':value});};}
23
+ if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
24
+ return reviver.call(holder,key,value);}
25
+ cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
26
+ ('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
27
+ if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
28
+ throw new SyntaxError('JSON.parse');};}}());
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require 'signature-pad/jquery.signaturepad'
3
+ */
@@ -0,0 +1,210 @@
1
+ @font-face {
2
+ font-family: 'Journal';
3
+ src: url("<%= asset_path 'signature-pad/journal.eot' %>");
4
+ src: url("<%= asset_path 'signature-pad/journal.eot?#iefix' %>") format('embedded-opentype'),
5
+ url("<%= asset_path 'signature-pad/journal.woff' %>") format('woff'),
6
+ url("<%= asset_path 'signature-pad/journal.ttf' %>") format('truetype'),
7
+ url("<%= asset_path 'signature-pad/journal.svg#JournalRegular' %>") format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ .sigPad {
13
+ margin: 0;
14
+ padding: 0;
15
+ width: 200px;
16
+ }
17
+
18
+ .sigPad label {
19
+ display: block;
20
+ margin: 0 0 0.515em;
21
+ padding: 0;
22
+
23
+ color: #000;
24
+ font: italic normal 1em/1.375 Georgia,Times,serif;
25
+ }
26
+
27
+ .sigPad label.error {
28
+ color: #f33;
29
+ }
30
+
31
+ .sigPad input {
32
+ margin: 0;
33
+ padding: 0.2em 0;
34
+ width: 198px;
35
+
36
+ border: 1px solid #666;
37
+
38
+ font-size: 1em;
39
+ }
40
+
41
+ .sigPad input.error {
42
+ border-color: #f33;
43
+ }
44
+
45
+ .sigPad button {
46
+ margin: 1em 0 0 0;
47
+ padding: 0.6em 0.6em 0.7em;
48
+
49
+ background-color: #ccc;
50
+ border: 0;
51
+ -moz-border-radius: 8px;
52
+ -webkit-border-radius: 8px;
53
+ border-radius: 8px;
54
+
55
+ cursor: pointer;
56
+
57
+ color: #555;
58
+ font: bold 1em/1.375 sans-serif;
59
+ text-align: left;
60
+ }
61
+
62
+ .sigPad button:hover {
63
+ background-color: #333;
64
+
65
+ color: #fff;
66
+ }
67
+
68
+ .sig {
69
+ display: none;
70
+ }
71
+
72
+ .sigNav {
73
+ display: none;
74
+ height: 2.25em;
75
+ margin: 0;
76
+ padding: 0;
77
+ position: relative;
78
+
79
+ list-style-type: none;
80
+ }
81
+
82
+ .sigNav li {
83
+ display: inline;
84
+ float: left;
85
+ margin: 0;
86
+ padding: 0;
87
+ }
88
+
89
+ .sigNav a,
90
+ .sigNav a:link,
91
+ .sigNav a:visited {
92
+ display: block;
93
+ margin: 0;
94
+ padding: 0 0.6em;
95
+
96
+ border: 0;
97
+
98
+ color: #333;
99
+ font-weight: bold;
100
+ line-height: 2.25em;
101
+ text-decoration: underline;
102
+ }
103
+
104
+ .sigNav a.current,
105
+ .sigNav a.current:link,
106
+ .sigNav a.current:visited {
107
+ background-color: #666;
108
+ -moz-border-radius-topleft: 8px;
109
+ -moz-border-radius-topright: 8px;
110
+ -webkit-border-top-left-radius: 8px;
111
+ -webkit-border-top-right-radius: 8px;
112
+ border-radius: 8px 8px 0 0;
113
+
114
+ color: #fff;
115
+ text-decoration: none;
116
+ }
117
+
118
+ .sigNav .typeIt a.current,
119
+ .sigNav .typeIt a.current:link,
120
+ .sigNav .typeIt a.current:visited {
121
+ background-color: #ccc;
122
+
123
+ color: #555;
124
+ }
125
+
126
+ .sigNav .clearButton {
127
+ bottom: 0.2em;
128
+ display: none;
129
+ position: absolute;
130
+ right: 0;
131
+
132
+ font-size: 0.75em;
133
+ line-height: 1.375;
134
+ }
135
+
136
+ .sigWrapper {
137
+ clear: both;
138
+ height: 55px;
139
+
140
+ border: 1px solid #ccc;
141
+ }
142
+
143
+ .sigWrapper.current {
144
+ border-color: #666;
145
+ }
146
+
147
+ .signed .sigWrapper {
148
+ border: 0;
149
+ }
150
+
151
+ .pad {
152
+ position: relative;
153
+
154
+ /**
155
+ * For cross browser compatibility, this should be an absolute URL
156
+ * In IE the cursor is relative to the HTML document
157
+ * In all other browsers the cursor is relative to the CSS file
158
+ *
159
+ * http://www.useragentman.com/blog/2011/12/21/cross-browser-css-cursor-images-in-depth/
160
+ */
161
+ cursor: url("../assets/signature-pad/pen.cur"), crosshair;
162
+ /**
163
+ * IE will ignore this line because of the hotspot position
164
+ * Unfortunately we need this twice, because some browsers ignore the hotspot inside the .cur
165
+ */
166
+ cursor: url(<%= asset_path 'signature-pad/pen.cur' %>) 16 16, crosshair;
167
+
168
+ -ms-touch-action: none;
169
+ -webkit-user-select: none;
170
+ -moz-user-select: none;
171
+ -ms-user-select: none;
172
+ -o-user-select: none;
173
+ user-select: none;
174
+ }
175
+
176
+ .typed {
177
+ height: 55px;
178
+ margin: 0;
179
+ padding: 0 5px;
180
+ position: absolute;
181
+ z-index: 90;
182
+
183
+ cursor: default;
184
+
185
+ color: #145394;
186
+ font: normal 1.875em/50px "Journal",Georgia,Times,serif;
187
+ }
188
+
189
+ .typeItDesc,
190
+ .drawItDesc {
191
+ display: none;
192
+ margin: 0.75em 0 0.515em;
193
+ padding: 0.515em 0 0;
194
+
195
+ border-top: 3px solid #ccc;
196
+
197
+ color: #000;
198
+ font: italic normal 1em/1.375 Georgia,Times,serif;
199
+ }
200
+
201
+ p.error {
202
+ display: block;
203
+ margin: 0.5em 0;
204
+ padding: 0.4em;
205
+
206
+ background-color: #f33;
207
+
208
+ color: #fff;
209
+ font-weight: bold;
210
+ }
@@ -0,0 +1,10 @@
1
+ require "signature/pad/rails/version"
2
+
3
+ module Signature
4
+ module Pad
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ module Signature
2
+ module Pad
3
+ module Rails
4
+ VERSION = "0.2"
5
+ SIGNATURE_PAD_VERSION = "2.5.1"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'signature/pad/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "signature-pad-rails"
8
+ spec.version = Signature::Pad::Rails::VERSION
9
+ spec.authors = ["Justin Tomich"]
10
+ spec.email = ["tomichj@gmail.com"]
11
+ spec.summary = "Use Tom Bradley's Signature Pad with rails"
12
+ spec.description = "This gem provides Tom Bradley's Signature Pad jquery plugin, plus json2 and flashcanvas. See http://thomasjbradley.ca/lab/signature-pad/"
13
+ spec.homepage = "https://github.com/tomichj/signature-pad-rails"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_dependency "rails", ">= 4.0.0", "< 5.0"
20
+ spec.add_dependency "jquery-rails", ">= 3.1.0", "< 5.0"
21
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: signature-pad-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ platform: ruby
6
+ authors:
7
+ - Justin Tomich
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 4.0.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: jquery-rails
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 3.1.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '5.0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 3.1.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '5.0'
53
+ description: This gem provides Tom Bradley's Signature Pad jquery plugin, plus json2
54
+ and flashcanvas. See http://thomasjbradley.ca/lab/signature-pad/
55
+ email:
56
+ - tomichj@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - ".gitignore"
62
+ - CHANGELOG.md
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - app/assets/cursors/signature-pad/pen.cur
68
+ - app/assets/flash/signature-pad/flashcanvas.swf
69
+ - app/assets/fonts/signature-pad/journal.eot
70
+ - app/assets/fonts/signature-pad/journal.svg
71
+ - app/assets/fonts/signature-pad/journal.ttf
72
+ - app/assets/fonts/signature-pad/journal.woff
73
+ - app/assets/javascripts/signature-pad.js
74
+ - app/assets/javascripts/signature-pad/flashcanvas.js
75
+ - app/assets/javascripts/signature-pad/jquery.signaturepad.js
76
+ - app/assets/javascripts/signature-pad/json2.min.js
77
+ - app/assets/stylesheets/signature-pad.css
78
+ - app/assets/stylesheets/signature-pad/jquery.signaturepad.css.erb
79
+ - lib/signature/pad/rails.rb
80
+ - lib/signature/pad/rails/version.rb
81
+ - signature-pad-rails.gemspec
82
+ homepage: https://github.com/tomichj/signature-pad-rails
83
+ licenses:
84
+ - MIT
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.2.2
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Use Tom Bradley's Signature Pad with rails
106
+ test_files: []