From 18082526f48afcef3fc574e1536ef282aa0cf5bd Mon Sep 17 00:00:00 2001 From: Imran Sobir Date: Mon, 24 Apr 2017 10:59:11 +0500 Subject: [PATCH 1/2] Show hostname in history page. --- qutebrowser/html/history.html | 7 +++++++ qutebrowser/javascript/history.js | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/qutebrowser/html/history.html b/qutebrowser/html/history.html index 35ac419be..955aefb19 100644 --- a/qutebrowser/html/history.html +++ b/qutebrowser/html/history.html @@ -47,6 +47,13 @@ table { text-align: center; } +.hostname { + color: #858585; + font-size: 0.9em; + margin-left: 10px; + text-decoration: none; +} + {% endblock %} {% block content %}

Browsing history

diff --git a/qutebrowser/javascript/history.js b/qutebrowser/javascript/history.js index a2448a14f..f46ceb49d 100644 --- a/qutebrowser/javascript/history.js +++ b/qutebrowser/javascript/history.js @@ -111,7 +111,11 @@ window.loadHistory = (function() { var link = document.createElement("a"); link.href = itemUrl; link.innerHTML = itemTitle; + var host = document.createElement("span"); + host.className = "hostname"; + host.innerHTML = link.hostname; title.appendChild(link); + title.appendChild(host); var time = document.createElement("td"); time.className = "time"; From fe7d21dfbe0b9dabcb66eaa61c20a5d16c9e175c Mon Sep 17 00:00:00 2001 From: Imran Sobir Date: Mon, 24 Apr 2017 15:30:01 +0500 Subject: [PATCH 2/2] Show hostname in non-javascript history page. --- qutebrowser/browser/qutescheme.py | 3 ++- qutebrowser/html/history.html | 8 -------- qutebrowser/html/history_nojs.html | 7 +++++-- qutebrowser/html/styled.html | 7 +++++++ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index d71b6c135..bca93e3c8 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -311,7 +311,8 @@ def qute_history(url): start_time = time.mktime(next_date.timetuple()) - 1 history = [ (i["url"], i["title"], - datetime.datetime.fromtimestamp(i["time"]/1000)) + datetime.datetime.fromtimestamp(i["time"]/1000), + QUrl(i["url"]).host()) for i in history_data(start_time) if "next" not in i ] diff --git a/qutebrowser/html/history.html b/qutebrowser/html/history.html index 955aefb19..2c6c0a2f1 100644 --- a/qutebrowser/html/history.html +++ b/qutebrowser/html/history.html @@ -46,14 +46,6 @@ table { height: 40px; text-align: center; } - -.hostname { - color: #858585; - font-size: 0.9em; - margin-left: 10px; - text-decoration: none; -} - {% endblock %} {% block content %}

Browsing history

diff --git a/qutebrowser/html/history_nojs.html b/qutebrowser/html/history_nojs.html index 3fed67797..bcc5663c1 100644 --- a/qutebrowser/html/history_nojs.html +++ b/qutebrowser/html/history_nojs.html @@ -42,9 +42,12 @@ table { - {% for url, title, time in history %} + {% for url, title, time, host in history %} - + {% endfor %} diff --git a/qutebrowser/html/styled.html b/qutebrowser/html/styled.html index e2a608538..f4d256422 100644 --- a/qutebrowser/html/styled.html +++ b/qutebrowser/html/styled.html @@ -38,4 +38,11 @@ td { padding: 2px 5px; text-align: left; } + +.hostname { + color: #858585; + font-size: 0.9em; + margin-left: 10px; + text-decoration: none; +} {% endblock %}
{{curr_date.strftime("%a, %d %B %Y")}}
{{title}} + {{title}} + {{host}} + {{time.strftime("%X")}}