make all quote links stub-tolerant
This commit is contained in:
parent
f25155ea8d
commit
0786f023f3
@ -23,6 +23,11 @@ Build =
|
|||||||
-> n = (n + 1) % 3
|
-> n = (n + 1) % 3
|
||||||
sameThread: (boardID, threadID) ->
|
sameThread: (boardID, threadID) ->
|
||||||
g.VIEW is 'thread' and g.BOARD.ID is boardID and g.THREADID is +threadID
|
g.VIEW is 'thread' and g.BOARD.ID is boardID and g.THREADID is +threadID
|
||||||
|
postURL: (boardID, threadID, postID) ->
|
||||||
|
if Build.sameThread boardID, threadID
|
||||||
|
"\#p#{postID}"
|
||||||
|
else
|
||||||
|
"/#{boardID}/thread/#{threadID}\#p#{postID}"
|
||||||
postFromObject: (data, boardID) ->
|
postFromObject: (data, boardID) ->
|
||||||
o =
|
o =
|
||||||
# id
|
# id
|
||||||
@ -192,12 +197,11 @@ Build =
|
|||||||
else
|
else
|
||||||
h_file = ''
|
h_file = ''
|
||||||
|
|
||||||
if Build.sameThread boardID, threadID
|
postLink = Build.postURL boardID, threadID, postID
|
||||||
postLink = "\#p#{postID}"
|
quoteLink = if Build.sameThread boardID, threadID
|
||||||
quoteLink = "javascript:quote('#{postID}');"
|
"javascript:quote('#{postID}');"
|
||||||
else
|
else
|
||||||
postLink = "/#{boardID}/thread/#{threadID}\#p#{postID}"
|
"/#{boardID}/thread/#{threadID}\#q#{postID}"
|
||||||
quoteLink = "/#{boardID}/thread/#{threadID}\#q#{postID}"
|
|
||||||
|
|
||||||
if isSticky
|
if isSticky
|
||||||
h_sticky = " <img src='#{h_staticPath}sticky#{h_gifIcon}' alt='Sticky' title='Sticky' class='stickyIcon retina'>"
|
h_sticky = " <img src='#{h_staticPath}sticky#{h_gifIcon}' alt='Sticky' title='Sticky' class='stickyIcon retina'>"
|
||||||
|
|||||||
@ -24,7 +24,7 @@ QuoteBacklink =
|
|||||||
return if @isClone or !@quotes.length
|
return if @isClone or !@quotes.length
|
||||||
markYours = Conf['Quick Reply'] and Conf['Mark Quotes of You'] and QR.db.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID}
|
markYours = Conf['Quick Reply'] and Conf['Mark Quotes of You'] and QR.db.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID}
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
href: "/#{@board}/thread/#{@thread}#p#{@}"
|
href: Build.postURL @board.ID, @thread.ID, @ID
|
||||||
className: if @isHidden then 'filtered backlink' else 'backlink'
|
className: if @isHidden then 'filtered backlink' else 'backlink'
|
||||||
textContent: (Conf['backlink'].replace /%id/, @ID) + (if markYours then '\u00A0(You)' else '')
|
textContent: (Conf['backlink'].replace /%id/, @ID) + (if markYours then '\u00A0(You)' else '')
|
||||||
for quote in @quotes
|
for quote in @quotes
|
||||||
|
|||||||
@ -45,13 +45,13 @@ Quotify =
|
|||||||
# Don't (Dead) when quotifying in an archived post,
|
# Don't (Dead) when quotifying in an archived post,
|
||||||
# and we know the post still exists.
|
# and we know the post still exists.
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
href: "/#{boardID}/thread/#{post.thread}#p#{postID}"
|
href: Build.postURL boardID, post.thread.ID, postID
|
||||||
className: 'quotelink'
|
className: 'quotelink'
|
||||||
textContent: quote
|
textContent: quote
|
||||||
else
|
else
|
||||||
# Replace the .deadlink span if we can redirect.
|
# Replace the .deadlink span if we can redirect.
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
href: "/#{boardID}/thread/#{post.thread}#p#{postID}"
|
href: Build.postURL boardID, post.thread.ID, postID
|
||||||
className: 'quotelink deadlink'
|
className: 'quotelink deadlink'
|
||||||
target: '_blank'
|
target: '_blank'
|
||||||
textContent: "#{quote}\u00A0(Dead)"
|
textContent: "#{quote}\u00A0(Dead)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user