clipbucket/upload/js/functions.min.js

1 line
26 KiB
JavaScript
Raw Permalink Normal View History

function Confirm_Delete(e){confirm("Are you sure you want to delete")&&(document.location=e)}function Confirm_Uninstall(e){confirm("Are you sure you want to uninstall this plugin ?")&&(document.location=e)}function confirm_it(e){var t=confirm(e);return t?!0:!1}function reloadImage(e,t){img=document.getElementById(t),img.src=e+"?"+Math.random()}function validate_category_form(thisform){with(thisform){if(0==validate_required(title,"Title must be filled out!"))return title.focus(),!1;if(0==validate_required(description,"Description must be filled out!"))return description.focus(),!1}}function validate_ad_form(thisform){with(thisform){if(0==validate_required(name,"Name must be filled out!"))return name.focus(),!1;if(0==validate_required(type,"Type must be filled out!"))return type.focus(),!1;if(0==validate_required(syntax,"Syntax Must Be Filled Out"))return syntax.focus(),!1;if(0==validate_required(code,"Code Must Be Filled Out"))return code.focus(),!1}}function load_more(e,t,o,a,n,i,l){$.ajax({beforeSend:function(e){$("#"+o).html("loading")},type:"POST",url:baseurl+"/ajax.php",data:{limit:e,mode:t,inner_mode:o,cat_id:i,total:l},dataType:"json",success:function(e){e&&($("#"+a).append(e.template),$(n).attr({limit:parseInt(e.count)+parseInt(e.total)})),1==e.limit_exceeds&&n.css("display","none"),"limit_exceeds"==e&&n.css("display","none"),$("#"+o).html("Laod More...")}})}function randomString(){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",t=8,o="",a=0;t>a;a++){var n=Math.floor(Math.random()*e.length);o+=e.substring(n,n+1)}return o}function check_remote_url(){$("#remoteUploadBttn").attr("disabled","disabled").hide(),$("#ytUploadBttn").attr("disabled","disabled"),$("#remoteUploadBttnStop").show();var e=$("#remote_file_url").val();if(force_stop=!1,!e||"undefined"==e)return $("#error_msgs").html('<div class="alert alert-danger" role="alert"> Please enter valid remote URL</div>'),$("#remoteUploadBttn").attr("disabled","").show(),$("#remoteUploadBttnStop").attr("disabled","disabled").hide(),!1;var t=$.ajax({url:download_page,type:"POST",data:{file:e,file_name:file_name},dataType:"json",beforeSend:function(){status_update();var t=getName(e);$("#loading").html('<div style="float: left; display: inline-block;"><img src="'+imageurl+'/ajax-loader.gif"></div><div style="float: left; line-height: 16px; padding-left:5px">'+lang.remoteUploadFile+'</div><div class="clear"></div>'),$("#remoteFileName").replaceWith('"'+t+'"')},success:function(e){e.error&&(force_stop=!0,$("#remoteUploadBttn").attr("disabled",""),$("#ytUploadBttn").attr("disabled",""),alert(e.error)),$("#loading").html("");var t=e.vid;$.post(baseurl+"/actions/file_uploader.php",{getForm:"get_form",title:$("#remote_file_url").val(),objId:remoteObjID,vid:t},function(e){$("#remoteUploadBttnStop").hide(),$("#ytUploadBttn").hide(),$("#remoteForm").append(e),$("#cbSubmitUpload"+remoteObjID).before('<span id="updateVideoDataLoading" style="margin-right:5px"></span>').attr("disabled","").attr("value",lang.saveData).attr("onClick","doUpdateVideo('#uploadForm"+remoteObjID+"','"+remoteObjID+"')").after('<input type="hidden" name="videoid" value="'+t+'" id="videoid" />').after('<input type="hidden" name="updateVideo" value="yes" id="updateVideo" />')},"text")}});$("#remoteUploadBttnStop").click(function(){t.abort(),force_stop=!0,$("#loading").html(""),$("#remoteDownloadStatus").hide(),$(this).hide(),$("#remoteUploadBttn").attr("disabled","").show()})}function youtube_upload(){$("#remoteUploadBttn").attr("disabled","disabled"),$("#ytUploadBttn").attr("disabled","disabled");var e=$("#remote_file_url").val();if(force_stop=!1,!e||"undefined"==e)return"#error_msgs".html('<div class="alert alert-danger" role="alert"> Please enter valid URL</div>'),$("#remoteUploadBttn").button("reset"),$("#ytUploadBttn").button("reset"),force_stop=!0,!1;$.ajax({url:download_page,type:"POST",data:{file:e,file_name:file_name,youtube:"yes"},dataType:"json",beforeSend:function(){$("#loading").html('<div style="float: left; display: inline-block;"><img src="'+imageurl+'/ajax-loader.gif"><