comparison booket.js @ 2:82c50265c8dc

Display creation and modification time
author Guido Berhoerster <guido+booket@berhoerster.name>
date Mon, 08 Sep 2014 19:34:11 +0200
parents c2248f662a2c
children 4786df0aec03
comparison
equal deleted inserted replaced
1:6559033d9996 2:82c50265c8dc
1029 1029
1030 BookmarkView.prototype.onBookmarkAdded = function (bookmark) { 1030 BookmarkView.prototype.onBookmarkAdded = function (bookmark) {
1031 var newNode; 1031 var newNode;
1032 var bookmarkElement; 1032 var bookmarkElement;
1033 var linkElement; 1033 var linkElement;
1034 var ctimeElement;
1035 var mtimeElement;
1034 var tagListElement; 1036 var tagListElement;
1035 1037
1036 newNode = document.importNode(this.bookmarkTemplate.content, true); 1038 newNode = document.importNode(this.bookmarkTemplate.content, true);
1037 1039
1038 bookmarkElement = newNode.querySelector('li'); 1040 bookmarkElement = newNode.querySelector('li');
1039 bookmarkElement.dataset.bookmarkUrl = bookmark.url; 1041 bookmarkElement.dataset.bookmarkUrl = bookmark.url;
1040 1042
1041 linkElement = bookmarkElement.querySelector('a.bookmark-link'); 1043 linkElement = bookmarkElement.querySelector('a.bookmark-link');
1042 linkElement.textContent = linkElement.title = bookmark.title; 1044 linkElement.textContent = linkElement.title = bookmark.title;
1043 linkElement.href = bookmark.url; 1045 linkElement.href = bookmark.url;
1046
1047 ctimeElement = bookmarkElement.querySelector('.ctime');
1048 ctimeElement.dateTime = bookmark.ctime.toISOString();
1049 ctimeElement.textContent = bookmark.ctime.toString();
1050
1051 mtimeElement = bookmarkElement.querySelector('.mtime');
1052 mtimeElement.dateTime = bookmark.mtime.toISOString();
1053 mtimeElement.textContent = bookmark.mtime.toString();
1044 1054
1045 tagListElement = bookmarkElement.querySelector('ul.tag-list'); 1055 tagListElement = bookmarkElement.querySelector('ul.tag-list');
1046 bookmark.tags.forEach(function (tag) { 1056 bookmark.tags.forEach(function (tag) {
1047 var newNode; 1057 var newNode;
1048 var tagElement; 1058 var tagElement;