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

View File

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

View File

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

View File

@ -87,7 +87,7 @@ Unread =
addPosts: (posts) ->
for post in posts
{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
threadID: post.thread.ID
postID: ID
@ -101,7 +101,7 @@ Unread =
Unread.update()
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.openNotification post
return
@ -159,7 +159,7 @@ Unread =
{ID, data} = post
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
threadID: data.thread.ID
postID: ID