|
@ -1,82 +1,90 @@ |
|
|
tag app-links |
|
|
tag app-links |
|
|
|
|
|
|
|
|
|
|
|
def handle_edit |
|
|
|
|
|
return unless state.sorted_links.length > 0 |
|
|
|
|
|
refs.edit.open api.selected_link |
|
|
|
|
|
|
|
|
get tips |
|
|
get tips |
|
|
let result = [] |
|
|
let result = [] |
|
|
|
|
|
let temp |
|
|
|
|
|
|
|
|
result.push <> |
|
|
temp = { |
|
|
<.tip |
|
|
click_handler: api.handle_click_link.bind(api) |
|
|
@click=api.handle_click_link |
|
|
hotkey_handler: api.handle_click_link.bind(api) |
|
|
@hotkey('return').force=api.handle_click_link |
|
|
hotkey: 'return' |
|
|
> |
|
|
hotkey_display_name: 'Return' |
|
|
<.tip-hotkey> "Return" |
|
|
} |
|
|
if api.selected_link.is_bang |
|
|
temp.content = api.selected_link.is_bang ? "Use Bang" : "Navigate To Link" |
|
|
<.tip-content> "Use Bang" |
|
|
result.push temp |
|
|
else |
|
|
|
|
|
<.tip-content> "Navigate To Link" |
|
|
temp = { |
|
|
|
|
|
click_handler: api.handle_add_link.bind(api) |
|
|
result.push <> |
|
|
hotkey_handler: api.handle_add_link.bind(api) |
|
|
<.tip |
|
|
hotkey: 'shift+return' |
|
|
@click=api.handle_add_link |
|
|
hotkey_display_name: 'Shift + Return' |
|
|
@hotkey('shift+return').force=api.handle_add_link |
|
|
content: "Create Link \"{state.query.trim!}\"" |
|
|
> |
|
|
} |
|
|
<.tip-hotkey> "Shift + Return" |
|
|
result.push temp |
|
|
<.tip-content.ellipsis> |
|
|
|
|
|
<span[ws:pre]> "Create Link " |
|
|
temp = { |
|
|
let sq = state.query.trim!.split /\s+/ |
|
|
click_handler: handle_edit.bind(this) |
|
|
if sq.length >= 2 |
|
|
hotkey_handler: handle_edit.bind(this) |
|
|
let url = sq.pop! |
|
|
hotkey: 'shift+backspace' |
|
|
<span> '"' |
|
|
hotkey_display_name: "Shift + Backspace" |
|
|
<span> sq.join " " |
|
|
content: "Edit Link" |
|
|
<span[c:blue3 ws:pre]> " {url}" |
|
|
} |
|
|
<span> '"' |
|
|
result.push temp |
|
|
else |
|
|
|
|
|
<span> "\"{sq.join " "}\"" |
|
|
temp = { |
|
|
|
|
|
click_handler: api.toggle_effective_names.bind(api) |
|
|
result.push <> |
|
|
hotkey_handler: api.toggle_effective_names.bind(api) |
|
|
<.tip |
|
|
hotkey: 'tab' |
|
|
@click=handle_edit |
|
|
hotkey_display_name: "Tab" |
|
|
@hotkey('shift+backspace').force=handle_edit |
|
|
content: "Toggle Effective Names" |
|
|
> |
|
|
} |
|
|
<.tip-hotkey> "Shift + Backspace" |
|
|
result.push temp |
|
|
<.tip-content> "Edit Link" |
|
|
|
|
|
|
|
|
temp = { |
|
|
result.push <> |
|
|
click_handler: (do refs.settings.open!).bind(this) |
|
|
<.tip |
|
|
hotkey_handler: (do refs.settings.open!).bind(this) |
|
|
@click=api.toggle_effective_names |
|
|
hotkey: 'shift+tab' |
|
|
@hotkey('tab').force=api.toggle_effective_names |
|
|
hotkey_display_name: "Shift + Tab" |
|
|
> |
|
|
content: "Toggle Settings" |
|
|
<.tip-hotkey> "Tab" |
|
|
} |
|
|
<.tip-content> "Toggle Effective Names" |
|
|
result.push temp |
|
|
|
|
|
|
|
|
result.push <> |
|
|
temp = { |
|
|
<.tip |
|
|
click_handler: api.handle_cut.bind(api) |
|
|
@click=refs.settings.open |
|
|
} |
|
|
@hotkey('shift+tab').force=refs.settings.open |
|
|
|
|
|
> |
|
|
|
|
|
<.tip-hotkey> "Shift + Tab" |
|
|
|
|
|
<.tip-content> "Toggle Settings" |
|
|
|
|
|
|
|
|
|
|
|
result.push <> |
|
|
|
|
|
<.tip @click=api.handle_cut> |
|
|
|
|
|
if api.math_result |
|
|
if api.math_result |
|
|
<.tip-hotkey> "Cut (Math, If No Selection)" |
|
|
temp.hotkey_display_name = "Cut (If No Selection)" |
|
|
<.tip-content> "Cut Math Result" |
|
|
temp.content = "Cut All Text" |
|
|
else |
|
|
else |
|
|
<.tip-hotkey> "Cut (If No Selection)" |
|
|
temp.hotkey_display_name = "Cut (Math, If No Selection)" |
|
|
<.tip-content> "Cut All Text" |
|
|
temp.content = "Cut Math Result" |
|
|
|
|
|
result.push temp |
|
|
result.push <> |
|
|
|
|
|
<.tip.noclick |
|
|
temp = { |
|
|
@hotkey('down').force=api.increment_link_selection_index |
|
|
hotkey_handler: api.increment_link_selection_index.bind(api) |
|
|
@hotkey('up').force=api.decrement_link_selection_index |
|
|
hotkey: 'down' |
|
|
> |
|
|
hotkey_display_name: "Down Arrow" |
|
|
<.tip-hotkey> "Up/Down Arrow" |
|
|
content: "Move Selection Down" |
|
|
<.tip-content> "Move Selection" |
|
|
} |
|
|
|
|
|
result.push temp |
|
|
result.push <> |
|
|
|
|
|
<.tip.noclick> |
|
|
temp = { |
|
|
<.tip-hotkey> "Paste (If Input Empty)" |
|
|
hotkey_handler: api.decrement_link_selection_index.bind(api) |
|
|
<.tip-content> "Instant Search" |
|
|
hotkey: 'up' |
|
|
|
|
|
hotkey_display_name: "Up Arrow" |
|
|
|
|
|
content: "Move Selection Up" |
|
|
|
|
|
} |
|
|
|
|
|
result.push temp |
|
|
|
|
|
|
|
|
|
|
|
temp = { |
|
|
|
|
|
hotkey_display_name: "Paste (If Input Empty)" |
|
|
|
|
|
content: "Instant Search" |
|
|
|
|
|
} |
|
|
|
|
|
result.push temp |
|
|
|
|
|
|
|
|
result |
|
|
result |
|
|
|
|
|
|
|
@ -91,5 +99,5 @@ tag app-links |
|
|
<.links> |
|
|
<.links> |
|
|
css ofy:scroll |
|
|
css ofy:scroll |
|
|
for link, index in state.sorted_links |
|
|
for link, index in state.sorted_links |
|
|
<app-link link=link index=index> |
|
|
<app-link link=link index=index handle_edit=handle_edit> |
|
|
|
|
|
|
|
|