1 2function media_report_admin(media_id,userid) 3{ 4 5 str = 'action=reportmedia_to_admin&media_id='+media_id+'&userid='+userid; 6 var retVal = confirm("Are you sure you want to report a Media to Admin?"); 7 if( retVal == true ){ 8 9 10 jQuery.ajax({ 11 url: userpro_ajax_media_url, 12 data: str, 13 type: 'POST', 14 success:function(data){ 15 16 jQuery("#"+media_id).removeClass('reportmedia'); 17 18 }, 19 error:function(data){alert(data); 20 21 alert(data.error); 22 } 23 });} 24} 25 26 27jQuery(document).ready(function($){ 28 jQuery('.media_tab_data').hide(); 29 jQuery('.media_tab_data:first').show(); 30 jQuery('#navmediacontainer li a').css({'backgroundColor':'#555' , 'color': '#fff'}); 31 jQuery('#navmediacontainer a:first').css({'backgroundColor':'#fff' , 'color': '#000'}); 32 33 if(jQuery('.media_tab_data').parents('.updb-view-media-music').length) { 34 35 jQuery('.media_tab_data').show(); 36 document.getElementById("photo_tab_data"+user_id).style.display="block"; 37 document.getElementById("video_tab_data"+user_id).style.display="block"; 38 document.getElementById("music_tab_data"+user_id).style.display="block"; 39 } 40 41}); 42 43function media_manager_like(mediaid,uid,totallike,totaldislike) 44{ 45 46 str = 'action=media_manager_like&media_id='+mediaid+'&user_id='+uid; 47 jQuery.ajax({ 48 url: userpro_ajax_media_url, 49 data: str, 50 type: 'POST', 51 success:function(data){ 52 jQuery('.userpro_likedislike_'+mediaid).hide(); 53 var like=totallike+1; 54 var dislike=totaldislike; 55 56 jQuery('.userpro_likedislike_'+mediaid).html('<i style="color:green;opacity: 0.5;" class="userpro_media_like fa fa-thumbs-up"></i>'+like+' <i style="color:black;opacity: 0.5;" class="userpro_media_like fa fa-thumbs-down"></i>'+dislike).show(); 57 }, 58 error:function(data){ 59 alert(data); 60 } 61 }); 62} 63function media_manager_dislike(mediaid,uid,totaldislike,totallike) 64{ 65 str = 'action=media_manager_dislike&media_id='+mediaid+'&user_id='+uid; 66 jQuery.ajax({ 67 url: userpro_ajax_media_url, 68 data: str, 69 type: 'POST', 70 success:function(data){ 71 jQuery('.userpro_likedislike_'+mediaid).hide(); 72 var like=totallike; 73 var dislike=totaldislike+1; 74 jQuery('.userpro_likedislike_'+mediaid).html('<i style="color:black;opacity: 0.5;" class="userpro_media_like fa fa-thumbs-up"></i>'+like+' <i style="color:red;opacity: 0.5;" class="userpro_media_like fa fa-thumbs-down"></i>'+dislike).show(); 75 76 77 }, 78 error:function(data){ 79 alert(data); 80 } 81 }); 82} 83function save_img_caption(capid,lable) 84{ 85 var cap= document.getElementById(capid); 86 var caplable=lable; 87 if(cap.value!='') 88 { 89 str = 'action=add_capto_img&cap='+cap.value+'&caplable='+caplable; 90 jQuery.ajax({ 91 url: userpro_ajax_media_url, 92 data: str, 93 type: 'POST', 94 success:function(data){ 95 96 97 98 99 }, 100 error:function(data){ 101 alert(data); 102 } 103 }); 104 } 105} 106 107function userpro_save_media_restriction(mediaId){ 108 109 var radiovalue= jQuery('input[name="public-'+mediaId+'"]:checked').val(); 110 111 str = 'action=userpro_save_media_restriction&media_id='+mediaId+'&radiovalue='+radiovalue; 112 jQuery.ajax({ 113 url: userpro_ajax_media_url, 114 data: str, 115 dataType: 'JSON', 116 type: 'POST', 117 success:function(data){ 118 119 }, 120 error:function(data){ 121 alert(data); 122 } 123 }); 124 125} 126 127 128function userpro_delete_youtubeurl(media_id,user_id,elm) 129{ 130 131 132 str = 'action=delete_youtubeurl&media_id='+media_id; 133 jQuery.ajax({ 134 url: userpro_ajax_media_url, 135 data: str, 136 dataType: 'JSON', 137 type: 'POST', 138 success:function(data){ 139 140 jQuery(elm).parent().remove(); 141 142 143 }, 144 error:function(data){ 145 alert(data); 146 } 147 }); 148} 149 150function mediamanager_youtube_url(elm) 151{ 152 var youtube_url=jQuery('#youtube_url').val(); 153 154 155 str = 'action=userpro_add_youtube_url&url='+youtube_url; 156 jQuery.ajax({ 157 url: userpro_ajax_media_url, 158 data: str, 159 type: 'POST', 160 success:function(data){ 161 162 if(data=='Invalid iFrame url') 163 { 164 alert("Invalid iFrame url"); 165 jQuery('#youtube_url').val(''); 166 } 167 else 168 { 169 jQuery('#youtube_url').val(''); 170 jQuery('#userinput').after(data); 171 } 172 }, 173 error:function(data){ 174 alert(data); 175 } 176 }); 177} 178function userpro_delete_files(file_name,user_id,file_id){ 179 str = 'action=userpro_media_delete&file_name='+file_name+'&user_id='+user_id; 180 jQuery.ajax({ 181 url: userpro_ajax_media_url, 182 data: str, 183 dataType: 'JSON', 184 type: 'POST', 185 success:function(data){ 186 jQuery('#'+file_id).remove(); 187 }, 188 error:function(data){ 189 alert(data); 190 } 191 }); 192} 193 194function userpro_media_manager(){ 195jQuery(".userpro-media-upload").each(function(){ 196 var allowed = jQuery(this).data('allowed_extensions'); 197 var filetype = jQuery(this).data('filetype'); 198 var media_type = jQuery(this).data('media_type'); 199 var form = jQuery(this).parents('.userpro').find('form'); 200 var upload_limit=jQuery(this).data('upload_limit'); 201 202 jQuery(this).uploadFile({ 203 url: userpro_media_upload_url+"?upload_limit="+upload_limit+"&filetype="+filetype, 204 allowedTypes: allowed, 205 multiple:true, 206 onSubmit:function(files){ 207 var statusbar = jQuery('.ajax-file-upload-statusbar:visible'); 208 statusbar.parents('.userpro-input').find('.red').hide(); 209 if (statusbar.parents('.userpro-input').find('img.default').length){ 210 statusbar.parents('.userpro-input').find('img.default').show(); 211 statusbar.parents('.userpro-input').find('img.modified').remove(); 212 } 213 }, 214 onSuccess:function(files,data,xhr){ 215 try{ 216 data= jQuery.parseJSON(data); 217 data = data.ret; 218 } 219 catch(e){ 220 alert("Upload Limit Exceeded."); 221 var statusbar = jQuery('.ajax-file-upload-statusbar:visible'); 222 statusbar.hide(); 223 } 224 if(data.limit_exceed=="1") 225 { 226 alert("Upload Limit Exceeded."); 227 var statusbar = jQuery('.ajax-file-upload-statusbar:visible'); 228 statusbar.hide(); 229 } 230 else 231 {
232 try{ 233 var statusbar = jQuery('.ajax-file-upload-statusbar:visible'); 234 var src="",srcname="",medianame="",thumbnail_path=""; 235 var media_count=data.length; 236 for(count=0;count<data.length;count++) 237 { 238 src += data[count].target_file_uri+'------'; 239 srcname += data[count].target_file_name+'------'; 240 medianame +=data[count].media_name+'------'; 241 thumbnail_path +=data[count].thumbnail_path+'------'; 242 243 } 244 } 245 catch(e){ 246 alert("Upload Limit Exceeded."); 247 var statusbar = jQuery('.ajax-file-upload-statusbar:visible'); 248 statusbar.hide(); 249 250 } 251 str = 'action=userpro_media_upload&filetype='+filetype+'&src='+src+'&media_type='+media_type+'&srcname='+srcname+'&media_name='+medianame+'&thumbnail_path='+thumbnail_path; 252 jQuery.ajax({ 253 url: userpro_ajax_media_url, 254 data: str, 255 dataType: 'JSON', 256 type: 'POST', 257 success:function(data){ 258 statusbar.prev().fadeIn( function() { 259 if (filetype == 'media'){ 260 261 statusbar.parents('.userpro-input').prepend( data.response ); 262 263 } else if (filetype == 'photo'){ 264 265 statusbar.parents('.userpro-input').prepend( data.response ); 266 267 } else if (filetype == 'video'){ 268 269 statusbar.parents('.userpro-input').prepend( data.response ); 270 271 } else if (filetype == 'music'){ 272 273 statusbar.parents('.userpro-input').prepend( data.response ); 274 275 } 276 statusbar.hide(); 277 }); 278 statusbar.parents('.userpro-input').find('input:hidden').val( src ); 279 statusbar.parents('.userpro-input').find('.userpro-pic-none').hide(); 280 281 // re-validate 282 form.find('input').each(function(){ 283 jQuery(this).trigger('blur'); 284 }); 285 286 } 287 }); 288 } 289 } 290 }); 291}); 292 293} 294 295function get_previous_page_media(){ 296 document.getElementById("count").value--; 297 if(document.getElementById("count").value<=1) 298 { 299 document.getElementById("previous_page").style.display="none"; 300 } 301 if(document.getElementById("total_page_count").value != document.getElementById("count").value) 302 { 303 document.getElementById("next_page").style.display="block"; 304 } 305 for(i=0;i<parseInt(document.getElementById("total_media_count").value,10);i++) 306 { 307 if(document.getElementById(i)!=null) 308 { 309 if(Math.floor(i/parseInt(document.getElementById("media_per_page").value,10))==(parseInt(document.getElementById("count").value)-1)) 310 { 311 document.getElementById(i).style.display="block"; 312 } 313 else 314 { 315 document.getElementById(i).style.display="none"; 316 } 317 } 318 } 319} 320 321function get_next_page_media(){ 322 document.getElementById("count").value++; 323 if(document.getElementById("count").value>=2) 324 { 325 document.getElementById("previous_page").style.display="block"; 326 } 327 if(document.getElementById("total_page_count").value == document.getElementById("count").value) 328 { 329 document.getElementById("next_page").style.display="none"; 330 } 331 for(i=0;i<parseInt(document.getElementById("total_media_count").value,10);i++) 332 { 333 if(document.getElementById(i)!=null) 334 { 335 if(Math.floor(i/parseInt(document.getElementById("media_per_page").value,10))==(parseInt(document.getElementById("count").value)-1)) 336 { 337 document.getElementById(i).style.display="block"; 338 } 339 else 340 { 341 document.getElementById(i).style.display="none"; 342 } 343 } 344 } 345} 346 347 348function get_previous_page_media_video(){ 349 document.getElementById("count_video").value--; 350 if(document.getElementById("count_video").value<=1) 351 { 352 document.getElementById("previous_page_video").style.display="none"; 353 } 354 if(document.getElementById("total_page_count_video").value != document.getElementById("count").value) 355 { 356 document.getElementById("next_page_video").style.display="block"; 357 } 358 for(i=0;i<parseInt(document.getElementById("total_media_count_video").value,10);i++) 359 { 360 if(document.getElementById(i+"_video")!=null) 361 { 362 if(Math.floor(i/parseInt(document.getElementById("media_per_page_video").value,10))==(parseInt(document.getElementById("count_video").value)-1)) 363 { 364 document.getElementById(i+"_video").style.display="block"; 365 } 366 else 367 { 368 document.getElementById(i+"_video").style.display="none"; 369 } 370 } 371 } 372} 373 374function get_next_page_media_video(){ 375 document.getElementById("count_video").value++; 376 if(document.getElementById("count_video").value>=2) 377 { 378 document.getElementById("previous_page_video").style.display="block"; 379 } 380 if(document.getElementById("total_page_count_video").value == document.getElementById("count_video").value) 381 { 382 document.getElementById("next_page_video").style.display="none"; 383 } 384 for(i=0;i<parseInt(document.getElementById("total_media_count_video").value,10);i++) 385 { 386 if(document.getElementById(i+"_video")!=null) 387 { 388 if(Math.floor(i/parseInt(document.getElementById("media_per_page_video").value,10))==(parseInt(document.getElementById("count_video").value)-1)) 389 { 390 document.getElementById(i+"_video").style.display="block"; 391 } 392 else 393 { 394 document.getElementById(i+"_video").style.display="none"; 395 } 396 } 397 } 398} 399 400function get_previous_page_media_music(){ 401 document.getElementById("count_music").value--; 402 if(document.getElementById("count_music").value<=1) 403 { 404 document.getElementById("previous_page_music").style.display="none"; 405 } 406 if(document.getElementById("total_page_count_music").value != document.getElementById("count").value) 407 { 408 document.getElementById("next_page_music").style.display="block"; 409 } 410 for(i=0;i<parseInt(document.getElementById("total_media_count_music").value,10);i++) 411 { 412 if(document.getElementById(i+"_music")!=null) 413 { 414 if(Math.floor(i/parseInt(document.getElementById("media_per_page_music").value,10))==(parseInt(document.getElementById("count_music").value)-1)) 415 { 416 document.getElementById(i+"_music").style.display="block"; 417 } 418 else 419 { 420 document.getElementById(i+"_music").style.display="none"; 421 } 422 } 423 } 424} 425 426function get_next_page_media_music(){ 427 document.getElementById("count_music").value++; 428 if(document.getElementById("count_music").value>=2) 429 { 430 document.getElementById("previous_page_music").style.display="block"; 431 } 432 if(document.getElementById("total_page_count_music").value == document.getElementById("count_music").value) 433 { 434 document.getElementById("next_page_music").style.display="none"; 435 } 436 for(i=0;i<parseInt(document.getElementById("total_media_count_music").value,10);i++) 437 { 438 if(document.getElementById(i+"_music")!=null) 439 { 440 if(Math.floor(i/parseInt(document.getElementById("media_per_page_music").value,10))==(parseInt(document.getElementById("count_music").value)-1)) 441 { 442 document.getElementById(i+"_music").style.display="block"; 443 } 444 else 445 { 446 document.getElementById(i+"_music").style.display="none"; 447 } 448 } 449 } 450} 451
452function change_media_tab(i,user_id){ 453 454 jQuery('.media_tab_data').hide(); 455 jQuery('#navmediacontainer li a').css({'backgroundColor':'#555' , 'color': '#fff'}); 456 if(i==user_id+'1') 457 { 458 document.getElementById("photo_tab_data"+user_id).style.display="block"; 459 document.getElementById("photo_tab"+user_id).style.backgroundColor="#fff"; 460 document.getElementById("photo_tab"+user_id).style.color="#000"; 461 } 462 if(i==user_id+'2') 463 { 464 document.getElementById("video_tab_data"+user_id).style.display="block"; 465 document.getElementById("video_tab"+user_id).style.backgroundColor="#fff"; 466 document.getElementById("video_tab"+user_id).style.color="#000"; 467 468 } 469 if(i==user_id+'3') 470 { 471 document.getElementById("music_tab_data"+user_id).style.display="block"; 472 document.getElementById("music_tab"+user_id).style.backgroundColor="#fff"; 473 document.getElementById("music_tab"+user_id).style.color="#000"; 474 } 475 if(i==user_id+'4') 476 { 477 document.getElementById("instagram_tab_data"+user_id).style.display="block"; 478 document.getElementById("instagram_tab"+user_id).style.backgroundColor="#fff"; 479 document.getElementById("instagram_tab"+user_id).style.color="#000"; 480 } 481 482} 483 484function delete_temp_media(id){ 485 str = 'action=userpro_temp_media_delete&file_name='+id; 486 jQuery.ajax({ 487 url: userpro_ajax_media_url, 488 data: str, 489 dataType: 'JSON', 490 type: 'POST', 491 success:function(data){ 492 alert("File has been removed successfully"); 493 var deletedMedia=document.getElementById(id); 494 deletedMedia.style.display='none'; 495 }, 496 error:function(data){ 497 alert("Error in deleting file"); 498 } 499 }); 500} 501
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.