|
|
@ -29,8 +29,10 @@ function requestRepliedBefore(postLi) |
|
|
|
var reply_k = originalPost.attr('data-replied-to-id'); |
|
|
|
var reply_k = originalPost.attr('data-replied-to-id'); |
|
|
|
|
|
|
|
|
|
|
|
if( reply_n != undefined && reply_k != undefined ) { |
|
|
|
if( reply_n != undefined && reply_k != undefined ) { |
|
|
|
|
|
|
|
if (reply_n[0] !== '!') { |
|
|
|
dhtget(reply_n, "post" + reply_k, "s", |
|
|
|
dhtget(reply_n, "post" + reply_k, "s", |
|
|
|
function (postLi, postFromJson) { |
|
|
|
function (postLi, postFromJson) { |
|
|
|
|
|
|
|
console.log(postFromJson); |
|
|
|
if (postFromJson) { |
|
|
|
if (postFromJson) { |
|
|
|
postLi.find('textarea').textcomplete('destroy'); // FIXME maybe we need to reset position instead (but curently it's cheaper)
|
|
|
|
postLi.find('textarea').textcomplete('destroy'); // FIXME maybe we need to reset position instead (but curently it's cheaper)
|
|
|
|
var newStreamPost = postToElem(postFromJson, "related"); |
|
|
|
var newStreamPost = postToElem(postFromJson, "related"); |
|
|
@ -41,6 +43,23 @@ function requestRepliedBefore(postLi) |
|
|
|
requestRepliedBefore(newStreamPost); |
|
|
|
requestRepliedBefore(newStreamPost); |
|
|
|
} |
|
|
|
} |
|
|
|
}, postLi); |
|
|
|
}, postLi); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//replied to a promoted post... try to get it..
|
|
|
|
|
|
|
|
var params = [1, parseInt(reply_k)]; |
|
|
|
|
|
|
|
twisterRpc("getspamposts", params, |
|
|
|
|
|
|
|
function (postLi, postFromJson) { |
|
|
|
|
|
|
|
console.log(postFromJson[0]); |
|
|
|
|
|
|
|
if (postFromJson) { |
|
|
|
|
|
|
|
postLi.find('textarea').textcomplete('destroy'); // FIXME maybe we need to reset position instead (but curently it's cheaper)
|
|
|
|
|
|
|
|
var newStreamPost = postToElem(postFromJson[0], "related", 1); |
|
|
|
|
|
|
|
newStreamPost.hide(); |
|
|
|
|
|
|
|
postLi.before(newStreamPost); |
|
|
|
|
|
|
|
newStreamPost.slideDown("fast"); |
|
|
|
|
|
|
|
$.MAL.relatedPostLoaded(); |
|
|
|
|
|
|
|
requestRepliedBefore(newStreamPost); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, postLi, function(arg,ret) {console.log(ret)}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|