Merge Mayhem X

This commit is contained in:
Jordan Bates 2013-04-26 13:31:54 -07:00
commit a025c4e8eb
7 changed files with 100 additions and 56 deletions

View File

@ -1,5 +1,11 @@
<<<<<<< HEAD
seaweedchan:
- Fix emoji and favicon previews not updating on change.
=======
- Fix bug where a thread would freeze on load.
### 3.2.1 - *2013-04-26*
>>>>>>> mayhem/v3
### 1.1.1 - 2013-04-26
zixaphir:
@ -80,4 +86,4 @@ zixaphir:
- Fix unread post count for filtered posts
- Fix issues when switching from ihavenoface's fork
- Fix backlinks not receiving filtered class
- Fix QR position not saving on refresh
- Fix QR position not saving on refresh

View File

@ -188,7 +188,7 @@
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Hide the normal post form.'],
'Cooldown': [true, 'Prevent "flood detected" errors.'],
'Cooldown': [true, 'Indicate the remaining time before posting again.'],
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
},
'Quote Links': {
@ -4303,7 +4303,7 @@
psa = $.id('globalMessage');
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
if (hr = $.x('following-sibling::hr', psa)) {
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
return hr.hidden = psa.hidden;
}
},
@ -6756,24 +6756,14 @@
});
},
node: function() {
var ID, post, posts, _ref;
Unread.thread = this;
Unread.title = d.title;
posts = [];
_ref = this.posts;
for (ID in _ref) {
post = _ref[ID];
if (post.isReply) {
posts.push(post);
}
}
Unread.lastReadPost = Unread.db.get({
boardID: this.board.ID,
threadID: this.ID,
defaultValue: 0
});
Unread.addPosts(posts);
$.on(d, '4chanXInitFinished', Unread.ready);
$.on(d, 'ThreadUpdate', Unread.onUpdate);
$.on(d, 'scroll visibilitychange', Unread.read);
if (Conf['Unread Line']) {
@ -6783,15 +6773,35 @@
return $.on(window, 'load', Unread.scroll);
}
},
ready: function() {
var ID, post, posts, _ref;
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
for (ID in _ref) {
post = _ref[ID];
if (post.isReply) {
posts.push(post);
}
}
return Unread.addPosts(posts);
},
scroll: function() {
var hash, posts, root;
var hash, post, posts, prevID, root;
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
return;
}
if (Unread.posts.length) {
prevID = 0;
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
if (!(Get.postFromRoot(root)).isHidden) {
post = Get.postFromRoot(root);
if (prevID === post.ID) {
break;
}
prevID = post.ID;
if (!post.isHidden) {
break;
}
}

View File

@ -189,7 +189,7 @@
'Remember QR Size': [false, 'Remember the size of the Quick reply.'],
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Hide the normal post form.'],
'Cooldown': [true, 'Prevent "flood detected" errors.'],
'Cooldown': [true, 'Indicate the remaining time before posting again.'],
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
},
'Quote Links': {
@ -4299,7 +4299,7 @@
psa = $.id('globalMessage');
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
if (hr = $.x('following-sibling::hr', psa)) {
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
return hr.hidden = psa.hidden;
}
},
@ -6752,24 +6752,14 @@
});
},
node: function() {
var ID, post, posts, _ref;
Unread.thread = this;
Unread.title = d.title;
posts = [];
_ref = this.posts;
for (ID in _ref) {
post = _ref[ID];
if (post.isReply) {
posts.push(post);
}
}
Unread.lastReadPost = Unread.db.get({
boardID: this.board.ID,
threadID: this.ID,
defaultValue: 0
});
Unread.addPosts(posts);
$.on(d, '4chanXInitFinished', Unread.ready);
$.on(d, 'ThreadUpdate', Unread.onUpdate);
$.on(d, 'scroll visibilitychange', Unread.read);
if (Conf['Unread Line']) {
@ -6779,15 +6769,35 @@
return $.on(window, 'load', Unread.scroll);
}
},
ready: function() {
var ID, post, posts, _ref;
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
for (ID in _ref) {
post = _ref[ID];
if (post.isReply) {
posts.push(post);
}
}
return Unread.addPosts(posts);
},
scroll: function() {
var hash, posts, root;
var hash, post, posts, prevID, root;
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
return;
}
if (Unread.posts.length) {
prevID = 0;
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
if (!(Get.postFromRoot(root)).isHidden) {
post = Get.postFromRoot(root);
if (prevID === post.ID) {
break;
}
prevID = post.ID;
if (!post.isHidden) {
break;
}
}

View File

@ -81,7 +81,7 @@
'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'],
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'],
'Hide Original Post Form': [true, 'Hide the normal post form.'],
'Cooldown': [true, 'Prevent "flood detected" errors.'],
'Cooldown': [true, 'Indicate the remaining time before posting again.'],
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
},
'Quote Links': {
@ -4212,7 +4212,7 @@
psa = $.id('globalMessage');
psa.hidden = PSAHiding.btn.hidden = (_ref = PSAHiding.trim(psa), __indexOf.call(hiddenPSAs, _ref) >= 0) ? true : false;
if (hr = $.x('following-sibling::hr', psa)) {
if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') {
return hr.hidden = psa.hidden;
}
},
@ -6665,24 +6665,14 @@
});
},
node: function() {
var ID, post, posts, _ref;
Unread.thread = this;
Unread.title = d.title;
posts = [];
_ref = this.posts;
for (ID in _ref) {
post = _ref[ID];
if (post.isReply) {
posts.push(post);
}
}
Unread.lastReadPost = Unread.db.get({
boardID: this.board.ID,
threadID: this.ID,
defaultValue: 0
});
Unread.addPosts(posts);
$.on(d, '4chanXInitFinished', Unread.ready);
$.on(d, 'ThreadUpdate', Unread.onUpdate);
$.on(d, 'scroll visibilitychange', Unread.read);
if (Conf['Unread Line']) {
@ -6692,15 +6682,35 @@
return $.on(window, 'load', Unread.scroll);
}
},
ready: function() {
var ID, post, posts, _ref;
$.off(d, '4chanXInitFinished', Unread.ready);
posts = [];
_ref = Unread.thread.posts;
for (ID in _ref) {
post = _ref[ID];
if (post.isReply) {
posts.push(post);
}
}
return Unread.addPosts(posts);
},
scroll: function() {
var hash, posts, root;
var hash, post, posts, prevID, root;
if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) {
return;
}
if (Unread.posts.length) {
prevID = 0;
while (root = $.x('preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root)) {
if (!(Get.postFromRoot(root)).isHidden) {
post = Get.postFromRoot(root);
if (prevID === post.ID) {
break;
}
prevID = post.ID;
if (!post.isHidden) {
break;
}
}

View File

@ -267,7 +267,7 @@ Config =
]
'Cooldown': [
true
'Prevent "flood detected" errors.'
'Indicate the remaining time before posting again.'
]
'Cooldown Prediction': [
true

View File

@ -61,7 +61,7 @@ PSAHiding =
true
else
false
if hr = $.x 'following-sibling::hr', psa
hr.hidden = psa.hidden
if (hr = psa.nextElementSibling) and hr.nodeName is 'HR'
hr.hidden = psa.hidden
trim: (psa) ->
psa.textContent.replace(/\W+/g, '').toLowerCase()
psa.textContent.replace(/\W+/g, '').toLowerCase()

View File

@ -15,26 +15,34 @@ Unread =
node: ->
Unread.thread = @
Unread.title = d.title
posts = []
for ID, post of @posts
posts.push post if post.isReply
Unread.lastReadPost = Unread.db.get
boardID: @board.ID
threadID: @ID
defaultValue: 0
Unread.addPosts posts
$.on d, '4chanXInitFinished', Unread.ready
$.on d, 'ThreadUpdate', Unread.onUpdate
$.on d, 'scroll visibilitychange', Unread.read
$.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line']
$.on window, 'load', Unread.scroll if Conf['Scroll to Last Read Post']
ready: ->
$.off d, '4chanXInitFinished', Unread.ready
posts = []
for ID, post of Unread.thread.posts
posts.push post if post.isReply
Unread.addPosts posts
scroll: ->
# Let the header's onload callback handle it.
return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts
if Unread.posts.length
# Scroll to before the first unread post.
prevID = 0
while root = $.x 'preceding-sibling::div[contains(@class,"postContainer")][1]', Unread.posts[0].nodes.root
break unless (Get.postFromRoot root).isHidden
post = Get.postFromRoot root
break if prevID is post.ID
prevID = post.ID
break unless post.isHidden
root.scrollIntoView false
return
# Scroll to the last read post.
@ -175,4 +183,4 @@ Unread =
# `favicon.href = href` isn't enough on Opera.
# Opera won't always update the favicon if the href didn't change.
$.add d.head, Favicon.el
<% } %>
<% } %>