mirror of
https://github.com/owncloud/bookmarks.git
synced 2025-03-22 13:19:40 +01:00
Transform load of bookmart to GET request. Idempotent query
This commit is contained in:
parent
94160cb421
commit
c8ef4de201
@ -30,17 +30,17 @@ require_once(OC_App::getAppPath('bookmarks').'/bookmarksHelper.php');
|
||||
$req_type= isset($_GET['type']) ? $_GET['type'] : 'bookmark';
|
||||
|
||||
if($req_type == 'rel_tags') {
|
||||
$tags = analyzeTagRequest(isset($_POST['tag']) ? $_POST['tag'] : '');
|
||||
$tags = analyzeTagRequest(isset($_GET['tag']) ? $_GET['tag'] : '');
|
||||
$qtags = OC_Bookmarks_Bookmarks::findTags($tags);
|
||||
OCP\JSON::success(array('data' => $qtags));
|
||||
|
||||
}
|
||||
else { // type == bookmark
|
||||
$filterTag = analyzeTagRequest(isset($_POST['tag']) ? $_POST['tag'] : '');
|
||||
$filterTag = analyzeTagRequest(isset($_GET['tag']) ? $_GET['tag'] : '');
|
||||
|
||||
$offset = isset($_POST['page']) ? intval($_POST['page']) * 10 : 0;
|
||||
$offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0;
|
||||
|
||||
$sort = isset($_POST['sort']) ? ($_POST['sort']) : 'bookmarks_sorting_recent';
|
||||
$sort = isset($_GET['sort']) ? ($_GET['sort']) : 'bookmarks_sorting_recent';
|
||||
if($sort == 'bookmarks_sorting_clicks') {
|
||||
$sqlSortColumn = 'clickcount';
|
||||
} else {
|
||||
|
@ -80,9 +80,6 @@
|
||||
margin-right: 0.8em;
|
||||
}
|
||||
|
||||
.bookmark_url { display: none; color: #999; }
|
||||
.bookmark_single:hover .bookmark_url { display: inline; }
|
||||
|
||||
.bm_view_list .bookmark_tags {
|
||||
position: absolute;
|
||||
top: 0.5em;
|
||||
@ -269,14 +266,20 @@ li:hover em { display : none; }
|
||||
width: 228px;
|
||||
height: 160px
|
||||
}
|
||||
|
||||
.bookmark_desc{
|
||||
min-height: 1em;
|
||||
}
|
||||
/*
|
||||
.bm_view_img .bookmark_single:hover .bookmark_url{
|
||||
display:block;
|
||||
display:block;
|
||||
}
|
||||
.bm_view_img .bookmark_single .bookmark_url{
|
||||
display:block;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.bookmark_single:hover .bookmark_url { display: inline; }*/
|
||||
.bookmark_url { display: none; }
|
||||
|
||||
.bm_view_img .bookmark_actions {
|
||||
bottom: 0.7em;
|
||||
display: block;
|
||||
|
@ -62,18 +62,19 @@ function updateTagsList(tag) {
|
||||
function filterTagsChanged()
|
||||
{
|
||||
$('#bookmarkFilterTag').val($('#tag_filter input:hidden').val());
|
||||
bookmarks_page = 0;
|
||||
$('.bookmarks_list').empty();
|
||||
bookmarks_page = 0;
|
||||
getBookmarks();
|
||||
}
|
||||
function getBookmarks() {
|
||||
if(bookmarks_loading) {
|
||||
//have patience :)
|
||||
return;
|
||||
}
|
||||
}
|
||||
bookmarks_loading = true;
|
||||
//Update Rel Tags
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
type: 'GET',
|
||||
url: OC.filePath('bookmarks', 'ajax', 'updateList.php') + '&type=rel_tags',
|
||||
data: {tag: $('#bookmarkFilterTag').val(), page:bookmarks_page, sort:bookmarks_sorting },
|
||||
success: function(tags){
|
||||
@ -88,9 +89,8 @@ function getBookmarks() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
type: 'GET',
|
||||
url: OC.filePath('bookmarks', 'ajax', 'updateList.php') + '&type=bookmark',
|
||||
data: {tag: $('#bookmarkFilterTag').val(), page:bookmarks_page, sort:bookmarks_sorting },
|
||||
success: function(bookmarks){
|
||||
@ -197,6 +197,7 @@ function updateBookmarksList(bookmark) {
|
||||
'<p class="bookmark_title">'+
|
||||
'<a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a>' +
|
||||
'</p>' +
|
||||
'<p class="bookmark_desc">'+ encodeEntities(bookmark.description) + '</p>' +
|
||||
'<p class="bookmark_url"><a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.url) + '</a></p>' +
|
||||
'</div>'
|
||||
);
|
||||
@ -221,6 +222,7 @@ function updateBookmarksList(bookmark) {
|
||||
'<a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.title) + '</a>' +
|
||||
'</p>' +
|
||||
'<p class="bookmark_url"><a href="' + encodeEntities(bookmark.url) + '" target="_blank" class="bookmark_link">' + encodeEntities(bookmark.url) + '</a></p>' +
|
||||
'<p class="bookmark_desc">'+ encodeEntities(bookmark.description) + '</p>' +
|
||||
'</div>'
|
||||
);
|
||||
$('div[data-id="'+ bookmark.id +'"]').data('record', bookmark);
|
||||
|
Loading…
x
Reference in New Issue
Block a user