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.
68 lines
1.7 KiB
68 lines
1.7 KiB
tag app-links
|
|
|
|
get tips
|
|
let result = []
|
|
let temp
|
|
|
|
temp = {
|
|
click_handler: api.handle_click_link.bind(api)
|
|
hotkey_handler: api.handle_click_link.bind(api)
|
|
hotkey: 'return'
|
|
hotkey_display_name: 'Return'
|
|
}
|
|
temp.content = api.selected_link.is_bang ? "Use Bang" : [api.#link_input, api.#link_title].includes(document.activeElement) ? state.link_selection_index == -1 ? "Add New Link" : "Edit Link" : "Navigate To Link"
|
|
result.push temp
|
|
|
|
temp = {
|
|
click_handler: api.handle_cut.bind(api)
|
|
}
|
|
if api.math_result
|
|
temp.hotkey_display_name = "Cut Math"
|
|
temp.content = "Cut Math Result"
|
|
else
|
|
temp.hotkey_display_name = "Cut"
|
|
temp.content = "Cut All Text"
|
|
result.push temp
|
|
|
|
temp = {
|
|
click_handler: api.increment_link_selection_index.bind(api)
|
|
hotkey_handler: api.increment_link_selection_index.bind(api)
|
|
hotkey: 'down'
|
|
hotkey_display_name: "Down Arrow"
|
|
content: "Move Selection Down"
|
|
}
|
|
result.push temp
|
|
|
|
temp = {
|
|
click_handler: api.decrement_link_selection_index.bind(api)
|
|
hotkey_handler: api.decrement_link_selection_index.bind(api)
|
|
hotkey: 'up'
|
|
hotkey_display_name: "Up Arrow"
|
|
content: state.link_selection_index > 0 ? "Move Selection Up" : "Add New Link"
|
|
}
|
|
result.push temp
|
|
|
|
let content = switch document.activeElement
|
|
when this.api.#link_title then ""
|
|
when this.api.#link_input then "Edit title"
|
|
else "Edit link"
|
|
|
|
if content
|
|
temp = {
|
|
click_handler: do api.#link_input.focus!
|
|
hotkey_display_name: "Shift+Tab"
|
|
content
|
|
}
|
|
result.push temp
|
|
|
|
result
|
|
|
|
<self>
|
|
css w:100% d:flex fld:column gap:15px ofy:hidden max-height:100%
|
|
|
|
<app-tips$tips tips=tips>
|
|
|
|
<.links>
|
|
css ofy:auto
|
|
for link, index in state.sorted_links
|
|
<app-link link=link index=index>
|
|
|