<commit_before>//function storage_check(){
//    // IF RETURNING USER
//    if(localStorage.getItem('clock_s') !== null) {
//
//    } else if(localStorage.getItem('timerClock_s') !== null) {
//
//    } else if(localStorage.getItem('countDownClock_s') !== null) {
//
//    } else if(localStorage.getItem('stopWatchClock_s') !== null) {
//
//    } else if(localStorage.getItem('lapTimerClock_s') !== null) {
//
//    } else {
//
//        timerClock.render(130, 0, 'Demo Timer'); // timer presented if user came in first time and no global \ local storage.
//    }
//
//}

var storage = {
    local : {
        save : function() {
            localStorage.setItem($('#storage_key_save').val(), JSON.stringify(temporary_storage));
           // maybe store last value in session and load after page reload.
           // or need track somehow from which name of local \ global storage get timers after page reload.
           // sessionStorage.setItem('last_timer', JSON.stringify(temporary_storage));
        },
        load : function() {
            alert(localStorage.getItem($('#storage_key_load').val()));
        }
    },
    global : {
        save : function() {
            $.ajax({
                type: "POST",
                url: "/storage/save",
                data: 'padID=' + $('#storage_key_save').val() + '&text=' + JSON.stringify(temporary_storage), // not working
                cache: false,
                success: function(msg) {
                    alert('saved!');
                }
            });
        },
        load : function() {
            $.ajax({
                type: "POST",
                url: "/storage/load",
                data: 'padID=' + $('#storage_key_load').val(),
                cache: false,
                success: function(msg) {
                    alert(msg);
                }
            });
        }
    },
    user : { // TODO: after auth, login, etc...
        save : function() {
            alert('save to users account');
        },
        load : function() {
            alert('load from users account');
        }
    },
};<commit_msg>load timers view from global is work<commit_after>//function storage_check(){
//    // IF RETURNING USER
//    if(localStorage.getItem('clock_s') !== null) {
//
//    } else if(localStorage.getItem('timerClock_s') !== null) {
//
//    } else if(localStorage.getItem('countDownClock_s') !== null) {
//
//    } else if(localStorage.getItem('stopWatchClock_s') !== null) {
//
//    } else if(localStorage.getItem('lapTimerClock_s') !== null) {
//
//    } else {
//
//        timerClock.render(130, 0, 'Demo Timer'); // timer presented if user came in first time and no global \ local storage.
//    }
//
//}

var storage = {
    local : {
        save : function() {
            localStorage.setItem($('#storage_key_save').val(), JSON.stringify(temporary_storage));
           // maybe store last value in session and load after page reload.
           // or need track somehow from which name of local \ global storage get timers after page reload.
           // sessionStorage.setItem('last_timer', JSON.stringify(temporary_storage));
        },
        load : function() {
            //alert(localStorage.getItem($('#storage_key_load').val()));
        }
    },
    global : {
        save : function() {
            $.ajax({
                type: "POST",
                url: "/storage/save",
                data: 'padID=' + $('#storage_key_save').val() + '&text=' + JSON.stringify(temporary_storage), // not working
                cache: false,
                success: function(msg) {
                    alert('saved!');
                }
            });
        },
        load : function() {
            $.ajax({
                type: "POST",
                url: "/storage/load",
                data: 'padID=' + $('#storage_key_load').val(),
                cache: false,
                success: function(msg) {
                    //alert(msg);
                    var result = JSON.parse(msg); // console.log(JSON.parse(msg));

                    for (var i in result) {
                        if(result.hasOwnProperty(i) && !jQuery.isEmptyObject(result[i])) {
                            var value = result[i],
                                timer_type = result[i].type;

                            switch(timer_type) {
                                case '1':
                                    clock.render(value);
                                    break;
                                case '2':
                                    timerClock.render(value);
                                    break;
                                case '3':
                                    countDownClock.render(value);
                                    break;
                                case '4':
                                    stopWatchClock.render(value);
                                    break;
                                case '5':
                                    lapTimerClock.render(value);
                                    break;
                                default :
                                    alert('error, unknown type');
                                    break;
                            }
                        }
                    }
                }
            });
        }
    },
    user : { // TODO: after auth, login, etc...
        save : function() {
            alert('save to users account');
        },
        load : function() {
            alert('load from users account');
        }
    },
};
{'fraction_non_alphanumeric': 0.13738819320214668, 'fraction_numerical': 0.002325581395348837, 'mean_word_length': 1.2046529968454258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '292134', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1376, 'n_words': 306}