Bookmark layout updated

This commit is contained in:
Marvin Thomas Rabe 2012-02-01 22:02:06 +01:00
parent bbd10a3c94
commit f999fbf81a
2 changed files with 22 additions and 8 deletions

View File

@ -18,7 +18,7 @@
} }
.bookmarks_list { .bookmarks_list {
margin-top: 2.8em; margin-top: 36px;
} }
.bookmarks_addBml { .bookmarks_addBml {
@ -63,10 +63,22 @@
.bookmark_title { font-weight: bold; display: inline-block; margin-right: 0.8em; } .bookmark_title { font-weight: bold; display: inline-block; margin-right: 0.8em; }
.bookmark_url { display: none; color: #999; } .bookmark_url { display: none; color: #999; }
.bookmark_single:hover .bookmark_url { display: inline; } .bookmark_single:hover .bookmark_url { display: inline; }
.bookmark_tags {
.bookmark_tag { position: absolute;
color: #ff3333; top: 0.5em;
right: 6em;
text-align: right;
} }
.bookmark_tag {
display: inline-block;
color: white;
margin: 0 0.2em;
padding: 0 0.4em;
background-color: #1D2D44;
border-radius: 0.4em;
opacity: 0.2;
}
.bookmark_tag:hover { opacity: 0.5; }
.loading_meta { .loading_meta {
display: none; display: none;

View File

@ -87,8 +87,8 @@ function addOrEditBookmark(event) {
'<div class="bookmark_single" data-id="' + bookmark_id + '" >' + '<div class="bookmark_single" data-id="' + bookmark_id + '" >' +
'<p class="bookmark_actions"><span class="bookmark_delete"><img src="img/delete.png" title="Delete"></span>&nbsp;<span class="bookmark_edit"><img src="img/edit.png" title="Edit"></span></p>' + '<p class="bookmark_actions"><span class="bookmark_delete"><img src="img/delete.png" title="Delete"></span>&nbsp;<span class="bookmark_edit"><img src="img/edit.png" title="Edit"></span></p>' +
'<p class="bookmark_title"><a href="' + url + '" target="_blank" class="bookmark_link">' + title + '</a></p>' + '<p class="bookmark_title"><a href="' + url + '" target="_blank" class="bookmark_link">' + title + '</a></p>' +
'<p class="bookmark_url">' + url + '</p>' +
'<p class="bookmark_tags">' + tagshtml + '</p>' + '<p class="bookmark_tags">' + tagshtml + '</p>' +
'<p class="bookmark_url">' + url + '</p>' +
'</div>' '</div>'
); );
} }
@ -146,7 +146,8 @@ function updateBookmarksList(bookmark) {
var tags = encodeEntities(bookmark.tags).split(' '); var tags = encodeEntities(bookmark.tags).split(' ');
var taglist = ''; var taglist = '';
for ( var i=0, len=tags.length; i<len; ++i ){ for ( var i=0, len=tags.length; i<len; ++i ){
taglist = taglist + '<a class="bookmark_tag" href="?tag=' + encodeURI(tags[i]) + '">' + tags[i] + '</a> '; if(tags[i] != '')
taglist = taglist + '<a class="bookmark_tag" href="?tag=' + encodeURI(tags[i]) + '">' + tags[i] + '</a> ';
} }
if(!hasProtocol(bookmark.url)) { if(!hasProtocol(bookmark.url)) {
bookmark.url = 'http://' + bookmark.url; bookmark.url = 'http://' + bookmark.url;
@ -156,9 +157,11 @@ function updateBookmarksList(bookmark) {
'<p class="bookmark_actions"><span class="bookmark_delete"><img src="img/delete.png" title="Delete"></span>&nbsp;<span class="bookmark_edit"><img src="img/edit.png" title="Edit"></span></p>' + '<p class="bookmark_actions"><span class="bookmark_delete"><img src="img/delete.png" title="Delete"></span>&nbsp;<span class="bookmark_edit"><img src="img/edit.png" title="Edit"></span></p>' +
'<p class="bookmark_title"><a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a></p>' + '<p class="bookmark_title"><a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a></p>' +
'<p class="bookmark_url">' + encodeEntities(bookmark.url) + '</p>' + '<p class="bookmark_url">' + encodeEntities(bookmark.url) + '</p>' +
'<p class="bookmark_tags">' + taglist + '</p>' +
'</div>' '</div>'
); );
if(taglist != '') {
$('div[data-id="'+ bookmark.id +'"]').append('<p class="bookmark_tags">' + taglist + '</p>');
}
} }
function updateOnBottom() { function updateOnBottom() {
@ -178,7 +181,6 @@ function recordClick(event) {
function encodeEntities(s){ function encodeEntities(s){
try { try {
return $('<div/>').text(s).html(); return $('<div/>').text(s).html();
} catch (ex) { } catch (ex) {
return ""; return "";
} }