new Loader()
- Description:
UI Loader tool
Members
FILE_ICONS
- Description:
Common file extension icon
Common file extension icon
KEYS
- Description:
Common key codes
- BACKSPACE
- TAB
- ENTER
- SHIFT
- CTRL
- ALT
- PAUSE
- CAPS_LOCK
- ESCAPE
- PAGE_UP
- PAGE_DOWN
- END
- HOME
- LEFT_ARROW
- UP_ARROW
- RIGHT_ARROW
- DOWN_ARROW
- INSERT
- DELETE
Common key codes
- BACKSPACE
- TAB
- ENTER
- SHIFT
- CTRL
- ALT
- PAUSE
- CAPS_LOCK
- ESCAPE
- PAGE_UP
- PAGE_DOWN
- END
- HOME
- LEFT_ARROW
- UP_ARROW
- RIGHT_ARROW
- DOWN_ARROW
- INSERT
- DELETE
MIME_EXT
- Description:
Mime type to file extension
Mime type to file extension
editors
- Description:
Loaded editors
Loaded editors
Methods
addShortcuts(keys)
- Description:
Add keys shortcuts to document
Parameters:
Name | Type | Description |
---|---|---|
keys |
Object | Pair of ('ctrl' | 'shift' | 'alt') + letter or char-code = callback or shortcut definition |
clearCache(action)
- Description:
System clear cache
Parameters:
Name | Type | Description |
---|---|---|
action |
string | Action |
clientId()
- Description:
Return the local client Id from local storage
compat(w)
- Description:
Complete globals in window.Simplicite
Parameters:
Name | Type | Description |
---|---|---|
w |
Object | Optional window to init |
detachURL(url, options)
- Description:
Open the url in a separate window with the UI engine
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string | URL to load in a new window |
|||||||||||||||||||||||||||||||||||
options |
Object | Detach options Properties
|
Returns:
new window
firebase(data)
- Description:
Firebase service wrapper
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object | Service data Properties
|
getNavInstanceName(c, obj, inst)
- Description:
Generate the instance name within the component navigator. Returns the common instance name on main navigation, otherwise add a suffix ex: the_ajax_(name)_nav(id)
Parameters:
Name | Type | Description |
---|---|---|
c |
string | jQuery | Component |
obj |
string | Simplicite.UI.BusinessObject | Object name or BusinessObject |
inst |
string | Optional instance name, default = |
getNavObject(ctn, obj, inst, cbk, params)
- Description:
Get a business object extended with UI abilities per container navigator
- obj.metadata: object metadata with extended ObjectField
- obj.ui: this UI engine shorthand
- obj.locals.ui: copy of global UI options, to be changed per instance
- optional editors: load Ace and/or Tinymce
- optional web resources: STYLES and SCRIPT
- optional UI constraints script
Parameters:
Name | Type | Description |
---|---|---|
ctn |
string | jQuery | Container |
obj |
string | Simplicite.UI.BusinessObject | Object name or BusinessObject |
inst |
string | Optional instance name, default is the_ajax_name to be managed as a Main and Ajax object on server side |
cbk |
function | Callback function(obj) when loaded |
params |
Object | Optional parameters to load metadata |
getTop()
- Description:
Top Simplicite window
getUIObject(obj, inst, cbk, params)
- Description:
Get a business object extended with UI abilities:
- obj.metadata: object metadata with extended ObjectField
- obj.ui: $ui engine shorthand
- obj.locals.ui: copy of global UI options, to be changed per instance
- optional editors: load Ace and/or Tinymce
- optional web resources: STYLES and SCRIPT
- optional UI constraints script
Parameters:
Name | Type | Description |
---|---|---|
obj |
string | Simplicite.UI.BusinessObject | Object name or BusinessObject |
inst |
string | Optional instance name, default is the_ajax_name to be managed as a Main and Ajax object on server side |
cbk |
function | Callback function(obj) when loaded |
params |
Object | Optional parameters to load metadata |
load(p)
- Description:
Load a HTML/JS/CSS resource(s) in the target selector
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Array | Parameters or array of parameters Properties
|
Returns:
Promise
loadAceEditor(cbk)
- Description:
Load ACE editor
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadCSS(p)
- Description:
Load a server CSS
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | string | Parameters or URL Properties
|
loadCalendar(cbk)
- Description:
Calendar loading from FULLCALENDAR_LIBS or /scripts/fullcalendar. Needs sysparam
FULLCALENDAR_VERSION
= 4 or 5 (default)
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | Optional callback |
loadCharts(cbk, version)
- Description:
Load chart.js libs
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | Optional callback |
version |
string | Optional version (2 or 3), default CHARTJS_VERSION or 3. |
loadDiagramEngine()
- Description:
Load the diagram engine
loadEditor(editor, cbk)
- Description:
External editor loading
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
editor |
Object | editor parameters Properties
|
||||||||||||
cbk |
function | callback when loaded |
loadEngine(name, onload)
- Description:
Load the Rendering engine
Parameters:
Name | Type | Description |
---|---|---|
name |
string | extended engine name (bootstrap5 by default) |
onload |
function | onload callback |
loadFontsMeta(cbk)
- Description:
Load metadata of font icons
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback(meta) |
loadGridJson(cbk)
- Description:
Grid tool for JSON in a table
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadGridStack(cbk, version)
- Description:
Gridstack
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
version |
string | Optional version, default GRIDSTACK_VERSION or 6. |
loadHighlight(cbk, optionsopt)
- Description:
Load highlight tool
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | optional callback |
|||||||||
options |
object |
<optional> |
Options Properties
|
loadImport()
- Description:
load import view
loadJqPlot(cbk)
- Description:
Load jqPlot
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadLocalEditor(cbk)
- Description:
Load local code editor
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | callback |
loadMarked(cbk)
- Description:
Load Marked parser (Markdown to HTML)
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadMustache(cbk)
- Description:
Load Mustache template parser
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadPart(p)
- Description:
Load a HTML/JS/CSS resource in the target selector
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Parameters Properties
|
loadParts(list, cbk)
- Description:
Load HTML/JS/CSS resources
Parameters:
Name | Type | Description |
---|---|---|
list |
Array | list of parts [{ name, url, type, target }] |
cbk |
function | callback when loaded |
loadResource(p)
- Description:
Load a disposition resource and replace [ROOT] tokens
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | Parameters Properties
|
loadScript(p)
- Description:
Load a server JavaScript
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | string | minimal parameter { url } or URL Properties
|
loadScripts(list, onload)
- Description:
Load a list of JS/CSS scripts (preserve ordering)
Parameters:
Name | Type | Description |
---|---|---|
list |
Array.<Object> | Array.<string> | list of scripts URL (js or css) |
onload |
function | callback |
loadSelectBox(cbk)
- Description:
Load the select box component (see https://select2.org)
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadSimpliciteClient(cbk)
- Description:
Load Simplicite standalone client lib
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadSpeech()
- Description:
Load the speech engine
loadTerminal(cbk)
- Description:
Load Terminal (XTerm.js)
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadTinyMCE(cbk)
- Description:
Load TinyMCE editor
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
loadURL(ctn, url, options, cbk)
- Description:
Load URL in a container: wrap the URL to specific controllers (list, form...) or call the back-end thru ajax
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ctn |
string | jQuery | Container to load the URL (default is #work) |
||||||||||||||||||||||||||||||
url |
string | URL to load |
||||||||||||||||||||||||||||||
options |
Object | Contextual parameters Properties
|
||||||||||||||||||||||||||||||
cbk |
function | Optional callback when loaded |
logout(params)
- Description:
Default logout: confirm (with text CONFIRM_LOGOUT) and save session before quit
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | logout parameters Properties
|
main(cbk)
- Description:
Displays all site parts:
- Create main div
- load only options.resources if specified
- load part MAIN/HEADER/FOOTER/MENU/WORK when options.useMainParts=true
- load STYLES + SCRIPT resources of disposition or object
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | Final callback when displayed |
monitor(ctn, params)
- Description:
UI monitoring
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
ctn |
jQuery | Container to monitor |
||||||
params |
Object | Parameters or action Properties
|
onMessageReceived(m)
- Description:
Firebase default handler when a message is received thru FCM or worker.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
m |
Object | Message or notification Properties
|
openURL(url, target)
- Description:
Open the URL in a new window
Parameters:
Name | Type | Description |
---|---|---|
url |
string | URL to open |
target |
string | Optional, default |
quit(params)
- Description:
Default quit is a session logout
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | logout parameters Properties
|
ready(app, engine, options, cbk)
- Description:
When page is loaded: load user rights, menu, texts and engine.
Then call the main page service.
Parameters:
Name | Type | Description |
---|---|---|
app |
Simplicite.Ajax | Optional Ajax API to access to data |
engine |
string | extension name (default 'bootstrap5') |
options |
Simplicite.UI.Globals | some globals options to override |
cbk |
function | Optional callback(err) when loaded |
saveSession(cbk)
- Description:
Save the session (by default the recent activity in HISTORY)
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | optional callback |
session(cbk, params)
- Description:
Open the user session with authtoken
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
cbk |
function | callback(err) when the session is opened or not |
||||||
params |
Object | options Properties
|
setAjax(app)
- Description:
Set the Ajax APIs
Parameters:
Name | Type | Description |
---|---|---|
app |
Simplicite.Ajax | Simplicite.Ajax instance |
setEngineView(name, cbk)
- Description:
Set the view engine
Parameters:
Name | Type | Description |
---|---|---|
name |
string | extension name (ex: bootstrap) |
cbk |
function | onload callback |
setTheme(theme, cbk)
- Description:
Change the current CSS theme (stored in local storage)
Parameters:
Name | Type | Description |
---|---|---|
theme |
string | theme name (ex: 'default', 'light', 'dark', 'simplicite') |
cbk |
function | optional callback |
splash()
- Description:
Loading page with status
waitForURL(ctn, url, params, pgs)
- Description:
Call periodically to check if the response is completed
Parameters:
Name | Type | Description |
---|---|---|
ctn |
jQuery | Container to load the URL |
url |
string | URL to launch the asynchronous task on server side, and be polled with a check parameter periodically, must respond 202 while the task is not completed |
params |
Object | Optional parameters for loadURL |
pgs |
function | Optional progress callback(message) |
Returns:
Promise when loaded, or catch when stopped
webpush()
- Description:
WebPush service
(inner) keydown(e)
- Description:
Default keydown handler
CTRL-S : trigger "ui.key.ctrls" to all "js-ctrl-s" elements
ESCAPE : in order of priority close dialog, blur field (remove focus), or back in navigation
SHIFT-LEFT/RIGHT : navigation between list items
ALT-H : back to the home page
ALT-M : focus last visited menu item
ALT-W : wide screen = toggle menu
ALT-B : open the bookmarks dialog
ALT-F : focus the global searchbox
ALT-L : focus the first list row
ALT-N : focus the next area/panel
Parameters:
Name | Type | Description |
---|---|---|
e |
Object | Key event |