Skip to content

Latest commit

 

History

History
1034 lines (736 loc) · 29.1 KB

File metadata and controls

1034 lines (736 loc) · 29.1 KB

Classes

List

{Object} List List object

Pattern

{Object} Pattern Pattern object

Point

{Object} Point X & Y coordinates for an object

Cursor

{Object} Cursor Cursor object

Text

{Object} Text Text object

MouseMove

{Object} MouseMove MouseMove utilization class

Functions

pxToNumber(value)number

Converts CSS string value to number/integer

jsonToCss(json)string

Converts the 'css' object into a CSS inline string

setCursorType(element)

Set's the cursor type based on passed element's tag name

getCenterPoint(element)Point

Gets the center point of an element

mouseover(element)

Actions executed after a mouseover event

mouseout(element)

Actions executed after a mouseout event

createCursor(id, type)

Create and embeds cursor within DOM

isXPath(id)boolean

Checks whether the passed id is an XPath

isCssSelector(id)boolean

Checks whether the passed id is a CSS query selector

isId(id)boolean

Checks whether the passed id is an element identifier

isCamelCase(string)boolean

Checks whether a string is camel case

isXPathOrCssSelector(id)boolean

Checks whether an id is an XPath or CSS Selector

setUserAgent()

Identifies and sets the present user agent

getElementByXPath(xpath)Object

Returns an element based on its XPath

getXPath(element)string

Returns an XPath for the passed element

getElement(id)Object

Returns a DOM's element based on its identifier

getEasing(type)function

Returns an easing function based on the input type

getElementByXPathOrSelector(id)Object

Returns an element based on its XPath or CSS Selector

addGeneratedId(id)Object

Adds a generated id to the passed element

cleanScriptCode(script)string

Cleans script of it's function wrapper

hotkeyListener()function

Mousetrap hotkey listener for activating MouseMove.go ( )

embedMousetrap()

Embed mousetrap script into DOM

seedMouseEvents()

Seeds mouse binding mouse events along with unique identifiers

List

{Object} List List object

Kind: global class
Properties

Name Type Description
index number Index of list
current string Current data value of list
length number Length of list

new List(array)

Creates a list

Param Type Description
array Array Array list

list.index

Set index property

Kind: instance property of List

Param Type Description
value number Index value

list.index ⇒ number

Get index property

Kind: instance property of List
Returns: number - Index value

list.current

Set current value

Kind: instance property of List

Param Type Description
value string Current data value

list.current ⇒ string

Get current value

Kind: instance property of List
Returns: string - Current data value

list.currentId ⇒ string

Get current DOM identifier

Kind: instance property of List
Returns: string - Current DOM identifier

list.next() ⇒ string

Go to next value in list

Kind: instance method of List
Returns: string - Identifier for DOM
Note: increment after completion

list.prev() ⇒ string

Go to previous value in list

Kind: instance method of List
Returns: string - Identifier of DOM
Note: increment before completion

List.isList(array) ⇒ boolean

Checks whether the passed value is an instance of List

Kind: static method of List
Returns: boolean - True | False

Param Type Description
array List List instance

Pattern

{Object} Pattern Pattern object

Kind: global class
Properties

Name Type Description
index number Index of list
current string Current data value of list
length number Length of list

new Pattern(array)

Creates a list

Param Type Description
array Array Array list

pattern.index

Set index property

Kind: instance property of Pattern

Param Type Description
value number Index value

pattern.index ⇒ number

Get index property

Kind: instance property of Pattern
Returns: number - Index value

pattern.current

Set current value

Kind: instance property of Pattern

Param Type Description
value string Current data value

pattern.current ⇒ Object

Get current value

Kind: instance property of Pattern
Returns: Object - Current data value

pattern.currentId ⇒ string

Get current DOM identifier

Kind: instance property of Pattern
Returns: string - Current DOM Identifier

pattern.currentAction ⇒ string

Get current action

Kind: instance property of Pattern
Returns: string - Current action

pattern.next() ⇒ string

Go to next value in list

Kind: instance method of Pattern
Returns: string - Identifier for DOM
Note: increment after completion

pattern.prev() ⇒ string

Go to previous value in list

Kind: instance method of Pattern
Returns: string - Identifier of DOM
Note: increment before completion

pattern.indexOfId(id)

Returns the index of the passed id; within the pattern array

Kind: instance method of Pattern

Param Type Description
id string Identifier of DOM; XPath, CSS Selector

pattern.insert(index, object)

Inserts an object at the index provided

Kind: instance method of Pattern

Param Type Description
index number Index number to insert into
object Object Implicitly of explicitly declared object; see README.md

