Classes
Members
# (static, constant) ATTRIBUTE_OPTIONS :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTE_PREFIX :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTE_THEME_NAME :string
- string
# (static, constant) ATTRIBUTE_THEME_PREFIX :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTE_UPDATER_ATTRIBUTES :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTE_UPDATER_INSERT :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTE_UPDATER_INSERT_REFERENCE :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTE_UPDATER_REMOVE :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTE_UPDATER_REPLACE :string
- string
- Since:
- 1.8.0
# (static, constant) ATTRIBUTEPREFIX :string
attribute prefix
- string
# (static, constant) DEFAULT_THEME :string
default theme
- string
Methods
# (static) findDocumentTemplate(id) → {Template}
you can call the method via the monster namespace Monster.DOM.findDocumentTemplate()
.
<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/template.js';
console.log(Monster.DOM.findDocumentTemplate())
</script>
Alternatively, you can also integrate this function individually.
<script type="module">
import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/template.js';
console.log(findDocumentTemplate())
</script>
Name | Type | Description |
---|---|---|
id |
string |
- Since:
- 1.7.0
- Copyright:
- schukai GmbH
-
-
template id not found.
- Type
- Error
-
-
-
value is not a string
- Type
- TypeError
-
- Type
- Template
# (static) getDocument() → {object}
this method fetches the document object
<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js';
console.log(Monster.DOM.getDocument())
</script>
Alternatively, you can also integrate this function individually.
<script type="module">
import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js';
console.log(getDocument())
</script>
in nodejs this functionality can be performed with jsdom.
import {JSDOM} from "jsdom"
if (typeof window !== "object") {
const {window} = new JSDOM('', {
url: 'http://example.com/',
pretendToBeVisual: true
});
[
'self',
'document',
'Document',
'Node',
'Element',
'HTMLElement',
'DocumentFragment',
'DOMParser',
'XMLSerializer',
'NodeFilter',
'InputEvent',
'CustomEvent'
].forEach(key => (getGlobal()[key] = window[key]));
}
- Since:
- 1.6.0
- Copyright:
- schukai GmbH
-
not supported environment
- Type
- Error
- Type
- object
# (static) getDocumentFragmentFromString() → {DocumentFragment}
this method fetches the document object
<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js';
console.log(Monster.DOM.getDocumentFragmentFromString())
</script>
Alternatively, you can also integrate this function individually.
<script type="module">
import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js';
console.log(getDocumentFragmentFromString('<div></div>'))
</script>
in nodejs this functionality can be performed with jsdom.
import {JSDOM} from "jsdom"
if (typeof window !== "object") {
const {window} = new JSDOM('', {
url: 'http://example.com/',
pretendToBeVisual: true
});
[
'self',
'document',
'Document',
'Node',
'Element',
'HTMLElement',
'DocumentFragment',
'DOMParser',
'XMLSerializer',
'NodeFilter',
'InputEvent',
'CustomEvent'
].forEach(key => (getGlobal()[key] = window[key]));
}
- Since:
- 1.6.0
- Copyright:
- schukai GmbH
-
-
not supported environment
- Type
- Error
-
-
-
value is not a string
- Type
- TypeError
-
- Type
- DocumentFragment
# (static) getHandleFromNode(node) → {Handle|undefined}
get the handle of a node
if a node is specified without a handler, a recursive search upwards is performed until the corresponding handle is found, or undefined is returned.
you can call the method via the monster namespace Monster.DOM.getHandleFromNode()
.
<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/handle.js';
console.log(Monster.DOM.getHandleFromNode())
</script>
Alternatively, you can also integrate this function individually.
<script type="module">
import {getHandleFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/handle.js';
console.log(getHandleFromNode())
</script>
Name | Type | Description |
---|---|---|
node |
Node |
- Since:
- 1.6.0
- Copyright:
- schukai GmbH
-
value is not an instance of Node
- Type
- TypeError
- Type
- Handle | undefined
# (static) getWindow() → {object}
this method fetches the window object
<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js';
console.log(Monster.DOM.getWindow())
</script>
Alternatively, you can also integrate this function individually.
<script type="module">
import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/dom/util.js';
console.log(getWindow(null))
</script>
in nodejs this functionality can be performed with jsdom.
import {JSDOM} from "jsdom"
if (typeof window !== "object") {
const {window} = new JSDOM('', {
url: 'http://example.com/',
pretendToBeVisual: true
});
getGlobal()['window']=window;
[
'self',
'document',
'Document',
'Node',
'Element',
'HTMLElement',
'DocumentFragment',
'DOMParser',
'XMLSerializer',
'NodeFilter',
'InputEvent',
'CustomEvent'
].forEach(key => (getGlobal()[key] = window[key]));
}
- Since:
- 1.6.0
- Copyright:
- schukai GmbH
-
not supported environment
- Type
- Error
- Type
- object
# (static) registerCustomElement(element) → {void}
This method registers a new element. The string returned by CustomElement.getTag()
is used as the tag.
Name | Type | Description |
---|---|---|
element |
CustomElement |
- Since:
- 1.7.0
- Copyright:
- schukai GmbH
-
Failed to execute 'define' on 'CustomElementRegistry': is not a valid custom element name
- Type
- DOMException
- Type
- void