indexareascript.blade.php
6.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<script>
function search_ofriends()
{
var searchstr = $("#search_ofriends").val();
if(searchstr.length >= 4)
{
doAjax('social?stype=search_ofriends&srch_data='+searchstr+'&stage='+lastvarUrl,'','online_friends_top','ajax_onlinefriends','singlefail','POST');
}
}
<?php $wall_type_arr=array("activity","personal","photo","link","attachment","notes","question","test");foreach($wall_type_arr as $walltype){ ?>
$("#{!!$walltype!!}wallul").parent().bind("scroll",function(){
//console.log(""+$("#{!!$walltype!!}wallul").parent().scrollTop()+" "+$("#{!!$walltype!!}wallul").parent().prop('scrollHeight')+" "+$("#{!!$walltype!!}wallul").parent().height());
var diff=$("#{!!$walltype!!}wallul").parent().prop('scrollHeight')-$("#{!!$walltype!!}wallul").parent().scrollTop()-$("#{!!$walltype!!}wallul").parent().height();
if(diff<100&&$("#{!!$walltype!!}lastdate").val()!="")
{
var idprepend=$("#{!!$walltype!!}lastdate").val();
idprepend=idprepend.replace(/-/g,"");
idprepend=idprepend.replace(/:/g,"");
idprepend=idprepend.replace(/ /g,"");
show_wall_feeds("{!!$walltype!!}",1);
$("#"+idprepend+"{!!$walltype!!}walldivul").css({"display":"none"});
}
});
<?php } ?>
var lastwallfeed='activity';
function show_wall_feeds(ptype,flag)
{
if(ptype=='')ptype=lastwallfeed;
if(ptype=='')ptype='activity';
lastwallfeed=ptype;
var filter="All_Posts";
var hashtags=encodeURIComponent($("#"+ptype+"filterhashtags").val());
if(flag!=1) {$("#"+ptype+"lastdate").val("");$("#"+ptype+"wallul").html("<br><br><br><br><br>");}
if($("#"+ptype+"wall_filter").val() != '')filter = $("#"+ptype+"wall_filter").val();
var idprepend=$("#"+ptype+"lastdate").val();
idprepend=idprepend.replace(/-/g,"");
idprepend=idprepend.replace(/:/g,"");
idprepend=idprepend.replace(/ /g,"");
if(flag==1){$("#"+idprepend+ptype+"wallul").html("<br><br><br><br><br>");}//<center><img src='assets/images/loading.gif' width=50px></center>
doAjax('social/{!!Auth::user()->id!!}?show=wall&wall='+ptype+'&filter='+filter+'&lastdate='+$("#"+ptype+"lastdate").val()+'&hashtags='+hashtags,'',idprepend+ptype+"wallul",ptype+'ajax_wall_show','singlefail','GET', function(){
//if($("#wallsdivpp").length)$("#"+ptype+"wallul").height($("#wall_feed").height()-$("#wallsdivpp").height()-$("#"+ptype+"wallsdivppp").height());
});
}
function socialhashtagsearch(str)
{
$("#"+lastwallfeed+"filterhashtags").val(str);
$("#"+lastwallfeed+"wall_filter").val("");
show_wall_feeds('',0);
}
function popupProfileSocial(uid)
{
// $("#welcome_wizard_body").html("");
// doAjax('social?stype=load_frnddetails&show_user='+uid,'','welcome_wizard_body','ajax_profile_update','singlefail','POST');
// $("#welcome_wizard").modal('show');
//
// $('#welcome_wizard').on('hidden.bs.modal', function () {
// $("#welcome_wizard_body").html("");
// });
}
function checkpostcomment(e,postid,value,userid)
{
var keycode= e.keyCode || e.which;
if(keycode==13&&value!='')
{
var putdata="stype=comment&postid="+postid+"&cdata="+value;
doAjax('social?userid='+userid,putdata,'','ajax_post_create','singlefail','POST',function(){
});
return false;
}
return true;
}
function storecommentsuccess(postid,cdata,dt)
{
$("#postbox_"+postid+" div:last").before(" \
<div class='media innerAll margin-none bg-gray-light border-top border-bottom'> \
<img src='{!!Auth::user()->fetchphotothumb()!!}' alt='photo' class='media-object pull-left' width='35'> \
<div class='media-body'> \
<a href='javascript:void(0);' class='strong'>{!!Auth::user()->dispname()!!}</a> "+cdata+" \
<a href='#delete_comm_confirm' data-toggle='modal'><i class='fa fa-trash-o pull-right' onclick='$('#del_comm').attr({'delete':"+postid+", 'time':'"+dt+"'});' style='color:#DFDFDF'></i></a> \
<div class='timeline-bottom'> \
<i class='fa fa-clock-o'></i> Just Now \
</div> \
</div> \
</div> \
");
$("#commentbox_"+postid).val("");
}
function expandWall()
{
$("#postin_area_tops").slideToggle();
$("#postin_area_top").slideToggle();
if($("#expand_wall").attr("class")=="btn btn-default")
{
$("#expand_wall_txt").html("Hide Write Post");
$("#expand_wall").attr("class", "btn btn-default filled");
$("#expand_wall_icon").attr("class", "fa fa-th-large");
}
else
{
$("#expand_wall_txt").html("Write Post");
$("#expand_wall").attr("class", "btn btn-default");
$("#expand_wall_icon").attr("class", "fa fa-th");
}
}
function sindexmenu(str,elem)
{
$(".ssm").removeClass("active");
$(elem).parent().addClass("active");
doAjax('social/{!!Auth::user()->id!!}?show='+str,'','socialrightall','ajax_wall_show','singlethis','GET');return false;
}
function plusonpost(count,postid)
{
if(!$("#post_t"+count+"_"+postid).hasClass('text-primary'))
{
$("#post_t1_"+postid).removeClass("text-primary");
$("#post_t2_"+postid).removeClass("text-primary");
$("#post_t3_"+postid).removeClass("text-primary");
for(i=1;i<=count;i++)$("#post_t"+i+"_"+postid).toggleClass("text-primary");
}
else
{
$("#post_t1_"+postid).removeClass("text-primary");
$("#post_t2_"+postid).removeClass("text-primary");
$("#post_t3_"+postid).removeClass("text-primary");
count=0;
}
$("#post_t1_"+postid+"_eps").html(parseInt($("#post_t1_"+postid+"_eps").attr('oldvalttl'))-parseInt($("#post_t1_"+postid+"_eps").attr('oldmyval'))+count);
doAjax('social?userid={!!Auth::user()->id!!}','stype=likepost&postid='+postid+'&count='+count,'','ajax_post_create','singlefail','POST');
}
function del_comment(commentid,postid)
{
doAjax('social?stype=del_comment&delc_id='+commentid+'&delp_id='+postid,'','','ajax_comment_delete','singlefail','POST');
}
function delete_post(id)
{
doAjax('social?stype=del_post&delp_id='+id,'','','ajax_delete_post','singlefail','POST');
}
function share_post(id,shareacl,sharecaption)
{
var varstr='&shrp_id='+id;
if(shareacl != '')
varstr+= "&shareacl="+shareacl;
if(sharecaption != '')
varstr+= "&sharecaption="+sharecaption;
doAjax('social?stype=share_post'+varstr,'','','ajax_share_post','singlefail','POST');
}
function spam_post(id,reason)
{
doAjax('social?stype=spam_post&id='+id+'&reason='+reason,'','','ajax_spam_post','singlefail','POST');
}
var filterkeyuptimer=null;
function filterhashkeyup(str)
{
clearTimeout(filterkeyuptimer);
filterkeyuptimer = setTimeout(function(){show_wall_feeds('');}, 1500);
}
</script>