diff --git a/README.md b/README.md new file mode 100644 index 0000000..e0bfe82 --- /dev/null +++ b/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) \ No newline at end of file diff --git a/index.html b/index.html index 424f819..63f718b 100644 --- a/index.html +++ b/index.html @@ -1,9 +1,10 @@ - + Start + diff --git a/src/api.imba b/src/api.imba index 157f866..e948e56 100644 --- a/src/api.imba +++ b/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' \ No newline at end of file diff --git a/src/components/app-home.imba b/src/components/app-home.imba index 806d78d..058323a 100644 --- a/src/components/app-home.imba +++ b/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 >