diff --git a/css/bookmarks.css b/css/bookmarks.css index 3c4b557f..ce552bd2 100644 --- a/css/bookmarks.css +++ b/css/bookmarks.css @@ -155,7 +155,7 @@ #addBm ul.tagit { background:white; } -#addBm input.ui-autocomplete-input{ +#addBm input.ui-autocomplete-input, #tag_filter input.ui-autocomplete-input{ box-shadow:none; } @@ -167,18 +167,18 @@ #tag_filter { padding-left: 1em; } -#leftcontent hr { - background-color:#DDDDDD; - border:0; - color:#DDDDDD; - height:1px; - margin-top: 1em; - margin-bottom: 1em; -} -#leftcontent li, .leftcontent li { + +#leftcontent > ul > li, .leftcontent li { padding: 0.2em; padding-left:1em; } +#leftcontent > label { + margin-top: 1em; + margin-bottom: 0.7em; + display: block; + padding-left: 1em; +} + #leftcontent .tag_list > li .tag , #leftcontent .share_list > li .tag{ background: none repeat scroll 0 0 #DEE7F8; border: 1px solid #CAD8F3; @@ -204,4 +204,28 @@ li:hover .tags_actions { display:block; } -li:hover em { display : none; } \ No newline at end of file +li:hover em { display : none; } +#tag_filter li, #tag_filter li:hover{ + background: none repeat scroll 0 0 #F8F8F8; + +} +#tag_filter ul.tagit li.tagit-choice { + background: none repeat scroll 0 0 #DEE7F8; + padding: 0.2em 18px 0.2em 0.5em; +/* padding:0; */ +} + +#tag_filter a { + display: inline; + float: none; + margin: 0; + padding: 0; +} +#tag_filter ul.tagit li.tagit-choice .close{ + margin-top: -8px; + cursor: pointer; + margin-top: -8px; + position: absolute; + right: 0.1em; + top: 50%; +} \ No newline at end of file diff --git a/index.php b/index.php index 6f7e93ce..d6c7232b 100644 --- a/index.php +++ b/index.php @@ -31,13 +31,19 @@ OCP\App::setActiveNavigationEntry( 'bookmarks_index' ); OCP\Util::addscript('bookmarks','bookmarks'); OCP\Util::addStyle('bookmarks', 'bookmarks'); -$tags = explode(',', isset($_GET['tag']) ? $_GET['tag'] : ''); -if($tags[0] =='') unset($tags[0]); -$qtags = OC_Bookmarks_Bookmarks::findTags($tags); + +OCP\Util::addscript('bookmarks','tag-it'); +OCP\Util::addStyle('bookmarks', 'jquery.tagit'); +$qtags = OC_Bookmarks_Bookmarks::findTags(); $shared = OC_Bookmarks_Bookmarks::findSharing(); +$tags = array(); +foreach($qtags as $tag) { + $tags[] = $tag['tag']; +} + $tmpl = new OCP\Template( 'bookmarks', 'list', 'user' ); $tmpl->assign('req_tag',isset($_GET['tag']) ? $_GET['tag'] : ''); -$tmpl->assign('tags', $qtags); +$tmpl->assign('tags', json_encode($tags), false); $tmpl->assign('shared', $shared); $tmpl->printPage(); diff --git a/js/bookmarks.js b/js/bookmarks.js index 42d1b0e6..93076286 100644 --- a/js/bookmarks.js +++ b/js/bookmarks.js @@ -10,8 +10,22 @@ $(document).ready(function() { }); $(window).resize(); $('.bookmarks_list').scroll(updateOnBottom).empty().width($('#rightcontent').width()); + $('#tag_filter input').tagit({ + allowSpaces: true, + availableTags: fullTags, + onTagRemoved: filterTagsChanged + }).tagit('option', 'onTagAdded', filterTagsChanged); + + getBookmarks(); }); + +function addFilterTag(event) +{ + event.preventDefault(); + $('#tag_filter input').tagit('createTag', $(this).text()); +} + function updateTagsList(tag) { $('.tag_list').append('