Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

7 Commits

Repository files navigation

Build StatusDependencies

Classes

HTMLStock
HTMLStockClassList
HTMLStockHelper
Element
Node
HTMLDocument

HTMLStock

Kind: global class
this: HTMLStock
Access: public
Since: 0.1.0

new HTMLStock(arrayLike)

HTMLStock is an abstraction of HTMLCollection and NodeList Classes to be used

ParamTypeDescription
arrayLikeobjectA NodeList, HTMLCollection or an Array Like object containing HTMLElements or undefined properties

htmlStock._map(func, _this) ⇒

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

ParamTypeDescription
funcfunctionA function that will be used on every element of the HTMLStock
_thisobjectAn object to be passed as the function's context

htmlStock._filter(func, _this) ⇒

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

ParamTypeDescription
funcfunctionA function that will be used to validate every element of the HTMLStock, it will keep the elements that return truthfully in the function execution
_thisobjectAn object to be passed as the function's context

htmlStock._reduce(func, [initialValue])

HTMLStock._reduce is an implementation of Array.prototype.reduce for HTMLStock

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
funcfunctionFunction to execute on each value
[initialValue]Optional. Value to use as the first argument to the first call of the callback.

htmlStock._reduceRight(func, [initialValue])

HTMLStock._reduceRight is an implementation of Array.prototype.reduceRight for HTMLStock

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
funcfunctionFunction to execute on each value
[initialValue]Optional. Value to use as the first argument to the first call of the callback.

htmlStock._forEach(func, [thisArg])

HTMLStock._forEach is an implementation of Array.prototype.forEach for HTMLStock

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
funcfunctionFunction to execute for each element
[thisArg]Optional. Value to use as this when executing callback.

htmlStock._every(func, [thisArg])

HTMLStock._every is an implementation of Array.prototype.every for HTMLStock

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
funcfunctionFunction to execute on each value
[thisArg]Optional. Value to use as this when executing callback.

htmlStock._some(func, [thisArg])

HTMLStock._some is an implementation of Array.prototype.some for HTMLStock

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
funcfunctionFunction to test for each element
[thisArg]Optional. Value to use as this when executing callback.

htmlStock._addEventListener(type, func, [options], [useCapture])

HTMLStock._addEventListener is a proxy to use the HTMLStock's elements addEventListener

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
typestringA string representing the event type to listen for.
funcfunctionThe 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]objectAn options object that specifies characteristics about the event listener
[useCapture]booleanA 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(type, func, [options], [useCapture])

HTMLStock._listen is a proxy to use the HTMLStock's elements addEventListener

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
typestringA string representing the event type to listen for.
funcfunctionThe 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]objectAn options object that specifies characteristics about the event listener
[useCapture]booleanA 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(type, func, [options], [useCapture])

HTMLStock._removeEventListener is a proxy to use the HTMLStock's elements removeEventListener

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
typestringA string representing the event type to remove.
funcfunctionThe EventListener function to remove from the event target.
[options]objectAn options object that specifies characteristics about the event listener
[useCapture]booleanSpecifies 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(type, func, [options], [useCapture])

HTMLStock._unlisten is a proxy to use the HTMLStock's elements removeEventListener

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
typestringA string representing the event type to remove.
funcfunctionThe EventListener function to remove from the event target.
[options]objectAn options object that specifies characteristics about the event listener
[useCapture]booleanSpecifies 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()

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(position, text)

HTMLStock._insertAdjacentHTML is a proxy to use the HTMLStock's elements insertAdjacentHTML

Kind: instance method of HTMLStock
Access: public
Since: 0.1.0

ParamTypeDescription
positionstringposition is the position relative to the element.
textstringtext is the string to be parsed as HTML or XML and inserted into the tree.

HTMLStockClassList

Kind: global class
this: HTMLStockClassList
Access: public
Since: 0.1.0

new HTMLStockClassList(instance)

HTMLStockClassList is a proxy to access the classList property of the Elements inside the HTMLStock

ParamTypeDescription
instanceHTMLStockClassListAn initiated instance of HTMLStockClassList

htmlStockClassList._add(classes)

HTMLStockClassList._add is a proxy to use the HTMLStock's elements classList.add

Kind: instance method of HTMLStockClassList
Access: public
Since: 0.1.0

ParamTypeDescription
classesArray.<string>Class values. If these classes already exist in attribute of the element, then they are ignored.

htmlStockClassList._remove(classes)

HTMLStockClassList._remove is a proxy to use the HTMLStock's elements classList.remove

