new Widget(app, ui, view)
- Description:
Common widgets
Parameters:
Name | Type | Description |
---|---|---|
app |
Simplicite.Ajax | Ajax service |
ui |
Simplicite.UI.Engine | Main UI controller |
view |
Simplicite.UI.View.Main | View services |
Members
PALETTES
- Description:
Predefined palettes
- Base
- Pastel
- Strong
- Light
- Bright
- Mars
- Sea
- Berry
- Fire
- Choco
Predefined palettes
- Base
- Pastel
- Strong
- Light
- Bright
- Mars
- Sea
- Berry
- Fire
- Choco
Methods
actionBar(list, alignRight)
- Description:
Action bar
Parameters:
Name | Type | Description |
---|---|---|
list |
Array.<jQuery> | Array of buttons (plain or plus) |
alignRight |
boolean | pull on the right side of container ? |
Returns:
div.actions
actionItems(o, rowId, list, plus, options)
- Description:
Convert actions to buttons array
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
o |
Simplicite.Ajax.BusinessObject | Business object |
||||||||||||||||||
rowId |
string | Optional rowId on form/row |
||||||||||||||||||
list |
Array.<Object> | List of actions as plain buttons |
||||||||||||||||||
plus |
Array.<Object> | List of actions as 'plus' button |
||||||||||||||||||
options |
Object | Options Properties
|
Returns:
jQuery items
animate(ctn, div, type, cbk)
- Description:
Replace the current content with another one
Parameters:
Name | Type | Description |
---|---|---|
ctn |
jQuery | container |
div |
jQuery | new content to load in container |
type |
string | optional animation: slide 'left, slide 'right' or 'opacity' |
cbk |
function | optional callback when the animation is terminated |
avatar(data)
- Description:
Build an avatar image
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | { userId, image (usr_image_id) } or { login, firstname, lastname, picture (full usr_image_id document) } |
Returns:
.avatar
badge(p)
- Description:
Create a badge
Parameters:
Name | Type | Description |
---|---|---|
p |
string | Object | value or { name, value } |
Returns:
div.badge
barOverflow(ctn, options)
- Description:
Transform a bar with overflow button for invisible items in a dropdown
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ctn |
jQuery | horizontal bar container (ul or div, with a limited height) with items (li/a, button or div) |
||||||||||||
options |
Object | Overflow options Properties
|
Returns:
.bar-overflow + caller must trigger 'ui.resize' when displayed to fit size
breadcrump(items, size, cbk)
- Description:
Build a breadcrump 'first / ... / last ones'
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<string> | Array.<Object> | list of items : string or |
size |
number | size limit |
cbk |
function | click handler on item |
Returns:
ol.breadcrumb
calculator(input, cbk)
- Description:
Launch a simple calculator on input
Parameters:
Name | Type | Description |
---|---|---|
input |
Object | form input |
cbk |
function | callback(result) |
Returns:
input
changePwd()
- Description:
Simple dialog to change the user's password
charCounter(inp, options)
- Description:
Create a characters counter on input field
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
inp |
string | jQuery | input or textarea |
|||||||||||||||
options |
Object | Options Properties
|
circularProgressBar(options)
- Description:
Circular progress bar
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | { background, color, percent, duration, radius, width } Properties
|
completion(inp, limit, search, select, disp, options)
- Description:
Bind a completion to input
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
inp |
jQuery | input or null |
||||||
limit |
number | max size of results (0 = no limit) |
||||||
search |
function | search service(cbk) |
||||||
select |
function | optional callback(data) on picking (click or enter) |
||||||
disp |
function | optional callback to display a result |
||||||
options |
Object | options Properties
|
Returns:
input
completionSocial(textarea)
- Description:
Bind a completion to textarea (substitute @login)
Parameters:
Name | Type | Description |
---|---|---|
textarea |
jQuery | social textarea |
docUploader(ctn, list, options)
- Description:
Multi-files rendering + upload
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ctn |
jQuery | container |
||||||||||||||||||||||||||||||||||||
list |
Array | list of documents { id, name } |
||||||||||||||||||||||||||||||||||||
options |
Object | options Properties
|
editMarkdown(md, cbk)
- Description:
Edit a markdown text in a dialog with a preview area
Parameters:
Name | Type | Description |
---|---|---|
md |
string | Initial value |
cbk |
function | Callback with new value |
getBase64Image(img, mime)
- Description:
Convert image to base64 (using a canvas)
Parameters:
Name | Type | Description |
---|---|---|
img |
Object | DOM image |
mime |
string | mime type (ex: image/jpeg) |
Returns:
string = image BASE64 encoded
iconPicker(input, embedded, selected, onSelect)
- Description:
Icon picker
Parameters:
Name | Type | Description |
---|---|---|
input |
jquery | input to set with selected icon |
embedded |
boolean | only content or full dialog |
selected |
string | optional selected icon |
onSelect |
function | optional callback(icon) |
news(ctn, list, options)
- Description:
Display the news
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ctn |
jQuery | container to display articles (null to display a popup or a ticker bar) |
||||||||||||
list |
Array.<Object> | news list from WebNews object or or |
||||||||||||
options |
Object | optional parameters Properties
|
notepad(options)
- Description:
Advanced notepad with activities
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | options Properties
|
palettePicker(params)
- Description:
Palette of colors picker
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | Parameters Properties
|
pillbox(div, data, limit, search, disp, lookup, onAdd, onRemove, onCreate, onOpen)
- Description:
Pillbox control with completion
Parameters:
Name | Type | Description |
---|---|---|
div |
Object | container |
data |
Object | pre-selected data [{id,label,del,open}] |
limit |
number | max size of search results (0 = read only) |
search |
function | optional service(value, cbk) to search data with the input value |
disp |
function | to display completion row and add pillbox data {id,label} |
lookup |
function | optional service(cbk(id,label)) to display a lookup to add an item |
onAdd |
function | optional callback(id,cbk) when item is added, set to null to disable adding |
onRemove |
function | optional callback(id,cbk) when item is removed, set to null to disable deletion |
onCreate |
function | optional callback(val,cbk(id,label)) when item is created, set to null to disable creation |
onOpen |
function | optional callback(id) to open the object form |
Returns:
pillbox
postProgress(ctn, e, params)
- Description:
POST/UPLOAD dialog
Parameters:
Name | Type | Description |
---|---|---|
ctn |
$ | container |
e |
Object | progress event from xhr |
params |
Object | { id, label, after, background } |
scanCode(options)
- Description:
Scan a QRCode/barcode
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
scratchPad(options)
- Description:
Simple scratch pad
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
slider(p)
- Description:
Build a slider
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | slider parameters Properties
|
Returns:
div.slider
starSlider(p, disabled)
- Description:
Build a star slider (rate rendering)
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | slider parameters Properties
|
||||||||||||
disabled |
boolean | false to disable the slider |
Returns:
div.star-slider
switchButton(p, checked, disabled, round)
- Description:
Build a switch button on/off
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
p |
Object | button parameters Properties
|
|||||||||||||||
checked |
boolean | on/off ? |
|||||||||||||||
disabled |
boolean | false to disable the switch |
|||||||||||||||
round |
boolean | round or square? |
Returns:
label with a checkbox and a slider
takePicture(options)
- Description:
Open a dialog to take a picture
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
Promise with data URL 'data:image/png;base64,...'
takeSignature(options)
- Description:
Take a signature on pad
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
tickerBar(params)
- Description:
Display a ticker bar
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | Optional parameters Properties
|
toast(options)
- Description:
Toast dialog
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | text or { level, content, position, align, duration } Properties
|
toastLoading(title, filename, url, p)
- Description:
Toast during the export loading
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
title |
string | toast title |
|||||||||
filename |
string | file name to download |
|||||||||
url |
string | url to load |
|||||||||
p |
Object | Options Properties
|
waitdlg()
- Description:
Wait dialog box
Returns:
div.waitdlg
(inner) actionItem(a, o, rowId, click, minified)
- Description:
Build an action control
Parameters:
Name | Type | Description |
---|---|---|
a |
Object | action metadata |
o |
Simplicite.Ajax.BusinessObject | object |
rowId |
string | optional rowId for form/row action |
click |
function | click handler |
minified |
boolean | true to move the label in a tooltip |
Returns:
button or li for 'Plus' button