|
@ -25,7 +25,7 @@ tag app |
|
|
|
|
|
|
|
|
def reload_db |
|
|
def reload_db |
|
|
state.links = await db.reload! |
|
|
state.links = await db.reload! |
|
|
state.scored_links = fzy state.links, state.query |
|
|
sort_links! |
|
|
|
|
|
|
|
|
def navigate link |
|
|
def navigate link |
|
|
link.last_opened = Date.now! |
|
|
link.last_opened = Date.now! |
|
@ -108,8 +108,7 @@ tag app |
|
|
def handle_input |
|
|
def handle_input |
|
|
sort_links! |
|
|
sort_links! |
|
|
|
|
|
|
|
|
def handle_click_delete |
|
|
def handle_click_delete link |
|
|
let link = state.scored_links[0] |
|
|
|
|
|
return unless link |
|
|
return unless link |
|
|
return unless window.confirm "Do you really want to delete {link..name}?" |
|
|
return unless window.confirm "Do you really want to delete {link..name}?" |
|
|
await db.delete link |
|
|
await db.delete link |
|
@ -165,13 +164,13 @@ tag app |
|
|
|
|
|
|
|
|
css .links |
|
|
css .links |
|
|
d:flex fld:column jc:flex-start |
|
|
d:flex fld:column jc:flex-start |
|
|
g:20px w:100% mt:20px ofy:auto fl:1 |
|
|
w:100% mt:20px ofy:auto fl:1 |
|
|
px:20px |
|
|
px:20px |
|
|
|
|
|
|
|
|
css .link |
|
|
css .link |
|
|
d:flex fld:row jc:space-between ai:center |
|
|
d:flex fld:row jc:space-between ai:center |
|
|
cursor:pointer px:15px rd:5px |
|
|
px:15px py:10px rd:5px |
|
|
@first py:10px bg:blue3/5 |
|
|
@first mb:10px bg:blue3/5 |
|
|
|
|
|
|
|
|
css a |
|
|
css a |
|
|
tt:capitalize td:none c:blue3 fs:20px |
|
|
tt:capitalize td:none c:blue3 fs:20px |
|
@ -188,9 +187,17 @@ tag app |
|
|
css .create |
|
|
css .create |
|
|
c:purple4 cursor:pointer py:10px |
|
|
c:purple4 cursor:pointer py:10px |
|
|
|
|
|
|
|
|
|
|
|
css .delete |
|
|
|
|
|
bd:1px solid purple4/50 |
|
|
|
|
|
transition:opacity 100ms |
|
|
|
|
|
px:7px rd:3px fs:15px mr:15px |
|
|
|
|
|
c:purple4 cursor:pointer o:0 |
|
|
|
|
|
|
|
|
|
|
|
css .link@hover .delete |
|
|
|
|
|
o:100 |
|
|
|
|
|
|
|
|
<.buttons> |
|
|
<.buttons> |
|
|
|
|
|
|
|
|
<.button@click=handle_click_delete> "DELETE" |
|
|
|
|
|
<.button@click=handle_click_export> "EXPORT" |
|
|
<.button@click=handle_click_export> "EXPORT" |
|
|
|
|
|
|
|
|
if loading_import |
|
|
if loading_import |
|
@ -222,10 +229,12 @@ tag app |
|
|
|
|
|
|
|
|
<.links> |
|
|
<.links> |
|
|
for obj in state.scored_links |
|
|
for obj in state.scored_links |
|
|
<.link@click.prevent=handle_click_link(obj)> |
|
|
<.link> |
|
|
<[d:flex]> |
|
|
<[d:flex fl:1 cursor:pointer]@click.prevent=handle_click_link(obj)> |
|
|
<img height=20 width=20 src=obj.img> |
|
|
<img height=20 width=20 src=obj.img> |
|
|
<a href=obj.link> obj.name |
|
|
<a href=obj.link> obj.name |
|
|
|
|
|
<[d:flex]> |
|
|
|
|
|
<.delete@click=handle_click_delete(obj)> "x" |
|
|
<.frequency> obj.frequency |
|
|
<.frequency> obj.frequency |
|
|
|
|
|
|
|
|
imba.mount <app> |
|
|
imba.mount <app> |
|
|