|
@ -3,7 +3,6 @@ import { evaluate as eval_math } from 'mathjs' |
|
|
tag app-links |
|
|
tag app-links |
|
|
|
|
|
|
|
|
def mount |
|
|
def mount |
|
|
p document |
|
|
|
|
|
$links-input.focus! |
|
|
$links-input.focus! |
|
|
|
|
|
|
|
|
def handle_paste e |
|
|
def handle_paste e |
|
@ -93,7 +92,8 @@ tag app-links |
|
|
|
|
|
|
|
|
def render |
|
|
def render |
|
|
|
|
|
|
|
|
<self[w:100%]> |
|
|
<self> |
|
|
|
|
|
css w:100% d:flex fld:column gap:10px |
|
|
|
|
|
|
|
|
if $as.active |
|
|
if $as.active |
|
|
<app-settings$as> |
|
|
<app-settings$as> |
|
@ -132,10 +132,11 @@ tag app-links |
|
|
<.side.right @click.if(!state.loading)=toggle_settings> |
|
|
<.side.right @click.if(!state.loading)=toggle_settings> |
|
|
<svg src="../assets/settings.svg"> |
|
|
<svg src="../assets/settings.svg"> |
|
|
|
|
|
|
|
|
if config.data.enable_tips |
|
|
if state.active_bang or state.sorted_links.length < 1 |
|
|
if state.active_bang |
|
|
|
|
|
|
|
|
|
|
|
<app-tips> |
|
|
<app-tips> |
|
|
|
|
|
|
|
|
|
|
|
<.tip-row> |
|
|
|
|
|
|
|
|
<.tip |
|
|
<.tip |
|
|
@click=(state.active_bang = no) |
|
|
@click=(state.active_bang = no) |
|
@ -144,93 +145,119 @@ tag app-links |
|
|
<.tip-hotkey> "Esc" |
|
|
<.tip-hotkey> "Esc" |
|
|
<.tip-content> "Back" |
|
|
<.tip-content> "Back" |
|
|
|
|
|
|
|
|
else |
|
|
<.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 |
|
|
|
|
|
@click=(state.active_bang = no) |
|
|
|
|
|
@hotkey('esc').capture.if(!state.loading)=(state.active_bang = no) |
|
|
|
|
|
> |
|
|
|
|
|
<.tip-hotkey> "Return" |
|
|
|
|
|
<.tip-content> "Search" |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
|
|
|
|
<app-tips> |
|
|
|
|
|
|
|
|
<app-tips> |
|
|
<.tip-row> |
|
|
|
|
|
|
|
|
<.tip-row> |
|
|
<.tip |
|
|
|
|
|
@click=handle_click_link |
|
|
<.tip |
|
|
@hotkey('return').force.if(!loading)=handle_click_link |
|
|
@click=handle_click_link |
|
|
> |
|
|
@hotkey('return').force.if(!loading)=handle_click_link |
|
|
<.tip-hotkey> "Return" |
|
|
> |
|
|
<.tip-content> "Navigate To Link" |
|
|
<.tip-hotkey> "Return" |
|
|
|
|
|
<.tip-content> "Navigate To Link" |
|
|
<.tip |
|
|
|
|
|
@click=handle_shift_return |
|
|
<.tip |
|
|
@hotkey('shift+return').capture.if(!state.loading)=handle_shift_return |
|
|
@click=handle_shift_return |
|
|
> |
|
|
@hotkey('shift+return').capture.if(!state.loading)=handle_shift_return |
|
|
<.tip-hotkey> "Shift + Return" |
|
|
> |
|
|
<.tip-content.ellipsis> |
|
|
<.tip-hotkey> "Shift + Return" |
|
|
<span[ws:pre]> "Create Link " |
|
|
<.tip-content.ellipsis> |
|
|
let sq = state.query.trim!.split /\s+/ |
|
|
<span[ws:pre]> "Create Link " |
|
|
if sq.length >= 2 |
|
|
let sq = state.query.trim!.split /\s+/ |
|
|
let url = sq.pop! |
|
|
if sq.length >= 2 |
|
|
<span> '"' |
|
|
let url = sq.pop! |
|
|
<span> sq.join " " |
|
|
<span> '"' |
|
|
<span[c:blue3 ws:pre]> " {url}" |
|
|
<span> sq.join " " |
|
|
<span> '"' |
|
|
<span[c:blue3 ws:pre]> " {url}" |
|
|
|
|
|
<span> '"' |
|
|
|
|
|
else |
|
|
|
|
|
<span> "\"{sq.join " "}\"" |
|
|
|
|
|
|
|
|
|
|
|
<.tip |
|
|
|
|
|
@click=handle_shift_backspace |
|
|
|
|
|
@hotkey('shift+backspace').capture.if(!state.loading)=handle_shift_backspace |
|
|
|
|
|
> |
|
|
|
|
|
<.tip-hotkey> "Shift + Backspace" |
|
|
|
|
|
<.tip-content> "Edit Link" |
|
|
|
|
|
|
|
|
|
|
|
<app-tips-more$tips-more> |
|
|
|
|
|
|
|
|
|
|
|
<.tip-row> |
|
|
|
|
|
|
|
|
|
|
|
<.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" |
|
|
|
|
|
|
|
|
|
|
|
<.tip |
|
|
|
|
|
@click.if(!state.loading)=api.toggle_settings |
|
|
|
|
|
@hotkey('esc').capture.if(!state.loading)=toggle_settings |
|
|
|
|
|
> |
|
|
|
|
|
<.tip-hotkey> "Esc" |
|
|
|
|
|
<.tip-content> "Toggle Settings" |
|
|
|
|
|
|
|
|
|
|
|
<.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-row> |
|
|
|
|
|
|
|
|
|
|
|
<.tip |
|
|
|
|
|
@click.if(!loading)=handle_cut |
|
|
|
|
|
> |
|
|
|
|
|
if math_result |
|
|
|
|
|
<.tip-hotkey> "Cut (Math, If No Selection)" |
|
|
|
|
|
<.tip-content> "Cut Math Result" |
|
|
|
|
|
else |
|
|
else |
|
|
<.tip-hotkey> "Cut (If No Selection)" |
|
|
<span> "\"{sq.join " "}\"" |
|
|
<.tip-content> "Cut All Text" |
|
|
|
|
|
|
|
|
<.tip |
|
|
|
|
|
@click=handle_shift_backspace |
|
|
|
|
|
@hotkey('shift+backspace').capture.if(!state.loading)=handle_shift_backspace |
|
|
|
|
|
> |
|
|
|
|
|
<.tip-hotkey> "Shift + Backspace" |
|
|
|
|
|
<.tip-content> "Edit Link" |
|
|
|
|
|
|
|
|
|
|
|
<app-tips-more$tips-more> |
|
|
|
|
|
|
|
|
|
|
|
<.tip-row> |
|
|
|
|
|
|
|
|
|
|
|
<.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" |
|
|
|
|
|
|
|
|
|
|
|
<.tip |
|
|
|
|
|
@click.if(!state.loading)=api.toggle_settings |
|
|
|
|
|
@hotkey('esc').capture.if(!state.loading)=toggle_settings |
|
|
|
|
|
> |
|
|
|
|
|
<.tip-hotkey> "Esc" |
|
|
|
|
|
<.tip-content> "Toggle Settings" |
|
|
|
|
|
|
|
|
|
|
|
<.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-row> |
|
|
|
|
|
|
|
|
|
|
|
<.tip |
|
|
|
|
|
@click.if(!loading)=handle_cut |
|
|
|
|
|
> |
|
|
|
|
|
if 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" |
|
|
|
|
|
|
|
|
<.tip.noclick> |
|
|
<.tip.noclick> |
|
|
<.tip-hotkey> "Paste (If Input Empty)" |
|
|
<.tip-hotkey> "Paste (If Input Empty)" |
|
|
<.tip-content> "Instant Search" |
|
|
<.tip-content> "Instant Search" |
|
|
|
|
|
|
|
|
<.tip.placeholder> |
|
|
<.tip.placeholder> |
|
|
|
|
|
|
|
|
unless $tips-more.active |
|
|
unless $tips-more.active |
|
|
<.links> |
|
|
<.links> |
|
|
css d:flex fld:column jc:flex-start |
|
|
css d:flex fld:column jc:flex-start |
|
|
fl:1 w:100% ofy:auto |
|
|
fl:1 w:100% ofy:auto |
|
|
|
|
|
|
|
|
if not viewing_community_links and (state.active_bang or state.sorted_links.length < 1) |
|
|
if state.active_bang |
|
|
<app-bang data=state.active_bang> |
|
|
<app-bang bang=state.active_bang> |
|
|
|
|
|
elif state.sorted_links.length < 1 |
|
|
|
|
|
<app-bang bang=config.data.default_bang> |
|
|
else |
|
|
else |
|
|
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> |
|
|