feat: Add Be and tbd skill, also added Roadmap file

This commit is contained in:
2026-05-10 16:32:12 -04:00
parent 3500ade13f
commit 0bb8885802
29587 changed files with 10611695 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<!doctype html>
<html>
<head>
<meta charset="utf8" />
<title>Simple localForage example</title>
</head>
<body>
<script src="../dist/localforage.js"></script>
<script>
// Forcing WEBSQL here. Feel free to switch to other drivers :)
localforage.setDriver(localforage.WEBSQL).then(function() {
return localforage.ready();
}).then(() => {
console.log('ready: ' + localforage.driver());
}).then(() => {
var overall = Promise.resolve();
for (let i = 0; i < 1; i++) {
overall = overall.then(() => {
return wait(2000).then(() => (+new Date()) / 1000 | 0);
}).then((timestamp) => {
var data = new Uint32Array(2*1024*1024);
data[0] = timestamp;
return localforage.setItem(`bigdata${i}`, data).then(
data => console.log(`setItem${i} resolved`, data[0]),
e => {
console.log(`setItem${i} rejected`, e);
return Promise.reject(e);
}).then(() => {
return localforage.getItem(`bigdata${i}`);
}).then(
data => {
if (data && data[0] === timestamp) {
console.log(`getItem${i} data matches`, data[0]);
} else {
console.log(`getItem${i} data missmatch`, timestamp, data[0]);
}
},
e => {
console.log('rejected', e);
return Promise.reject(e);
});
});
}
return overall;
}).then(
() => console.log('all done'),
e => console.log('Error', e));
function wait(ms) {
return new Promise(function(resolve) {
resolve();
});
}
</script>
</body>
</html>

View File

@@ -0,0 +1,34 @@
<!doctype html>
<html>
<head>
<meta charset="utf8" />
<title>Simple localForage example</title>
</head>
<body>
<script src="../dist/localforage.js"></script>
<script>
// Forcing localstorage here. Feel free to switch to other drivers :)
localforage.setDriver(localforage.LOCALSTORAGE).then(function() {
var key = 'STORE_KEY';
// var value = 'What we save offline';
var value = new Uint8Array(8);
value[0] = 65
// var value = undefined;
var UNKNOWN_KEY = 'unknown_key';
localforage.setItem(key, value, function() {
console.log('Saved: ' + value);
localforage.getItem(key, function(err, readValue) {
console.log('Read: ', readValue);
});
// Since this key hasn't been set yet, we'll get a null value
localforage.getItem(UNKNOWN_KEY, function(err, readValue) {
console.log('Result of reading ' + UNKNOWN_KEY, readValue);
});
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,37 @@
<!doctype html>
<html>
<head>
<meta charset="utf8" />
<title>Simple localForage example</title>
</head>
<body>
<script src="../dist/localforage.js"></script>
<script>
// Forcing IndexedDB here.
localforage.setDriver(localforage.INDEXEDDB).then(function() {
var key = 'STORE_KEY';
var value = new Uint8Array(8);
value[0] = 65
var UNKNOWN_KEY = 'unknown_key';
localforage.setItem(key, value, function() {
console.log('Saved: ' + value);
// causes InvalidState erros
localforage._dbInfo.db.close();
localforage.getItem(key).then(function(readValue) {
console.log('Read: ', readValue);
}).catch(function(err) {
console.error('Read: ', err);
});
// Since this key hasn't been set yet, we'll get a null value
localforage.getItem(UNKNOWN_KEY).then(function(err, readValue) {
console.log('Result of reading ' + UNKNOWN_KEY, readValue);
});
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,36 @@
requirejs.config({
paths: {
localforage: './../dist/localforage'
}
});
define(['localforage'], function(lf) {
lf.ready(function() {
var key = 'STORE_KEY';
var value = 'What we save offline';
var UNKNOWN_KEY = 'unknown_key';
lf.setItem(key, value, function() {
console.log('SAVING', value);
lf.getItem(key, function(readValue) {
console.log('READING', readValue);
});
});
// Promises code.
lf.setItem('promise', 'ring', function() {
lf.getItem('promise').then(function(readValue) {
console.log('YOU PROMISED!', readValue);
});
});
// Since this key hasn't been set yet, we'll get a null value
lf.getItem(UNKNOWN_KEY, function(readValue) {
console.log('FAILED READING', UNKNOWN_KEY, readValue);
});
});
lf.ready().then(function() {
console.log("You can use ready from Promises too");
})
});

View File

@@ -0,0 +1,45 @@
<!doctype html>
<html>
<head>
<meta charset="utf8" />
<title>localForage no available driver example</title>
</head>
<body>
<script>
try {
window.indexedDB.open = null;
} catch (e) { }
try {
window.localStorage.setItem = null;
} catch (e) { }
try {
window.openDatabase = null;
} catch (e) { }
</script>
<script src="../dist/localforage.js"></script>
<script>
localforage.ready(function() {
console.log('ready', arguments);
localforage.setItem('testKey', 'testValue').then(function() {}, function() {
console.log('setItem: ', arguments);
});
localforage.getItem('testKey').then(function() {}, function() {
console.log('getItem: ', arguments);
});
})
.then(function() {
}, function() {
console.log('ready().then', arguments);
console.log('localforage.driver():', localforage.driver());
localforage.setDriver(localforage.LOCALSTORAGE).then(function() {}, function() {
console.log('setDriver', arguments);
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="utf8" />
<title>require.js localForage example</title>
</head>
<body>
<script src="../bower_components/requirejs/require.js" data-main="main.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
var msg;
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS LOGSSS (id unique, log)');
tx.executeSql('INSERT INTO LOGSSS (id, log) VALUES (1, "foobar")');
tx.executeSql('INSERT INTO LOGSSS (id, log) VALUES (2, ?)', [(new Blob([94864]))]);
msg = '<p>Log message created and row inserted.</p>';
document.querySelector('#status').innerHTML = msg;
});
db.transaction(function (tx) {
tx.executeSql('SELECT * FROM LOGSSS', [], function (tx, results) {
var len = results.rows.length, i;
msg = "<p>Found rows: " + len + "</p>";
document.querySelector('#status').innerHTML += msg;
for (i = 0; i < len; i++){
msg = "<p><b>" + results.rows.item(i).log + "</b></p>";
document.querySelector('#status').innerHTML += msg;
console.log(msg);
}
}, null);
});
</script>
</head>
<body>
<div id="status" name="status">Status Message</div>
</body>
</html>