Link from native catalog to external catalog should read 'External Catalog'
This commit is contained in:
parent
0aeed5edaa
commit
99d01bf59b
@ -14,10 +14,11 @@ CatalogLinks =
|
|||||||
link.href = CatalogLinks.index()
|
link.href = CatalogLinks.index()
|
||||||
when "/#{g.BOARD}/catalog"
|
when "/#{g.BOARD}/catalog"
|
||||||
link.href = CatalogLinks.catalog()
|
link.href = CatalogLinks.catalog()
|
||||||
if g.VIEW is 'catalog' and Conf['JSON Index'] and Conf['Use <%= meta.name %> Catalog']
|
if g.VIEW is 'catalog' and (catalogURL = CatalogLinks.catalog()) isnt g.SITE.urls.catalog?(g.BOARD)
|
||||||
catalogLink = link.parentNode.cloneNode true
|
catalogLink = link.parentNode.cloneNode true
|
||||||
catalogLink.firstElementChild.textContent = '<%= meta.name %> Catalog'
|
link2 = catalogLink.firstElementChild
|
||||||
catalogLink.firstElementChild.href = CatalogLinks.catalog()
|
link2.href = catalogURL
|
||||||
|
link2.textContent = if link2.hostname is location.hostname then '<%= meta.name %> Catalog' else 'External Catalog'
|
||||||
$.after link.parentNode, [$.tn(' '), catalogLink]
|
$.after link.parentNode, [$.tn(' '), catalogLink]
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -101,7 +102,7 @@ CatalogLinks =
|
|||||||
else if Conf['JSON Index'] and Conf['Use <%= meta.name %> Catalog']
|
else if Conf['JSON Index'] and Conf['Use <%= meta.name %> Catalog']
|
||||||
if location.hostname in ['boards.4chan.org', 'boards.4channel.org'] and g.BOARD.ID is board and g.VIEW is 'index' then '#catalog' else "//#{BoardConfig.domain(board)}/#{board}/#catalog"
|
if location.hostname in ['boards.4chan.org', 'boards.4channel.org'] and g.BOARD.ID is board and g.VIEW is 'index' then '#catalog' else "//#{BoardConfig.domain(board)}/#{board}/#catalog"
|
||||||
else
|
else
|
||||||
"//#{BoardConfig.domain(board)}/#{board}/catalog"
|
g.sites[siteID].urls.catalog?({siteID, boardID: board})
|
||||||
|
|
||||||
index: (board=g.BOARD.ID) ->
|
index: (board=g.BOARD.ID) ->
|
||||||
if Conf['JSON Index'] and board isnt 'f'
|
if Conf['JSON Index'] and board isnt 'f'
|
||||||
|
|||||||
@ -47,6 +47,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"
|
||||||
|
catalog: ({siteID, boardID}) -> "#{Conf['siteProperties'][siteID]?.root or "http://#{siteID}/"}#{boardID}/catalog.html"
|
||||||
threadJSON: ({siteID, boardID, threadID}) ->
|
threadJSON: ({siteID, boardID, threadID}) ->
|
||||||
root = Conf['siteProperties'][siteID]?.root
|
root = Conf['siteProperties'][siteID]?.root
|
||||||
if root then "#{root}#{boardID}/res/#{threadID}.json" else ''
|
if root then "#{root}#{boardID}/res/#{threadID}.json" else ''
|
||||||
|
|||||||
@ -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}"
|
||||||
|
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"
|
||||||
threadsListJSON: ({boardID}) -> "#{location.protocol}//a.4cdn.org/#{boardID}/threads.json"
|
threadsListJSON: ({boardID}) -> "#{location.protocol}//a.4cdn.org/#{boardID}/threads.json"
|
||||||
archiveListJSON: ({boardID}) -> if BoardConfig.isArchived(boardID) then "#{location.protocol}//a.4cdn.org/#{boardID}/archive.json" else ''
|
archiveListJSON: ({boardID}) -> if BoardConfig.isArchived(boardID) then "#{location.protocol}//a.4cdn.org/#{boardID}/archive.json" else ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user