Turns out I never finished my Thread Title magic...

because @MayhemYDG had already done it and done it better. So I
thought mine was working when it was just his... and then
realized when I didn't disconnect it and the index was getting a
title from a thread that it wasn't working and his was.

So let's just use his code.
This commit is contained in:
Zixaphir 2014-01-10 18:07:14 -07:00
parent ebf6808297
commit bc9f094a77
5 changed files with 18 additions and 20 deletions

View File

@ -8641,6 +8641,9 @@
},
node: function() {
return d.title = Get.threadExcerpt(this);
},
disconnect: function() {
return Thread.callbacks.disconnect('Thread Excerpt');
}
};
@ -11860,7 +11863,7 @@
g.BOARD.threads = {};
return $.rmAll($('.board'));
},
threadFeatures: [['Unread Count', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Expansion', ExpandThread]],
threadFeatures: [['Thread Excerpt', ThreadExcerpt], ['Unread Count', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Expansion', ExpandThread]],
disconnect: function() {
var err, errors, feature, features, name, _i, _len, _ref;
features = g.VIEW === 'thread' ? Navigate.threadFeatures : [];
@ -12012,6 +12015,7 @@
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) {
return;
}
$.addClass(Index.button, 'fa-spin');
path = this.pathname.split('/');
hash = this.hash;
if (path[0] === '') {
@ -12087,7 +12091,7 @@
}
},
parse: function(data) {
var OP, board, comment, errors, makePost, obj, post, posts, subject, thread, threadRoot, title, _i, _len, _ref;
var OP, board, errors, makePost, obj, post, posts, thread, threadRoot, _i, _len;
board = g.BOARD;
Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true);
thread = new Thread(OP.no, board);
@ -12109,11 +12113,6 @@
}
};
makePost($('.opContainer', threadRoot));
_ref = posts[0].info, subject = _ref.subject, comment = _ref.comment;
title = "/" + g.BOARD.ID + "/ - " + (subject || comment);
if (title.length > 100) {
title = title.slice(0, 100);
}
for (_i = 0, _len = data.length; _i < _len; _i++) {
obj = data[_i];
post = Build.postFromObject(obj, board);

View File

@ -8624,6 +8624,9 @@
},
node: function() {
return d.title = Get.threadExcerpt(this);
},
disconnect: function() {
return Thread.callbacks.disconnect('Thread Excerpt');
}
};
@ -11849,7 +11852,7 @@
g.BOARD.threads = {};
return $.rmAll($('.board'));
},
threadFeatures: [['Unread Count', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Expansion', ExpandThread]],
threadFeatures: [['Thread Excerpt', ThreadExcerpt], ['Unread Count', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Expansion', ExpandThread]],
disconnect: function() {
var err, errors, feature, features, name, _i, _len, _ref;
features = g.VIEW === 'thread' ? Navigate.threadFeatures : [];
@ -12001,6 +12004,7 @@
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) {
return;
}
$.addClass(Index.button, 'fa-spin');
path = this.pathname.split('/');
hash = this.hash;
if (path[0] === '') {
@ -12076,7 +12080,7 @@
}
},
parse: function(data) {
var OP, board, comment, errors, makePost, obj, post, posts, subject, thread, threadRoot, title, _i, _len, _ref;
var OP, board, errors, makePost, obj, post, posts, thread, threadRoot, _i, _len;
board = g.BOARD;
Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true);
thread = new Thread(OP.no, board);
@ -12098,11 +12102,6 @@
}
};
makePost($('.opContainer', threadRoot));
_ref = posts[0].info, subject = _ref.subject, comment = _ref.comment;
title = "/" + g.BOARD.ID + "/ - " + (subject || comment);
if (title.length > 100) {
title = title.slice(0, 100);
}
for (_i = 0, _len = data.length; _i < _len; _i++) {
obj = data[_i];
post = Build.postFromObject(obj, board);

View File

@ -35,6 +35,7 @@ Navigate =
$.rmAll $ '.board'
threadFeatures: [
['Thread Excerpt', ThreadExcerpt]
['Unread Count', Unread]
['Quote Threading', QuoteThreading]
['Thread Stats', ThreadStats]
@ -170,6 +171,8 @@ Navigate =
return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org' or
(e and (e.shiftKey or (e.type is 'click' and e.button isnt 0))) # Not simply a left click
$.addClass Index.button, 'fa-spin'
path = @pathname.split '/'
hash = @hash
path.shift() if path[0] is ''
@ -258,10 +261,6 @@ Navigate =
makePost $('.opContainer', threadRoot)
{subject, comment} = posts[0].info
title = "/#{g.BOARD.ID}/ - #{subject or comment}"
title = title[...100] if title.length > 100
for obj in data
post = Build.postFromObject obj, board
makePost post

View File

@ -5,5 +5,5 @@ ThreadExcerpt =
Thread.callbacks.push
name: 'Thread Excerpt'
cb: @node
node: ->
d.title = Get.threadExcerpt @
node: -> d.title = Get.threadExcerpt @
disconnect: -> Thread.callbacks.disconnect 'Thread Excerpt'

View File

@ -8,6 +8,7 @@ Quotify =
Post.callbacks.push
name: 'Resurrect Quotes'
cb: @node
node: ->
for deadlink in $$ '.deadlink', @nodes.comment
if @isClone