mirror of https://github.com/luileito/jsketch.git
Updated doc
This commit is contained in:
parent
8bb7360f2b
commit
06d19333cd
|
|
@ -61,6 +61,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel current animation.
|
* Cancel current animation.
|
||||||
|
* @return {AnimateSketch}.
|
||||||
*/
|
*/
|
||||||
this.cancel = function() {
|
this.cancel = function() {
|
||||||
cancelAnimationFrame(raf);
|
cancelAnimationFrame(raf);
|
||||||
|
|
@ -107,7 +108,7 @@
|
||||||
/**
|
/**
|
||||||
* Animate plugin constructor for jQuery Sketchable instances.
|
* Animate plugin constructor for jQuery Sketchable instances.
|
||||||
* @param {jQuery} $instance - jQuery Sketchable instance.
|
* @param {jQuery} $instance - jQuery Sketchable instance.
|
||||||
* @memberof $.fn.sketchable.plugins
|
* @namespace $.fn.sketchable.plugins.animate
|
||||||
*/
|
*/
|
||||||
$.fn.sketchable.plugins.animate = function($instance) {
|
$.fn.sketchable.plugins.animate = function($instance) {
|
||||||
// Access the instance configuration.
|
// Access the instance configuration.
|
||||||
|
|
@ -156,7 +157,7 @@
|
||||||
/**
|
/**
|
||||||
* Animate canvas strokes.
|
* Animate canvas strokes.
|
||||||
* @return {jQuery} jQuery sketchable element.
|
* @return {jQuery} jQuery sketchable element.
|
||||||
* @memberof $.fn.sketchable
|
* @memberof $.fn.sketchable.plugins.animate
|
||||||
* @example jqueryElem.sketchable('strokes', strokesArray).sketchable('animate.strokes');
|
* @example jqueryElem.sketchable('strokes', strokesArray).sketchable('animate.strokes');
|
||||||
* @example
|
* @example
|
||||||
* // Accessing event hooks:
|
* // Accessing event hooks:
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@
|
||||||
* Note: This is equivalent to accessing `Sketchable.prototype` in the non-jQuery version.
|
* Note: This is equivalent to accessing `Sketchable.prototype` in the non-jQuery version.
|
||||||
* @namespace $.fn.sketchable.api
|
* @namespace $.fn.sketchable.api
|
||||||
* @type {object}
|
* @type {object}
|
||||||
* @see Sketchable.prototype
|
* @see Sketchable
|
||||||
*/
|
*/
|
||||||
$.fn.sketchable.api = api;
|
$.fn.sketchable.api = api;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@
|
||||||
/**
|
/**
|
||||||
* Memento plugin constructor for jQuery Sketchable instances.
|
* Memento plugin constructor for jQuery Sketchable instances.
|
||||||
* @param {jQuery} $instance - jQuery sketchable instance.
|
* @param {jQuery} $instance - jQuery sketchable instance.
|
||||||
* @memberof $.fn.sketchable.plugins
|
* @namespace $.fn.sketchable.plugins.memento
|
||||||
*/
|
*/
|
||||||
$.fn.sketchable.plugins.memento = function($instance) {
|
$.fn.sketchable.plugins.memento = function($instance) {
|
||||||
// Access the instance configuration.
|
// Access the instance configuration.
|
||||||
|
|
@ -217,7 +217,7 @@
|
||||||
/**
|
/**
|
||||||
* Goes back to the previous CANVAS state, if available.
|
* Goes back to the previous CANVAS state, if available.
|
||||||
* @return {jQuery} jQuery sketchable element.
|
* @return {jQuery} jQuery sketchable element.
|
||||||
* @memberof $.fn.sketchable
|
* @memberof $.fn.sketchable.plugins.memento
|
||||||
* @example jqueryElem.sketchable('memento.undo');
|
* @example jqueryElem.sketchable('memento.undo');
|
||||||
*/
|
*/
|
||||||
undo: function() {
|
undo: function() {
|
||||||
|
|
@ -228,7 +228,7 @@
|
||||||
/**
|
/**
|
||||||
* Goes forward to the previous CANVAS state, if available.
|
* Goes forward to the previous CANVAS state, if available.
|
||||||
* @return {jQuery} jQuery sketchable element.
|
* @return {jQuery} jQuery sketchable element.
|
||||||
* @memberof $.fn.sketchable
|
* @memberof $.fn.sketchable.plugins.memento
|
||||||
* @example jqueryElem.sketchable('memento.redo');
|
* @example jqueryElem.sketchable('memento.redo');
|
||||||
*/
|
*/
|
||||||
redo: function() {
|
redo: function() {
|
||||||
|
|
@ -239,7 +239,7 @@
|
||||||
/**
|
/**
|
||||||
* Save a snapshot of the current CANVAS.
|
* Save a snapshot of the current CANVAS.
|
||||||
* @return {jQuery} jQuery sketchable element.
|
* @return {jQuery} jQuery sketchable element.
|
||||||
* @memberof $.fn.sketchable
|
* @memberof $.fn.sketchable.plugins.memento
|
||||||
* @example jqueryElem.sketchable('memento.save');
|
* @example jqueryElem.sketchable('memento.save');
|
||||||
*/
|
*/
|
||||||
save: function() {
|
save: function() {
|
||||||
|
|
@ -250,7 +250,7 @@
|
||||||
/**
|
/**
|
||||||
* Read current CANVAS state: `{ image:String, strokes:Array }`.
|
* Read current CANVAS state: `{ image:String, strokes:Array }`.
|
||||||
* @return {object}
|
* @return {object}
|
||||||
* @memberof $.fn.sketchable
|
* @memberof $.fn.sketchable.plugins.memento
|
||||||
* @example var state = jqueryElem.sketchable('memento.state');
|
* @example var state = jqueryElem.sketchable('memento.state');
|
||||||
*/
|
*/
|
||||||
state: function() {
|
state: function() {
|
||||||
|
|
@ -263,7 +263,7 @@
|
||||||
* @param {string} state.image - Base64 image.
|
* @param {string} state.image - Base64 image.
|
||||||
* @param {array} state.strokes - Associated strokes.
|
* @param {array} state.strokes - Associated strokes.
|
||||||
* @return {jQuery} jQuery sketchable element.
|
* @return {jQuery} jQuery sketchable element.
|
||||||
* @memberof $.fn.sketchable
|
* @memberof $.fn.sketchable.plugins.memento
|
||||||
* @example jqueryElem.sketchable('memento.restore', state);
|
* @example jqueryElem.sketchable('memento.restore', state);
|
||||||
*/
|
*/
|
||||||
restore: function(state) {
|
restore: function(state) {
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,6 @@
|
||||||
/**
|
/**
|
||||||
* jSketch methods (publicly extensible).
|
* jSketch methods (publicly extensible).
|
||||||
* @ignore
|
* @ignore
|
||||||
* @memberof jSketch
|
|
||||||
* @see jSketch
|
|
||||||
*/
|
*/
|
||||||
jSketch.prototype = {
|
jSketch.prototype = {
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel current animation.
|
* Cancel current animation.
|
||||||
|
* @return {AnimateSketch}.
|
||||||
*/
|
*/
|
||||||
this.cancel = function() {
|
this.cancel = function() {
|
||||||
cancelAnimationFrame(raf);
|
cancelAnimationFrame(raf);
|
||||||
|
|
@ -109,7 +110,7 @@
|
||||||
/**
|
/**
|
||||||
* Animate plugin constructor for jQuery Sketchable instances.
|
* Animate plugin constructor for jQuery Sketchable instances.
|
||||||
* @param {Sketchable} instance - Sketchable element.
|
* @param {Sketchable} instance - Sketchable element.
|
||||||
* @memberof Sketchable#plugins
|
* @namespace Sketchable.plugins.animate
|
||||||
*/
|
*/
|
||||||
Sketchable.prototype.plugins.animate = function(instance) {
|
Sketchable.prototype.plugins.animate = function(instance) {
|
||||||
// Access the instance configuration.
|
// Access the instance configuration.
|
||||||
|
|
@ -158,7 +159,7 @@
|
||||||
/**
|
/**
|
||||||
* Animate canvas strokes.
|
* Animate canvas strokes.
|
||||||
* @return {Sketchable} instance Sketchable element.
|
* @return {Sketchable} instance Sketchable element.
|
||||||
* @memberof Sketchable
|
* @memberof Sketchable.plugins.animate
|
||||||
* @example sketchableInstance.strokes(strokeArray).animate.strokes();
|
* @example sketchableInstance.strokes(strokeArray).animate.strokes();
|
||||||
* @example
|
* @example
|
||||||
* // Accessing event hooks:
|
* // Accessing event hooks:
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@
|
||||||
/**
|
/**
|
||||||
* Memento plugin constructor for Sketchable instances.
|
* Memento plugin constructor for Sketchable instances.
|
||||||
* @param {Sketchable} instance - Sketchable element.
|
* @param {Sketchable} instance - Sketchable element.
|
||||||
* @memberof Sketchable#plugins
|
* @namespace Sketchable.plugins.memento
|
||||||
*/
|
*/
|
||||||
Sketchable.prototype.plugins.memento = function(instance) {
|
Sketchable.prototype.plugins.memento = function(instance) {
|
||||||
// Access the instance configuration.
|
// Access the instance configuration.
|
||||||
|
|
@ -219,7 +219,7 @@
|
||||||
/**
|
/**
|
||||||
* Goes back to the previous CANVAS state, if available.
|
* Goes back to the previous CANVAS state, if available.
|
||||||
* @return {Sketchable} Sketchable instance.
|
* @return {Sketchable} Sketchable instance.
|
||||||
* @memberof Sketchable
|
* @memberof Sketchable.plugins.memento
|
||||||
* @example sketchableInstance.memento.undo();
|
* @example sketchableInstance.memento.undo();
|
||||||
*/
|
*/
|
||||||
undo: function() {
|
undo: function() {
|
||||||
|
|
@ -230,7 +230,7 @@
|
||||||
/**
|
/**
|
||||||
* Goes forward to the previous CANVAS state, if available.
|
* Goes forward to the previous CANVAS state, if available.
|
||||||
* @return {Sketchable} Sketchable instance.
|
* @return {Sketchable} Sketchable instance.
|
||||||
* @memberof Sketchable
|
* @memberof Sketchable.plugins.memento
|
||||||
* @example sketchableInstance.memento.redo();
|
* @example sketchableInstance.memento.redo();
|
||||||
*/
|
*/
|
||||||
redo: function() {
|
redo: function() {
|
||||||
|
|
@ -241,7 +241,7 @@
|
||||||
/**
|
/**
|
||||||
* Save a snapshot of the current CANVAS.
|
* Save a snapshot of the current CANVAS.
|
||||||
* @return {Sketchable} Sketchable instance.
|
* @return {Sketchable} Sketchable instance.
|
||||||
* @memberof Sketchable
|
* @memberof Sketchable.plugins.memento
|
||||||
* @example sketchableInstance.memento.save();
|
* @example sketchableInstance.memento.save();
|
||||||
*/
|
*/
|
||||||
save: function() {
|
save: function() {
|
||||||
|
|
@ -252,7 +252,7 @@
|
||||||
/**
|
/**
|
||||||
* Read current CANVAS state: `{ image:String, strokes:Array }`.
|
* Read current CANVAS state: `{ image:String, strokes:Array }`.
|
||||||
* @return {object}
|
* @return {object}
|
||||||
* @memberof Sketchable
|
* @memberof Sketchable.plugins.memento
|
||||||
* @example var state = sketchableInstance.memento.state();
|
* @example var state = sketchableInstance.memento.state();
|
||||||
*/
|
*/
|
||||||
state: function() {
|
state: function() {
|
||||||
|
|
@ -265,7 +265,7 @@
|
||||||
* @param {string} state.image - Base64 image.
|
* @param {string} state.image - Base64 image.
|
||||||
* @param {array} state.strokes - Associated strokes.
|
* @param {array} state.strokes - Associated strokes.
|
||||||
* @return {Sketchable} Sketchable instance.
|
* @return {Sketchable} Sketchable instance.
|
||||||
* @memberof Sketchable
|
* @memberof Sketchable.plugins.memento
|
||||||
* @example
|
* @example
|
||||||
* var someState = sketchableInstance.memento.state();
|
* var someState = sketchableInstance.memento.state();
|
||||||
* sketchableInstance.memento.restore(someState);
|
* sketchableInstance.memento.restore(someState);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue