Merge branch 'v3' of git://github.com/MayhemYDG/4chan-x into v3

Conflicts:
	CHANGELOG.md
	CONTRIBUTING.md
	Gruntfile.coffee
	package.json
	src/Miscellaneous/Keybinds.coffee
This commit is contained in:
Zixaphir 2013-12-09 19:00:56 -07:00
commit bdba59eccc
8 changed files with 34 additions and 35 deletions

View File

@ -1,5 +1,5 @@
/* /*
* 4chan X - Version 1.2.43 - 2013-12-06 * 4chan X - Version 1.2.43 - 2013-12-09
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

@ -22,7 +22,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.2.43 - 2013-12-06 * 4chan X - Version 1.2.43 - 2013-12-09
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -2752,7 +2752,7 @@
} }
flag = !flagCode ? '' : boardID === 'pol' ? " <img src='" + staticPath + "country/troll/" + (flagCode.toLowerCase()) + ".gif' alt=" + flagCode + " title='" + flagName + "' class=countryFlag>" : " <span title='" + flagName + "' class='flag flag-" + (flagCode.toLowerCase()) + "'></span>"; flag = !flagCode ? '' : boardID === 'pol' ? " <img src='" + staticPath + "country/troll/" + (flagCode.toLowerCase()) + ".gif' alt=" + flagCode + " title='" + flagName + "' class=countryFlag>" : " <span title='" + flagName + "' class='flag flag-" + (flagCode.toLowerCase()) + "'></span>";
if (file != null ? file.isDeleted : void 0) { if (file != null ? file.isDeleted : void 0) {
fileHTML = isOP ? ("<div class=file id=f" + postID + "><div class=fileInfo></div><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted" + gifIcon + "' alt='File deleted.' class=fileDeleted>") + "</span></div>" : ("<div class=file id=f" + postID + "><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted-res" + gifIcon + "' alt='File deleted.' class=fileDeletedRes>") + "</span></div>"; fileHTML = isOP ? ("<div class=file id=f" + postID + "><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted" + gifIcon + "' alt='File deleted.' class=fileDeleted>") + "</span></div>" : ("<div class=file id=f" + postID + "><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted-res" + gifIcon + "' alt='File deleted.' class=fileDeletedRes>") + "</span></div>";
} else if (file) { } else if (file) {
ext = file.name.slice(-3); ext = file.name.slice(-3);
if (!file.twidth && !file.theight && ext === 'gif') { if (!file.twidth && !file.theight && ext === 'gif') {
@ -10723,7 +10723,7 @@
if (!this.file || this.isClone) { if (!this.file || this.isClone) {
return; return;
} }
return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); return this.file.text.innerHTML = "<span class=file-info>" + (FileInfo.funk(FileInfo, this)) + "</span>";
}, },
createFunc: function(format) { createFunc: function(format) {
var code; var code;
@ -11295,7 +11295,7 @@
Keybinds.hl(0, threadRoot); Keybinds.hl(0, threadRoot);
break; break;
case Conf['Hide']: case Conf['Hide']:
if (g.VIEW === 'index') { if (ThreadHiding.db) {
ThreadHiding.toggle(thread); ThreadHiding.toggle(thread);
} }
break; break;
@ -11408,7 +11408,7 @@
} }
}, },
hl: function(delta, thread) { hl: function(delta, thread) {
var axe, height, next, postEl, replies, reply, root, _i, _len; var axis, height, next, postEl, replies, reply, root, _i, _len;
postEl = $('.reply.highlight', thread); postEl = $('.reply.highlight', thread);
if (!delta) { if (!delta) {
@ -11421,8 +11421,8 @@
height = postEl.getBoundingClientRect().height; height = postEl.getBoundingClientRect().height;
if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) { if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
root = postEl.parentNode; root = postEl.parentNode;
axe = delta === +1 ? 'following' : 'preceding'; axis = delta === +1 ? 'following' : 'preceding';
if (!(next = $.x("" + axe + "-sibling::div[contains(@class,'replyContainer')][1]/child::div[contains(@class,'reply')]", root))) { if (!(next = $.x("" + axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
return; return;
} }
Header.scrollToIfNeeded(next, delta === +1); Header.scrollToIfNeeded(next, delta === +1);
@ -11518,11 +11518,11 @@
return $('.board'); return $('.board');
}, },
scroll: function(delta) { scroll: function(delta) {
var axe, next, thread, top; var axis, next, thread, top;
thread = Nav.getThread(); thread = Nav.getThread();
axe = delta === +1 ? 'following' : 'preceding'; axis = delta === +1 ? 'following' : 'preceding';
if (next = $.x("" + axe + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) { if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
top = Header.getTopOf(thread); top = Header.getTopOf(thread);
if (delta === +1 && top < 5 || delta === -1 && top > -5) { if (delta === +1 && top < 5 || delta === -1 && top > -5) {
thread = next; thread = next;

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript // Generated by CoffeeScript
/* /*
* 4chan X - Version 1.2.43 - 2013-12-06 * 4chan X - Version 1.2.43 - 2013-12-09
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -2764,7 +2764,7 @@
} }
flag = !flagCode ? '' : boardID === 'pol' ? " <img src='" + staticPath + "country/troll/" + (flagCode.toLowerCase()) + ".gif' alt=" + flagCode + " title='" + flagName + "' class=countryFlag>" : " <span title='" + flagName + "' class='flag flag-" + (flagCode.toLowerCase()) + "'></span>"; flag = !flagCode ? '' : boardID === 'pol' ? " <img src='" + staticPath + "country/troll/" + (flagCode.toLowerCase()) + ".gif' alt=" + flagCode + " title='" + flagName + "' class=countryFlag>" : " <span title='" + flagName + "' class='flag flag-" + (flagCode.toLowerCase()) + "'></span>";
if (file != null ? file.isDeleted : void 0) { if (file != null ? file.isDeleted : void 0) {
fileHTML = isOP ? ("<div class=file id=f" + postID + "><div class=fileInfo></div><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted" + gifIcon + "' alt='File deleted.' class=fileDeleted>") + "</span></div>" : ("<div class=file id=f" + postID + "><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted-res" + gifIcon + "' alt='File deleted.' class=fileDeletedRes>") + "</span></div>"; fileHTML = isOP ? ("<div class=file id=f" + postID + "><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted" + gifIcon + "' alt='File deleted.' class=fileDeleted>") + "</span></div>" : ("<div class=file id=f" + postID + "><span class=fileThumb>") + ("<img src='" + staticPath + "filedeleted-res" + gifIcon + "' alt='File deleted.' class=fileDeletedRes>") + "</span></div>";
} else if (file) { } else if (file) {
ext = file.name.slice(-3); ext = file.name.slice(-3);
if (!file.twidth && !file.theight && ext === 'gif') { if (!file.twidth && !file.theight && ext === 'gif') {
@ -10714,7 +10714,7 @@
if (!this.file || this.isClone) { if (!this.file || this.isClone) {
return; return;
} }
return this.file.text.innerHTML = FileInfo.funk(FileInfo, this); return this.file.text.innerHTML = "<span class=file-info>" + (FileInfo.funk(FileInfo, this)) + "</span>";
}, },
createFunc: function(format) { createFunc: function(format) {
var code; var code;
@ -11286,7 +11286,7 @@
Keybinds.hl(0, threadRoot); Keybinds.hl(0, threadRoot);
break; break;
case Conf['Hide']: case Conf['Hide']:
if (g.VIEW === 'index') { if (ThreadHiding.db) {
ThreadHiding.toggle(thread); ThreadHiding.toggle(thread);
} }
break; break;
@ -11399,7 +11399,7 @@
} }
}, },
hl: function(delta, thread) { hl: function(delta, thread) {
var axe, height, next, postEl, replies, reply, root, _i, _len; var axis, height, next, postEl, replies, reply, root, _i, _len;
postEl = $('.reply.highlight', thread); postEl = $('.reply.highlight', thread);
if (!delta) { if (!delta) {
@ -11412,8 +11412,8 @@
height = postEl.getBoundingClientRect().height; height = postEl.getBoundingClientRect().height;
if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) { if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) {
root = postEl.parentNode; root = postEl.parentNode;
axe = delta === +1 ? 'following' : 'preceding'; axis = delta === +1 ? 'following' : 'preceding';
if (!(next = $.x("" + axe + "-sibling::div[contains(@class,'replyContainer')][1]/child::div[contains(@class,'reply')]", root))) { if (!(next = $.x("" + axis + "-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root))) {
return; return;
} }
Header.scrollToIfNeeded(next, delta === +1); Header.scrollToIfNeeded(next, delta === +1);
@ -11509,11 +11509,11 @@
return $('.board'); return $('.board');
}, },
scroll: function(delta) { scroll: function(delta) {
var axe, next, thread, top; var axis, next, thread, top;
thread = Nav.getThread(); thread = Nav.getThread();
axe = delta === +1 ? 'following' : 'preceding'; axis = delta === +1 ? 'following' : 'preceding';
if (next = $.x("" + axe + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) { if (next = $.x("" + axis + "-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread)) {
top = Header.getTopOf(thread); top = Header.getTopOf(thread);
if (delta === +1 && top < 5 || delta === -1 && top > -5) { if (delta === +1 && top < 5 || delta === -1 && top > -5) {
thread = next; thread = next;

View File

@ -540,8 +540,8 @@ a.hide-announcement {
} }
/* File */ /* File */
.fileText:hover .fntrunc, .file-info:hover .fntrunc,
.fileText:not(:hover) .fnfull, .file-info:not(:hover) .fnfull,
.expanded-image > .post > .file > .fileThumb > img[data-md5], .expanded-image > .post > .file > .fileThumb > img[data-md5],
:not(.expanded-image) > .post > .file > .fileThumb > .full-image { :not(.expanded-image) > .post > .file > .fileThumb > .full-image {
display: none; display: none;

View File

@ -124,7 +124,7 @@ Build =
if file?.isDeleted if file?.isDeleted
fileHTML = if isOP fileHTML = if isOP
"<div class=file id=f#{postID}><div class=fileInfo></div><span class=fileThumb>" + "<div class=file id=f#{postID}><span class=fileThumb>" +
"<img src='#{staticPath}filedeleted#{gifIcon}' alt='File deleted.' class=fileDeleted>" + "<img src='#{staticPath}filedeleted#{gifIcon}' alt='File deleted.' class=fileDeleted>" +
"</span></div>" "</span></div>"
else else

View File

@ -8,7 +8,7 @@ FileInfo =
cb: @node cb: @node
node: -> node: ->
return if !@file or @isClone return if !@file or @isClone
@file.text.innerHTML = FileInfo.funk FileInfo, @ @file.text.innerHTML = "<span class=file-info>#{FileInfo.funk FileInfo, @}</span>"
createFunc: (format) -> createFunc: (format) ->
code = format.replace /%(.)/g, (s, c) -> code = format.replace /%(.)/g, (s, c) ->
if c of FileInfo.formatters if c of FileInfo.formatters
@ -21,11 +21,10 @@ FileInfo =
return "#{size.toFixed()} Bytes" return "#{size.toFixed()} Bytes"
i = 1 + ['KB', 'MB'].indexOf unit i = 1 + ['KB', 'MB'].indexOf unit
size /= 1024 while i-- size /= 1024 while i--
size = size = if unit is 'MB'
if unit is 'MB' Math.round(size * 100) / 100
Math.round(size * 100) / 100 else
else size.toFixed()
size.toFixed()
"#{size} #{unit}" "#{size} #{unit}"
escape: (name) -> escape: (name) ->
name.replace /<|>/g, (c) -> name.replace /<|>/g, (c) ->

View File

@ -126,7 +126,7 @@ Keybinds =
when Conf['Deselect reply'] when Conf['Deselect reply']
Keybinds.hl 0, threadRoot Keybinds.hl 0, threadRoot
when Conf['Hide'] when Conf['Hide']
ThreadHiding.toggle thread if g.VIEW is 'index' ThreadHiding.toggle thread if ThreadHiding.db
when Conf['Previous Post Quoting You'] when Conf['Previous Post Quoting You']
QuoteYou.cb.seek 'preceding' QuoteYou.cb.seek 'preceding'
when Conf['Next Post Quoting You'] when Conf['Next Post Quoting You']
@ -222,11 +222,11 @@ Keybinds =
{height} = postEl.getBoundingClientRect() {height} = postEl.getBoundingClientRect()
if Header.getTopOf(postEl) >= -height and Header.getBottomOf(postEl) >= -height # We're at least partially visible if Header.getTopOf(postEl) >= -height and Header.getBottomOf(postEl) >= -height # We're at least partially visible
root = postEl.parentNode root = postEl.parentNode
axe = if delta is +1 axis = if delta is +1
'following' 'following'
else else
'preceding' 'preceding'
return unless next = $.x "#{axe}-sibling::div[contains(@class,'replyContainer')][1]/child::div[contains(@class,'reply')]", root return unless next = $.x "#{axis}-sibling::div[contains(@class,'replyContainer') and not(@hidden) and not(child::div[@class='stub'])][1]/child::div[contains(@class,'reply')]", root
Header.scrollToIfNeeded next, delta is +1 Header.scrollToIfNeeded next, delta is +1
@focus next @focus next
$.rmClass postEl, 'highlight' $.rmClass postEl, 'highlight'

View File

@ -48,11 +48,11 @@ Nav =
scroll: (delta) -> scroll: (delta) ->
thread = Nav.getThread() thread = Nav.getThread()
axe = if delta is +1 axis = if delta is +1
'following' 'following'
else else
'preceding' 'preceding'
if next = $.x "#{axe}-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread if next = $.x "#{axis}-sibling::div[contains(@class,'thread') and not(@hidden)][1]", thread
# Unless we're not at the beginning of the current thread, # Unless we're not at the beginning of the current thread,
# and thus wanting to move to beginning, # and thus wanting to move to beginning,
# or we're above the first thread and don't want to skip it. # or we're above the first thread and don't want to skip it.