You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.5 KiB

tag app-links
2 years ago
def handle_click_delete link
return unless window.confirm "Do you really want to delete {link..display_name}?"
handle_delete link
def handle_click_pin link
api.pin_link link
def handle_edit
return unless state.sorted_links.length > 0
refs.edit.open api.selected_link
def render
2 years ago
<self>
2 years ago
css w:100% d:flex fld:column gap:15px ofy:hidden
2 years ago
<app-tips>
2 years ago
<.tip-row>
2 years ago
<.tip
2 years ago
@click=api.handle_click_link
@hotkey('return').force.if(!loading)=api.handle_click_link
2 years ago
>
<.tip-hotkey> "Return"
<.tip-content> "Navigate To Link"
<.tip
@click=handle_shift_return
@hotkey('shift+return').capture.if(!state.loading)=handle_shift_return
>
<.tip-hotkey> "Shift + Return"
<.tip-content.ellipsis>
<span[ws:pre]> "Create Link "
let sq = state.query.trim!.split /\s+/
if sq.length >= 2
let url = sq.pop!
<span> '"'
<span> sq.join " "
<span[c:blue3 ws:pre]> " {url}"
<span> '"'
else
<span> "\"{sq.join " "}\""
<.tip
2 years ago
@click=handle_edit
@hotkey('shift+backspace').capture.if(!state.loading)=handle_edit
>
<.tip-hotkey> "Shift + Backspace"
<.tip-content> "Edit Link"
2 years ago
<app-tips-more$tips-more>
2 years ago
<.tip-row>
2 years ago
<.tip
@click.if(!state.loading)=api.toggle_effective_names
@hotkey('tab').capture.if(!state.loading)=api.toggle_effective_names
>
<.tip-hotkey> "Tab"
<.tip-content> "Toggle Effective Names"
2 years ago
<.tip
@click.if(!state.loading)=refs.settings.open
2 years ago
@hotkey('shift+tab').capture.if(!state.loading)=refs.settings.open
>
2 years ago
<.tip-hotkey> "Shift + Tab"
<.tip-content> "Toggle Settings"
2 years ago
<.tip
@click.if(!loading)=api.handle_cut
>
if api.math_result
<.tip-hotkey> "Cut (Math, If No Selection)"
<.tip-content> "Cut Math Result"
else
<.tip-hotkey> "Cut (If No Selection)"
<.tip-content> "Cut All Text"
2 years ago
2 years ago
<.tip-row>
<.tip.noclick
@hotkey('down').capture.if(!state.loading)=api.increment_link_selection_index
@hotkey('up').capture.if(!state.loading)=api.decrement_link_selection_index
>
<.tip-hotkey> "Up/Down Arrow"
<.tip-content> "Move Selection"
<.tip.noclick>
<.tip-hotkey> "Paste (If Input Empty)"
<.tip-content> "Instant Search"
2 years ago
<.tip.placeholder>
2 years ago
unless $tips-more.active
<.links>
css ofy:scroll
for link, index in state.sorted_links
<app-link link=link index=index>