Kind: global class
this: HTMLStock
Access: public
Since: 0.1.0
- HTMLStock
- new HTMLStock(arrayLike)
- ._map(func, _this) ⇒
- ._filter(func, _this) ⇒
- ._reduce(func, [initialValue])
- ._reduceRight(func, [initialValue])
- ._forEach(func, [thisArg])
- ._every(func, [thisArg])
- ._some(func, [thisArg])
- ._addEventListener(type, func, [options], [useCapture])
- ._listen(type, func, [options], [useCapture])
- ._removeEventListener(type, func, [options], [useCapture])
- ._unlisten(type, func, [options], [useCapture])
- ._remove()
- ._insertAdjacentHTML(position, text)
HTMLStock is an abstraction of HTMLCollection and NodeList Classes to be used
Param | Type | Description |
---|---|---|
arrayLike | object |
A NodeList, HTMLCollection or an Array Like object containing HTMLElements or undefined properties |
HTMLStock._map is an abstraction of Array's map that returns a HTMLStock instance instead of an Array
Kind: instance method of HTMLStock
Returns: HTMLStock
this: HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
func | function |
A function that will be used on every element of the HTMLStock |
_this | object |
An object to be passed as the function's context |
HTMLStock._filter is an abstraction of Array's filter that returns a HTMLStock instance instead of an Array
Kind: instance method of HTMLStock
Returns: HTMLStock
this: HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
func | function |
A function that will be used to validate every element of the HTMLStock, it will keep the elements that return truthfully in the function execution |
_this | object |
An object to be passed as the function's context |
HTMLStock._reduce is an implementation of Array.prototype.reduce for HTMLStock
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
func | function |
Function to execute on each value |
[initialValue] | Optional. Value to use as the first argument to the first call of the callback. |
HTMLStock._reduceRight is an implementation of Array.prototype.reduceRight for HTMLStock
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
func | function |
Function to execute on each value |
[initialValue] | Optional. Value to use as the first argument to the first call of the callback. |
HTMLStock._forEach is an implementation of Array.prototype.forEach for HTMLStock
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
func | function |
Function to execute for each element |
[thisArg] | Optional. Value to use as this when executing callback. |
HTMLStock._every is an implementation of Array.prototype.every for HTMLStock
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
func | function |
Function to execute on each value |
[thisArg] | Optional. Value to use as this when executing callback. |
HTMLStock._some is an implementation of Array.prototype.some for HTMLStock
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
func | function |
Function to test for each element |
[thisArg] | Optional. Value to use as this when executing callback. |
HTMLStock._addEventListener is a proxy to use the HTMLStock's elements addEventListener
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
type | string |
A string representing the event type to listen for. |
func | function |
The object that receives a notification when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function. |
[options] | object |
An options object that specifies characteristics about the event listener |
[useCapture] | boolean |
A Boolean that indicates that events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. Events that are bubbling upward through the tree will not trigger a listener designated to use capture. Event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, when both elements have registered a handle for that event. The event propagation mode determines the order in which elements receive the event. See DOM Level 3 Events and JavaScript Event order for a detailed explanation. If not specified, useCapture defaults to false. |
HTMLStock._listen is a proxy to use the HTMLStock's elements addEventListener
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
type | string |
A string representing the event type to listen for. |
func | function |
The object that receives a notification when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function. |
[options] | object |
An options object that specifies characteristics about the event listener |
[useCapture] | boolean |
A Boolean that indicates that events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. Events that are bubbling upward through the tree will not trigger a listener designated to use capture. Event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, when both elements have registered a handle for that event. The event propagation mode determines the order in which elements receive the event. See DOM Level 3 Events and JavaScript Event order for a detailed explanation. If not specified, useCapture defaults to false. |
HTMLStock._removeEventListener is a proxy to use the HTMLStock's elements removeEventListener
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
type | string |
A string representing the event type to remove. |
func | function |
The EventListener function to remove from the event target. |
[options] | object |
An options object that specifies characteristics about the event listener |
[useCapture] | boolean |
Specifies whether the EventListener to be removed is registered as a capturing listener or not. If this parameter is absent, a default value of false is assumed. |
HTMLStock._unlisten is a proxy to use the HTMLStock's elements removeEventListener
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
type | string |
A string representing the event type to remove. |
func | function |
The EventListener function to remove from the event target. |
[options] | object |
An options object that specifies characteristics about the event listener |
[useCapture] | boolean |
Specifies whether the EventListener to be removed is registered as a capturing listener or not. If this parameter is absent, a default value of false is assumed. |
HTMLStock._remove is a proxy to use the HTMLStock's childNodes remove
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
HTMLStock._insertAdjacentHTML is a proxy to use the HTMLStock's elements insertAdjacentHTML
Kind: instance method of HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
position | string |
position is the position relative to the element. |
text | string |
text is the string to be parsed as HTML or XML and inserted into the tree. |
Kind: global class
this: HTMLStockClassList
Access: public
Since: 0.1.0
HTMLStockClassList is a proxy to access the classList property of the Elements inside the HTMLStock
Param | Type | Description |
---|---|---|
instance | HTMLStockClassList |
An initiated instance of HTMLStockClassList |
HTMLStockClassList._add is a proxy to use the HTMLStock's elements classList.add
Kind: instance method of HTMLStockClassList
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
classes | Array.<string> |
Class values. If these classes already exist in attribute of the element, then they are ignored. |
HTMLStockClassList._remove is a proxy to use the HTMLStock's elements classList.remove
Kind: instance method of HTMLStockClassList
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
classes | Array.<string> |
Class values. |
HTMLStockClassList._toggle is a proxy to use the HTMLStock's elements classList.toggle
Kind: instance method of HTMLStockClassList
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
classes | Array.<string> |
Class values. When only one argument is present: Toggle class value; i.e., if class exists then remove it, if not, then add it. When a second argument is present: If the second argument is true, add specified class value, and if it is false, remove it. |
Kind: global class
this: HTMLStockClassList
Access: public
Since: 0.1.0
- HTMLStockHelper
- new HTMLStockHelper(instance)
- .buildHTMLStockClassListProto(prop)
- .applyMethodToElements(conf, [_classMethod]) ⇒
- .applySetterToElements(conf) ⇒
- .aliasMethods(propObj, _class) ⇒
- .aliasGetters(propObj, _class) ⇒
- .copyProto(prop, _class) ⇒
- .callMethods() ⇒
- .delegateCall(delegated, props, _class) ⇒
- .extendNative()
Helper that copies some methods from other prototypes, as well create some of HTMLStock methods
Param | Type | Description |
---|---|---|
instance | HTMLStockClassList |
An initiated instance of HTMLStockClassList |
Proxy a given property to every classList HTMLStock HTMLElements
Kind: instance method of HTMLStockHelper
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
prop | string |
The property name that will be proxied HTMLStock elements |
Proxy a given method to every HTMLStock HTMLElements
Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
conf | string | object |
An object with the alias and prop names, if as string is passed then the alias will be the same but with a _ (underscore) in front of it |
[_classMethod] | string |
A classMethod name that can be passed on so the property will be accessed |
Proxy a given value to every HTMLStock HTMLElements through a setter
Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
conf | string | object |
An object with the alias and prop names, if as string is passed then the alias will be the same but with a _ (underscore) in front of it |
A factory for aliases methods for a Class that will use the original Class methods but return a HTMLStock
Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
propObj | string | object |
An object with the alias and prop names, if as string is passed then the alias will be the same but with a _ (underscore) in front of it |
_class | function |
A Class that will have the alias builtin |
A factory for aliases getters for a Class that will use the original Class getter but return a HTMLStock
Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
propObj | string | object |
An object with the alias and prop names, if as string is passed then the alias will be the same but with a _ (underscore) in front of it |
_class | function |
A Class that will have the alias builtin |
Copy properties from a Class.prototype to HTMLStock.prototype
Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
prop | string |
the target property |
_class | function |
A Class that will have its prototype property copied |
Delegates a method based on the arguments passed
Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0
Calls a method passing the properties and the class that will be used by it
Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
delegated | string |
HTMLStockHelper method that will be called |
props | Array |
An array with strings or objects with the property/alias that will be passed to the method |
_class | function |
The target Class |
Extend some Native Classes and prototypes like Element, Node and HTMLDocument
Kind: instance method of HTMLStockHelper
Access: public
Since: 0.1.0
Kind: global class
Access: public
The Element interface represents an object of a Document. This interface describes methods and properties common to all kinds of elements. Specific behaviors are described in interfaces which inherit from Element but add additional functionality. For example, the HTMLElement interface is the base interface for HTML elements, while the SVGElement interface is the basis for all SVG elements.
A querySelectorAll alias that returns a HTMLStock instead of NodeList
Kind: instance method of Element
Returns: HTMLStock
Access: public
Since: 0.1.0
A querySelectorAll alias that returns a HTMLStock instead of NodeList
Kind: instance method of Element
Returns: HTMLStock
Access: public
Since: 0.1.0
Kind: global class
Access: public
Properties
Name | Type | Description |
---|---|---|
Node.prototype._children | HTMLStock |
A children alias that returns a HTMLStock instead of HTMLCollection |
Node.prototype._childNodes | HTMLStock |
A childNodes alias that returns a HTMLStock instead of HTMLCollection |
A Node is an interface from which a number of DOM types inherit, and allows these various types to be treated (or tested) similarly.
Returns all parentNodes from an Element until it reaches the HTMLBodyElement
Kind: instance method of Node
Returns: HTMLStock
this: HTMLElement
Access: public
Since: 0.1.0
Kind: global class
Access: public
Properties
Name | Type | Description |
---|---|---|
HTMLDocument.prototype._children | HTMLStock |
A children alias that returns a HTMLStock instead of HTMLCollection |
HTMLDocument.prototype._childNodes | HTMLStock |
A childNodes alias that returns a HTMLStock instead of HTMLCollection |
HTMLDocument is an abstract interface of the DOM which provides access to special properties and methods not present by default on a regular (XML) document.
A querySelectorAll alias that returns a HTMLStock instead of NodeList
Kind: instance method of HTMLDocument
Returns: HTMLStock
Access: public
Since: 0.1.0
A querySelectorAll alias that returns a HTMLStock instead of NodeList
Kind: instance method of HTMLDocument
Returns: HTMLStock
Access: public
Since: 0.1.0