Merge branch 'mayhem' into v3
Conflicts: CHANGELOG.md package.json src/General/Index.coffee src/Images/ImageHover.coffee
This commit is contained in:
commit
7818dec073
@ -3240,10 +3240,15 @@
|
||||
}
|
||||
Navigate.title();
|
||||
try {
|
||||
pageNum || (pageNum = 0);
|
||||
if (req.status === 200) {
|
||||
Index.parse(req.response, pageNum);
|
||||
} else if (req.status === 304) {
|
||||
Index.pageNav(pageNum || 0);
|
||||
if (Index.currentPage === pageNum) {
|
||||
Index.buildIndex();
|
||||
} else {
|
||||
Index.pageNav(pageNum);
|
||||
}
|
||||
}
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
@ -3266,7 +3271,7 @@
|
||||
Index.parseThreadList(pages);
|
||||
Index.buildThreads();
|
||||
Index.sort();
|
||||
if (pageNum != null) {
|
||||
if ((pageNum != null) && Index.currentPage !== pageNum) {
|
||||
Index.pageNav(pageNum);
|
||||
return;
|
||||
}
|
||||
@ -4016,6 +4021,7 @@
|
||||
$.cache(url, function() {
|
||||
return Get.archivedPost(this, boardID, postID, root, context);
|
||||
}, {
|
||||
responseType: 'json',
|
||||
withCredentials: url.archive.withCredentials
|
||||
});
|
||||
} else {
|
||||
@ -6775,6 +6781,9 @@
|
||||
}
|
||||
QR.status();
|
||||
QR.error(err);
|
||||
if (QR.captcha.isEnabled) {
|
||||
QR.captcha.setup();
|
||||
}
|
||||
return;
|
||||
}
|
||||
h1 = $('h1', resDoc);
|
||||
@ -6805,6 +6814,9 @@
|
||||
});
|
||||
postsCount = QR.posts.length - 1;
|
||||
QR.cooldown.auto = postsCount && isReply;
|
||||
if (QR.captcha.isEnabled && QR.cooldown.auto) {
|
||||
QR.captcha.setup();
|
||||
}
|
||||
if (!(Conf['Persistent QR'] || QR.cooldown.auto)) {
|
||||
QR.close();
|
||||
} else {
|
||||
@ -8294,8 +8306,8 @@
|
||||
return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover);
|
||||
},
|
||||
catalogNode: function() {
|
||||
var _ref, _ref1;
|
||||
if (!(((_ref = this.thread.OP.file) != null ? _ref.isImage : void 0) || ((_ref1 = this.thread.OP.file) != null ? _ref1.isVideo : void 0))) {
|
||||
var file;
|
||||
if (!((file = this.thread.OP.file) && (file.isImage || file.isVideo))) {
|
||||
return;
|
||||
}
|
||||
return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover);
|
||||
|
||||
@ -3301,10 +3301,15 @@
|
||||
}
|
||||
Navigate.title();
|
||||
try {
|
||||
pageNum || (pageNum = 0);
|
||||
if (req.status === 200) {
|
||||
Index.parse(req.response, pageNum);
|
||||
} else if (req.status === 304) {
|
||||
Index.pageNav(pageNum || 0);
|
||||
if (Index.currentPage === pageNum) {
|
||||
Index.buildIndex();
|
||||
} else {
|
||||
Index.pageNav(pageNum);
|
||||
}
|
||||
}
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
@ -3327,7 +3332,7 @@
|
||||
Index.parseThreadList(pages);
|
||||
Index.buildThreads();
|
||||
Index.sort();
|
||||
if (pageNum != null) {
|
||||
if ((pageNum != null) && Index.currentPage !== pageNum) {
|
||||
Index.pageNav(pageNum);
|
||||
return;
|
||||
}
|
||||
@ -4077,6 +4082,7 @@
|
||||
$.cache(url, function() {
|
||||
return Get.archivedPost(this, boardID, postID, root, context);
|
||||
}, {
|
||||
responseType: 'json',
|
||||
withCredentials: url.archive.withCredentials
|
||||
});
|
||||
} else {
|
||||
@ -6820,6 +6826,9 @@
|
||||
}
|
||||
QR.status();
|
||||
QR.error(err);
|
||||
if (QR.captcha.isEnabled) {
|
||||
QR.captcha.setup();
|
||||
}
|
||||
return;
|
||||
}
|
||||
h1 = $('h1', resDoc);
|
||||
@ -6850,6 +6859,9 @@
|
||||
});
|
||||
postsCount = QR.posts.length - 1;
|
||||
QR.cooldown.auto = postsCount && isReply;
|
||||
if (QR.captcha.isEnabled && QR.cooldown.auto) {
|
||||
QR.captcha.setup();
|
||||
}
|
||||
if (!(Conf['Persistent QR'] || QR.cooldown.auto)) {
|
||||
QR.close();
|
||||
} else {
|
||||
@ -8322,8 +8334,8 @@
|
||||
return $.on(this.file.thumb, 'mouseover', ImageHover.mouseover);
|
||||
},
|
||||
catalogNode: function() {
|
||||
var _ref, _ref1;
|
||||
if (!(((_ref = this.thread.OP.file) != null ? _ref.isImage : void 0) || ((_ref1 = this.thread.OP.file) != null ? _ref1.isVideo : void 0))) {
|
||||
var file;
|
||||
if (!((file = this.thread.OP.file) && (file.isImage || file.isVideo))) {
|
||||
return;
|
||||
}
|
||||
return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover);
|
||||
|
||||
@ -104,6 +104,7 @@ Get =
|
||||
$.cache url,
|
||||
-> Get.archivedPost @, boardID, postID, root, context
|
||||
,
|
||||
responseType: 'json'
|
||||
withCredentials: url.archive.withCredentials
|
||||
else
|
||||
$.addClass root, 'warning'
|
||||
|
||||
@ -544,10 +544,14 @@ Index =
|
||||
Navigate.title()
|
||||
|
||||
try
|
||||
pageNum or= 0
|
||||
if req.status is 200
|
||||
Index.parse req.response, pageNum
|
||||
else if req.status is 304
|
||||
Index.pageNav pageNum or 0
|
||||
if Index.currentPage is pageNum
|
||||
Index.buildIndex()
|
||||
else
|
||||
Index.pageNav pageNum
|
||||
catch err
|
||||
c.error "Index failure: #{err.message}", err.stack
|
||||
# network error or non-JSON content for example.
|
||||
@ -568,7 +572,7 @@ Index =
|
||||
Index.parseThreadList pages
|
||||
Index.buildThreads()
|
||||
Index.sort()
|
||||
if pageNum?
|
||||
if pageNum? and Index.currentPage isnt pageNum
|
||||
Index.pageNav pageNum
|
||||
return
|
||||
Index.buildIndex()
|
||||
|
||||
@ -12,7 +12,7 @@ ImageHover =
|
||||
return unless @file?.isImage or @file?.isVideo
|
||||
$.on @file.thumb, 'mouseover', ImageHover.mouseover
|
||||
catalogNode: ->
|
||||
return unless @thread.OP.file?.isImage or @thread.OP.file?.isVideo
|
||||
return unless (file = @thread.OP.file) and (file.isImage or file.isVideo)
|
||||
$.on @nodes.thumb, 'mouseover', ImageHover.mouseover
|
||||
mouseover: (e) ->
|
||||
post = if $.hasClass @, 'thumb'
|
||||
|
||||
@ -755,6 +755,7 @@ QR =
|
||||
QR.cooldown.auto = false
|
||||
QR.status()
|
||||
QR.error err
|
||||
QR.captcha.setup() if QR.captcha.isEnabled
|
||||
return
|
||||
|
||||
h1 = $ 'h1', resDoc
|
||||
@ -789,6 +790,7 @@ QR =
|
||||
# Enable auto-posting if we have stuff left to post, disable it otherwise.
|
||||
postsCount = QR.posts.length - 1
|
||||
QR.cooldown.auto = postsCount and isReply
|
||||
QR.captcha.setup() if QR.captcha.isEnabled and QR.cooldown.auto
|
||||
|
||||
unless Conf['Persistent QR'] or QR.cooldown.auto
|
||||
QR.close()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user