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