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:
parent
ebf6808297
commit
bc9f094a77
@ -8641,6 +8641,9 @@
|
|||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
return d.title = Get.threadExcerpt(this);
|
return d.title = Get.threadExcerpt(this);
|
||||||
|
},
|
||||||
|
disconnect: function() {
|
||||||
|
return Thread.callbacks.disconnect('Thread Excerpt');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -11860,7 +11863,7 @@
|
|||||||
g.BOARD.threads = {};
|
g.BOARD.threads = {};
|
||||||
return $.rmAll($('.board'));
|
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() {
|
disconnect: function() {
|
||||||
var err, errors, feature, features, name, _i, _len, _ref;
|
var err, errors, feature, features, name, _i, _len, _ref;
|
||||||
features = g.VIEW === 'thread' ? Navigate.threadFeatures : [];
|
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)))) {
|
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$.addClass(Index.button, 'fa-spin');
|
||||||
path = this.pathname.split('/');
|
path = this.pathname.split('/');
|
||||||
hash = this.hash;
|
hash = this.hash;
|
||||||
if (path[0] === '') {
|
if (path[0] === '') {
|
||||||
@ -12087,7 +12091,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
parse: function(data) {
|
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;
|
board = g.BOARD;
|
||||||
Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true);
|
Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true);
|
||||||
thread = new Thread(OP.no, board);
|
thread = new Thread(OP.no, board);
|
||||||
@ -12109,11 +12113,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
makePost($('.opContainer', threadRoot));
|
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++) {
|
for (_i = 0, _len = data.length; _i < _len; _i++) {
|
||||||
obj = data[_i];
|
obj = data[_i];
|
||||||
post = Build.postFromObject(obj, board);
|
post = Build.postFromObject(obj, board);
|
||||||
|
|||||||
@ -8624,6 +8624,9 @@
|
|||||||
},
|
},
|
||||||
node: function() {
|
node: function() {
|
||||||
return d.title = Get.threadExcerpt(this);
|
return d.title = Get.threadExcerpt(this);
|
||||||
|
},
|
||||||
|
disconnect: function() {
|
||||||
|
return Thread.callbacks.disconnect('Thread Excerpt');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -11849,7 +11852,7 @@
|
|||||||
g.BOARD.threads = {};
|
g.BOARD.threads = {};
|
||||||
return $.rmAll($('.board'));
|
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() {
|
disconnect: function() {
|
||||||
var err, errors, feature, features, name, _i, _len, _ref;
|
var err, errors, feature, features, name, _i, _len, _ref;
|
||||||
features = g.VIEW === 'thread' ? Navigate.threadFeatures : [];
|
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)))) {
|
if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$.addClass(Index.button, 'fa-spin');
|
||||||
path = this.pathname.split('/');
|
path = this.pathname.split('/');
|
||||||
hash = this.hash;
|
hash = this.hash;
|
||||||
if (path[0] === '') {
|
if (path[0] === '') {
|
||||||
@ -12076,7 +12080,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
parse: function(data) {
|
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;
|
board = g.BOARD;
|
||||||
Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true);
|
Navigate.threadRoot = threadRoot = Build.thread(board, OP = data.shift(), true);
|
||||||
thread = new Thread(OP.no, board);
|
thread = new Thread(OP.no, board);
|
||||||
@ -12098,11 +12102,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
makePost($('.opContainer', threadRoot));
|
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++) {
|
for (_i = 0, _len = data.length; _i < _len; _i++) {
|
||||||
obj = data[_i];
|
obj = data[_i];
|
||||||
post = Build.postFromObject(obj, board);
|
post = Build.postFromObject(obj, board);
|
||||||
|
|||||||
@ -35,6 +35,7 @@ Navigate =
|
|||||||
$.rmAll $ '.board'
|
$.rmAll $ '.board'
|
||||||
|
|
||||||
threadFeatures: [
|
threadFeatures: [
|
||||||
|
['Thread Excerpt', ThreadExcerpt]
|
||||||
['Unread Count', Unread]
|
['Unread Count', Unread]
|
||||||
['Quote Threading', QuoteThreading]
|
['Quote Threading', QuoteThreading]
|
||||||
['Thread Stats', ThreadStats]
|
['Thread Stats', ThreadStats]
|
||||||
@ -170,6 +171,8 @@ Navigate =
|
|||||||
return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org' or
|
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
|
(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 '/'
|
path = @pathname.split '/'
|
||||||
hash = @hash
|
hash = @hash
|
||||||
path.shift() if path[0] is ''
|
path.shift() if path[0] is ''
|
||||||
@ -258,10 +261,6 @@ Navigate =
|
|||||||
|
|
||||||
makePost $('.opContainer', threadRoot)
|
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
|
for obj in data
|
||||||
post = Build.postFromObject obj, board
|
post = Build.postFromObject obj, board
|
||||||
makePost post
|
makePost post
|
||||||
|
|||||||
@ -5,5 +5,5 @@ ThreadExcerpt =
|
|||||||
Thread.callbacks.push
|
Thread.callbacks.push
|
||||||
name: 'Thread Excerpt'
|
name: 'Thread Excerpt'
|
||||||
cb: @node
|
cb: @node
|
||||||
node: ->
|
node: -> d.title = Get.threadExcerpt @
|
||||||
d.title = Get.threadExcerpt @
|
disconnect: -> Thread.callbacks.disconnect 'Thread Excerpt'
|
||||||
|
|||||||
@ -8,6 +8,7 @@ Quotify =
|
|||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Resurrect Quotes'
|
name: 'Resurrect Quotes'
|
||||||
cb: @node
|
cb: @node
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
for deadlink in $$ '.deadlink', @nodes.comment
|
for deadlink in $$ '.deadlink', @nodes.comment
|
||||||
if @isClone
|
if @isClone
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user