Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Allow navigating to bookmarks page, improve it's layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
alcinnz committed Jun 5, 2020
1 parent 8d00e83 commit af71667
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 29 deletions.
12 changes: 7 additions & 5 deletions data/pages/NOT-FOUND
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,24 @@
<p>{% trans %}Maybe you meant one of these other internal pages?{% endtrans %}</p>

<dl>
<dt><a href="odysseus:bookmarks">{% trans %}Bookmarks{% endtrans %}</a></dt>
<dd>{% trans %}Webpages you've starred.{% endtrans %}</dd>
<dt><a href="odysseus:credits">{% trans %}Credits{% endtrans %}</a></dt>
<dd>{% trans %}The people you should thank for this gorgeous browsing experience.{% endtrans %}</dd>
<dt><a href="odysseus:debugging/index">{% trans %}Odysseus Debugging{% endtrans %}</a></dt>
<dd>{% trans %}Tools for ensuring your browser is working correctly.{% endtrans %}</dd>
<dt><a href="odysseus:feedreaders">{% trans %}Compatible Feed Readers{% endtrans %}</a></dt>
<dd>{% trans %}Lists all compatible feedreaders available in your package repositories.{% endtrans %}</dd>
<dt>{% trans %}Compatible Apps{% endtrans %}:
<form action="odysseus:filetype" method="GET"><input type="text" placeholder="MIME Type" name="mime" /></form>
</dt>
<dt><a href="odysseus:history">{% trans %}History{% endtrans %}</a></dt>
<dd>{% trans %}The pages you've visited before.{% endtrans %}</dd>
<dt><a href="odysseus:home">{% trans %}Odysseus's homepage{% endtrans %}</a></dt>
<dd>{% trans %}Includes links to the pages you visit most.{% endtrans %}</dd>
<dd>{% trans %}This is what you see when you open a new tab.{% endtrans %}</dd>
<dt><a href="odysseus:privacy">{% trans %}Privacy Policy{% endtrans %}</a></dt>
<dd>{% trans %}The privacy situation around Odysseus.{% endtrans %}</a></dt>
<dt><a href="odysseus:feedreaders">{% trans %}Compatible Feed Readers{% endtrans %}</a></dt>
<dd>{% trans %}Lists all compatible feedreaders available in your package repositories.{% endtrans %}</dd>
<dt>{% trans %}Compatible Apps{% endtrans %}:
<form action="odysseus:filetype" method="GET"><input type="text" placeholder="MIME Type" name="mime" /></form>
</dt>
<dd>{% trans %}Lists all apps in your package repository capable of opening a specific MIME type.{% endtrans %}</dd>
<dt><a href="odysseus:suggestions">{% trans %}Personalized suggestions{% endtrans %}</a></dt>
<dd>{% trans %}Links recommended by visited pages you have yet to visit.{% endtrans %}</dd>
Expand Down
8 changes: 6 additions & 2 deletions data/pages/bookmarks
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>{% trans %}Favourites{% endtrans %}</title>
<style>@import url(odysseus:butterick.css)</style>
<title>[starred] {% trans %}Favourites{% endtrans %}</title>
<style>
@import url(odysseus:butterick.css);
figure {width: 134px; overflow: crop;}
legend {text-overflow: ellipsis;}
</style>
</head>
<body>
<nav>
Expand Down
24 changes: 2 additions & 22 deletions src/Traits/autocomplete/imply-http.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,8 @@ namespace Odysseus.Traits {
return; // Doesn't even resemble a URI!

// TODO handle IPv6 addresses.
bool has_schema;
if ("://" in query) has_schema = true;
else if (!(":" in query)) has_schema = false;
else {
var host = query.split("/", 2)[0];
if (host == null) host = query;

var user = host[0:host.index_of("@")];
if (user != null) has_schema = !(":" in user);
else {
var port = host[host.index_of(":")+1:host.length];
has_schema = false;
foreach (var digit in port.data) {
if ('0' < digit || digit > '9') {
has_schema = true;
break;
}
}
}
}

if (has_schema) c.suggestion(query);
// Maybe other failure cases, but the more sophisticated test broke.
if (":" in query) c.suggestion(query);
else c.suggestion("https://" + query);
}
}
Expand Down

0 comments on commit af71667

Please sign in to comment.