Kind: instance method of HTMLStockClassList
Access: public
Since: 0.1.0

ParamTypeDescription
classesArray.<string>Class values.

htmlStockClassList._toggle(classes)

HTMLStockClassList._toggle is a proxy to use the HTMLStock's elements classList.toggle

Kind: instance method of HTMLStockClassList
Access: public
Since: 0.1.0

ParamTypeDescription
classesArray.<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.

HTMLStockHelper

Kind: global class
this: HTMLStockClassList
Access: public
Since: 0.1.0

new HTMLStockHelper(instance)

Helper that copies some methods from other prototypes, as well create some of HTMLStock methods

ParamTypeDescription
instanceHTMLStockClassListAn initiated instance of HTMLStockClassList

htmlStockHelper.buildHTMLStockClassListProto(prop)

Proxy a given property to every classList HTMLStock HTMLElements

Kind: instance method of HTMLStockHelper
Access: public
Since: 0.1.0

ParamTypeDescription
propstringThe property name that will be proxied HTMLStock elements

htmlStockHelper.applyMethodToElements(conf, [_classMethod]) ⇒

Proxy a given method to every HTMLStock HTMLElements

Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0

ParamTypeDescription
confstring | objectAn 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]stringA classMethod name that can be passed on so the property will be accessed

htmlStockHelper.applySetterToElements(conf) ⇒

Proxy a given value to every HTMLStock HTMLElements through a setter

Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0

ParamTypeDescription
confstring | objectAn 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

htmlStockHelper.aliasMethods(propObj, _class) ⇒

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

ParamTypeDescription
propObjstring | objectAn 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
_classfunctionA Class that will have the alias builtin

htmlStockHelper.aliasGetters(propObj, _class) ⇒

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

ParamTypeDescription
propObjstring | objectAn 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
_classfunctionA Class that will have the alias builtin

htmlStockHelper.copyProto(prop, _class) ⇒

Copy properties from a Class.prototype to HTMLStock.prototype

Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0

ParamTypeDescription
propstringthe target property
_classfunctionA Class that will have its prototype property copied

htmlStockHelper.callMethods() ⇒

Delegates a method based on the arguments passed

Kind: instance method of HTMLStockHelper
Returns: HTMLStockHelper
Access: public
Since: 0.1.0

htmlStockHelper.delegateCall(delegated, props, _class) ⇒

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

ParamTypeDescription
delegatedstringHTMLStockHelper method that will be called
propsArrayAn array with strings or objects with the property/alias that will be passed to the method
_classfunctionThe target Class

htmlStockHelper.extendNative()

Extend some Native Classes and prototypes like Element, Node and HTMLDocument

Kind: instance method of HTMLStockHelper
Access: public
Since: 0.1.0

Element

Kind: global class
Access: public

new Element()

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.

element._querySelectorAll() ⇒

A querySelectorAll alias that returns a HTMLStock instead of NodeList

Kind: instance method of Element
Returns: HTMLStock
Access: public
Since: 0.1.0

element._findAll() ⇒

A querySelectorAll alias that returns a HTMLStock instead of NodeList

Kind: instance method of Element
Returns: HTMLStock
Access: public
Since: 0.1.0

Node

Kind: global class
Access: public
Properties

NameTypeDescription
Node.prototype._childrenHTMLStockA children alias that returns a HTMLStock instead of HTMLCollection
Node.prototype._childNodesHTMLStockA childNodes alias that returns a HTMLStock instead of HTMLCollection

new Node()

A Node is an interface from which a number of DOM types inherit, and allows these various types to be treated (or tested) similarly.

node._parents() ⇒

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

HTMLDocument

Kind: global class
Access: public
Properties

NameTypeDescription
HTMLDocument.prototype._childrenHTMLStockA children alias that returns a HTMLStock instead of HTMLCollection
HTMLDocument.prototype._childNodesHTMLStockA childNodes alias that returns a HTMLStock instead of HTMLCollection

new HTMLDocument()

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.

htmlDocument._querySelectorAll() ⇒

A querySelectorAll alias that returns a HTMLStock instead of NodeList

Kind: instance method of HTMLDocument
Returns: HTMLStock
Access: public
Since: 0.1.0

htmlDocument._findAll() ⇒

A querySelectorAll alias that returns a HTMLStock instead of NodeList

Kind: instance method of HTMLDocument
Returns: HTMLStock
Access: public
Since: 0.1.0

About

A class based on NodeList/HTMLCollection classes that proxies some Element methods like addEventListener, remove, classList

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages