clipbucket/upload/js/clipbucket.min.js

1 line
33 KiB
JavaScript
Raw Normal View History

!function(window){var _cb=function(){var self=this;if(this.baseurl=baseurl,this.imageurl="",this.page=this.baseurl+"/ajax.php",this.loading_img="<img allign='center' style='vertical-align:middle' src='"+imageurl+"/ajax-loader-big.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)var StringMaker=function(){this.str="",this.length=0,this.append=function(t){this.str+=t,this.length+=t.length},this.prepend=function(t){this.str=t+this.str,this.length+=t.length},this.toString=function(){return this.str}};else var StringMaker=function(){this.parts=[],this.length=0,this.append=function(t){this.parts.push(t),this.length+=t.length},this.prepend=function(t){this.parts.unshift(t),this.length+=t.length},this.toString=function(){return this.parts.join("")}};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){return!!confirm(t)},this.reloadImage=function(t,e){img=document.getElementById(e),img.src=t+"?"+Math.random()},this.validate_category_form=function(thisform){var self=this;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){var self=this;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="",a=0;a<8;a++){var i=Math.floor(Math.random()*t.length);e+=t.substring(i,i+1)}return e},this.check_remote_url=function(){var t=this,e=$("#remote_file_url").val(),a=$("#ytUploadBttn"),i=$("#remoteUploadBttn"),s=$("#remoteUploadBttnStop");if(this.force_stop=!1,e.match(/^e.g/)||void 0===e||0===e.length)return $("#error_msgs").html('<div class="alert alert-danger" role="alert">Given URL is invalid!</div>'),!1;var o,n=function(t){void 0!==t?(s.removeAttr("disabled").hide(),a.removeAttr("disabled"),i.removeAttr("disabled").show()):($(".downloadStatusContainer").addClass("hidden"),s.removeAttr("disabled").hide(),a.removeAttr("disabled"),i.removeAttr("disabled").show())};void 0!==o?(i.attr("disabled","disabled"),a.attr("disabled","disabled")):($(".downloadStatusContainer").removeClass("hidden"),i.attr("disabled","disabled").hide(),a.attr("disabled","disabled"),s.show());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").va