src/app/www/js/functions.js
/**
 * Loads a script that is stored inside ESP32.
 */
Loads a script that is stored inside ESP32.
Loads a script that is stored inside ESP32 .
function openScript() {
    let scriptName = ID("filename-open").value;
    if(!scriptName.startsWith("/")) {
        scriptName = "/" + scriptName;
    }
    const form = API.createRequestForm({
        Filename: scriptName
    });
    API.call(API.Resource.OPEN, form)
       .then(text => {
            editor.setValue(deProcessCode(text));
            status.lastVersion = text;
            status.isSaved = true;
            status.filename = scriptName;
        })
        .catch(() => {});
    hideOptionsMenu();
}
function openScript ( ) { let scriptName = ID ( "filename-open" ) . value ; if ( ! scriptName . startsWith ( "/" ) ) { scriptName = "/" + scriptName ; } const form = API . createRequestForm ( { Filename : scriptName } ) ; API . call ( API . Resource . OPEN , form ) . then ( text => { editor . setValue ( deProcessCode ( text ) ) ; status . lastVersion = text ; status . isSaved = true ; status . filename = scriptName ; } ) . catch ( ( ) => { } ) ; hideOptionsMenu ( ) ; }
Loads a script that is stored inside ESP32.
Loads a script that is stored inside ESP32 .