Put catalog stuff into post rather than moving post stuff into catalog thread.
This commit is contained in:
parent
a736f139dc
commit
9cee88ce3a
@ -165,6 +165,7 @@ Build =
|
||||
thread: (thread, data) ->
|
||||
if (root = thread.nodes.root)
|
||||
$.rmAll root
|
||||
delete thread.nodes.placeholder
|
||||
else
|
||||
thread.nodes.root = root = $.el 'div',
|
||||
className: 'thread'
|
||||
@ -203,12 +204,11 @@ Build =
|
||||
postCount = data.replies + 1
|
||||
fileCount = data.images + !!data.ext
|
||||
|
||||
container = $.el 'div', <%= readHTML('CatalogThread.html') %>
|
||||
$.before thread.OP.nodes.info, [container.childNodes...]
|
||||
|
||||
root = $.el 'div',
|
||||
className: 'catalog-thread post' # post added to make 4chan postInfo CSS work
|
||||
|
||||
$.extend root, <%= readHTML('CatalogThread.html') %>
|
||||
|
||||
root.dataset.fullID = thread.fullID
|
||||
className: 'thread catalog-thread'
|
||||
$.addClass root, thread.OP.highlights... if thread.OP.highlights
|
||||
$.addClass root, 'noFile' unless thread.OP.file
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ Get =
|
||||
index = root.dataset.clone
|
||||
if index then post.clones[index] else post
|
||||
postFromNode: (root) ->
|
||||
Get.postFromRoot $.x '(ancestor::div[contains(@class,"postContainer") or contains(@class,"catalog-thread")][1]|following::div[contains(@class,"postContainer")][1])', root
|
||||
Get.postFromRoot $.x '(ancestor::div[contains(@class,"postContainer")][1]|following::div[contains(@class,"postContainer")][1])', root
|
||||
postDataFromLink: (link) ->
|
||||
if link.hostname is 'boards.4chan.org'
|
||||
path = link.pathname.split /\/+/
|
||||
|
||||
@ -713,7 +713,9 @@ Index =
|
||||
Index.buildReplies threads if Conf['Show Replies']
|
||||
nodes = []
|
||||
for thread in threads
|
||||
thread.OP.setCatalogOP false
|
||||
if thread.nodes.placeholder
|
||||
$.replace thread.nodes.placeholder, thread.OP.nodes.root
|
||||
delete thread.nodes.placeholder
|
||||
if (file = thread.OP.file) and (thumb = thread.OP.file.thumb) and thumb.dataset.src
|
||||
thumb.src = thumb.dataset.src
|
||||
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289
|
||||
@ -729,7 +731,10 @@ Index =
|
||||
Index.sizeCatalogViews threads
|
||||
nodes = []
|
||||
for thread in threads
|
||||
thread.OP.setCatalogOP true
|
||||
unless thread.nodes.placeholder
|
||||
thread.nodes.placeholder = $.el 'div'
|
||||
$.replace thread.OP.nodes.root, thread.nodes.placeholder
|
||||
$.add thread.catalogView.nodes.root, thread.OP.nodes.root
|
||||
nodes.push thread.catalogView.nodes.root
|
||||
$.add Index.root, nodes
|
||||
if doc.contains Index.root
|
||||
|
||||
@ -39,6 +39,7 @@ Nav =
|
||||
Nav.scroll +1
|
||||
|
||||
getThread: ->
|
||||
return $ '.board' if $.hasClass doc, 'catalog-mode'
|
||||
for threadRoot in $$ '.thread'
|
||||
thread = Get.threadFromRoot threadRoot
|
||||
continue if thread.isHidden and !thread.stub
|
||||
|
||||
@ -4,11 +4,12 @@ class CatalogThread
|
||||
constructor: (root, @thread) ->
|
||||
@ID = @thread.ID
|
||||
@board = @thread.board
|
||||
{post} = @thread.OP.nodes
|
||||
@nodes =
|
||||
root: root
|
||||
thumb: $ '.catalog-thumb', root
|
||||
icons: $ '.catalog-icons', root
|
||||
postCount: $ '.post-count', root
|
||||
fileCount: $ '.file-count', root
|
||||
pageCount: $ '.page-count', root
|
||||
thumb: $ '.catalog-thumb', post
|
||||
icons: $ '.catalog-icons', post
|
||||
postCount: $ '.post-count', post
|
||||
fileCount: $ '.file-count', post
|
||||
pageCount: $ '.page-count', post
|
||||
@thread.catalogView = @
|
||||
|
||||
@ -7,14 +7,10 @@ Post.Clone = class extends Post
|
||||
@[key] = @origin[key]
|
||||
|
||||
{nodes} = @origin
|
||||
cloneNode = if contractThumb
|
||||
@cloneWithoutVideo
|
||||
root = if contractThumb
|
||||
@cloneWithoutVideo nodes.root
|
||||
else
|
||||
(node) -> node.cloneNode true
|
||||
root = cloneNode nodes.root
|
||||
if @origin.isCatalogOP
|
||||
$.prepend $('.post', root), cloneNode(nodes.fileRoot) if nodes.fileRoot
|
||||
$.add $('.post', root), [cloneNode(nodes.info), cloneNode(nodes.comment)]
|
||||
nodes.root.cloneNode true
|
||||
Post.Clone.prefix or= 0
|
||||
for node in [root, $$('[id]', root)...]
|
||||
node.id = Post.Clone.prefix + node.id
|
||||
@ -32,6 +28,10 @@ Post.Clone = class extends Post
|
||||
$.rmClass root, 'forwarded' # quote inlining
|
||||
$.rmClass @nodes.post, 'highlight' # keybind navigation, ID highlighting
|
||||
|
||||
# Remove catalog stuff.
|
||||
$.rm $('.catalog-link', @nodes.post)
|
||||
$.rm $('.catalog-stats', @nodes.post)
|
||||
|
||||
@parseQuotes()
|
||||
@quotes = [@origin.quotes...]
|
||||
|
||||
|
||||
@ -36,9 +36,8 @@ class Post
|
||||
@parseQuotes()
|
||||
@parseFile()
|
||||
|
||||
@isDead = false
|
||||
@isHidden = false
|
||||
@isCatalogOP = false
|
||||
@isDead = false
|
||||
@isHidden = false
|
||||
|
||||
@clones = []
|
||||
<% if (readJSON('/.tests_enabled')) { %>
|
||||
@ -259,11 +258,3 @@ class Post
|
||||
for clone in @clones[index..]
|
||||
clone.nodes.root.dataset.clone = index++
|
||||
return
|
||||
|
||||
setCatalogOP: (isCatalogOP) ->
|
||||
return if @isCatalogOP is isCatalogOP
|
||||
@isCatalogOP = isCatalogOP
|
||||
node = if isCatalogOP then @thread.catalogView.nodes.root else @nodes.post
|
||||
{fileRoot, info, comment} = @nodes
|
||||
$.prepend node, fileRoot if fileRoot
|
||||
$.add node, [info, comment]
|
||||
|
||||
@ -19,6 +19,7 @@ class Thread
|
||||
|
||||
@nodes =
|
||||
root: null
|
||||
placeholder: null
|
||||
|
||||
@board.threads.push @ID, @
|
||||
g.threads.push @fullID, @
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
}
|
||||
|
||||
/* Catalog */
|
||||
:root.burichan .catalog-thread:hover > * {
|
||||
:root.burichan .catalog-thread:hover .post {
|
||||
background-color: #D6DAF0;
|
||||
}
|
||||
:root.burichan.werkTyme .catalog-thread:not(:hover), :root.burichan .catalog-thread:hover > * {
|
||||
:root.burichan.werkTyme .catalog-thread:not(:hover), :root.burichan .catalog-thread:hover .post {
|
||||
border-color: #B7C5D9;
|
||||
}
|
||||
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
}
|
||||
|
||||
/* Catalog */
|
||||
:root.futaba .catalog-thread:hover > * {
|
||||
:root.futaba .catalog-thread:hover .post {
|
||||
background-color: #F0E0D6;
|
||||
}
|
||||
:root.futaba.werkTyme .catalog-thread:not(:hover), :root.futaba .catalog-thread:hover > * {
|
||||
:root.futaba.werkTyme .catalog-thread:not(:hover), :root.futaba .catalog-thread:hover .post {
|
||||
border-color: #D9BFB7;
|
||||
}
|
||||
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
}
|
||||
|
||||
/* Catalog */
|
||||
:root.photon .catalog-thread:hover > * {
|
||||
:root.photon .catalog-thread:hover .post {
|
||||
background-color: #DDD;
|
||||
}
|
||||
:root.photon.werkTyme .catalog-thread:not(:hover), :root.photon .catalog-thread:hover > * {
|
||||
:root.photon.werkTyme .catalog-thread:not(:hover), :root.photon .catalog-thread:hover .post {
|
||||
border-color: #CCC;
|
||||
}
|
||||
:root.photon .catalog-code {
|
||||
|
||||
@ -718,39 +718,31 @@ div[data-checked="false"] > .suboption-list {
|
||||
word-wrap: break-word;
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
div.catalog-thread {
|
||||
margin: 4px;
|
||||
}
|
||||
.catalog-thread > * {
|
||||
margin: 0 -1px;
|
||||
border-left: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
.catalog-thread > .postContainer {
|
||||
overflow: hidden;
|
||||
}
|
||||
.catalog-thread > :first-child {
|
||||
margin-top: -21px;
|
||||
border-top: 1px solid transparent;
|
||||
.catalog-small .catalog-thread,
|
||||
.catalog-small .catalog-thread > .postContainer {
|
||||
width: 165px;
|
||||
height: 320px;
|
||||
}
|
||||
.catalog-thread.noFile > :first-child {
|
||||
padding-top: 20px;
|
||||
.catalog-large .catalog-thread,
|
||||
.catalog-large .catalog-thread > .postContainer {
|
||||
width: 270px;
|
||||
height: 410px;
|
||||
}
|
||||
.catalog-thread > :last-child {
|
||||
margin-bottom: -1px;
|
||||
border-bottom: 1px solid transparent;
|
||||
.catalog-thread .post {
|
||||
margin: -1px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.catalog-link {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
.catalog-small .catalog-thread {
|
||||
width: 165px;
|
||||
height: 320px;
|
||||
}
|
||||
.catalog-large .catalog-thread {
|
||||
width: 270px;
|
||||
height: 410px;
|
||||
}
|
||||
.catalog-thumb {
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, .25);
|
||||
@ -791,12 +783,18 @@ div.catalog-thread {
|
||||
.catalog-stats > [title] {
|
||||
cursor: help;
|
||||
}
|
||||
#delform .catalog-thread:not(:hover) > .file,
|
||||
#delform .catalog-thread:not(:hover) > .postInfo,
|
||||
#delform .catalog-thread > .file > :not(.fileText),
|
||||
#delform .catalog-thread > .file > .fileText > :not(:first-child),
|
||||
#delform .catalog-thread > .postInfo > :not(.nameBlock):not(.dateTime),
|
||||
#delform .catalog-thread .posteruid {
|
||||
.catalog-thread blockquote {
|
||||
margin: 0;
|
||||
}
|
||||
#delform .catalog-thread:not(:hover) .file,
|
||||
#delform .catalog-thread:not(:hover) .postInfo,
|
||||
#delform .catalog-thread > .postContainer > :not(.post),
|
||||
#delform .catalog-thread .file > :not(.fileText),
|
||||
#delform .catalog-thread .file > .fileText > :not(:first-child),
|
||||
#delform .catalog-thread .postInfo > :not(.nameBlock):not(.dateTime),
|
||||
#delform .catalog-thread .posteruid,
|
||||
.thread:not(.catalog-thread) .catalog-link,
|
||||
.thread:not(.catalog-thread) .catalog-stats {
|
||||
display: none;
|
||||
}
|
||||
.catalog-thread .fileText {
|
||||
@ -805,7 +803,7 @@ div.catalog-thread {
|
||||
line-height: 1;
|
||||
padding: 2px;
|
||||
}
|
||||
#delform .catalog-thread > .postInfo {
|
||||
#delform .catalog-thread .postInfo {
|
||||
width: auto;
|
||||
}
|
||||
.catalog-thread .subject {
|
||||
@ -816,12 +814,16 @@ div.catalog-thread {
|
||||
font-style: italic;
|
||||
}
|
||||
.catalog-thread:hover {
|
||||
overflow: visible;
|
||||
z-index: 1;
|
||||
}
|
||||
.catalog-thread:hover > * {
|
||||
margin-left: -61px;
|
||||
margin-right: -61px;
|
||||
.catalog-thread:hover > .postContainer {
|
||||
overflow: visible;
|
||||
}
|
||||
.catalog-thread:hover .post {
|
||||
margin: -21px -61px -1px;
|
||||
}
|
||||
.catalog-thread.noFile:hover .post {
|
||||
margin-top: -1px;
|
||||
}
|
||||
.catalog-thread .prettyprinted {
|
||||
max-width: 100%;
|
||||
|
||||
@ -30,10 +30,10 @@
|
||||
}
|
||||
|
||||
/* Catalog */
|
||||
:root.tomorrow .catalog-thread:hover > * {
|
||||
:root.tomorrow .catalog-thread:hover .post {
|
||||
background-color: #282A2E;
|
||||
}
|
||||
:root.tomorrow.werkTyme .catalog-thread:not(:hover), :root.tomorrow .catalog-thread:hover > * {
|
||||
:root.tomorrow.werkTyme .catalog-thread:not(:hover), :root.tomorrow .catalog-thread:hover .post {
|
||||
border-color: #111;
|
||||
}
|
||||
:root.tomorrow .catalog-code {
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
}
|
||||
|
||||
/* Catalog */
|
||||
:root.yotsuba-b .catalog-thread:hover > * {
|
||||
:root.yotsuba-b .catalog-thread:hover .post {
|
||||
background-color: #D6DAF0;
|
||||
}
|
||||
:root.yotsuba-b.werkTyme .catalog-thread:not(:hover), :root.yotsuba-b .catalog-thread:hover > * {
|
||||
:root.yotsuba-b.werkTyme .catalog-thread:not(:hover), :root.yotsuba-b .catalog-thread:hover .post {
|
||||
border-color: #B7C5D9;
|
||||
}
|
||||
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
}
|
||||
|
||||
/* Catalog */
|
||||
:root.yotsuba .catalog-thread:hover > * {
|
||||
:root.yotsuba .catalog-thread:hover .post {
|
||||
background-color: #F0E0D6;
|
||||
}
|
||||
:root.yotsuba.werkTyme .catalog-thread:not(:hover), :root.yotsuba .catalog-thread:hover > * {
|
||||
:root.yotsuba.werkTyme .catalog-thread:not(:hover), :root.yotsuba .catalog-thread:hover .post {
|
||||
border-color: #D9BFB7;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user