Merge branch 'master' into page1
Conflicts: src/General/Index.coffee
This commit is contained in:
commit
102e5de01e
@ -181,12 +181,16 @@ Build =
|
|||||||
else
|
else
|
||||||
''
|
''
|
||||||
|
|
||||||
if isOP and g.VIEW is 'index'
|
if isOP and g.VIEW is 'index' and Conf['JSON Navigation']
|
||||||
pageNum = Math.floor Index.liveThreadIDs.indexOf(postID) / Index.threadsNumPerPage
|
pageNum = Math.floor Index.liveThreadIDs.indexOf(postID) / Index.threadsNumPerPage
|
||||||
pageIcon = " <span class=page-num title='This thread is on page #{pageNum} in the original index.'>[#{pageNum}]</span>"
|
pageIcon = " <span class=page-num title='This thread is on page #{pageNum} in the original index.'>[#{pageNum}]</span>"
|
||||||
|
else
|
||||||
|
pageIcon = ''
|
||||||
|
|
||||||
|
if isOP and g.VIEW is 'index'
|
||||||
replyLink = " <span>[<a href='/#{boardID}/res/#{threadID}' class=replylink>Reply</a>]</span>"
|
replyLink = " <span>[<a href='/#{boardID}/res/#{threadID}' class=replylink>Reply</a>]</span>"
|
||||||
else
|
else
|
||||||
pageIcon = replyLink = ''
|
replyLink = ''
|
||||||
|
|
||||||
container = $.el 'div',
|
container = $.el 'div',
|
||||||
id: "pc#{postID}"
|
id: "pc#{postID}"
|
||||||
|
|||||||
@ -672,11 +672,11 @@ vp-replace
|
|||||||
# Board Navigation
|
# Board Navigation
|
||||||
'Front page': [
|
'Front page': [
|
||||||
'0'
|
'0'
|
||||||
'Jump to page 0.'
|
'Jump to front page.'
|
||||||
]
|
]
|
||||||
'Open front page': [
|
'Open front page': [
|
||||||
'Shift+0'
|
'Shift+0'
|
||||||
'Open page 0 in a new tab.'
|
'Open front page in a new tab.'
|
||||||
]
|
]
|
||||||
'Next page': [
|
'Next page': [
|
||||||
'Shift+Right'
|
'Shift+Right'
|
||||||
|
|||||||
@ -163,13 +163,13 @@ Index =
|
|||||||
getCurrentPage: ->
|
getCurrentPage: ->
|
||||||
+window.location.pathname.split('/')[2] or 1
|
+window.location.pathname.split('/')[2] or 1
|
||||||
userPageNav: (pageNum) ->
|
userPageNav: (pageNum) ->
|
||||||
|
Navigate.pushState if pageNum is 1 then './' else pageNum
|
||||||
if Conf['Refreshed Navigation'] and Conf['Index Mode'] isnt 'all pages'
|
if Conf['Refreshed Navigation'] and Conf['Index Mode'] isnt 'all pages'
|
||||||
Index.update pageNum
|
Index.update pageNum
|
||||||
else
|
else
|
||||||
Index.pageNav pageNum
|
Index.pageNav pageNum
|
||||||
pageNav: (pageNum) ->
|
pageNav: (pageNum) ->
|
||||||
return if Index.currentPage is pageNum
|
return if Index.currentPage is pageNum
|
||||||
history.pushState null, '', if pageNum is 1 then './' else pageNum
|
|
||||||
Index.pageLoad pageNum
|
Index.pageLoad pageNum
|
||||||
pageLoad: (pageNum) ->
|
pageLoad: (pageNum) ->
|
||||||
Index.currentPage = pageNum
|
Index.currentPage = pageNum
|
||||||
@ -492,6 +492,7 @@ Index =
|
|||||||
Index.buildIndex()
|
Index.buildIndex()
|
||||||
Index.setPage()
|
Index.setPage()
|
||||||
else
|
else
|
||||||
|
Navigate.pushState if pageNum is 1 then './' else pageNum
|
||||||
Index.pageNav pageNum
|
Index.pageNav pageNum
|
||||||
|
|
||||||
querySearch: (query) ->
|
querySearch: (query) ->
|
||||||
|
|||||||
@ -198,7 +198,7 @@ Navigate =
|
|||||||
if threadID
|
if threadID
|
||||||
view = 'thread'
|
view = 'thread'
|
||||||
else
|
else
|
||||||
pageNum = view
|
pageNum = +view
|
||||||
view = 'index' # path is "/boardID/". See the problem?
|
view = 'index' # path is "/boardID/". See the problem?
|
||||||
|
|
||||||
if view is g.VIEW and boardID is g.BOARD.ID
|
if view is g.VIEW and boardID is g.BOARD.ID
|
||||||
@ -302,6 +302,10 @@ Navigate =
|
|||||||
if Conf['Unread Count']
|
if Conf['Unread Count']
|
||||||
Navigate.ready 'Unread Count', Unread.ready, Conf['Unread Count']
|
Navigate.ready 'Unread Count', Unread.ready, Conf['Unread Count']
|
||||||
|
|
||||||
|
pushState: (path) ->
|
||||||
|
history.pushState null, '', path
|
||||||
|
Navigate.path = window.location.pathname
|
||||||
|
|
||||||
popstate: ->
|
popstate: ->
|
||||||
return if window.location.pathname is Navigate.path
|
return if window.location.pathname is Navigate.path
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user