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.

104 lines
2.4 KiB

2 years ago
tag app-bang
2 years ago
get tips
2 years ago
let result = []
2 years ago
2 years ago
result.push <>
2 years ago
<.tip
@click=api.handle_bang
@hotkey('return').capture.if(!state.loading)=api.handle_bang
>
<.tip-hotkey> "Return"
<.tip-content> "Search"
2 years ago
result.push <>
2 years ago
<.tip
@click=api.handle_add_link
@hotkey('shift+return').capture.if(!state.loading)=api.handle_add_link
>
<.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 " "}\""
2 years ago
result.push <>
2 years ago
if state.active_bang
<.tip
@click=api.unset_active_bang
2 years ago
@hotkey('esc').capture.if(!state.loading)=api.unset_active_bang
2 years ago
>
<.tip-hotkey> "Esc"
<.tip-content> "Back"
else
<.tip.noclick>
<.tip-hotkey> "Paste (If Input Empty)"
<.tip-content> "Instant Search"
2 years ago
result.push <>
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
result.push <>
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
result.push <>
2 years ago
<.tip
@click.if(!state.loading)=refs.settings.open
@hotkey('shift+tab').capture.if(!state.loading)=refs.settings.open
>
<.tip-hotkey> "Shift + Tab"
<.tip-content> "Toggle Settings"
2 years ago
if state.active_bang
2 years ago
result.push <>
2 years ago
<.tip.noclick>
<.tip-hotkey> "Paste (If Input Empty)"
<.tip-content> "Instant Search"
2 years ago
result
2 years ago
def render
<self>
2 years ago
css w:100% d:flex fld:column gap:15px
2 years ago
<app-tips$tips tips=tips>
2 years ago
unless $tips.show_more
<.bang.selected@click=api.handle_bang>
css d:flex fld:row jc:space-between ai:center
2 years ago
px:16px py:11px rd:5px cursor:pointer c:#FAD4AB
2 years ago
<.link-left>
css d:flex fl:1
2 years ago
2 years ago
<img.link-icon src=api.bang.icon>
css w:20px h:20px mr:10px rd:3px
2 years ago
2 years ago
<.display-name> api.encoded_bang_query
2 years ago
css fs:20px word-break:break-all
2 years ago
<.link-right>
css d:flex fld:row jc:space-between ai:center
2 years ago
2 years ago
<.frequency> api.bang.frequency
css fs:15px ml:7px