sp.signature
Capture signatures easy peasy lemon squeezy. Converts to SVG format for proper storage.
How to use
Alloy View
<Alloy>
<Window id="win" onLoad="doLoad">
<Widget id="sigCapture" src="sp.signature" />
</Window>
</Alloy>
Alloy Controller
// Load Signature Capture widget
$.sigCapture.init({
borderColor:"#444",
top:5,
width:(Alloy.Globals.deviceHeight-50),
height:(Alloy.Globals.deviceWidth-100)
});
// Capture Signature
$.sigCapture.save();
Methods
Init
Instantiate the canvas element.
Save
Generate SVG file. Fires a callback.
Clear
Undo
Events
app:signature:capture
app:signature:save
Generate SVG file. Callback contains string representation. Must convert to Buffer before uploading to server as a file object.
app:signature:undo
Clear last gesture.
app:signature:modified
Determine if a signature has been started.
License
Author: Terry Z Martin, @tzmartin
Copyright 2014 Semantic Press. All rights reserved.