Share.prototype={
constructor:Share,init:function(){
if(this.user.is_login&&!this.user.no_un){
this.initDatas();
this.fillLikeForums()
}
this.bindEvents();
this.bindListeners();
this.picObj=new Pics(this.dataObj);
this.picObj.init();
this.initInputs()
}
,bindEvents:function(){
this.bindFnameEvent();
this.bindLikedForumsClickEvent();
this.bindTitleEvent();
this.bindContentEvent();
this.bindSummaryEvent();
this.bindSubmitEvent()
}
,bindListeners:function(){
this.on("FORUM_NOT_NULL",this.checkFname);
this.on("TITLE_NOT_NULL",this.checkTitle);
this.on("FORUM_NOT_EXIST",this.isFnameExist);
this.on("POST_DATA",this.postData)
}
,initDatas:function(){
var c=null;
var d=this.dataObj.like_forum||{};
for(var b=0,a=d.length;
b=e){
return c+"..."
}
}
return d
}
,fillLikeForums:function(){
var f=this.user.like_forum,j=$("#j_liked_forums"),k=new Array(),c=new Array(),h=0,d=0,b="";
for(var e=0,g=f.length;
e'+b+"")
}
else{
if(d<1200){
c.push(''+b+"")
}
}
}
j.html(k.join(""));
if(c.length>0){
var a=$('\u5c55\u5f00');
a.bind("click",function(){
a.remove();
j.append(c.join(""))
});
j.append(a)
}
}
,checkFname:function(){
var b=$.trim(this.fname.val()),a=this.errConfig.FORUM_NOT_NULL;
a.needCheck=false;
if(b===""){
this.fnameError.text(a.msg).show();
this.fname.focus();
return false
}
else{
this.fnameError.hide();
return true
}
}
,checkTitle:function(){
var b=$.trim(this.title.val()),a=this.errConfig.TITLE_NOT_NULL;
a.needCheck=false;
if(b===""){
this.titleTip.text(a.msg).show();
return false
}
else{
this.titleTip.hide();
return true
}
}
,isFnameExist:function(d){
var a=this,b=this.errConfig.FORUM_NOT_EXIST,c=$.trim(this.fname.val());
if(a.checkFname()){
$.tb.post("/f/commit/share/fnameShareApi",{
fname:c
}
,function(e){
if(e&&e.no===0){
a.fnameError.hide();
a.setForumObj(e.data.fid,c,e.data.can_send_pics);
a.canPost=true
}
else{
a.fnameError.text(b.msg).show();
a.canPost=false
}
if(d&&a.canPost){
a.fireEvent("POST_DATA")
}
})
}
}
,setForumObj:function(c,a,b){
if($("#j_pic_checkbox").attr("checked")){
this.picObj.canSendPics(b)
}
this.forumObj={
fid:c,fname:a
}
}
,checkInputs:function(){
var b=this,d=null,c=["FORUM_NOT_NULL","TITLE_NOT_NULL"];
for(var e=0,a=c.length;
e0){
a.push("
");
a.push(b)
}
if(d.videos.video_r.length>0){
var f=d.videos.pkey||"",e=d.videos.video_r,c=d.videos.video_s||"";
a.push("
");
a.push('