diff booket.js @ 3:4786df0aec03

Display URL and hostname Display the hostname after the title and the full URL below it
author Guido Berhoerster <guido+booket@berhoerster.name>
date Mon, 08 Sep 2014 20:01:41 +0200
parents 82c50265c8dc
children 39c95b9826d2
line wrap: on
line diff
--- a/booket.js	Mon Sep 08 19:34:11 2014 +0200
+++ b/booket.js	Mon Sep 08 20:01:41 2014 +0200
@@ -1031,6 +1031,8 @@
     var newNode;
     var bookmarkElement;
     var linkElement;
+    var hostnameElement;
+    var urlElement;
     var ctimeElement;
     var mtimeElement;
     var tagListElement;
@@ -1044,6 +1046,13 @@
     linkElement.textContent = linkElement.title = bookmark.title;
     linkElement.href = bookmark.url;
 
+    hostnameElement = bookmarkElement.querySelector('.bookmark-hostname');
+    hostnameElement.textContent = (linkElement.hostname !== '') ?
+        '[' + linkElement.hostname + ']' : '';
+
+    urlElement = bookmarkElement.querySelector('.bookmark-url');
+    urlElement.textContent = bookmark.url;
+
     ctimeElement = bookmarkElement.querySelector('.ctime');
     ctimeElement.dateTime = bookmark.ctime.toISOString();
     ctimeElement.textContent = bookmark.ctime.toString();