Compare commits

...

1 Commits

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

14
src/api.imba

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

10
src/components/app-home.imba

@ -19,19 +19,17 @@ tag app-home
elif !url
$link-input-url.focus!
else
if api.selected_link.name != title
delete Links[api.selected_link.name]
if api.selected_link.title != title
delete Links[api.selected_link.title]
Links[title] =? url
storage.set 'links', Links
api.refresh_links!
api.select_name(title)
api.select_link(title)
$home-input.focus!
def delete_link
delete Links[$link-input-title.value]
storage.set 'links', Links
$link-input-title.value = ""
$link-input-url.value = ""
api.refresh_links!
$home-input.focus!
@ -63,7 +61,7 @@ tag app-home
@blur=blur
placeholder="title"
@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]
disabled=state.loading

3
src/main.imba

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

Loading…
Cancel
Save