make things work with Quick Reply and Thread Updater disabled

This commit is contained in:
ccd0 2014-05-11 17:36:13 -07:00
parent 1f714bbac8
commit c3f04314cc
4 changed files with 12 additions and 17 deletions

View File

@ -105,16 +105,11 @@ Navigate =
$.rmClass doc, g.VIEW $.rmClass doc, g.VIEW
$.addClass doc, view $.addClass doc, view
{ delete g.THREADID if view is 'index'
index: ->
delete g.THREADID
QR.link.textContent = 'Start a Thread'
thread: -> if Conf['Quick Reply']
QR.link.textContent = 'Reply to Thread' QR.link.textContent = if g.VIEW is 'thread' then 'Reply to Thread' else 'Start a Thread'
}[view]() QR.status() # Re-enable the QR in the case of a 404'd thread or something.
QR.status() # Re-enable the QR in the case of a 404'd thread or something.
g.VIEW = view g.VIEW = view
@ -126,7 +121,7 @@ Navigate =
$('#returnlink a').href = "/#{g.BOARD}/" $('#returnlink a').href = "/#{g.BOARD}/"
QR.flagsInput() QR.flagsInput() if Conf['Quick Reply']
$.cache '//a.4cdn.org/boards.json', -> $.cache '//a.4cdn.org/boards.json', ->
try try
@ -183,7 +178,7 @@ Navigate =
if @pathname is Navigate.path if @pathname is Navigate.path
return if @id is 'popState' return if @id is 'popState'
if g.VIEW is 'thread' if g.VIEW is 'thread'
ThreadUpdater.update() ThreadUpdater.update() if Conf['Thread Updater']
else else
Index.update() Index.update()
e?.preventDefault() e?.preventDefault()
@ -305,7 +300,7 @@ Navigate =
Unread.ready() if Conf['Unread Count'] Unread.ready() if Conf['Unread Count']
QR.generatePostableThreadsList() QR.generatePostableThreadsList() if Conf['Quick Reply']
Header.hashScroll.call window Header.hashScroll.call window
Main.handleErrors errors if errors Main.handleErrors errors if errors

View File

@ -50,7 +50,7 @@ DeleteLink =
form = form =
mode: 'usrdel' mode: 'usrdel'
onlyimgdel: fileOnly onlyimgdel: fileOnly
pwd: QR.persona.getPassword() form.pwd = QR.persona.getPassword() if Conf['Quick Reply']
form[post.ID] = 'delete' form[post.ID] = 'delete'
link = @ link = @

View File

@ -70,7 +70,7 @@ Keybinds =
when Conf['Update'] when Conf['Update']
switch g.VIEW switch g.VIEW
when 'thread' when 'thread'
ThreadUpdater.update() ThreadUpdater.update() if Conf['Thread Updater']
when 'index' when 'index'
if Conf['JSON Navigation'] then Index.update() if Conf['JSON Navigation'] then Index.update()
when Conf['Watch'] when Conf['Watch']

View File

@ -87,7 +87,7 @@ Unread =
addPosts: (posts) -> addPosts: (posts) ->
for post in posts for post in posts
{ID} = post {ID} = post
continue if ID <= Unread.lastReadPost or post.isHidden or QR.db.get { continue if ID <= Unread.lastReadPost or post.isHidden or QR.db?.get {
boardID: post.board.ID boardID: post.board.ID
threadID: post.thread.ID threadID: post.thread.ID
postID: ID postID: ID
@ -101,7 +101,7 @@ Unread =
Unread.update() Unread.update()
addPostQuotingYou: (post) -> addPostQuotingYou: (post) ->
for quotelink in post.nodes.quotelinks when QR.db.get Get.postDataFromLink quotelink for quotelink in post.nodes.quotelinks when QR.db?.get Get.postDataFromLink quotelink
Unread.postsQuotingYou.push post Unread.postsQuotingYou.push post
Unread.openNotification post Unread.openNotification post
return return
@ -159,7 +159,7 @@ Unread =
{ID, data} = post {ID, data} = post
posts.rm ID posts.rm ID
if Conf['Mark Quotes of You'] and QR.db.get { if Conf['Mark Quotes of You'] and QR.db?.get {
boardID: data.board.ID boardID: data.board.ID
threadID: data.thread.ID threadID: data.thread.ID
postID: ID postID: ID