Pattern.isPattern(arrayOfObjects) ⇒ boolean

Checks whether the passed value is an instance of Pattern

Kind: static method of Pattern
Returns: boolean - True | False

Param Type Description
arrayOfObjects Pattern Pattern instance

Point

{Object} Point X & Y coordinates for an object

Kind: global class
Properties

Name Type Default Description
[x] number 0 X - x-axis coordinate
[y] number 0 Y - y-axis coordinate

new Point(x, y)

Create a point

Param Type Description
x number X coordinate value
y number Y coordinate value

point.x

Set x-axis value

Kind: instance property of Point

Param Type Description
value number X coordinate value

point.x ⇒ number

Get x-axis value

Kind: instance property of Point
Returns: number - X coordinate value

point.y

Set the y-axis value

Kind: instance property of Point

Param Type Description
value number Y coordinate value

point.y ⇒ number

Get y-axis value

Kind: instance property of Point
Returns: number - Y coordinate value

Point.isPoint(object) ⇒ boolean

Checks whether the passed object is an instance of Point

Kind: static method of Point
Returns: boolean - True | False

Param Type Description
object Point Point instance

Cursor

{Object} Cursor Cursor object

Kind: global class
Properties

Name Type Description
position Point X & Y axis coordinates
id string Cursor's DOM identifier
type string Type of cursor
config Object Internal private configuration
tools Object Internal private utility methods

new Cursor(position, id, type)

Create a single instance of a Cursor

Param Type Description
position string X & Y axis coordinates
id string Cursor's DOM identifier
type string Type of cursor, within #_cursors

cursor.id

Set id property

Kind: instance property of Cursor

Param Type Description
id string Identifier of Cursor

cursor.id ⇒ string

Get id property

Kind: instance property of Cursor
Returns: string - Identifier of Cursor

cursor.type

Set type property

Kind: instance property of Cursor

Param Type Description
value string Type property

cursor.type

Get type property

Kind: instance property of Cursor

Param Type Description
Type string property

cursor.position

Set position property

Kind: instance property of Cursor

Param Type Description
point Point X & Y coordinates

cursor.position ⇒ Point

Get position property

Kind: instance property of Cursor
Returns: Point - X & Y coordinates

cursor.distance

Set distance property

Kind: instance property of Cursor

Param Type Description
id string Identifier of element

cursor.distance ⇒ number

Get distance property

Kind: instance property of Cursor
Returns: number - Distance from last distance check

cursor.angle

Set angle property

Kind: instance property of Cursor

Param Type Description
id string Identifier of element

cursor.angle ⇒ number

Get angle property

Kind: instance property of Cursor
Returns: number - Angle property; in radians

cursor.nextElement(id)

Sets the next element

Kind: instance method of Cursor

Param Type Description
id string Identifier of element within DOM

cursor.toNextElement(id)

Sends cursor to the location of the next element

Kind: instance method of Cursor

Param Type Description
id string Identifier of element within DOM

cursor.mouseAction(element)

Initiates any mouse actions associated with the passed 'element'

Kind: instance method of Cursor

Param Type Description
element HTMLElement HTML DOM element

cursor.switchType(type)

Switch cursor's visual type

Kind: instance method of Cursor

Param Type Default Description
type string "pointer" Cursor type within #config.presentation [ os ].cursors [ type ]

cursor.createSelectOptions(id, id)

Creates and mirrors a select input element; from the DOM

Kind: instance method of Cursor

Param Type Description
id string Identifier of element within DOM
id string Identifier of element within DOM

cursor.setInteraction()

Set's this cursor's mouse interaction type; with other DOM elements

Kind: instance method of Cursor

Cursor.isCursor(value) ⇒ boolean

Checks whether the passed value is an instance of Cursor

Kind: static method of Cursor
Returns: boolean - True | False

Param Type Description
value Cursor Cursor instance

Text

{Object} Text Text object

Kind: global class

Text.write(text, id, [timing])

Writes text within an input element

Kind: static method of Text

Param Type Default Description
text string Text output
id string Input Identifier
[timing] number 120 Timing interval for typing

MouseMove

{Object} MouseMove MouseMove utilization class

Kind: global class
Properties

Name Type Description
sequence Pattern | List Pattern or List object
cursor Cursor Cursor object
animation string Cursor linear animation
config Object Internal private configuration
tools Object Internal private utility methods

new MouseMove(sequence, cursor)

Create a single instance of MouseMove

Param Type Description
sequence Array Pattern or List of DOM identifiers
cursor Cursor Cursor object

mouseMove.sequence

Set sequence property

Kind: instance property of MouseMove

Param Type Description
array Array Array object

mouseMove.sequence ⇒ Array

