Save IDs of your posts.
This commit is contained in:
parent
22c341e46d
commit
ce5e03fa81
@ -5558,6 +5558,8 @@
|
|||||||
if (g.VIEW === 'catalog' || !Conf['Quick Reply']) {
|
if (g.VIEW === 'catalog' || !Conf['Quick Reply']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Misc.clearThreads("yourPosts." + g.BOARD);
|
||||||
|
this.syncYourPosts();
|
||||||
if (Conf['Hide Original Post Form']) {
|
if (Conf['Hide Original Post Form']) {
|
||||||
$.addClass(doc, 'hide-original-post-form');
|
$.addClass(doc, 'hide-original-post-form');
|
||||||
}
|
}
|
||||||
@ -5663,6 +5665,16 @@
|
|||||||
return QR.unhide();
|
return QR.unhide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
syncYourPosts: function(yourPosts) {
|
||||||
|
if (yourPosts) {
|
||||||
|
QR.yourPosts = yourPosts;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QR.yourPosts = $.get("yourPosts." + g.BOARD, {
|
||||||
|
threads: {}
|
||||||
|
});
|
||||||
|
return $.sync("yourPosts." + g.BOARD, QR.syncYourPosts);
|
||||||
|
},
|
||||||
error: function(err) {
|
error: function(err) {
|
||||||
var el;
|
var el;
|
||||||
QR.open();
|
QR.open();
|
||||||
@ -6448,7 +6460,7 @@
|
|||||||
return QR.ajax = $.ajax($.id('postForm').parentNode.action, callbacks, opts);
|
return QR.ajax = $.ajax($.id('postForm').parentNode.action, callbacks, opts);
|
||||||
},
|
},
|
||||||
response: function(req) {
|
response: function(req) {
|
||||||
var ban, board, err, h1, persona, postID, reply, threadID, tmpDoc, _, _ref, _ref1;
|
var ban, board, err, h1, persona, postID, reply, threadID, tmpDoc, _, _base, _ref, _ref1;
|
||||||
delete QR.ajax;
|
delete QR.ajax;
|
||||||
tmpDoc = d.implementation.createHTMLDocument('');
|
tmpDoc = d.implementation.createHTMLDocument('');
|
||||||
tmpDoc.documentElement.innerHTML = req.response;
|
tmpDoc.documentElement.innerHTML = req.response;
|
||||||
@ -6496,6 +6508,8 @@
|
|||||||
_ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
|
_ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
|
||||||
threadID = +threadID;
|
threadID = +threadID;
|
||||||
postID = +postID;
|
postID = +postID;
|
||||||
|
((_base = QR.yourPosts.threads)[threadID] || (_base[threadID] = [])).push(postID);
|
||||||
|
$.set("yourPosts." + g.BOARD, QR.yourPosts);
|
||||||
$.event('QRPostSuccessful', {
|
$.event('QRPostSuccessful', {
|
||||||
board: g.BOARD,
|
board: g.BOARD,
|
||||||
threadID: threadID || postID,
|
threadID: threadID || postID,
|
||||||
|
|||||||
@ -2,6 +2,9 @@ QR =
|
|||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Quick Reply']
|
return if g.VIEW is 'catalog' or !Conf['Quick Reply']
|
||||||
|
|
||||||
|
Misc.clearThreads "yourPosts.#{g.BOARD}"
|
||||||
|
@syncYourPosts()
|
||||||
|
|
||||||
if Conf['Hide Original Post Form']
|
if Conf['Hide Original Post Form']
|
||||||
$.addClass doc, 'hide-original-post-form'
|
$.addClass doc, 'hide-original-post-form'
|
||||||
|
|
||||||
@ -83,6 +86,13 @@ QR =
|
|||||||
else
|
else
|
||||||
QR.unhide()
|
QR.unhide()
|
||||||
|
|
||||||
|
syncYourPosts: (yourPosts) ->
|
||||||
|
if yourPosts
|
||||||
|
QR.yourPosts = yourPosts
|
||||||
|
return
|
||||||
|
QR.yourPosts = $.get "yourPosts.#{g.BOARD}", threads: {}
|
||||||
|
$.sync "yourPosts.#{g.BOARD}", QR.syncYourPosts
|
||||||
|
|
||||||
error: (err) ->
|
error: (err) ->
|
||||||
QR.open()
|
QR.open()
|
||||||
if typeof err is 'string'
|
if typeof err is 'string'
|
||||||
@ -805,6 +815,9 @@ QR =
|
|||||||
threadID = +threadID
|
threadID = +threadID
|
||||||
postID = +postID
|
postID = +postID
|
||||||
|
|
||||||
|
(QR.yourPosts.threads[threadID] or= []).push postID
|
||||||
|
$.set "yourPosts.#{g.BOARD}", QR.yourPosts
|
||||||
|
|
||||||
# Post/upload confirmed as successful.
|
# Post/upload confirmed as successful.
|
||||||
$.event 'QRPostSuccessful', {
|
$.event 'QRPostSuccessful', {
|
||||||
board: g.BOARD
|
board: g.BOARD
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user