13 | 13 | 2. Javascript file `inspect_start_plate.js` in `resources/libprep/` updated:[[BR]]a. Function `initPage()` updated by adding event handlers for clicks on new lab protocol links coupled to new function `viewProtocol()`. Also removal of unused code.[[BR]]b. Function `plateInfoLoaded(response)` updated by setting plate name to name in response data.[[BR]]c. Function `downloadLibPrepFile()` updated by obtaining bioplate data for submit info by calling new function `fetchBioplateData()`.[[BR]]d. New function `fetchBioplateData()` added. It contains code previously in function `downloadLibPrepFile()`, in order to make it available to other functions.[[BR]]e. Function `createProtocol()` updated by obtaining submit info for bioplate by calling new function `fetchSubmitInfo()`. Call of function `JSON.stringify(submitInfo)` to obtain string to store in hidden form field exchanged for call of function `JSON.stringify(submitInfo, circular_reference_remover)`, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object.[[BR]]f. New function `fetchSubmitInfo()` added. It contains code previously in function `createProtocol()`, in order to make it available to other functions.[[BR]]g. New function `viewProtocol(event)` added. It calls new function `fetchBioplateData()` to obtain bioplate data for submit info, and new function `fetchSubmitInfo()` to obtain rest of the submit info. Function `JSON.stringify(submitInfo, circular_reference_remover)` is called to obtain string to store in hidden form field, where second argument is new function `circular_reference_remover(key, value)`, that removes any circular references in input JSON object. Data is stored in hidden fields for form with name "`meludi2`", after which `frm.submit()` is called to change action to JSP file `libprep_plate_protocol2.jsp`.[[BR]]h. New function `circular_reference_remover(key, value)` added. It removes any circular references in input JSON object, relying on global JSONArray `circular_reference_cache`, that should be set to `null`, after each call to `JSON.stringify(JSONJObject, circular_reference_remover)`. |