Fix some issues causing Navigation functions to fail.
This commit is contained in:
parent
7677f6bb35
commit
6760d4b948
@ -12666,14 +12666,13 @@
|
||||
$.addClass($("a[href*='/" + boardID + "/']", fullBoardList), 'current');
|
||||
Header.generateBoardList(Conf['boardnav'].replace(/(\r\n|\n|\r)/g, ' '));
|
||||
QR.flagsInput();
|
||||
return $.cache('//a.4cdn.org/boards.json', function(_arg) {
|
||||
var aboard, board, err, target, _i, _len, _ref;
|
||||
target = _arg.target;
|
||||
if (target.status !== 200) {
|
||||
return;
|
||||
}
|
||||
return $.cache('//a.4cdn.org/boards.json', function() {
|
||||
var aboard, board, err, _i, _len, _ref;
|
||||
try {
|
||||
_ref = target.response.boards;
|
||||
if (this.status !== 200) {
|
||||
return;
|
||||
}
|
||||
_ref = this.response.boards;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
aboard = _ref[_i];
|
||||
if (!(aboard.board === boardID)) {
|
||||
@ -12690,7 +12689,6 @@
|
||||
error: err
|
||||
}
|
||||
]);
|
||||
return false;
|
||||
}
|
||||
if (!board) {
|
||||
return;
|
||||
@ -13573,7 +13571,7 @@
|
||||
return $.ready(Main.initReady);
|
||||
},
|
||||
initStyle: function() {
|
||||
var mainStyleSheet, setStyle, style, styleSheets, _ref;
|
||||
var _ref;
|
||||
$.off(d, '4chanMainInit', Main.initStyle);
|
||||
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
|
||||
return;
|
||||
@ -13583,6 +13581,10 @@
|
||||
}
|
||||
$.addClass(doc, 'fourchan-x', 'seaweedchan', g.VIEW, 'gecko');
|
||||
$.addStyle(Main.css);
|
||||
return Main.setClass();
|
||||
},
|
||||
setClass: function() {
|
||||
var mainStyleSheet, setStyle, style, styleSheets;
|
||||
style = 'yotsuba-b';
|
||||
mainStyleSheet = $('link[title=switch]', d.head);
|
||||
styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
|
||||
|
||||
@ -12680,14 +12680,13 @@
|
||||
$.addClass($("a[href*='/" + boardID + "/']", fullBoardList), 'current');
|
||||
Header.generateBoardList(Conf['boardnav'].replace(/(\r\n|\n|\r)/g, ' '));
|
||||
QR.flagsInput();
|
||||
return $.cache('//a.4cdn.org/boards.json', function(_arg) {
|
||||
var aboard, board, err, target, _i, _len, _ref;
|
||||
target = _arg.target;
|
||||
if (target.status !== 200) {
|
||||
return;
|
||||
}
|
||||
return $.cache('//a.4cdn.org/boards.json', function() {
|
||||
var aboard, board, err, _i, _len, _ref;
|
||||
try {
|
||||
_ref = target.response.boards;
|
||||
if (this.status !== 200) {
|
||||
return;
|
||||
}
|
||||
_ref = this.response.boards;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
aboard = _ref[_i];
|
||||
if (!(aboard.board === boardID)) {
|
||||
@ -12704,7 +12703,6 @@
|
||||
error: err
|
||||
}
|
||||
]);
|
||||
return false;
|
||||
}
|
||||
if (!board) {
|
||||
return;
|
||||
@ -13585,7 +13583,7 @@
|
||||
return $.ready(Main.initReady);
|
||||
},
|
||||
initStyle: function() {
|
||||
var mainStyleSheet, setStyle, style, styleSheets, _ref;
|
||||
var _ref;
|
||||
$.off(d, '4chanMainInit', Main.initStyle);
|
||||
if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) {
|
||||
return;
|
||||
@ -13595,6 +13593,10 @@
|
||||
}
|
||||
$.addClass(doc, 'fourchan-x', 'seaweedchan', g.VIEW, 'blink');
|
||||
$.addStyle(Main.css);
|
||||
return Main.setClass();
|
||||
},
|
||||
setClass: function() {
|
||||
var mainStyleSheet, setStyle, style, styleSheets;
|
||||
style = 'yotsuba-b';
|
||||
mainStyleSheet = $('link[title=switch]', d.head);
|
||||
styleSheets = $$('link[rel="alternate stylesheet"]', d.head);
|
||||
|
||||
@ -526,6 +526,7 @@ Index =
|
||||
return
|
||||
|
||||
Navigate.title()
|
||||
|
||||
Index.board = "#{g.BOARD}"
|
||||
|
||||
try
|
||||
|
||||
@ -84,7 +84,9 @@ Main =
|
||||
$('link[href*=mobile]', d.head)?.disabled = true
|
||||
$.addClass doc, 'fourchan-x', 'seaweedchan', g.VIEW, '<% if (type === 'crx') { %>blink<% } else { %>gecko<% } %>'
|
||||
$.addStyle Main.css
|
||||
Main.setClass()
|
||||
|
||||
setClass: ->
|
||||
style = 'yotsuba-b'
|
||||
mainStyleSheet = $ 'link[title=switch]', d.head
|
||||
styleSheets = $$ 'link[rel="alternate stylesheet"]', d.head
|
||||
|
||||
@ -114,11 +114,10 @@ Navigate =
|
||||
|
||||
QR.flagsInput()
|
||||
|
||||
$.cache '//a.4cdn.org/boards.json', ({target}) ->
|
||||
return unless target.status is 200
|
||||
|
||||
$.cache '//a.4cdn.org/boards.json', ->
|
||||
try
|
||||
for aboard in target.response.boards when aboard.board is boardID
|
||||
return unless @status is 200
|
||||
for aboard in @response.boards when aboard.board is boardID
|
||||
board = aboard
|
||||
break
|
||||
|
||||
@ -127,7 +126,6 @@ Navigate =
|
||||
message: "Navigation failed to update board name."
|
||||
error: err
|
||||
]
|
||||
return false
|
||||
|
||||
return unless board
|
||||
Navigate.updateTitle board
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user