We (Still) Hate Console Errors 3.0

This commit is contained in:
Jordan Bates 2013-04-22 22:10:45 -07:00
parent 505f2b9437
commit 5823da664d
4 changed files with 74 additions and 84 deletions

View File

@ -6413,8 +6413,7 @@
});
},
node: function() {
var ID, post, posts, _ref,
_this = this;
var ID, post, posts, _ref;
Unread.thread = this;
Unread.title = d.title;
@ -6437,13 +6436,10 @@
if (Conf['Unread Line']) {
$.on(d, 'visibilitychange', Unread.setLine);
}
if (Conf['Scroll to Last Read Post']) {
return $.on(window, 'load', function(posts) {
return Unread.scroll.apply(_this, posts);
});
if (!Conf['Scroll to Last Read Post']) {
return;
}
},
scroll: function(posts) {
return $.on(window, 'load', function() {
var hash, root;
if ((hash = location.hash.match(/\d+/)) && hash[0] in this.posts) {
@ -6460,8 +6456,9 @@
}
return root.scrollIntoView(false);
} else if (posts.length) {
return Header.scrollToPost(posts[post.length - 1].nodes.root);
return Header.scrollToPost(posts[posts.length - 1].nodes.root);
}
});
},
sync: function() {
var lastReadPost;

View File

@ -6404,8 +6404,7 @@
});
},
node: function() {
var ID, post, posts, _ref,
_this = this;
var ID, post, posts, _ref;
Unread.thread = this;
Unread.title = d.title;
@ -6428,13 +6427,10 @@
if (Conf['Unread Line']) {
$.on(d, 'visibilitychange', Unread.setLine);
}
if (Conf['Scroll to Last Read Post']) {
return $.on(window, 'load', function(posts) {
return Unread.scroll.apply(_this, posts);
});
if (!Conf['Scroll to Last Read Post']) {
return;
}
},
scroll: function(posts) {
return $.on(window, 'load', function() {
var hash, root;
if ((hash = location.hash.match(/\d+/)) && hash[0] in this.posts) {
@ -6451,8 +6447,9 @@
}
return root.scrollIntoView(false);
} else if (posts.length) {
return Header.scrollToPost(posts[post.length - 1].nodes.root);
return Header.scrollToPost(posts[posts.length - 1].nodes.root);
}
});
},
sync: function() {
var lastReadPost;

View File

@ -6327,8 +6327,7 @@
});
},
node: function() {
var ID, post, posts, _ref,
_this = this;
var ID, post, posts, _ref;
Unread.thread = this;
Unread.title = d.title;
@ -6351,13 +6350,10 @@
if (Conf['Unread Line']) {
$.on(d, 'visibilitychange', Unread.setLine);
}
if (Conf['Scroll to Last Read Post']) {
return $.on(window, 'load', function(posts) {
return Unread.scroll.apply(_this, posts);
});
if (!Conf['Scroll to Last Read Post']) {
return;
}
},
scroll: function(posts) {
return $.on(window, 'load', function() {
var hash, root;
if ((hash = location.hash.match(/\d+/)) && hash[0] in this.posts) {
@ -6374,8 +6370,9 @@
}
return root.scrollIntoView(false);
} else if (posts.length) {
return Header.scrollToPost(posts[post.length - 1].nodes.root);
return Header.scrollToPost(posts[posts.length - 1].nodes.root);
}
});
},
sync: function() {
var lastReadPost;

View File

@ -26,11 +26,10 @@ Unread =
$.on d, 'ThreadUpdate', Unread.onUpdate
$.on d, 'scroll visibilitychange', Unread.read
$.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line']
if Conf['Scroll to Last Read Post']
$.on window, 'load', (posts) =>
Unread.scroll.apply @, posts
scroll: (posts) ->
return unless Conf['Scroll to Last Read Post']
$.on window, 'load', ->
# Let the header's onload callback handle it.
return if (hash = location.hash.match /\d+/) and hash[0] of @posts
if Unread.posts.length
@ -41,7 +40,7 @@ Unread =
root.scrollIntoView false
else if posts.length
# Scroll to the last read post.
Header.scrollToPost (posts[post.length - 1]).nodes.root
Header.scrollToPost (posts[posts.length - 1]).nodes.root
sync: ->
lastReadPost = Unread.db.get