var objPost_replypostid = 0; mayn.Portlet.posts = mayn.Portlet.extend({ __version : "1.0.0.0", __id : "Posts", showPortlet : function(mseq, p_tp) { this._DoPost('showPortlet', { 'mseq' : mseq, 'tp': p_tp }, this.tpl_compile_$showPortlet); }, tpl_compile_$showPortlet : function(a_data) { $("#post_container").html(a_data); }, delPost : function(a_id) { this._DoPost('delPost', {idx: a_id}, this.tpl_compile_$delPost); }, tpl_compile_$delPost : function(a_data) {}, delReply : function(a_id) { this._DoPost('delReply', {idx: a_id}, this.tpl_compile_$delReply); }, tpl_compile_$delReply : function(a_data) {}, readMore : function(mseq, p_tp, a_startpos) { this._DoPost('readMore', { 'mseq' : mseq, 'tp': p_tp, spos:a_startpos }, this.tpl_compile_$readMore); }, tpl_compile_$readMore : function(a_data) { $("#id_posts_readmore_area").remove(); $(".UI_post").append(a_data); }, saveReply : function(a_postid, a_reptxt) { objPost_replypostid = a_postid; this._DoPost('saveReply', { rep_id: a_postid, rep_cmt: a_reptxt }, this.tpl_compile_$saveReply); }, tpl_compile_$saveReply : function(a_data) { $("#id_posts_comarea" + objPost_replypostid).prepend(a_data); $("#id_posts_cmtbtn_" + objPost_replypostid).show(); $("#id_posts_cmtbtn_layer" + objPost_replypostid).hide(); $("#id_posts_reply_textarea" + objPost_replypostid).val(''); }, addPost : function(a_mseq, a_cmt, a_twitter, a_facebook, a_file) {this._DoPost('addPost', { mseq: a_mseq, cmt: a_cmt, twitter: a_twitter, facebook: a_facebook, file : a_file }, this.tpl_compile_$addPost); }, tpl_compile_$addPost : function(a_data) { //add isAttach = ""; $(".script_toggle_area").slideUp("fast"); $("#id_post_upload_img").val(""); $(".UI_post").prepend(a_data); $("#id_posts_post_textarea").val(''); $("#id_posts_postbtn").show(); $("#id_posts_addpost_loading").hide(); }, readReply : function(a_idx) { this._DoPost('readReply', {idx: a_idx}, this.tpl_compile_$readReply); }, tpl_compile_$readReply : function(a_data) { if(a_data == '') return; arr_ret = a_data.split('++++++::::::++++++'); if(arr_ret.length == 2) { if(arr_ret[1] == '') return; $("#id_posts_comarea_ajax" + arr_ret[0]).html(arr_ret[1]); } }, doConnect : function() {this._DoGet('doConnect', '', this.tpl_compile_$doConnect); }, tpl_compile_$doConnect : function(a_data) { if(a_data == 'NOT') openTwitterConnect(); }, dofacebookConnect : function() {this._DoGet('doFacebookConnect', '', this.tpl_compile_$dofacebookConnect); }, tpl_compile_$dofacebookConnect : function(a_data) { openFBConnect(a_data); } });