Disable transformation of full board list except on 4chan.
This commit is contained in:
parent
6a21dc6644
commit
a5099f0b20
@ -165,25 +165,14 @@ Header =
|
|||||||
$.sync 'boardnav', Header.generateBoardList
|
$.sync 'boardnav', Header.generateBoardList
|
||||||
|
|
||||||
generateFullBoardList: ->
|
generateFullBoardList: ->
|
||||||
nodes = []
|
if g.SITE.transformBoardList
|
||||||
spacer = -> $.el 'span', className: 'spacer'
|
nodes = g.SITE.transformBoardList()
|
||||||
items = $.X './/a|.//text()[not(ancestor::a)]', $(g.SITE.selectors.boardList)
|
else
|
||||||
i = 0
|
nodes = [$(g.SITE.selectors.boardList).cloneNode(true).childNodes...]
|
||||||
while node = items.snapshotItem i++
|
|
||||||
switch node.nodeName
|
|
||||||
when '#text'
|
|
||||||
for chr in node.nodeValue
|
|
||||||
span = $.el 'span', textContent: chr
|
|
||||||
span.className = 'space' if chr is ' '
|
|
||||||
nodes.push spacer() if chr is ']'
|
|
||||||
nodes.push span
|
|
||||||
nodes.push spacer() if chr is '['
|
|
||||||
when 'A'
|
|
||||||
a = node.cloneNode true
|
|
||||||
a.className = 'current' if a.hostname is location.hostname and a.pathname.split('/')[1] is g.BOARD.ID
|
|
||||||
nodes.push a
|
|
||||||
fullBoardList = $ '.boardList', Header.boardList
|
fullBoardList = $ '.boardList', Header.boardList
|
||||||
$.add fullBoardList, nodes
|
$.add fullBoardList, nodes
|
||||||
|
for a in $$ 'a', fullBoardList
|
||||||
|
a.className = 'current' if a.hostname is location.hostname and a.pathname.split('/')[1] is g.BOARD.ID
|
||||||
CatalogLinks.setLinks fullBoardList
|
CatalogLinks.setLinks fullBoardList
|
||||||
|
|
||||||
generateBoardList: (boardnav) ->
|
generateBoardList: (boardnav) ->
|
||||||
|
|||||||
@ -379,52 +379,52 @@ audio.controls-added {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@media (min-width: 1300px) {
|
@media (min-width: 1300px) {
|
||||||
:root.fixed:not(.centered-links) #header-bar {
|
:root.sw-yotsuba.fixed:not(.centered-links) #header-bar {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #board-list {
|
:root.sw-yotsuba.fixed:not(.centered-links) #board-list {
|
||||||
-webkit-flex: auto;
|
-webkit-flex: auto;
|
||||||
flex: auto;
|
flex: auto;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #full-board-list {
|
:root.sw-yotsuba.fixed:not(.centered-links) #full-board-list {
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) .hide-board-list-container {
|
:root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container {
|
||||||
-webkit-flex: none;
|
-webkit-flex: none;
|
||||||
flex: none;
|
flex: none;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #full-board-list > .boardList {
|
:root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList {
|
||||||
-webkit-flex: auto;
|
-webkit-flex: auto;
|
||||||
flex: auto;
|
flex: auto;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */
|
width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #full-board-list > .boardList > a,
|
:root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a,
|
||||||
:root.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {
|
:root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {
|
||||||
-webkit-flex: none;
|
-webkit-flex: none;
|
||||||
flex: none;
|
flex: none;
|
||||||
padding: .17em;
|
padding: .17em;
|
||||||
margin: -.17em -.32em;
|
margin: -.17em -.32em;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #full-board-list > .boardList > span {
|
:root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #full-board-list > .boardList > span.space {
|
:root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space {
|
||||||
-webkit-flex: 0 .63 .63em;
|
-webkit-flex: 0 .63 .63em;
|
||||||
flex: 0 .63 .63em;
|
flex: 0 .63 .63em;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {
|
:root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {
|
||||||
-webkit-flex: 0 .38 .38em;
|
-webkit-flex: 0 .38 .38em;
|
||||||
flex: 0 .38 .38em;
|
flex: 0 .38 .38em;
|
||||||
}
|
}
|
||||||
:root.fixed:not(.centered-links) #shortcuts {
|
:root.sw-yotsuba.fixed:not(.centered-links) #shortcuts {
|
||||||
float: initial;
|
float: initial;
|
||||||
-webkit-flex: none;
|
-webkit-flex: none;
|
||||||
flex: none;
|
flex: none;
|
||||||
|
|||||||
@ -239,3 +239,22 @@ SW.yotsuba =
|
|||||||
testNativeExtension: ->
|
testNativeExtension: ->
|
||||||
$.global ->
|
$.global ->
|
||||||
@enabled = 'true' if window.Parser.postMenuIcon
|
@enabled = 'true' if window.Parser.postMenuIcon
|
||||||
|
|
||||||
|
transformBoardList: ->
|
||||||
|
nodes = []
|
||||||
|
spacer = -> $.el 'span', className: 'spacer'
|
||||||
|
items = $.X './/a|.//text()[not(ancestor::a)]', $(SW.yotsuba.selectors.boardList)
|
||||||
|
i = 0
|
||||||
|
while node = items.snapshotItem i++
|
||||||
|
switch node.nodeName
|
||||||
|
when '#text'
|
||||||
|
for chr in node.nodeValue
|
||||||
|
span = $.el 'span', textContent: chr
|
||||||
|
span.className = 'space' if chr is ' '
|
||||||
|
nodes.push spacer() if chr is ']'
|
||||||
|
nodes.push span
|
||||||
|
nodes.push spacer() if chr is '['
|
||||||
|
when 'A'
|
||||||
|
a = node.cloneNode true
|
||||||
|
nodes.push a
|
||||||
|
return nodes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user