Make scroll to post quoting you keybinds work on Tinyboard/vichan. #2171
This commit is contained in:
parent
f89f9a2bbb
commit
d41c0cf96d
@ -92,7 +92,8 @@ QuoteYou =
|
|||||||
|
|
||||||
cb:
|
cb:
|
||||||
seek: (type) ->
|
seek: (type) ->
|
||||||
$.rmClass highlight, 'highlight' if highlight = $ '.highlight'
|
{highlight} = g.SITE.classes
|
||||||
|
$.rmClass highlighted, highlight if (highlighted = $ ".#{highlight}")
|
||||||
|
|
||||||
unless QuoteYou.lastRead and doc.contains(QuoteYou.lastRead) and $.hasClass(QuoteYou.lastRead, 'quotesYou')
|
unless QuoteYou.lastRead and doc.contains(QuoteYou.lastRead) and $.hasClass(QuoteYou.lastRead, 'quotesYou')
|
||||||
if not (post = QuoteYou.lastRead = $ '.quotesYou')
|
if not (post = QuoteYou.lastRead = $ '.quotesYou')
|
||||||
@ -111,12 +112,16 @@ QuoteYou =
|
|||||||
QuoteYou.cb.scroll posts[if type is 'following' then 0 else posts.length - 1]
|
QuoteYou.cb.scroll posts[if type is 'following' then 0 else posts.length - 1]
|
||||||
|
|
||||||
scroll: (root) ->
|
scroll: (root) ->
|
||||||
post = $ '.post', root
|
post = Get.postFromRoot root
|
||||||
if !post.getBoundingClientRect().height
|
if !post.nodes.post.getBoundingClientRect().height
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
QuoteYou.lastRead = root
|
QuoteYou.lastRead = root
|
||||||
location.href = "##{post.id}"
|
location.href = Get.url('post', post)
|
||||||
Header.scrollTo post
|
Header.scrollTo post.nodes.post
|
||||||
$.addClass post, 'highlight'
|
if post.isReply
|
||||||
|
sel = "#{g.SITE.selectors.postContainer}#{g.SITE.selectors.highlightable.reply}"
|
||||||
|
node = post.nodes.root
|
||||||
|
node = $ sel, node unless node.matches(sel)
|
||||||
|
$.addClass node, g.SITE.classes.highlight
|
||||||
return true
|
return true
|
||||||
|
|||||||
@ -45,6 +45,7 @@ SW.tinyboard =
|
|||||||
|
|
||||||
urls:
|
urls:
|
||||||
thread: ({siteID, boardID, threadID}) -> "#{Conf['siteProperties'][siteID]?.root or "http://#{siteID}/"}#{boardID}/res/#{threadID}.html"
|
thread: ({siteID, boardID, threadID}) -> "#{Conf['siteProperties'][siteID]?.root or "http://#{siteID}/"}#{boardID}/res/#{threadID}.html"
|
||||||
|
post: ({postID}) -> "##{postID}"
|
||||||
index: ({siteID, boardID}) -> "#{Conf['siteProperties'][siteID]?.root or "http://#{siteID}/"}#{boardID}/"
|
index: ({siteID, boardID}) -> "#{Conf['siteProperties'][siteID]?.root or "http://#{siteID}/"}#{boardID}/"
|
||||||
catalog: ({siteID, boardID}) -> "#{Conf['siteProperties'][siteID]?.root or "http://#{siteID}/"}#{boardID}/catalog.html"
|
catalog: ({siteID, boardID}) -> "#{Conf['siteProperties'][siteID]?.root or "http://#{siteID}/"}#{boardID}/catalog.html"
|
||||||
threadJSON: ({siteID, boardID, threadID}) ->
|
threadJSON: ({siteID, boardID, threadID}) ->
|
||||||
|
|||||||
@ -4,6 +4,7 @@ SW.yotsuba =
|
|||||||
|
|
||||||
urls:
|
urls:
|
||||||
thread: ({boardID, threadID}) -> "#{location.protocol}//#{BoardConfig.domain(boardID)}/#{boardID}/thread/#{threadID}"
|
thread: ({boardID, threadID}) -> "#{location.protocol}//#{BoardConfig.domain(boardID)}/#{boardID}/thread/#{threadID}"
|
||||||
|
post: ({postID}) -> "#p#{postID}"
|
||||||
index: ({boardID}) -> "#{location.protocol}//#{BoardConfig.domain(boardID)}/#{boardID}/"
|
index: ({boardID}) -> "#{location.protocol}//#{BoardConfig.domain(boardID)}/#{boardID}/"
|
||||||
catalog: ({boardID}) -> if boardID is 'f' then undefined else "#{location.protocol}//#{BoardConfig.domain(boardID)}/#{boardID}/catalog"
|
catalog: ({boardID}) -> if boardID is 'f' then undefined else "#{location.protocol}//#{BoardConfig.domain(boardID)}/#{boardID}/catalog"
|
||||||
threadJSON: ({boardID, threadID}) -> "#{location.protocol}//a.4cdn.org/#{boardID}/thread/#{threadID}.json"
|
threadJSON: ({boardID, threadID}) -> "#{location.protocol}//a.4cdn.org/#{boardID}/thread/#{threadID}.json"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user