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