Initial resources kit.

This commit is contained in:
James Cole
2023-07-11 11:45:55 +02:00
parent 27037c2fbb
commit b9cf8b3ef2
62 changed files with 32671 additions and 5563 deletions

View File

@@ -0,0 +1,42 @@
// basic store for preferred date range and some other vars.
// used in layout.
class Basic {
viewRange = '1M';
darkMode = 'browser';
listPageSize = 10;
locale = 'en-US';
range = {
start: null, end: null
};
currencyCode = 'AAA';
currencyId = '0';
constructor() {
}
init() {
console.log('init');
// load variables from window if present
this.loadVariable('viewRange')
}
loadVariable(name) {
console.log('loadVariable(' + name + ')');
if(window.hasOwnProperty(name)) {
console.log('from windows');
this[name] = window[name];
return;
}
// load from local storage
if(window.Alpine.store(name)) {
console.log('from alpine');
this[name] = window.Alpine.store(name);
return;
}
// grab using axios
console.log('axios');
}
}
export default Basic;