Update Config and Quote Threading.

This commit is contained in:
Zixaphir 2013-04-21 22:37:30 -07:00
parent 4d25b6ff3a
commit e0dbc28e3c
10 changed files with 70 additions and 76 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -9,10 +9,6 @@ Config =
false false
'Link to external catalog instead of the internal one.' 'Link to external catalog instead of the internal one.'
] ]
'Enable 4chan\'s Extension': [
false
'Compatibility between <%= meta.name %> and 4chan\'s inline extension is NOT guaranteed.'
]
'Custom Board Navigation': [ 'Custom Board Navigation': [
true true
'Show custom links instead of the full board list.' 'Show custom links instead of the full board list.'

View File

@ -201,6 +201,9 @@ a[href="javascript:;"] {
#navtopright { #navtopright {
display: none; display: none;
} }
#toggleMsgBtn {
display: none !important;
}
/* Notifications */ /* Notifications */
#notifications { #notifications {
@ -487,8 +490,11 @@ a.hide-announcement {
/* Quote Threading */ /* Quote Threading */
.threadContainer { .threadContainer {
margin-left: 20px; margin-left: 20px;
border-left: 1px solid black; border-left: 1px solid rgba(0,0,0,0.5);
} }
.threadOP {
clear: both;
}
/* File */ /* File */
.fileText:hover .fntrunc, .fileText:hover .fntrunc,

View File

@ -94,8 +94,4 @@ ExpandThread =
Main.callbackNodes Post, posts Main.callbackNodes Post, posts
$.after a, nodes $.after a, nodes
# Enable 4chan features. Fourchan.parseThread thread.ID, 1, nodes.length
if Conf['Enable 4chan\'s Extension']
$.globalEval "Parser.parseThread(#{thread.ID}, 1, #{nodes.length})"
else
Fourchan.parseThread thread.ID, 1, nodes.length

View File

@ -289,10 +289,7 @@ ThreadUpdater =
# Enable 4chan features. # Enable 4chan features.
threadID = ThreadUpdater.thread.ID threadID = ThreadUpdater.thread.ID
{length} = $$ '.thread > .postContainer', ThreadUpdater.root {length} = $$ '.thread > .postContainer', ThreadUpdater.root
if Conf['Enable 4chan\'s Extension'] Fourchan.parseThread threadID, length - count, length
$.globalEval "Parser.parseThread(#{threadID}, #{-count})"
else
Fourchan.parseThread threadID, length - count, length
$.event 'ThreadUpdate', $.event 'ThreadUpdate',
404: false 404: false

View File

@ -62,20 +62,29 @@ QuoteThreading =
delete @threaded delete @threaded
delete @cb delete @cb
return false if @thread.OP is qpost or (QuoteThreading.hasRun and !Unread.posts.contains qpost) return false if @thread.OP is qpost
if QuoteThreading.hasRun
height = doc.clientHeight
{bottom, top} = qpost.nodes.root.getBoundingClientRect()
# Post is unread or is fully visible.
return false unless Unread.posts.contains(qpost) or ((bottom < height) and (top > 0))
qroot = qpost.nodes.root qroot = qpost.nodes.root
threadContainer = qroot.nextSibling unless $.hasClass qroot, 'threadOP'
if threadContainer?.className isnt 'threadContainer' $.addClass qroot, 'threadOP'
threadContainer = $.el 'div', threadContainer = $.el 'div',
className: 'threadContainer' className: 'threadContainer'
$.after qroot, threadContainer $.after qroot, threadContainer
else
threadContainer = qroot.nextSibling
$.add threadContainer, @nodes.root $.add threadContainer, @nodes.root
return true return true
toggle: -> toggle: ->
thread = $ '.thread' thread = $ '.thread'
replies = $$ '.thread > .replyContainer, .threadContainer > .replyContainer', thread replies = $$ '.thread > .replyContainer, .threadContainer > .replyContainer', thread
QuoteThreading.enabled = @checked QuoteThreading.enabled = @checked
if @checked if @checked

View File

@ -35,7 +35,6 @@ Settings =
$.on d, 'AddSettingsSection', Settings.addSection $.on d, 'AddSettingsSection', Settings.addSection
$.on d, 'OpenSettings', (e) -> Settings.open e.detail $.on d, 'OpenSettings', (e) -> Settings.open e.detail
return if Conf['Enable 4chan\'s Extension']
settings = JSON.parse(localStorage.getItem '4chan-settings') or {} settings = JSON.parse(localStorage.getItem '4chan-settings') or {}
return if settings.disableAll return if settings.disableAll
settings.disableAll = true settings.disableAll = true