From 78b0b5d229dd89430714a1503d879e2e37000ea9 Mon Sep 17 00:00:00 2001 From: Kartik Gupta Date: Tue, 11 Oct 2016 03:42:51 +0530 Subject: [PATCH] Changes made : 1. The size of the panel will adjust according to the length of the text. 2. The overflow of the text would break in new line. (Actual bug fixed) 3. Made history links clickable. 4. Beautified the extension panel. --- history-deleter/history.css | 32 ++++++++++++++++++++++++++++++-- history-deleter/history.html | 6 ++++-- history-deleter/history.js | 8 +++++++- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/history-deleter/history.css b/history-deleter/history.css index b789105..ecb1bf6 100644 --- a/history-deleter/history.css +++ b/history-deleter/history.css @@ -1,4 +1,32 @@ html, body { - margin: 0.2em; - width: 350px; + margin: 0.3em; + width: auto; + min-width: 250px; + max-width: 500px; + background-color: #f8f8f8; } + +div { + margin-left: 0.5em; + margin-right: 0.5em; + border-bottom: 1px solid grey; +} + +#history-title { + font-weight: bold; + margin-left: 0.5em; + margin-right: 0.5em; +} + +#history { + display: block; + word-wrap: break-word; + margin: 0.5em; + text-decoration: none; +} + +#clear { + text-decoration: none; + margin-left: 0.5em; + margin-right: 0.5em; +} \ No newline at end of file diff --git a/history-deleter/history.html b/history-deleter/history.html index 5fc5382..5103d09 100644 --- a/history-deleter/history.html +++ b/history-deleter/history.html @@ -7,9 +7,11 @@ -

History for this domain (limited to 5 results):

+

History for (Last 5 results) :

+

-

Clear history for this domain

+
+

Clear history for

diff --git a/history-deleter/history.js b/history-deleter/history.js index a03e0f5..1ba0af9 100644 --- a/history-deleter/history.js +++ b/history-deleter/history.js @@ -2,6 +2,8 @@ function get_hostname(url) { var a = document.createElement('a'); a.href = url; + document.getElementById('domain1').innerHTML = a.hostname; + document.getElementById('domain2').innerHTML = a.hostname; return a.hostname; } @@ -27,8 +29,12 @@ chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { for (var k in results) { var history = results[k]; var li = document.createElement('p'); + var a = document.createElement('a'); var url = document.createTextNode(history.url); - li.appendChild(url); + a.href = history.url; + a.target = '_blank'; + a.appendChild(url); + li.appendChild(a); list.appendChild(li); } }