index
MMO · 36 symbols · generated 5 Oct 2026
$
mmo.js:27Make sure node is a dom element.
- Namespace
MMO
domReady
mmo.js:35Run a function once the dom is ready, immediately if it already is.
- Namespace
MMO
| fn | Function | |
| returns | Promise |
define
mmo.js:46Define a Custom Element
- Namespace
MMO
| tagName | string | |
| classElement | string | |
| extend | string | the htmlelement class parent (ex: div) |
| returns | void |
provide
mmo.js:78Declare a namespace, creating every missing level of it.
- Namespace
MMO
| name | string | MUST be MMO.xxxx |
| value = null | object | [opt] the value to set at the last level; a namespace is created without it |
| returns | !Object | the namespace |
require
mmo.js:102Declare that this file needs a namespace another one provides.
- Namespace
MMO
| name | string | |
| returns | ?Object | the namespace, or null when nothing provides it |
reloadJS
mmo.js:119Reload the library's <script> tags in place, cache-busted. A development helper: it re-evaluates the scripts without reloading the page, so the dom state survives.
- Namespace
MMO
| urlContains = 'client.js' | string | only reload the scripts whose src contains this; '' means all |
askBeforeLeaving
mmo.js:136Prevent leaving page without confirming
- Namespace
MMO
| add = true |
sleep
mmo.js:156- Namespace
MMO
| timeoutInMs = 300 | number | |
| returns | Promise<void> | resolved after that delay |
screenshot
asyncmmo.js:171Capture the current tab as an image.
- Namespace
MMO
| quality = 0.7 | number | 0..1, for the lossy formats |
| type = "image/jpeg" | string | the image mime type |
| returns | Promise<string | undefined> | a data url |
url
mmo.js:235Replace paths placeholder {xxx} in an url. ex: myurl/{username}/{date} The returned url is based on the siteurl path set in MMO.config.paths.
- Namespace
MMO
| url | string | |
| base = 'siteurl' | ?string | the base used to construct the url. it can be a registered path in the config or an absolute url or undefined. |
| data = null | null | object | Map | if given, will replace some placeholders with these data |
| returns | string |
fileUrl
mmo.js:278Same as MMO.url, except the base of the url is set to baseurl (which is the real url for files) instead of siteurl
- Namespace
MMO
| url | ||
| data = null |
path
mmo.js:287Get a path from the config (used by MMO.url)
- Namespace
MMO
| name | ||
| returns | * |
pathExists
mmo.js:295- Namespace
MMO
| name | string | |
| returns | boolean | true when the server registered a path under this name |
fetch
mmo.js:308Fetch a request async
- Namespace
MMO
| url | string | Request | the url to query or a Request Object |
| options = null | null | object | the options for fetch |
| returns | Promise | the response as value |
fetchJSON
mmo.js:323Fetch a request's json response async
- Namespace
MMO
| url | string | Request | the url to query or a Request Object |
| options = null | null | object | the options for fetch |
| returns | Promise | the json response as value |
fetchAPI
mmo.js:343- Namespace
MMO
| url | string | Request | the url to query or a Request Object |
| options = null | null | object | the options for fetch |
| returns | Promise | the json response as value {data: [MMO.elements.Entity], links: {rel: Link}, schema: ?MMO.schemas.Schema, logs: [Log]} |
loadJSON
asyncmmo.js:358- Namespace
MMO
| json | Object | the parsed response, MODIFIED in place |
| url = null | ?string | the url it came from, for the logs |
| returns | Promise<Object> | the same object |
fetchText
mmo.js:428Fetch a request's text response async
- Namespace
MMO
| url | string | Request | the url to query or a Request Object |
| options = null | null | object | the options for fetch |
| returns | Promise | the text response as value |
fetchXml
mmo.js:444Fetch and parse an xml document.
- Namespace
MMO
| url | string | Request | |
| options = null | ?Object | options for fetch |
| returns | Promise<Document> |
fetchSvg
mmo.js:457Fetch and parse an svg document.
- Namespace
MMO
| url | string | Request | |
| options = null | ?Object | options for fetch |
| returns | Promise<Document> |
fetchFile
mmo.js:472Fetch a request's file response async (as blob) and open a window with the data.
- Namespace
MMO
| url | string | Request | the url to query or a Request Object |
| options = null | null | object | the options for fetch |
| filename = null | null | string | the filename to use for the download |
| returns | Promise | the response blob as value |
sendMail
mmo.js:509Ask the server's mail controller to send a templated mail.
- Namespace
MMO
string | the recipient | |
| subject | string | |
| data | Object | the values injected into the template |
| template | string | the server side template's name |
| returns | Promise<Response> | |
| throws | MMO.Error | when the server registered no mail path |
download
mmo.js:523Trigger a download
- Namespace
MMO
| filename | ||
| data |
copyToClipboard
mmo.js:541Copy text content to clipboard
- Namespace
MMO
| text | ||
| returns |
Print given nodes in a new window
- Namespace
MMO
| title | ||
| ...nodes |
error
mmo.js:596In order to not mess up the correct line and number of the logs in the console, you need to return a function bound to the console: https://stackoverflow.com/questions/9559725/extending-console-log-without-affecting-log-line/26078207#26078207
- Namespace
MMO
warning
mmo.js:604Log a warning, tagged and colored, keeping the CALLER's file and line in the console.
- Namespace
MMO
info
mmo.js:612Log an informative message, tagged and colored.
- Namespace
MMO
debug
mmo.js:620Log a debug message, tagged but discreet.
- Namespace
MMO
scriptError
mmo.js:631Log an error that happen in an inline script
- Namespace
MMO
| message | string | the message |
| e | Error | the error thrown by the script |
| script | text | the script's text |
| returns | none |
uniqueID
mmo.js:644Unique ids for object so you can test if two objects are the same (same ids)
- Namespace
MMO
uniqueObjectID
mmo.js:651Get a stable numeric id for an object, assigning one on first use.
- Namespace
MMO
| object | Object | |
| returns | number |
onDateInput
mmo.js:666Browser fix: a date input silently clears itself when the user types a partial value.
- Namespace
MMO
| event | Event |
addCharactersLeft
mmo.js:681Add a live "N characters left" counter under every [maxlength] input of a subtree.
- Namespace
MMO
| node = null | ?Node | defaults to the whole document |
window
mmo.js:701- Namespace
MMO
insertText
mmo.js:729Insert text in an element
- Namespace
MMO
| element | ||
| text |