Implementing Permalinks and jumping to post from search. Performance

improvements.
Этот коммит содержится в:
Christopher Speller
2015-11-18 17:29:06 -05:00
родитель 5ee226d7f9
Коммит 9e8cd93790
29 изменённых файлов: 1340 добавлений и 696 удалений

Просмотреть файл

@@ -820,7 +820,37 @@ export function getPosts(channelId, since, success, error, complete) {
});
}
export function getPost(channelId, postId, success, error) {
export function getPostsBefore(channelId, post, offset, numPost, success, error, complete) {
$.ajax({
url: '/api/v1/channels/' + channelId + '/post/' + post + '/before/' + offset + '/' + numPost,
dataType: 'json',
type: 'GET',
ifModified: false,
success,
error: function onError(xhr, status, err) {
var e = handleError('getPostsBefore', xhr, status, err);
error(e);
},
complete: complete
});
}
export function getPostsAfter(channelId, post, offset, numPost, success, error, complete) {
$.ajax({
url: '/api/v1/channels/' + channelId + '/post/' + post + '/after/' + offset + '/' + numPost,
dataType: 'json',
type: 'GET',
ifModified: false,
success,
error: function onError(xhr, status, err) {
var e = handleError('getPostsAfter', xhr, status, err);
error(e);
},
complete: complete
});
}
export function getPost(channelId, postId, success, error, complete) {
$.ajax({
cache: false,
url: '/api/v1/channels/' + channelId + '/post/' + postId,
@@ -831,7 +861,24 @@ export function getPost(channelId, postId, success, error) {
error: function onError(xhr, status, err) {
var e = handleError('getPost', xhr, status, err);
error(e);
}
},
complete
});
}
export function getPostById(postId, success, error, complete) {
$.ajax({
cache: false,
url: '/api/v1/posts/' + postId,
dataType: 'json',
type: 'GET',
ifModified: false,
success,
error: function onError(xhr, status, err) {
var e = handleError('getPostById', xhr, status, err);
error(e);
},
complete
});
}