Browse Source

after all it's really slow on FF to use; as an ugly fix I open links in new tab; fix adding and deleting link with alias

main
Marek Piasecki 2 years ago
parent
commit
41ad82bd50
  1. 10
      README.md
  2. 3
      index.html
  3. 14
      src/api.imba
  4. 10
      src/components/app-home.imba
  5. 3
      src/main.imba

10
README.md

@ -0,0 +1,10 @@
De-chromified fork of [familyfriendlymikey/fuzzyhome](https://github.com/familyfriendlymikey/fuzzyhome).
Can work as old good home page on any browser. Not touching original bookmarks.
Oh wait. Looks like setting home page is not so simple anymore: [read](https://support.mozilla.org/en-US/questions/1087831).
After all this simple browser feature (having a home page) became really slow and unusable. Ugly fix applied: open links in new tab and keep
the tool open to reuse it.
Preview here [maniak.pro/home](http://maniak.pro/home)

3
index.html

@ -1,9 +1,10 @@
<html lang="en"> <html lang="en">
<head> <head>
<link rel="icon" href="data:,"> <link rel="icon" href="data:,">
<title>&lrm;</title> <title>Start</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Cache-control" content="public">
</head> </head>
<body style="background:#20222f"> <body style="background:#20222f">
<script type="module" src="/src/index.js"></script> <script type="module" src="/src/index.js"></script>

14
src/api.imba

@ -39,7 +39,7 @@ export default new class api
if name.startsWith "!" if name.startsWith "!"
is_bang = yes is_bang = yes
name = name.slice(1) name = name.slice(1)
{ name, alias, is_bang, url } { name, alias, is_bang, url, title: node.title }
def traverse stack def traverse stack
const links = [] const links = []
@ -81,11 +81,11 @@ export default new class api
Date!.toString!.split(" ").slice(0, 4).join(" ") Date!.toString!.split(" ").slice(0, 4).join(" ")
get selected_link get selected_link
state.sorted_links[state.link_selection_index] || { name: "", alias: "", is_bang:no, url: "" } state.sorted_links[state.link_selection_index] || { name: "", alias: "", is_bang:no, url: "", title: ""}
def select_name(name) def select_link(title)
set_link_selection_index(0) set_link_selection_index(0)
while selected_link.name != name while selected_link.title != title
increment_link_selection_index! increment_link_selection_index!
def set_link_selection_index index def set_link_selection_index index
@ -101,7 +101,8 @@ export default new class api
def navigate link def navigate link
await increment_link_frequency link await increment_link_frequency link
window.location.href = link.url #home_input.value = ""
window.open link.url,'_blank'
get math_result get math_result
try try
@ -148,5 +149,4 @@ export default new class api
"https://icon.horse/icon/{host}" "https://icon.horse/icon/{host}"
def help def help
let url = "https://github.com/familyfriendlymikey/fuzzyhome" window.open "https://github.com/familyfriendlymikey/fuzzyhome",'_blank'
window.open url,'_blank'

10
src/components/app-home.imba

@ -19,19 +19,17 @@ tag app-home
elif !url elif !url
$link-input-url.focus! $link-input-url.focus!
else else
if api.selected_link.name != title if api.selected_link.title != title
delete Links[api.selected_link.name] delete Links[api.selected_link.title]
Links[title] =? url Links[title] =? url
storage.set 'links', Links storage.set 'links', Links
api.refresh_links! api.refresh_links!
api.select_name(title) api.select_link(title)
$home-input.focus! $home-input.focus!
def delete_link def delete_link
delete Links[$link-input-title.value] delete Links[$link-input-title.value]
storage.set 'links', Links storage.set 'links', Links
$link-input-title.value = ""
$link-input-url.value = ""
api.refresh_links! api.refresh_links!
$home-input.focus! $home-input.focus!
@ -63,7 +61,7 @@ tag app-home
@blur=blur @blur=blur
placeholder="title" placeholder="title"
@keydown.enter.stop=edd_link! @keydown.enter.stop=edd_link!
value=api.selected_link.name value=api.selected_link.title
> >
<input$link-input-url[bdl:0 rdl:0 w:380px] <input$link-input-url[bdl:0 rdl:0 w:380px]
disabled=state.loading disabled=state.loading

3
src/main.imba

@ -26,9 +26,6 @@ extend tag element
get storage get storage
storage storage
if config.data.focus and location.search =? "?x"
throw new Error
global.Pins = {} global.Pins = {}
global.Frequencies = {} global.Frequencies = {}
global.Links = {} global.Links = {}

Loading…
Cancel
Save