mirror of
https://github.com/MatMoul/dokytree.git
synced 2024-12-24 08:36:11 +00:00
81 lines
1.5 KiB
Plaintext
81 lines
1.5 KiB
Plaintext
div#HEADFILES
|
|
-
|
|
let todos = []
|
|
const readNode = (curNode) => {
|
|
if(curNode?.data?.todo?.length > 0) {
|
|
curNode.data.todo.forEach((itm) => {
|
|
const nodeItem = {
|
|
name: curNode.data.name,
|
|
todo: itm,
|
|
}
|
|
todos.push(nodeItem)
|
|
})
|
|
}
|
|
|
|
curNode.items.forEach((itm) => {
|
|
if(itm?.data?.todo?.length > 0) {
|
|
itm.data.todo.forEach((todo) => {
|
|
const nodeItem = {
|
|
name: itm.data.name,
|
|
url: curNode.url + '?itm=' + itm.name,
|
|
todo: todo,
|
|
}
|
|
todos.push(nodeItem)
|
|
})
|
|
}
|
|
})
|
|
|
|
curNode.nodes.forEach((childNode) => {
|
|
readNode(childNode)
|
|
})
|
|
}
|
|
const readNode1 = (curNode) => {
|
|
if(curNode?.data?.todo?.length > 0) {
|
|
const nodeItem = {
|
|
name: curNode.data.name,
|
|
todos: curNode.data.todo,
|
|
}
|
|
todos.push(nodeItem)
|
|
}
|
|
curNode.items.forEach((itm) => {
|
|
if(itm?.data?.todo?.length > 0) {
|
|
const nodeItem = {
|
|
name: itm.data.name,
|
|
url: curNode.url + '?itm=' + itm.name,
|
|
todos: itm.data.todo,
|
|
}
|
|
todos.push(nodeItem)
|
|
}
|
|
})
|
|
curNode.nodes.forEach((childNode) => {
|
|
readNode(childNode)
|
|
})
|
|
}
|
|
|
|
readNode(doc)
|
|
todos = todos.sort((x, y) => {
|
|
return (y.todo.priority - x.todo.priority)
|
|
})
|
|
|
|
table
|
|
thead
|
|
th Priority
|
|
th Object
|
|
th Message
|
|
each itm in todos
|
|
if itm.todo.priority >= 10
|
|
tr.alert
|
|
td=itm.todo.priority
|
|
td
|
|
a.alert(href=itm.url)=itm.name
|
|
td=itm.todo.msg
|
|
else
|
|
tr
|
|
td=itm.todo.priority
|
|
td
|
|
a(href=itm.url)=itm.name
|
|
td=itm.todo.msg
|
|
|
|
div#FILES
|
|
div#FOOTFILES
|