SoftAP Code Parsing Issues

I’m having difficulties parsing through the SoftAP code to figure out which pieces of it do which tasks. This is probably due in large part to my lack of knowledge of HTML and JS, but i can’t seem to find where in the code certain tasks are accomplished. The code is particularly dense, but here’s what i’m looking to figure out and why:

  1. What specifically happens when i press the “Connect to Wifi” button? Somehow the wifi credentials are stored, and the photon exits listening mode, but i see none of the usual functions to do either of those things contained within the code.

I’d like to tweak the softAP code such that it can go through the entire wireless scan process and find a network, allow input of password, but then NOT immediately exit listening mode. Then later down the page there would be another HTML button that says something to the effect of ‘‘Exit listening mode’’ that would do nothing but that specific task.

Can anyone shed some light on what (and where these) tasks are occurring in the code to do this?