Skip to content

Commit

Permalink
lnote-1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhwagk committed Feb 28, 2024
1 parent 1105f15 commit 2cc0ee9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "lnote",
"displayName": "lnote",
"description": "A simple note-taking extension.",
"version": "1.1.4",
"version": "1.1.5",
"icon": "icon.png",
"publisher": "shinhwagk",
"preview": true,
Expand Down
22 changes: 13 additions & 9 deletions web/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,18 @@ function readerCategory(fdom: Element, als: string[], filter: string[]) {

const _notes = gs.kkk[als.join("|||")].map(nid => gs.allNotes.get(nid)!)
for (const n of _notes) {
if (filter.length >= 1) {
let pin = false;
for (const f of filter) {
for (const c of n.contents) {
if (c.includes(f)) { pin = true; break; }
}
if (pin) { break; }
}
if (!pin) { continue; }
// if (filter.length >= 1) {
// let pin = 0;
// for (const f of filter) {
// for (const c of n.contents) {
// if (c.includes(f)) { pin += 1; break; }
// }
// }
// if (pin < filter.length) { continue; }
// }

if (filter.length >= 1 && !filter.every(f => n.contents.some(c => c.includes(f)))) {
continue;
}
const notesDom = document.createElement('div');
notesDom.id = `note-${n.id}`;
Expand Down Expand Up @@ -404,6 +407,7 @@ function readerDomainName() {
e_search.maxLength = 2048;
e_search.rows = 1;
e_search.onkeyup = () => {
console.log(`info: search ${e_search.value}.`)
readerCategories(e_search.value.split(' '));
};

Expand Down

0 comments on commit 2cc0ee9

Please sign in to comment.