File size: 919 Bytes
b82d373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
////////////////// LOCAL STORAGE HANDLING /////////////////////

export function SaveLocal(target, val) {
    localStorage.setItem(target, val);
    console.debug('SaveLocal -- ' + target + ' : ' + val);
}
export function LoadLocal(target) {
    console.debug('LoadLocal -- ' + target);
    return localStorage.getItem(target);

}
export function LoadLocalBool(target) {
    let result = localStorage.getItem(target) === 'true';
    return result;
}
export function CheckLocal() {
    console.log('----------local storage---------');
    var i;
    for (i = 0; i < localStorage.length; i++) {
        console.log(localStorage.key(i) + ' : ' + localStorage.getItem(localStorage.key(i)));
    }
    console.log('------------------------------');
}

export function ClearLocal() { localStorage.clear(); console.log('Removed All Local Storage'); }

/////////////////////////////////////////////////////////////////////////