MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

modes

MMO · 1 symbole · générée le 27 Oct 2026

namespace

modes

Modes.js:17

The display modes of the page: one level -- how dense the application is, simple, standard, expert -- and any number of layers drawn over it -- dev, writer... (MMO\client\Modes on the server, which gives them in MMO.config.modes). A mode is presentation only: what the user may do is their rights', checked by the server.

MMO.modes = {…}
Espace de noms
MMO
What is hidden is the server's to say, so a change of modes saves them and reloads the page: the user's own `config.modes` (mmo.oauth) when there is a user, the `mmo-modes` cookie in any case.
if (MMO.modes.has('dev')) {drawDeveloperCues();}MMO.modes.toggle('dev'); // the developer layer on or off, then the page reloadsMMO.modes.set({level: 'simple'}); // the simple level, the layers left as they areMMO.modes.on('change', modes => ...); // before the page reloads

Index

listeners
config readonly accessor
level readonly accessor
layers readonly accessor
available(kind)
get(id)
has(id)
atLeast(level)
matches(modes, level)
spec(level, layers)
set(modes) asyncShow other modes: saved, then the page reloads (what is hidden is the server's to say).
cookiePath()The path the cookie is written on: the application's url as the browser sees it (siteurl), not the folder of its index.php (baseurl), which differs behind a rewrite (`SetEnv MMO_MODE_REWRITE de…
forget()Forget the modes the address gave (?modes=): the user's own are shown again, nothing saved.
toggle(layer)Turn a layer on or off.
on(event, listener)Listen to a change of modes, before the page reloads.
shortcut(event)Toggle the layer whose shortcut the key event is (ctrl+alt+d).
matchesShortcut(event, shortcut)

Propriétés4

config

readonlyaccessorModes.js:22
get config()
Type
level: string, layers: Array<string>, available: Array<Object>, overridden: boolean, query: string, cookie: string

layers

readonlyaccessorModes.js:32
get layers()
Type
Array<string>

Méthodes13

available(kind)

Modes.js:41
available(kind = null)
kind = null?string- level or layer, null for both
retourneArray<{id: string, kind: string, label: string, icon: ?string, description: ?string, rank: number, shortcut: ?string>} the modes the user may turn on, the levels lowest first

get(id)

Modes.js:46
get(id)
id
retourne?Objectone of available

has(id)

Modes.js:51
has(id)
id
retournebooleanwhether the layer is on, or the level is the one shown

atLeast(level)

Modes.js:56
atLeast(level)
level
retournebooleanwhether the level shown is level or above it

matches(modes, level)

Modes.js:67
matches(modes = null, level = null)
modes = nullstring | Array<string> | null- what markup says in data-mode: layers one of which must be on, !dev one which must be off
level = null?string- what it says in data-level
retournebooleanwhether it is shown

spec(level, layers)

Modes.js:77
spec(level, layers)
level
layers
retournestringsimple+dev: what the url, the cookie and the server read

set(modes)

asyncModes.js:86

Show other modes: saved, then the page reloads (what is hidden is the server's to say).

async set(modes = {})
modes = {}
retournePromise<void>

cookiePath()

Modes.js:119

The path the cookie is written on: the application's url as the browser sees it (siteurl), not the folder of its index.php (baseurl), which differs behind a rewrite (SetEnv MMO_MODE_REWRITE demo/www) and whose cookie the browser would never send back to the application's pages.

cookiePath()
retournestring

forget()

Modes.js:125

Forget the modes the address gave (?modes=): the user's own are shown again, nothing saved.

forget()

toggle(layer)

Modes.js:132

Turn a layer on or off.

toggle(layer)
layer

on(event, listener)

Modes.js:138

Listen to a change of modes, before the page reloads.

on(event, listener)
event
listener

shortcut(event)

Modes.js:147

Toggle the layer whose shortcut the key event is (ctrl+alt+d).

shortcut(event)
eventKeyboardEvent
retournebooleanwhether it was one

matchesShortcut(event, shortcut)

Modes.js:159
matchesShortcut(event, shortcut)
event
shortcut
retournebooleanwhether the key event is shortcut (ctrl+alt+d, shift+alt+w)