Summary Files Commits Branches @commit @diff @stats
path: root / checklist.html
diff options
context:
space:
mode:
Commit002a049289f69a07a23b7bc732d49cdc03f72bec (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-06-22 15:58:12 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-06-22 15:58:12 +0300
Filesa4583610d411da2f1365accb6e288cb048e0f651 /checklist.html
small-web-utilities-002a049289f69a07a23b7bc732d49cdc03f72bec.tar
small-web-utilities-002a049289f69a07a23b7bc732d49cdc03f72bec.tar.gz
small-web-utilities-002a049289f69a07a23b7bc732d49cdc03f72bec.zip
Parent3c72a4411d19c94efef113572c942e7baebaac41 (diff)
(checklist) Improved styling & formatting and added list autoload
1 files changed, 28 insertions, 22 deletions
-rw-r--r--checklist.html50
diff --git a/checklist.html b/checklist.html
index 7b084f3..800637f 100644
--- a/checklist.html
+++ b/checklist.html
@@ -20,6 +20,10 @@
margin-top: 0.5em;
}
+#single-checklist {
+ min-height: calc(100vh - 16px);
+}
+
.list-controls:hover + .list-item, .list-item > input:hover {
background-color: lightgray;
}
@@ -91,15 +95,17 @@ input {
<input type="button" value="Delete" id="delete-btn">
</p>
<br>
- <h3>
- <input type="text" id="name">
- </h3>
- <input type="button" value="Uncheck all" id="uncheck-all">
- <input type="button" value="Check all" id="check-all">
- <input type="button" value="Lock" id="lock-items">
- <input type="button" value="+" id="article-add-item">
- <input type="button" value="-" id="article-sub-item">
- <article id="lists"></article>
+ <div id="single-checklist">
+ <h3>
+ <input type="text" id="name">
+ <input type="button" value="Uncheck all" id="uncheck-all">
+ <input type="button" value="Check all" id="check-all">
+ <input type="button" value="Lock" id="lock-items">
+ <input type="button" value="+" id="article-add-item">
+ <input type="button" value="-" id="article-sub-item">
+ </h3>
+ <article id="lists"></article>
+ </div>
<script>
const lists = document.getElementById('lists');
const stylesheetLocked = document.getElementById('stylesheet-locked');
@@ -320,22 +326,9 @@ input {
}
}
- // while (db == '') {}
-
dbRequest.onsuccess = function() {
db = dbRequest.result;
- var store = db.transaction('CheckLists', 'readwrite').objectStore('CheckLists');
- var all = store.getAll();
- all.onsuccess = function() {
- all.result.forEach(function (l) {
- var nop = document.createElement('option');
- nop.value = l.name;
- nop.innerText = l.name;
- dropdown.appendChild(nop);
- });
- }
-
document.getElementById('open-btn').onclick = function () {
const listName = dropdown.options[dropdown.selectedIndex].text;
@@ -347,6 +340,18 @@ input {
}
}
+ var store = db.transaction('CheckLists', 'readwrite').objectStore('CheckLists');
+ var all = store.getAll();
+ all.onsuccess = function() {
+ all.result.forEach(function (l) {
+ var nop = document.createElement('option');
+ nop.value = l.name;
+ nop.innerText = l.name;
+ dropdown.appendChild(nop);
+ });
+ document.getElementById('open-btn').click();
+ }
+
document.getElementById('delete-btn').onclick = function () {
const listName = dropdown.options[dropdown.selectedIndex].text;
@@ -367,6 +372,7 @@ input {
var store = db.transaction('CheckLists', 'readwrite').objectStore('CheckLists');
store.put({ name: eiName.value, value: eiValue.value });
}
+
}
</script>
</body>