The Chimera2 Web Application uses several JavaScript libraries, including public ones such as jQuery and jQuery UI as well as custom libraries for Session Management and Applet Management.
The session management library is divided into two parts:
The public API consistents of attributes of one object:
The HTML layer API is accessible via $c2_session.
| Arguments: |
|
|---|---|
| Returns: | nothing. |
Initialize HTML and AJAX layers. The AJAX layer is initialized with a call to init(). To create user interface widgets, ui_init() looks for an HTML element with id c2_session. A jQuery button is inserted at the start of this element that both displays the name of the current active session and, when clicked, brings up a session selection dialog.
Web account used to contact server.
Name of current active session.
Password for current active session.
Array of sessions for current user. Each session is an object with attributes name and access (see list_sessions()).
The AJAX layer API is accessible via $c2_session.server.
| Arguments: |
|
|---|---|
| Returns: | nothing. |
Initialize AJAX layer. Must be called prior to using other functions.
| Returns: | jQuery API’s ajax jqXHR object. |
|---|
Send an AJAX request for session information. The return value is the object returned by jQuery’s jQuery API’s getJSON function, and is used to invoke callbacks and for adding error handling functionality. If the request is successful, the done method’s data argument has the session data, which is of the form:
[ "user_name", [
{ name: "session_name", access: "access_time" },
{ name: "session_name_2", access: "access_time_2" },
...
]]
and describes the list of sessions associated with a web account, where:
| Arguments: |
|
|---|---|
| Returns: | jQuery API’s ajax jqXHR object. |
Send an AJAX request to create a new session. The return value is the object returned by jQuery API’s get function, and is used to invoke callbacks and for adding error handling functionality. If the request is successful, the done method’s data argument is empty.
| Arguments: |
|
|---|---|
| Returns: | jQuery API’s ajax jqXHR object. |
Send an AJAX request to delete an existing session. The return value is the object returned by jQuery API’s get function, and is used to invoke callbacks and for adding error handling functionality. If the request is successful, the done method’s data argument is empty.
TODO