Merge branch 'v3'

Conflicts:
	LICENSE
	builds/appchan-x.user.js
	builds/crx/script.js
	src/General/css/style.css
This commit is contained in:
Zixaphir 2014-03-10 12:49:26 -07:00
commit f685dfe750
12 changed files with 113 additions and 83 deletions

View File

@ -1,5 +1,5 @@
/*
* appchan x - Version 2.9.1 - 2014-03-09
* appchan x - Version 2.9.1 - 2014-03-10
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -345,9 +345,18 @@ Config =
false
'Thread conversations'
]
'Quote Markers': [
'Mark Quotes of You': [
true
'Add "(You)", "(OP)", "(Cross-thread)", "(Dead)" markers to quote links.'
'Add \'(You)\' to quotes linking to your posts.'
]
'Mark OP Quotes': [
true
'Add \'(OP)\' to OP quotes.'
]
'Mark Cross-thread Quotes': [
true
'Add \'(Cross-thread)\' to cross-threads quotes.'
'Highlights own posts if Quote Markers are enabled.'
]
imageExpansion:
'Fit width': [

View File

@ -118,7 +118,12 @@ Index =
$.on d, 'scroll', Index.scroll
$.on @pagelist, 'click', @cb.pageNav
$.on $('#returnlink a', @navLinks), 'click', Navigate.navigate
$.on $('#returnlink a', @navLinks), 'click', (e) ->
if g.VIEW is 'index'
Index.setIndexMode Conf['Previous Index Mode']
e.preventDefault()
return
Navigate.navigate.call @, e
if g.VIEW is 'index'
@update()
@ -256,6 +261,7 @@ Index =
$.event 'change', null, Index.selectSort
catalogSwitch: ->
return if !Conf['JSON Navigation']
$.set 'Index Mode', 'catalog'
{hash} = window.location
window.location = './' + hash

View File

@ -15,12 +15,12 @@
border: 1px solid #{theme["Buttons Border"]};
}
.highlight-you .opContainer.quotesYou,
.highlight-own .opContainer.yourPost,
.highlight-own .opContainer.your-post,
.opContainer.filter-highlight {
box-shadow: inset 5px 0 #{theme["Backlinked Reply Outline"]};
}
.highlight-you .quotesYou > .reply,
.highlight-own .yourPost > .reply,
.highlight-own .your-post > .reply,
.filter-highlight > .reply {
box-shadow: -5px 0 #{theme["Backlinked Reply Outline"]};
}

View File

@ -255,7 +255,6 @@ class Post
# and paint them (Dead).
for quotelink in Get.allQuotelinksLinkingTo @ when not $.hasClass quotelink, 'deadlink'
$.addClass quotelink, 'deadlink'
continue unless Conf['Quote Markers']
QuoteMarkers.parseQuotelink Get.postFromNode(quotelink), quotelink, true
return
# XXX tmp fix for 4chan's racing condition
@ -276,7 +275,6 @@ class Post
for quotelink in Get.allQuotelinksLinkingTo @ when $.hasClass quotelink, 'deadlink'
$.rmClass quotelink, 'deadlink'
continue unless Conf['Quote Markers']
QuoteMarkers.parseQuotelink Get.postFromNode(quotelink), quotelink, true
return

View File

@ -79,7 +79,7 @@ DeleteLink =
cooldown:
start: (post, node) ->
unless QR.db?.get {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}
unless QR.db.get {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}
# Only start counting on our posts.
delete DeleteLink.cooldown.counting
return

View File

@ -335,6 +335,8 @@ ThreadUpdater =
ThreadUpdater.lastPost = posts[count - 1].ID
Main.callbackNodes Post, posts
scroll = Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and Header.getBottomOf(ThreadUpdater.root) > -75
for post in posts
{root} = post.nodes
if post.cb
@ -344,7 +346,7 @@ ThreadUpdater =
$.add ThreadUpdater.root, root
sendEvent()
if Conf['Auto Scroll'] and ThreadUpdater.scrollBG() and Header.getBottomOf(ThreadUpdater.root) > -25
if scroll
if Conf['Bottom Scroll']
window.scrollTo 0, d.body.clientHeight
else

View File

@ -42,7 +42,6 @@ QuoteBacklink =
return unless @isReply or Conf['OP Backlinks']
if @isClone
@nodes.backlinkContainer = $ '.backlink-container', @nodes.info
return unless Conf['Quote Markers']
for backlink in @nodes.backlinks
QuoteMarkers.parseQuotelink @, backlink, true, QuoteBacklink.funk Get.postDataFromLink(backlink).postID
return
@ -64,8 +63,7 @@ QuoteBacklink =
$.addClass a, 'deadlink'
if quoter.isHidden
$.addClass a, 'filtered'
if Conf['Quote Markers']
QuoteMarkers.parseQuotelink quoted, a, false, text
QuoteMarkers.parseQuotelink quoted, a, false, text
if Conf['Quote Previewing']
$.on a, 'mouseover', QuotePreview.mouseover
if Conf['Quote Inlining']

View File

@ -1,6 +1,10 @@
QuoteMarkers =
init: ->
return if !Conf['Quote Markers']
if Conf['Highlight Own Posts']
$.addClass doc, 'highlight-own'
if Conf['Highlight Posts Quoting You']
$.addClass doc, 'highlight-you'
Post.callbacks.push
name: 'Quote Markers'
@ -17,14 +21,15 @@ QuoteMarkers =
markers = []
{boardID, threadID, postID} = Get.postDataFromLink quotelink
if QR.db?.get {boardID, threadID, postID}
markers.push 'You'
if QR.db.get {boardID, threadID, postID}
markers.push 'You' if Conf['Mark Quotes of You']
$.addClass post.nodes.root, 'quotesYou'
if board.ID is boardID
if thread.ID is postID
if Conf['Mark OP Quotes'] and thread.ID is postID
markers.push 'OP'
if threadID and threadID isnt thread.ID # threadID is 0 for deadlinks
if Conf['Mark Cross-thread Quotes'] and (threadID and threadID isnt thread.ID) # threadID is 0 for deadlinks
markers.push 'Cross-thread'
if $.hasClass quotelink, 'deadlink'

View File

@ -64,7 +64,7 @@ Quotify =
@quotes.push quoteID unless quoteID in @quotes
unless a
deadlink.textContent = "#{quote}\u00A0(Dead)" if Conf['Quote Markers']
deadlink.textContent = "#{quote}\u00A0(Dead)"
return
$.replace deadlink, a