Class SAGE2_UI
Class defined in:public/src/SAGE2_UI.js:16
Web user interface
createFileList
( list, type, parent
)
public/src/SAGE2_UI.js:852
Create a list of element, returns the longest one
Parameters:return the longest elememt
dateToYYYYMMDDHHMMSS
( date
)
public/src/SAGE2_UI.js:2422
Format a date into a string
Parameters:-
date
<Date>date
formatted string
doesTranscriptActivateLocally
(
)
public/src/SAGE2_Speech.js:226
Check if transcript is a local speech command.
enableMouseholdToStart
(
)
public/src/SAGE2_Speech.js:393
Starts the mouse hold recognition. If there has not been a 1st name mention. Restart listener. Show listening. Mark this as getting an automatic name mention.
escapeDialog
( event
)
public/src/SAGE2_UI.js:2213
Handler for closing a dialog box with ESC key
Parameters:-
event
<Event>event data
fileDragEnter
( event
)
public/src/SAGE2_UI.js:903
Start drag'n'drop
Parameters:-
event
<Event>event data
fileDragLeave
( event
)
public/src/SAGE2_UI.js:918
Detect drag leave event
Parameters:-
event
<Event>event data
fileDrop
( event
)
public/src/SAGE2_UI.js:933
Handler for file drop
Parameters:-
event
<Event>event data
fileUploadProgress
( percent
)
public/src/SAGE2_UI.js:1054
File upload progress callback
Parameters:-
percent
<Number>process
fileUploadStart
( files
)
public/src/SAGE2_UI.js:981
File upload start callback
Parameters:-
files
<Object>array-like that containing the file infos
forceClick
( event
)
public/src/SAGE2_UI.js:1918
Handler for force click event (safari)
Parameters:-
event
<Event>event data
getCSSProperty
( cssFile, selector
)
public/src/SAGE2_UI.js:798
Get a CSS value from a style sheet
Parameters:handleClick
( element
)
public/src/SAGE2_UI.js:1251
Processing click
Parameters:-
element
<Element>DOM element triggering the click
handleDblClick
( element
)
public/src/SAGE2_UI.js:1882
Processing double click
Parameters:-
element
<Element>DOM element triggering the double click
hideAppContextMenuDiv
( data
)
public/src/SAGE2_UI.js:2525
Populates context menu. Called on initial right click with empty array for entriesToAdd Called again when appContextMenuContents packet is received. The call is given data.entries, data.app
Entries created will store their information within the div.
Parameters:hideAppContextMenuDiv
(
)
public/src/SAGE2_UI.js:2505
Hides context menu from the document. It only makes visibility hidden. So values are still there.
hideDialog
( id
)
public/src/SAGE2_UI.js:2351
Show a given dialog
Parameters:-
id
<String>element to show
initMouseholdToStart
(
)
public/src/SAGE2_Speech.js:344
Initializes by creating listeners to restart and enable sending if mouse is held down.
keyDown
( event
)
public/src/SAGE2_UI.js:2269
Handler for key down
Parameters:-
event
<Event>event data
keyPress
( event
)
public/src/SAGE2_UI.js:2293
Handler for key press
Parameters:-
event
<Event>event data
mouseCheck
( event
)
public/src/SAGE2_UI.js:1197
First handler for mouse event: fiding out if device has a mouse
Parameters:-
event
<Event>event data
mouseMoveListener
( e
)
public/src/SAGE2_Speech.js:513
Updates position of mouse location to move the listening visual.
Parameters:-
e
<Object>- The mouse event, should be standard.
noBackspace
( event
)
public/src/SAGE2_UI.js:2226
Handler for detecting backspace outside the drawing area
Parameters:-
event
<Event>event data
pad
( n, width, z
)
public/src/SAGE2_UI.js:2407
Pad a number to string
Parameters:formatted string
pointerClick
( event
)
public/src/SAGE2_UI.js:1241
Handler for click event
Parameters:-
event
<Event>event data
pointerDblClick
( event
)
public/src/SAGE2_UI.js:1872
Handler for double click event
Parameters:-
event
<Event>event data
pointerMove
( event
)
public/src/SAGE2_UI.js:1156
Handler for mouse move
Parameters:-
event
<Event>event data
pointerPress
( event
)
public/src/SAGE2_UI.js:1105
Handler for mouse press
Parameters:-
event
<Event>event data
pointerRelease
( event
)
public/src/SAGE2_UI.js:1132
Handler for mouse up
Parameters:-
event
<Event>event data
pointerScroll
( event
)
public/src/SAGE2_UI.js:1905
Handler for pointer scroll event
Parameters:-
event
<Event>event data
preventDefault
( event
)
public/src/SAGE2_UI.js:886
Prevent default event processing on a event
Parameters:-
event
<Event>event data
reloadIfServerRunning
( callback
)
public/src/SAGE2_UI.js:2434
Reload the page if server reloads
Parameters:-
callback
<Function>function to call
resizeMenuUI
( ratio
)
public/src/SAGE2_UI.js:760
Resize menus
Parameters:-
ratio
<Number>scale factor
restartIfMouseStillDownAndNotTalking
(
)
public/src/SAGE2_Speech.js:698
Restarts the voice recognition if mouse is held down, after response speech is done.
SAGE2_resize
( ratio
)
public/src/SAGE2_UI.js:733
Handler resizes
Parameters:-
ratio
<Number>scale factor
sendMessageMakeNote
(
)
public/src/SAGE2_UI.js:3258
This function is activated in 2 ways.
- User click the send button.
- User hits enter when making a note. This check is done in the noBackspace funciton. When activated will make the packet to launch app. Collects values from tags on page.
setListeningVisual
( shouldShow
)
public/src/SAGE2_Speech.js:574
Set whether or not to show the listening visual.
Parameters:-
shouldShow
<Boolean>- true to show, otherwise false.
setNameMarker
(
)
public/src/SAGE2_Speech.js:675
Activates after receiving from server what the name marker is. Only after receiving will it init the voice recognition.
setNoteToMakeMode
(
)
public/src/SAGE2_UI.js:3244
This sets the values of the note making button to make instead of save.
setupAppContextMenuDiv
(
)
public/src/SAGE2_UI.js:2456
After loading page will perform additional setup for the context menu. Mainly to do with javascript loading of variables for later use.
showAppContextMenuDiv
( x, y
)
public/src/SAGE2_UI.js:2490
Sets context menu to visible and moves to coordinates. Called after setting the entries.
Parameters:-
x
<Integer>- x position.
-
y
<Integer>- y position.
showDialog
( id
)
public/src/SAGE2_UI.js:2339
Show a given dialog
Parameters:-
id
<String>element to show
textToSpeech
( whatToSay
)
public/src/SAGE2_Speech.js:631
Will attempt to voice the given what to say.
Parameters:-
whatToSay
<String>- will attempt to say this.
toggleVoiceRecognition
(
)
public/src/SAGE2_Speech.js:653
Will toggle whether or not voice recognition starts for long click and hold.
touchEnd
( event
)
public/src/SAGE2_UI.js:2052
Handler for touch end event
Parameters:-
event
<Event>event data
touchMove
( event
)
public/src/SAGE2_UI.js:2117
Handler for touch move event
Parameters:-
event
<Event>event data
touchStart
( event
)
public/src/SAGE2_UI.js:1950
Handler for touch start event
Parameters:-
event
<Event>event data
uiDrawSendLineCommand
( xDest, yDest, xPrev, yPrev
)
public/src/SAGE2_UI.js:3592
When a user tries to draw on the doodle canavs, the events are converted to locations of where to place the line data. Previous location to current location. The client doesn't actually cause their canvas to update. The app sends a confirmation back which causes the canvas to update.
Parameters:uiDrawSetCurrentStateAndShow
( data
)
public/src/SAGE2_UI.js:3666
This will be called from a wsio packet "sendDataToClient". Must clear out canvas, set state, show dialog. Should happen when a user chooses to edit an existing doodle. Their canvas needs to be set to the current state of the doodle before edits should be made. But, doodles can be made from images which have varying sizes. They must also be contained within view correctly.
Parameters:uiDrawZoneRemoveSelfAsClient
( data
)
public/src/SAGE2_UI.js:3718
Called when the user creates a new doodle, or closes the doodle dialog. This is necessary because the doodle canvas space is a shared draw space, if they do not remove themselves the app will continue to send updates even if they are not currently editing the app.
Parameters: