scripts/index.js
/** Load the settings from local storage */
Load the settings from local storage
Load the settings from local storage
function loadSettings() {
    let jsonSettings = localStorage.getItem("passwordSettings");
    try {
        if (jsonSettings) {
            settings = JSON.parse(jsonSettings);
        }
    } catch (e) {
        debug.log("String is not valid JSON");
        localStorage.removeItem("passwordSettings");
    }
    $("#rounds-counter-display").attr("data-value", settings.amountOfRounds);
    $("#words-counter-display").attr("data-value", settings.amountOfWords);
    $("#time-counter-display").attr("data-value", settings.time);
    $("#extra-point-checkbox")[0].checked = settings.extraPointOnCompletion;
    updateCounters();
}
function loadSettings ( ) { let jsonSettings = localStorage . getItem ( "passwordSettings" ) ; try { if ( jsonSettings ) { settings = JSON . parse ( jsonSettings ) ; } } catch ( e ) { debug . log ( "String is not valid JSON" ) ; localStorage . removeItem ( "passwordSettings" ) ; } $ ( "#rounds-counter-display" ) . attr ( "data-value" , settings . amountOfRounds ) ; $ ( "#words-counter-display" ) . attr ( "data-value" , settings . amountOfWords ) ; $ ( "#time-counter-display" ) . attr ( "data-value" , settings . time ) ; $ ( "#extra-point-checkbox" ) [ 0 ] . checked = settings . extraPointOnCompletion ; updateCounters ( ) ; }
Load the settings from local storage
Load the settings from local storage
// No point storing it then // Use the current definition of settings (above)