Get sequence property

Kind: instance property of MouseMove
Returns: Array - List or Pattern instance

mouseMove.cursor

Set cursor property

Kind: instance property of MouseMove

Param Type Description
cursor Cursor Cursor object

mouseMove.cursor ⇒ Cursor

Get cursor property

Kind: instance property of MouseMove
Returns: Cursor - Cursor object

mouseMove.animation

Set animation property

Kind: instance property of MouseMove

Param Type Description
value string Animation type within #config.animations

mouseMove.animation ⇒ string

Get animation property

Kind: instance property of MouseMove
Returns: string - Animation type

mouseMove.go(duration)

Animate cursor

Kind: instance method of MouseMove

Param Type Description
duration number Duration of the animation

pxToNumber(value) ⇒ number

Converts CSS string value to number/integer

Kind: global function
Returns: number - Number value of parsed value

Param Type Description
value string CSS string value in pixels

jsonToCss(json) ⇒ string

Converts the 'css' object into a CSS inline string

Kind: global function
Returns: string - CSS inline string

Param Type Description
json object CSS object from #config.presentation.settings.css [ type ]

setCursorType(element)

Set's the cursor type based on passed element's tag name

Kind: global function

Param Type Description
element Object HTML DOM element

getCenterPoint(element) ⇒ Point

Gets the center point of an element

Kind: global function
Returns: Point - X & Y Coordinates

Param Type Description
element Object HTML DOM element

mouseover(element)

Actions executed after a mouseover event

Kind: global function

Param Type Description
element HTMLElement HTML DOM element

mouseout(element)

Actions executed after a mouseout event

Kind: global function

Param Type Description
element HTMLElement HTML DOM element

createCursor(id, type)

Create and embeds cursor within DOM

Kind: global function

Param Type Description
id string Identifier of cursor
type string Cursor type within #config.presentation [ os ].cursors [ type ]

isXPath(id) ⇒ boolean

Checks whether the passed id is an XPath

Kind: global function
Returns: boolean - True | False

Param Type Description
id string XPath

isCssSelector(id) ⇒ boolean

Checks whether the passed id is a CSS query selector

Kind: global function
Returns: boolean - True | False

Param Type Description
id string CSS query selector

isId(id) ⇒ boolean

Checks whether the passed id is an element identifier

Kind: global function
Returns: boolean - True | False

Param Type Description
id string Element identifier

isCamelCase(string) ⇒ boolean

Checks whether a string is camel case

Kind: global function
Returns: boolean - True | False

Param Type Description
string string Camel case string

isXPathOrCssSelector(id) ⇒ boolean

Checks whether an id is an XPath or CSS Selector

Kind: global function
Returns: boolean - True | False

Param Type Description
id string XPath or CSS Selector

setUserAgent()

Identifies and sets the present user agent

Kind: global function

getElementByXPath(xpath) ⇒ Object

Returns an element based on its XPath

Kind: global function
Returns: Object - HTML DOM element

Param Type Description
xpath string XPath

getXPath(element) ⇒ string

Returns an XPath for the passed element

Kind: global function
Returns: string - XPath

Param Type Description
element Object HTML DOM element

getElement(id) ⇒ Object

Returns a DOM's element based on its identifier

Kind: global function
Returns: Object - HTML DOM element

Param Type Description
id string CSS query, identifier, or XPath

getEasing(type) ⇒ function

Returns an easing function based on the input type

Kind: global function
Returns: function - Easing function from #config.animation.ease

Param Type Description
type string Type of easing animation, in camel case: i.e.: 'easeInSine'

getEasing~_stringToBracketNotation(string) ⇒ Array

Converts camel case string into an . for bracket notation

Kind: inner method of getEasing
Returns: Array - Array of strings

Param Type Description
string string Camel case string to split

getElementByXPathOrSelector(id) ⇒ Object

Returns an element based on its XPath or CSS Selector

Kind: global function
Returns: Object - HTML DOM element

Param Type Description
id string XPath or CSS Selector

addGeneratedId(id) ⇒ Object

Adds a generated id to the passed element

Kind: global function
Returns: Object - element HTML DOM element

Param Type Description
id string Element identifier

cleanScriptCode(script) ⇒ string

Cleans script of it's function wrapper

Kind: global function
Returns: string - Function as a string

Param Type Description
script function JavaScript function

hotkeyListener() ⇒ function

Mousetrap hotkey listener for activating MouseMove.go ( )

Kind: global function
Returns: function - Mousetrap hotkey listener

embedMousetrap()

Embed mousetrap script into DOM

Kind: global function

seedMouseEvents()

Seeds mouse binding mouse events along with unique identifiers

Kind: global function