-
Notifications
You must be signed in to change notification settings - Fork 0
actions.ts
-
reset() ⇒
void
Resets all fields in the input form to their default values and clears any outputs.
- copyCode(input, wikiCodeId)
Copies the code from the specified input element to the clipboard.
-
downloadFile(button) ⇒
void
Downloads a file with the name of the current page and content of globalElements.output.fullArticle.
-
createPage(element, [pagename]) ⇒
void
Disables pointer events on the given element, gets the name of the page, creates a wiki link, and assigns the link to the element.
-
assignLink(element, link) ⇒
undefined
Assigns the given
link
to the providedelement
. Before assigning, checks ifdataIntegrity
is valid. IfdataIntegrity
is invalid, disableselement
and displays an error message. Otherwise, assigns the link toelement
and opens it in a new tab.- toggleRedirect()
Toggles the display of copy and create redirect buttons.
Resets all fields in the input form to their default values and clears any outputs.
Copies the code from the specified input element to the clipboard.
Kind: global function
Param | Type | Description |
---|---|---|
input | HTMLElement |
The input element containing the code to be copied. |
wikiCodeId | string |
The ID of the wiki code container element. |
Downloads a file with the name of the current page and content of globalElements.output.fullArticle.
Kind: global function
Param | Type | Description |
---|---|---|
button | HTMLAnchorElement |
The anchor element that initiates the file download. |
Disables pointer events on the given element, gets the name of the page, creates a wiki link, and assigns the link to the element.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
element | HTMLElement |
The element that the link should be assigned to. |
|
[pagename] | string |
"pageData.name" |
The name of the new wiki page. Defaults to the name specified in the pageData object. |
Assigns the given link
to the provided element
. Before assigning,
checks if dataIntegrity
is valid. If dataIntegrity
is invalid,
disables element
and displays an error message. Otherwise, assigns
the link to element
and opens it in a new tab.
Kind: global function
Param | Type | Description |
---|---|---|
element | Object |
The HTML element to assign the link to. |
link | string |
The link to assign to |
Example
assignLink(myAnchorElement, 'https://www.example.com')
Toggles the display of copy and create redirect buttons.
Kind: global function
¡Gracias por utilizar el Creador de páginas para la Wiki! Espero que te ayude a crear páginas increíbles para tus descubrimientos en No Man's Sky. Si tiene algún problema o sugerencia sobre cómo se puede mejorar el proyecto, haganoslo saber.