This commit is contained in:
Barış Soner Uşaklı
2017-05-08 13:49:35 -04:00
481 changed files with 1430 additions and 654 deletions

View File

@@ -12,7 +12,8 @@ define('forum/topic', [
'navigator',
'sort',
'components',
], function (infinitescroll, threadTools, postTools, events, posts, images, replies, navigator, sort, components) {
'storage',
], function (infinitescroll, threadTools, postTools, events, posts, images, replies, navigator, sort, components, storage) {
var Topic = {};
var currentUrl = '';
@@ -142,7 +143,7 @@ define('forum/topic', [
function handleBookmark(tid) {
// use the user's bookmark data if available, fallback to local if available
var bookmark = ajaxify.data.bookmark || localStorage.getItem('topic:' + tid + ':bookmark');
var bookmark = ajaxify.data.bookmark || storage.getItem('topic:' + tid + ':bookmark');
var postIndex = getPostIndex();
if (postIndex && window.location.search.indexOf('page=') === -1) {
@@ -159,7 +160,7 @@ define('forum/topic', [
navigator.scrollToIndex(parseInt(bookmark - 1, 10), true);
},
closefn: function () {
localStorage.removeItem('topic:' + tid + ':bookmark');
storage.removeItem('topic:' + tid + ':bookmark');
},
});
setTimeout(function () {
@@ -270,7 +271,7 @@ define('forum/topic', [
function updateUserBookmark(index) {
var bookmarkKey = 'topic:' + ajaxify.data.tid + ':bookmark';
var currentBookmark = ajaxify.data.bookmark || localStorage.getItem(bookmarkKey);
var currentBookmark = ajaxify.data.bookmark || storage.getItem(bookmarkKey);
if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10))) {
if (app.user.uid) {
@@ -284,7 +285,7 @@ define('forum/topic', [
ajaxify.data.bookmark = index;
});
} else {
localStorage.setItem(bookmarkKey, index);
storage.setItem(bookmarkKey, index);
}
}