load/lonm-autosave-sessions.js
/**
     * Create an element for the current setting
     * @param modSetting
     */
Create an element for the current setting
@param modSetting
Create an element for the current setting @param modSetting
function makeSettingElement(modSetting) {
        const currentSettingValue = CURRENT_SETTINGS[modSetting.id];
        const div = document.createElement("div");
        div.className = "setting-single";
        const title = document.createElement("h3");
        title.innerText = modSetting.title;
        div.appendChild(title);
        if(modSetting.description){
            const info = document.createElement("p");
            info.className = "info";
            info.innerText = modSetting.description;
            div.appendChild(info);
        }
        const input = document.createElement("input");
        input.id = modSetting.id;
        input.value = currentSettingValue;
        input.autocomplete = "off";
        input.autocapitalize = "off";
        input.autocorrect = "off";
        input.spellcheck = "off";
        switch (modSetting.type) {
        case Number:
            input.type = "number";
            break;
        case String:
            input.type = "text";
            break;
        case Boolean:
            input.type = "checkbox";
            if(currentSettingValue){input.checked = "checked";}
            break;
        default:
            throw Error("Unknown setting type!");
        }
        if(modSetting.max){input.max = modSetting.max;}
        if(modSetting.min){input.min = modSetting.min;}
        if(modSetting.pattern){input.pattern = modSetting.pattern;}
        input.addEventListener("input", settingUpdated.bind(modSetting));
        div.appendChild(input);
        return div;
    }
function makeSettingElement ( modSetting ) { const currentSettingValue = CURRENT_SETTINGS [ modSetting . id ] ; const div = document . createElement ( "div" ) ; div . className = "setting-single" ; const title = document . createElement ( "h3" ) ; title . innerText = modSetting . title ; div . appendChild ( title ) ; if ( modSetting . description ) { const info = document . createElement ( "p" ) ; info . className = "info" ; info . innerText = modSetting . description ; div . appendChild ( info ) ; } const input = document . createElement ( "input" ) ; input . id = modSetting . id ; input . value = currentSettingValue ; input . autocomplete = "off" ; input . autocapitalize = "off" ; input . autocorrect = "off" ; input . spellcheck = "off" ; switch ( modSetting . type ) { case Number : input . type = "number" ; break ; case String : input . type = "text" ; break ; case Boolean : input . type = "checkbox" ; if ( currentSettingValue ) { input . checked = "checked" ; } break ; default : throw Error ( "Unknown setting type!" ) ; } if ( modSetting . max ) { input . max = modSetting . max ; } if ( modSetting . min ) { input . min = modSetting . min ; } if ( modSetting . pattern ) { input . pattern = modSetting . pattern ; } input . addEventListener ( "input" , settingUpdated . bind ( modSetting ) ) ; div . appendChild ( input ) ; return div ; }
Create an element for the current setting
 @param modSetting
Create an element for the current setting @param modSetting