transition to new HTML

This commit is contained in:
ccd0 2014-04-19 00:28:19 -07:00
parent 0bdb01e08f
commit 7aeb46abb9
7 changed files with 20 additions and 15 deletions

View File

@ -1,3 +1,6 @@
**ccd0**
- Start transition to new HTML.
### v1.7.10 ### v1.7.10
*2014-04-17* *2014-04-17*

View File

@ -103,6 +103,7 @@ Index =
d.implementation.createDocument(null, null, null).appendChild board d.implementation.createDocument(null, null, null).appendChild board
$.rm navLink for navLink in $$ '.navLinks' $.rm navLink for navLink in $$ '.navLinks'
$.id('search-box')?.parentNode.remove()
$.after $.x('child::form/preceding-sibling::hr[1]'), Index.navLinks $.after $.x('child::form/preceding-sibling::hr[1]'), Index.navLinks
$.rmClass doc, 'index-loading' $.rmClass doc, 'index-loading'

View File

@ -112,8 +112,8 @@ Navigate =
updateBoard: (boardID) -> updateBoard: (boardID) ->
fullBoardList = $ '#full-board-list', Header.boardList fullBoardList = $ '#full-board-list', Header.boardList
$.rmClass $('.current', fullBoardList), 'current' $('.current', fullBoardList)?.classList.remove 'current'
$.addClass $("a[href*='/#{boardID}/']", fullBoardList), 'current' $("a[href*='/#{boardID}/']", fullBoardList)?.classList.add 'current'
Header.generateBoardList Conf['boardnav'].replace /(\r\n|\n|\r)/g, ' ' Header.generateBoardList Conf['boardnav'].replace /(\r\n|\n|\r)/g, ' '
QR.flagsInput() QR.flagsInput()

View File

@ -56,9 +56,12 @@ a[href="javascript:;"] {
.warning { .warning {
color: red; color: red;
} }
#boardNavDesktop { #boardNavDesktop, #boardNavMobile {
display: none !important; display: none !important;
} }
body.hasDropDownNav{
margin-top: 5px;
}
a { a {
outline: none !important; outline: none !important;
} }
@ -66,9 +69,12 @@ a {
border-radius: 3px; border-radius: 3px;
padding: 0px 2px; padding: 0px 2px;
} }
body>hr, .ad-plea-bottom + hr { hr {
display: none; display: none;
} }
.board hr {
display: block;
}
.board > hr:last-of-type { .board > hr:last-of-type {
border-top-color: transparent !important; border-top-color: transparent !important;
} }

View File

@ -130,10 +130,7 @@ class Post
thumb.src thumb.src
else else
"#{location.protocol}//t.4cdn.org/#{@board}/thumb/#{@file.URL.match(/(\d+)\./)[1]}s.jpg" "#{location.protocol}//t.4cdn.org/#{@board}/thumb/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
@file.name = if nameNode = $ 'span', fileText @file.name = fileText.title or fileText.lastElementChild.title or fileText.lastElementChild.textContent
nameNode.title or nameNode.textContent
else
fileText.title
<% if (type === 'crx') { %> <% if (type === 'crx') { %>
# replace %22 with quotes, see: # replace %22 with quotes, see:
# crbug.com/81193 # crbug.com/81193

View File

@ -1,7 +1,7 @@
Banner = Banner =
init: -> init: ->
$.asap (-> d.body), -> $.asap (-> d.body), ->
$.asap (-> $ '.abovePostForm'), Banner.ready $.asap (-> $ 'hr'), Banner.ready
ready: -> ready: ->
banner = $ ".boardBanner" banner = $ ".boardBanner"
@ -10,7 +10,6 @@ Banner =
i = 0 i = 0
while child = children[i++] while child = children[i++]
if i is 1 if i is 1
child.id = "Banner"
child.title = "Click to change" child.title = "Click to change"
$.on child, 'click', Banner.cb.toggle $.on child, 'click', Banner.cb.toggle
@ -35,7 +34,7 @@ Banner =
-> ->
type = Object.keys(types)[Math.floor 3 * Math.random()] type = Object.keys(types)[Math.floor 3 * Math.random()]
num = Math.floor types[type] * Math.random() num = Math.floor types[type] * Math.random()
@src = "//s.4cdn.org/image/title/#{num}.#{type}" $('img', @parentNode).src = "//s.4cdn.org/image/title/#{num}.#{type}"
click: (e) -> click: (e) ->
if e.ctrlKey if e.ctrlKey

View File

@ -109,10 +109,9 @@ Keybinds =
if form = $ '.prev form' if form = $ '.prev form'
window.location = form.action window.location = form.action
when Conf['Search form'] when Conf['Search form']
if Conf['JSON Navigation'] searchInput = if Conf['JSON Navigation'] then Index.searchInput else $.id('search-box')
Index.searchInput.focus() Header.scrollToIfNeeded searchInput
else searchInput.focus()
$.id('search-btn').click()
when Conf['Open catalog'] when Conf['Open catalog']
if Conf['External Catalog'] if Conf['External Catalog']
window.location = CatalogLinks.external(g.BOARD.ID) window.location = CatalogLinks.external(g.BOARD.ID)