memento

$.fn.sketchable.plugins. memento

Memento plugin constructor for jQuery Sketchable instances.

Source:

Methods

(static) redo() → {jQuery}

Goes forward to the previous CANVAS state, if available.

Source:
Returns:
Type:
jQuery

jQuery sketchable element.

Example
jqueryElem.sketchable('memento.redo');

(static) restore(state) → {jQuery}

Restore a CANVAS state.

Source:
Parameters:
Name Type Description
state object

State data.

Name Type Description
image string

Base64 image.

strokes array

Associated strokes.

Returns:
Type:
jQuery

jQuery sketchable element.

Example
jqueryElem.sketchable('memento.restore', state);

(static) save() → {jQuery}

Save a snapshot of the current CANVAS.

Source:
Returns:
Type:
jQuery

jQuery sketchable element.

Example
jqueryElem.sketchable('memento.save');

(static) state() → {object}

Read current CANVAS state: { image:String, strokes:Array }.

Source:
Returns:
Type:
object
Example
var state = jqueryElem.sketchable('memento.state');

(static) undo() → {jQuery}

Goes back to the previous CANVAS state, if available.

Source:
Returns:
Type:
jQuery

jQuery sketchable element.

Example
jqueryElem.sketchable('memento.undo');