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. * Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/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 false
'Thread conversations' 'Thread conversations'
] ]
'Quote Markers': [ 'Mark Quotes of You': [
true 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: imageExpansion:
'Fit width': [ 'Fit width': [

View File

@ -118,7 +118,12 @@ Index =
$.on d, 'scroll', Index.scroll $.on d, 'scroll', Index.scroll
$.on @pagelist, 'click', @cb.pageNav $.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' if g.VIEW is 'index'
@update() @update()
@ -256,6 +261,7 @@ Index =
$.event 'change', null, Index.selectSort $.event 'change', null, Index.selectSort
catalogSwitch: -> catalogSwitch: ->
return if !Conf['JSON Navigation']
$.set 'Index Mode', 'catalog' $.set 'Index Mode', 'catalog'
{hash} = window.location {hash} = window.location
window.location = './' + hash window.location = './' + hash

View File

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

View File

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

View File

@ -79,7 +79,7 @@ DeleteLink =
cooldown: cooldown:
start: (post, node) -> 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. # Only start counting on our posts.
delete DeleteLink.cooldown.counting delete DeleteLink.cooldown.counting
return return

View File

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

View File

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

View File

@ -1,6 +1,10 @@
QuoteMarkers = QuoteMarkers =
init: -> 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 Post.callbacks.push
name: 'Quote Markers' name: 'Quote Markers'
@ -17,14 +21,15 @@ QuoteMarkers =
markers = [] markers = []
{boardID, threadID, postID} = Get.postDataFromLink quotelink {boardID, threadID, postID} = Get.postDataFromLink quotelink
if QR.db?.get {boardID, threadID, postID} if QR.db.get {boardID, threadID, postID}
markers.push 'You' markers.push 'You' if Conf['Mark Quotes of You']
$.addClass post.nodes.root, 'quotesYou'
if board.ID is boardID if board.ID is boardID
if thread.ID is postID if Conf['Mark OP Quotes'] and thread.ID is postID
markers.push 'OP' 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' markers.push 'Cross-thread'
if $.hasClass quotelink, 'deadlink' if $.hasClass quotelink, 'deadlink'

View File

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