clipbucket/upload/js/clipbucket.min.js

1 line
30 KiB
JavaScript
Raw Normal View History

2016-07-26 17:36:52 +05:00
!function(window){var _cb=function(){if(this.baseurl=baseurl,this.imageurl="",this.page=this.baseurl+"/ajax.php",this.loading_img="<img style='vertical-align:middle' src='"+this.imageurl+"/ajax-loader.gif'>",this.loading=this.loading_img+" Loading...",this.download=0,this.total_size=0,this.cur_speed=0,this.status_refesh=1,this.result_page=this.baseurl+"/actions/file_results.php",this.download_page=this.baseurl+"/actions/file_downloader.php",this.count=0,this.hasLoaded=!1,this.perc_download=0,this.force_stop=!1,this.remoteObjID="",this.current_menu="",this.normal_player_html="",this.hq_player_html="",this.has_hq_function=!1,this.collectionID=!1,this.keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",this.ua=navigator.userAgent.toLowerCase(),this.ua.indexOf(" chrome/")>=0||this.ua.indexOf(" firefox/")>=0||this.ua.indexOf(" gecko/")>=0);else;this.setRemoteId=function(){this.remoteObjID=this.randomString()},this.Confirm_Delete=function(t){confirm("Are you sure you want to delete")&&(document.location=t)},this.Confirm_Uninstall=function(t){confirm("Are you sure you want to uninstall this plugin ?")&&(document.location=t)},this.confirm_it=function(t){var e=confirm(t);return e?!0:!1},this.reloadImage=function(t,e){img=document.getElementById(e),img.src=t+"?"+Math.random()},this.validate_category_form=function(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}},this.validate_ad_form=function(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}},this.randomString=function(){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",e=8,a="",o=0;e>o;o++){var i=Math.floor(Math.random()*t.length);a+=t.substring(i,i+1)}return a},this.check_remote_url=function(){var t=this,e=$("#remote_file_url").val(),a=$("#ytUploadBttn"),o=$("#remoteUploadBttn"),i=$("#remoteUploadBttnStop");if(this.force_stop=!1,e.match(/^e.g/)||"undefined"==typeof e||0===e.length)return $("#error_msgs").html('<div class="alert alert-danger" role="alert">Given URL is invalid!</div>'),!1;var s=function(t){"undefined"!=typeof t?(o.attr("disabled","disabled"),a.attr("disabled","disabled")):($(".downloadStatusContainer").removeClass("hidden"),o.attr("disabled","disabled").hide(),a.attr("disabled","disabled"),i.show())},n=function(t){"undefined"!=typeof t?(i.removeAttr("disabled").hide(),a.removeAttr("disabled"),o.removeAttr("disabled").show()):($(".downloadStatusContainer").addClass("hidden"),i.removeAttr("disabled").hide(),a.removeAttr("disabled"),o.removeAttr("disabled").show())};s();var l=$.ajax({url:t.download_page,type:"POST",data:{file:e,file_name:file_name},dataType:"JSON",beforeSend:function(){t.remoteUploadStatusUpdate();var a=t.getName(e);$("#loading").html("Downloading"),$("#remoteFileName").replaceWith('"'+a+'"')},success:function(e){if(t.force_stop=!0,e.error)return t.force_stop=!0,n(),$("#error_msgs").html('<div class="alert alert-danger" role="alert"> File Type Not Allowed!</div>'),!1;n(),$("#loading").html("");var a=e.vid;$.post(t.baseurl+"/actions/getVideoDetails.php",{file_name:file_name,vid:a},function(t){var e=$("#updateVideoInfoForm").clone();$(e).find("input[name=title]").val(t.title),$(e).find("textarea#desc").val(t.description),$(e).find("input[name='category[]']:first").attr("checked","checked");var o=document.createElement("input");o.name="videoid",o.type="hidden",o.value=a;var i=document.createElement("input");i.name="file_name",i.type="hidden",i.value=file_name,$(e).append(o),$(e).append(i),$("#remoteForm").html(""),$(e).removeClass("hidden").attr("id","uploadFormContainer_remote").appendTo("#remoteForm"),$(e).find("form").on({submit:function(t){t.preventD