wasm-Subpackage begonnen

master
Klaus Wendel 5 months ago
parent 36aad58cc5
commit 47f1870ae2

@ -0,0 +1,108 @@
package wasm
import "syscall/js"
const (
PROPERTY_accessKey = "accessKey" //Sets or returns the accesskey attribute of an element
METHOD_addEventListener = "addEventListener" //Attaches an event handler to an element
METHOD_appendChild = "appendChild" //Adds (appends) a new child node to an element
PROPERTY_attributes = "attributes" //Returns a NamedNodeMap of an element's attributes
METHOD_blur = "blur" //Removes focus from an element
PROPERTY_childElementCount = "childElementCount" //Returns an elements's number of child elements
PROPERTY_childNodes = "childNodes" //Returns a NodeList of an element's child nodes
PROPERTY_children = "children" //Returns an HTMLCollection of an element's child elements
PROPERTY_classList = "classList" //Returns the class name(s) of an element
PROPERTY_className = "className" //Sets or returns the value of the class attribute of an element
METHOD_click = "click" //Simulates a mouse-click on an element
PROPERTY_clientHeight = "clientHeight" //Returns the height of an element, including padding
PROPERTY_clientLeft = "clientLeft" //Returns the width of the left border of an element
PROPERTY_clientTop = "clientTop" //Returns the width of the top border of an element
PROPERTY_clientWidth = "clientWidth" //Returns the width of an element, including padding
METHOD_cloneNode = "cloneNode" //Clones an element
METHOD_closest = "closest" //Searches the DOM tree for the closest element that matches a CSS selector
METHOD_compareDocumentPosition = "compareDocumentPosition" //Compares the document position of two elements
METHOD_contains = "contains" //Returns true if a node is a descendant of a node
PROPERTY_contentEditable = "contentEditable" //Sets or returns whether the content of an element is editable or not
PROPERTY_dir = "dir" //Sets or returns the value of the dir attribute of an element
PROPERTY_firstChild = "firstChild" //Returns the first child node of an element
PROPERTY_firstElementChild = "firstElementChild" //Returns the first child element of an element
METHOD_focus = "focus" //Gives focus to an element
METHOD_getAttribute = "getAttribute" //Returns the value of an element's attribute
METHOD_getAttributeNode = "getAttributeNode" //Returns an attribute node
METHOD_getBoundingClientRect = "getBoundingClientRect" //Returns the size of an element and its position relative to the viewport
METHOD_getElementsByClassName = "getElementsByClassName" //Returns a collection of child elements with a given class name
METHOD_getElementsByTagName = "getElementsByTagName" //Returns a collection of child elements with a given tag name
METHOD_hasAttribute = "hasAttribute" //Returns true if an element has a given attribute
METHOD_hasAttributes = "hasAttributes" //Returns true if an element has any attributes
METHOD_hasChildNodes = "hasChildNodes" //Returns true if an element has any child nodes
PROPERTY_id = "id" //Sets or returns the value of the id attribute of an element
PROPERTY_innerHTML = "innerHTML" //Sets or returns the content of an element
PROPERTY_innerText = "innerText" //Sets or returns the text content of a node and its descendants
METHOD_insertAdjacentElement = "insertAdjacentElement" //Inserts a new HTML element at a position relative to an element
METHOD_insertAdjacentHTML = "insertAdjacentHTML" //Inserts an HTML formatted text at a position relative to an element
METHOD_insertAdjacentText = "insertBefore" //Inserts text into a position relative to an element
METHOD_insertBefore = "" //Inserts a new child node before an existing child node
PROPERTY_isContentEditable = "isContentEditable" //Returns true if an element's content is editable
METHOD_isDefaultNamespace = "isDefaultNamespace" //Returns true if a given namespaceURI is the default
METHOD_isEqualNode = "isEqualNode" //Checks if two elements are equal
METHOD_isSameNode = "isSameNode" //Checks if two elements are the same node
PROPERTY_lang = "lang" //Sets or returns the value of the lang attribute of an element
PROPERTY_lastChild = "lastChild" //Returns the last child node of an element
PROPERTY_lastElementChild = "lastElementChild" //Returns the last child element of an element
METHOD_matches = "matches" //Returns true if an element is matched by a given CSS selector
PROPERTY_namespaceURI = "namespaceURI" //Returns the namespace URI of an element
PROPERTY_nextSibling = "nextSibling" //Returns the next node at the same node tree level
PROPERTY_nextElementSibling = "nextElementSibling=" //Returns the next element at the same node tree level
PROPERTY_nodeName = "nodeName" //Returns the name of a node
PROPERTY_nodeType = "nodeType" //Returns the node type of a node
PROPERTY_nodeValue = "nodeValue" //Sets or returns the value of a node
METHOD_normalize = "normalize" //Joins adjacent text nodes and removes empty text nodes in an element
PROPERTY_offsetHeight = "offsetHeight" //Returns the height of an element, including padding, border and scrollbar
PROPERTY_offsetWidth = "offsetWidth" //Returns the width of an element, including padding, border and scrollbar
PROPERTY_offsetLeft = "offsetLeft" //Returns the horizontal offset position of an element
PROPERTY_offsetParent = "offsetParent" //Returns the offset container of an element
PROPERTY_offsetTop = "offsetTop" //Returns the vertical offset position of an element
PROPERTY_outerHTML = "outerHTML" //Sets or returns the content of an element (including the start tag and the end tag)
PROPERTY_outerText = "outerText" //Sets or returns the outer text content of a node and its descendants
PROPERTY_ownerDocument = "ownerDocument" //Returns the root element (document object) for an element
PROPERTY_parentNode = "parentNode" //Returns the parent node of an element
PROPERTY_parentElement = "parentElement" //Returns the parent element node of an element
PROPERTY_previousSibling = "previousSibling" //Returns the previous node at the same node tree level
PROPERTY_previousElementSibling = "previousElementSibling" //Returns the previous element at the same node tree level
METHOD_querySelector = "querySelector" //Returns the first child element that matches a CSS selector(s)
METHOD_querySelectorAll = "remove" //Returns all child elements that matches a CSS selector(s)
METHOD_remove = "" //Removes an element from the DOM
METHOD_removeAttribute = "removeAttribute" //Removes an attribute from an element
METHOD_removeAttributeNode = "removeAttributeNode" //Removes an attribute node, and returns the removed node
METHOD_removeChild = "removeChild" //Removes a child node from an element
METHOD_removeEventListener = "removeEventListener" //Removes an event handler that has been attached with the addEventListener() method
METHOD_replaceChild = "replaceChild" //Replaces a child node in an element
PROPERTY_scrollHeight = "scrollHeight" //Returns the entire height of an element, including padding
METHOD_scrolltoView = "scrolltoView" //Scrolls the an element into the visible area of the browser window
PROPERTY_scrollLeft = "scrollLeft" //Sets or returns the number of pixels an element's content is scrolled horizontally
PROPERTY_scrollTop = "scrollTop" //Sets or returns the number of pixels an element's content is scrolled vertically
PROPERTY_scrollWidth = "scrollWidth" //Returns the entire width of an element, including padding
METHOD_setAttribute = "setAttribute" //Sets or changes an attribute's value
METHOD_setAttributeNode = "setAttributeNode" //Sets or changes an attribute node
PROPERTY_style = "style" //Sets or returns the value of the style attribute of an element
PROPERTY_tabIndex = "tabIndex" //Sets or returns the value of the tabindex attribute of an element
PROPERTY_tagName = "tagName" //Returns the tag name of an element
PROPERTY_textContent = "textContent" //Sets or returns the textual content of a node and its descendants
PROPERTY_title = "title" //Sets or returns the value of the title attribute of an element
METHOD_toString = "toString" //Converts an element to a string
)
func GetCheckedRadioOrCheckbox(jsObject js.Value) (id, name, value string) {
for i := 0; true; i++ {
if tmpObject := jsObject.Index(i); !tmpObject.IsUndefined() {
if tmpObject.Get("checked").Bool() {
id, name, value = tmpObject.Get("id").String(), tmpObject.Get("name").String(), tmpObject.Get("value").String()
break
}
} else {
break
}
}
return
}
Loading…
Cancel
Save