We can now popstate pages.
This commit is contained in:
parent
d0e0a21e2f
commit
865c5acfb6
@ -12048,7 +12048,7 @@
|
||||
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
|
||||
},
|
||||
navigate: function(e) {
|
||||
var boardID, hash, onload, path, threadID, view;
|
||||
var boardID, hash, onload, pageNum, path, threadID, view;
|
||||
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) {
|
||||
return;
|
||||
}
|
||||
@ -12068,7 +12068,12 @@
|
||||
if (this.id !== 'popState') {
|
||||
history.pushState(null, '', this.pathname);
|
||||
}
|
||||
view = threadID ? 'thread' : view || 'index';
|
||||
if (threadID) {
|
||||
view = 'thread';
|
||||
} else {
|
||||
pageNum = view;
|
||||
view = 'index';
|
||||
}
|
||||
if (view !== g.VIEW) {
|
||||
Navigate.disconnect();
|
||||
Navigate.clean();
|
||||
@ -12081,7 +12086,11 @@
|
||||
} else {
|
||||
Navigate.updateBoard(boardID);
|
||||
}
|
||||
return Index.update();
|
||||
if (Conf['Index Mode'] === 'paged' && pageNum) {
|
||||
return Index.update(pageNum);
|
||||
} else {
|
||||
return Index.update();
|
||||
}
|
||||
} else {
|
||||
onload = function(e) {
|
||||
return Navigate.load(e, hash);
|
||||
|
||||
@ -12037,7 +12037,7 @@
|
||||
return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title;
|
||||
},
|
||||
navigate: function(e) {
|
||||
var boardID, hash, onload, path, threadID, view;
|
||||
var boardID, hash, onload, pageNum, path, threadID, view;
|
||||
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) {
|
||||
return;
|
||||
}
|
||||
@ -12057,7 +12057,12 @@
|
||||
if (this.id !== 'popState') {
|
||||
history.pushState(null, '', this.pathname);
|
||||
}
|
||||
view = threadID ? 'thread' : view || 'index';
|
||||
if (threadID) {
|
||||
view = 'thread';
|
||||
} else {
|
||||
pageNum = view;
|
||||
view = 'index';
|
||||
}
|
||||
if (view !== g.VIEW) {
|
||||
Navigate.disconnect();
|
||||
Navigate.clean();
|
||||
@ -12070,7 +12075,11 @@
|
||||
} else {
|
||||
Navigate.updateBoard(boardID);
|
||||
}
|
||||
return Index.update();
|
||||
if (Conf['Index Mode'] === 'paged' && pageNum) {
|
||||
return Index.update(pageNum);
|
||||
} else {
|
||||
return Index.update();
|
||||
}
|
||||
} else {
|
||||
onload = function(e) {
|
||||
return Navigate.load(e, hash);
|
||||
|
||||
@ -185,10 +185,11 @@ Navigate =
|
||||
e.preventDefault() if e
|
||||
history.pushState null, '', @pathname unless @id is 'popState'
|
||||
|
||||
view = if threadID
|
||||
'thread'
|
||||
if threadID
|
||||
view = 'thread'
|
||||
else
|
||||
view or 'index' # path is "/boardID/". See the problem?
|
||||
pageNum = view
|
||||
view = 'index' # path is "/boardID/". See the problem?
|
||||
|
||||
if view isnt g.VIEW
|
||||
Navigate.disconnect()
|
||||
@ -201,7 +202,11 @@ Navigate =
|
||||
d.title = $('.boardTitle').textContent
|
||||
else
|
||||
Navigate.updateBoard boardID
|
||||
Index.update()
|
||||
|
||||
if Conf['Index Mode'] is 'paged' and pageNum
|
||||
Index.update pageNum
|
||||
else
|
||||
Index.update()
|
||||
|
||||
# Moving from index to thread or thread to thread
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user