@ -2467,13 +2467,47 @@ function postSubmit(e, oldLastPostId) {
@@ -2467,13 +2467,47 @@ function postSubmit(e, oldLastPostId) {
if ( splitedPostsCount > 1 ) {
if ( textArea . length < splitedPostsCount ) {
//current part will be sent as reply to the previous part...
postData = $ ( '<div data-id="' + lastPostId + '" data-screen-name="' + defaultScreenName + '"></div>' ) ;
postData = $ ( '<div data-id="' + lastPostId + '" data-screen-name="' + defaultScreenName
+ '" data-reply-part-id="' + ( splitedPostsCount - textArea . length ) . toString ( )
+ '"></div>' ) ;
}
}
var doSubmitPost = function ( postText , postData ) {
newPostMsg ( postText , postData . attr ( 'data-screen-name' ) , parseInt ( postData . attr ( 'data-id' ) ) ) ;
}
if ( postData . length )
var doSubmitPost = function ( postText , postDataElem ) {
var reply _n = postDataElem . attr ( 'data-screen-name' ) ;
var reply _k = parseInt ( postDataElem . attr ( 'data-id' ) ) ;
var part _id = postDataElem . attr ( 'data-reply-part-id' ) ;
var cbFunc = function ( req , ret ) {
var postDataElem = $ ( '.expanded-post .post-data'
+ '[data-screen-name=\'' + req . reply _n + '\']'
+ '[data-id=\'' + req . reply _k + '\']' ) ;
if ( ! postDataElem . length ) {
if ( req . part _id && ++ req . tries < 5 )
setTimeout ( req . cbFunc , 2000 , req ) ;
return ;
}
formerPostElem = postDataElem . closest ( 'li.post' ) ;
if ( ! formerPostElem . next ( ) . is ( '.post-replies' ) )
formerPostElem . after ( $ ( '<li class="post-replies"><ol class="sub-replies"></ol></li>' ) ) ; // FIXME replace with template as like as a reqRepAfterCB()'s similar thing
postToElem ( ret , 'related' ) . hide ( )
. appendTo ( formerPostElem . next ( ) . children ( '.sub-replies' ) )
. slideDown ( 'fast' )
;
} ;
newPostMsg ( postText , reply _n , reply _k ,
cbFunc , { reply _n : reply _n , reply _k : reply _k , part _id : part _id ,
cbFunc : cbFunc , tries : 0 }
) ;
} ;
else
var doSubmitPost = function ( postText ) {
newPostMsg ( postText ) ;
} ;
}
if ( textArea . length <= 1 ) {