| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
This library contains the Javascript eXtensible API.
This library contains a short-hand, extensible API that maps either to pre-existing Javascript DOM functions or to new functionality.
Array.each(callback) <extends: Array>
This function calls a callback function on each item of the array.Array.first() → String <extends: Array>
This function returns the first element of the array.Array.last() → String <extends: Array>
This function returns the last element of the array.Array.removeIf(callback) <extends: Array>
This function removes elements from the array based on the boolean results of the callback function.CustomElementRegistry.extends(tagName, jsClassName) <extends: CustomElementRegistry>
This method is an alias for 'CustomElementRegistry.define', which creates a new custom element by extending from an existing element.CustomElementRegistry.getClass(tagName) → Constructor <extends: CustomElementRegistry>
This method is an alias for 'CustomElementRegistry.get'.CustomElementRegistry.register(tagName, jsClassName) <extends: CustomElementRegistry>
This method is an alias for 'CustomElementRegistry.define', which creates a new custom element w/o extending from an existing element.Document.createElementWithAttributes(tag, attrs) <extends: Document>
This method calls document.createElement and sets the attributes by walking the specified attr hash and using setAttribute on each.Document.findStylesheet(basename) → StyleSheet or Null <extends: Document>
This method returns a stylesheet based on the specified filenameDocument.htmlToElement(snippet) → HTMLElement or Null <extends: Document>
This method creates an HTML element from the given snippet of HTML text.Document.loadImage(source) <extends: Document>
This method does an asynchronous deferred load of an image from the specified source.Document.qcfirst(name) → HTMLElement or Null <extends: Document>
This method returns the first element of a specified class, if it existsDocument.qchildren(selector) → Array<HTMLNode> <extends: Document>
This method filters a call to Document.qsall to direct children.Document.qclass(name) → HTMLCollection <extends: Document>
This method is an alias for 'getElementsByClassName', which searches the document for elements with the specified tag.Document.qid(id) → HTMLElement or Null <extends: Document>
This method is uses the built-in querySelector to find an element with the given idDocument.qsall(selector) → NodeList <extends: Document>
This method is an alias for 'querySelectorAll', which searches the document for elements using the specified selector.Document.qsel(selector) → HTMLElement or Null <extends: Document>
This method is an alias for 'querySelector', which searches the document for elements using the specified selector.Document.qsfirst(selector) → HTMLElement or Null <extends: Document>
This method uses qsall to return the array to find the first elementDocument.qslast(selector) → HTMLElement or Null <extends: Document>
This method uses qsall to return the array to find the last elementDocument.qtag(tag) → HTMLCollection <extends: Document>
This method is an alias for 'getElementsByTagName', which searches the document for elements with the specified tag.Document.qxy(x, y, include_shadows) → Array<HTMLElement> or Null <extends: Document>
This method returns a list of elements at the specified point in the document in topmost visible order.Document.walkElements(proc, xdata) <extends: Document>
This method calls document.body.walkElements() to traverse the entire document tree.Element.fqname() → String <extends: Element>
This method creates a fully-qualified name for the element, consisting of its tagName (converted to lower case), class names (prefixed with '.') and id (if defined, prefixed with '#').Element.qcfirst(name) → HTMLElement or Null <extends: Element>
This method returns the first element of a specified class, if it existsElement.qchildren(selector) → Array<HTMLNode> <extends: Element>
This method filters a call to Element.qsall to direct children.Element.qclass(name) → HTMLCollection <extends: Element>
This method is an alias for 'getElementsByClassName', which searches the subtree for elements with the specified tag.Element.qid(id) → Element or Null <extends: Element>
This method is an alias for 'querySelector', which searches the subtree for the element with the specified 'id' attribute value.Element.qparent(tag) → Element or Null <extends: Element>
This method locates an ancestor element with the given tag.Element.qsall(selector) → NodeList <extends: Element>
This method is an alias for 'querySelectorAll', which searches the subtree for elements using the specified selector.Element.qsel(selector) → Element or Null <extends: Element>
This method is an alias for 'querySelector', which searches the subtree for elements using the specified selector.Element.qsfirst(selector) → HTMLElement or Null <extends: Element>
This method uses qsall to return the array to find the first elementElement.qtag(tag) → HTMLCollection <extends: Element>
This method is an alias for 'getElementsByTagName', which searches the subtree for elements with the specified tag.Element.walkElements(proc, xdata) <extends: Element>
This method visits every element in the subtree and calls the given procedure with the given external data.Element.where() → Array<Element> <extends: Element>
This method returns this element's ancestry list of elements in the document from most distant to its immediate parent.HTMLElement.appendHTML(snippet) <extends: HTMLElement>
This method appends an element (and its subtree) as described by the given HTML snippet into this element's children list.HTMLElement.detach() → HTMLElement <extends: HTMLElement>
This method removes itself from its parent.HTMLElement.getComputedStyle(properties) → Hash <extends: HTMLElement>
Ths method retrieves computed styles from the element.HTMLElement.hide() <extends: HTMLElement>
This method hides this element by settings its style's display attribute to 'none'.HTMLElement.insertAfterHTML(snippet) <extends: HTMLElement>
This method inserts an element (and its subtree) as described by the given HTML snippet after this element in its parent's children list.HTMLElement.insertBeforeHTML(snippet) <extends: HTMLElement>
This method inserts an element (and its subtree) as described by the given HTML snippet before this element in its parent's children list.HTMLElement.isNthChildOf(parent) → Integer or Null <extends: HTMLElement>
This method checks to see if this element is a child of the specified parent and where in the parent's children list the element is.HTMLElement.prependChild(child) <extends: HTMLElement>
This method inserts the child element into the parent's children list as the new first element.HTMLElement.prependHTML(snippet) <extends: HTMLElement>
This method prepends an element (and its subtree) as described by the given HTML snippet into this element's children list.HTMLElement.removeAllChildren(parent) → HTMLElememt <extends: HTMLElement>
This method removes all of an element's children.HTMLElement.removeElementsAfter() <extends: HTMLElement>
This method removes child elements after this element in its parent's children list.HTMLElement.removeElementsBefore() <extends: HTMLElement>
This method removes child elements before this element in its parent's children list.HTMLElement.reparent(newParent, at) <extends: HTMLElement>
This method removes itself from its current parent and attaches itself to a new parent.HTMLElement.replaceWithHTML(snippet) <extends: HTMLElement>
This method replaces this element with an element (and its subtree) as described by the given HTML snippet in its parent's children list.HTMLElement.rotateElements(firstToLast) <extends: HTMLElement>
This method rotates an element's children. If firstToLast is true, the first child become the last child. Else, the last child becomes the first child.HTMLElement.show(type) <extends: HTMLElement>
This method displays this element by setting its style's display property to the given type, or 'block'HTMLImageElement.load(source) <extends: HTMLImageElement>
This method does an asynchronous deferred load of an image into the HTMLImageElement.JSON.toString(obj) → String <extends: JSON>
This method is an alias for 'JSON.stringify' if the Javascript's implementation of JSON does not have a toString method.Object.eachKey(callback) <extends: Object>
This function calls a callback function for each key/property of the Object. If the callback function returns false, the iteration is aborted.Object.eachValue(callback) <extends: Object>
This function calls a callback function for each value of the Object. If the callback function returns false, the iteration is aborted.Object.first() → Array<Any> <extends: Object>
This function returns the list of values in the Object.Object.hasKey(key) → Boolean <extends: Object>
This function returns true if the given key is defined within the Object.Object.key() → String <extends: Object>
This function returns the name of the first key/property of the Object.Object.klist() → Array<String> <extends: Object>
This function returns the list of keys/properties in the object.Object.value() → String <extends: Object>
This function returns the name of the first value of the Object.ShadowRoot.qcfirst(name) → HTMLElement or Null <extends: ShadowRoot>
This method returns the first element of a specified class, if it existsShadowRoot.qchildren(selector) → Array<HTMLNode> <extends: ShadowRoot>
This method filters a call to ShadowRoot.qsall to direct children.ShadowRoot.qclass(name) → HTMLCollection <extends: ShadowRoot>
This method is an alias for 'getElementsByClassName', which searches the shadow root for elements with the specified tag.ShadowRoot.qid(id) → HTMLElement or Null <extends: ShadowRoot>
This method is an alias for 'querySelector', which searches the shadow root for the element with the specified 'id' attribute value.ShadowRoot.qsall(selector) → NodeList <extends: ShadowRoot>
This method is an alias for 'querySelectorAll', which searches the shadow root for elements using the specified selector.ShadowRoot.qsel(selector) → HTMLElement or Null <extends: ShadowRoot>
This method is an alias for 'querySelector', which searches the shadow root for elements using the specified selector.ShadowRoot.qsfirst(selector) → HTMLElement or Null <extends: ShadowRoot>
This method uses qsall to return the array to find the first elementShadowRoot.qslast(selector) → HTMLElement or Null <extends: ShadowRoot>
This method uses qsall to return the array to find the last elementShadowRoot.qtag(tag) → HTMLCollection <extends: ShadowRoot>
This method is an alias for 'getElementsByTagName', which searches the shadow root for elements with the specified tag.ShadowRoot.qxy(x, y) → Array<HTMLElement> or Null <extends: ShadowRoot>
This method returns a list of elements at the specified point in the document in topmost visible order.ShadowRoot.qxys(x, y, deep) → Array<HTMLElement> or Null <extends: ShadowRoot>
This method returns a list of elements within a given element's shadow DOM at the specified point in the document in topmost visible order.String.fmt() → String <extends: String>
This function formats the incoming arguments into a string suitable for output, similar to the C function sprintf().String.makeHtmlSnippet(tag, attrs, inner) → String <extends: String>
This function formats the incoming arguments into a string suitable for output, similar to the C function sprintf().| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
The AJAX namespace encapsulates network interactions with a remote server.
The AJAX namespace encapsulates network interactions with a remote server. Even though it is called AJAX, it relies on the newer fetch API.
AJAX.fetch(url, payload, method) → Promise
This method is a wrapper for the fetch API.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
The AppLoader namespace encapsulates dynamic resource loading operations on app start.
AppLoader.load(callback, prime)
The AppLoader namespace encapsulates dynamic resource loading operations.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
This class extends the Error exception by categorizing it as an ArgumentError.
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
The ResLoader namespace encapsulates dynamic script loading operations.
The ResLoader namespace encapsulates dynamic script loading operations.
ResLoader.load(src, async, callback)
This method loads a script into a script element and appends it to the document's head.ResLoader.require(list)
This function loads a list of scripts asynchronously to the document's head. The pipeline ensures that downstream requirements are inserted at the head of the list.ResLoader.setChangeCallback(callback)
This function sets a callback function to be called whenever the internal requirements pipeline is added to.ResLoader.setCompletionCallback(callback)
This function sets a callback function to be called whenever a resource has been processed, whether loaded successfully or not.ResLoader.setFinishCallback(callback)
This function sets a callback function to be called whenever the requirements array is empty| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
This class extends the Error exception by categorizing it as an RuntimeError.