From 7432dcfdecd8bee8c2c90055f9b325bbed55e25c Mon Sep 17 00:00:00 2001 From: Alfred Egger Date: Tue, 19 Sep 2017 12:00:25 +0200 Subject: [PATCH] Add updated minified files --- js/add.min.js | 11 +---------- js/ocdownloader.min.js | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/js/add.min.js b/js/add.min.js index 3b04582..eb85fc5 100644 --- a/js/add.min.js +++ b/js/add.min.js @@ -1,10 +1 @@ -/** - * ownCloud - ocDownloader - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the LICENSE file. - * - * @author Xavier Beurois - * @copyright Xavier Beurois 2015 - */ - $(document).ready(function(){$("#ball").Badger("..."),$("#bcompletes").Badger("..."),$("#bactives").Badger("..."),$("#bwaitings").Badger("..."),$("#bstopped").Badger("..."),$("#bremoved").Badger("..."),OCDLR.Utils.UpdateQueue(!0,"add"),$("#NewDL").bind("click",function(){$(this).children("ul").is(":visible")?$(this).children("ul").hide():$(this).children("ul").show()}),$("#NewDL").children("div").children("p").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#NewDL").children("div").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#option-ftp-pasv").prop("checked",!0),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0),$("#option-bt-rmtorrent").prop("checked",!0),$("#TorrentsList").bind("click",function(){OCDLR.Utils.GetTorrentsList($(this).children("ul"))}),$("#app-content-wrapper .content-page[rel=OCDHTTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"http",e.val(),{HTTPUser:$("#option-http-user").val(),HTTPPasswd:$("#option-http-pwd").val(),HTTPReferer:$("#option-http-referer").val(),HTTPUseragent:$("#option-http-useragent").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-http-user").val(""),$("#option-http-pwd").val(""),$("#option-http-referer").val(""),$("#option-http-useragent").val("")}),$("#app-content-wrapper .content-page[rel=OCDFTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"ftp",e.val(),{FTPUser:$("#option-ftp-user").val(),FTPPasswd:$("#option-ftp-pwd").val(),FTPPasv:$("#option-ftp-pasv").prop("checked"),FTPReferer:$("#option-ftp-referer").val(),FTPUseragent:$("#option-ftp-useragent").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-ftp-user").val(""),$("#option-ftp-pwd").val(""),$("#option-ftp-pasv").prop("checked",!0),$("#option-ftp-referer").val(""),$("#option-ftp-useragent").val("")}),$("#app-content-wrapper .content-page[rel=OCDYT] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"yt",e.val(),{YTExtractAudio:$("#option-yt-extractaudio").prop("checked"),YTForceIPv4:$("#option-yt-forceipv4").prop("checked")}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0)}),$("#app-content-wrapper .content-page[rel=OCDBT] div.launch").bind("click",function(){var e=$("#TorrentsList").children("a"),o=t("ocdownloader","Select a file.torrent");e.text().trim()!=o.trim()&&"File"==e.prop("data-rel")&&OCDLR.Utils.AddDownload($(this),"bt",e.text(),{BTRMTorrent:$("#option-bt-rmtorrent").prop("checked")}),e.text(o),$("#option-bt-rmtorrent").prop("checked",!0)});var e=$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile #uploadfile").fileupload({autoUpload:!0,sequentialUploads:!0,type:"POST",dataType:"json"});e.on("fileuploadstart",function(t,e){$("#TorrentsList").children("ul").hide(),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-upload"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!0)}),e.on("fileuploaddone",function(t,e){e.result.ERROR?OCDLR.Utils.PrintError(e.result.MESSAGE):OCDLR.Utils.PrintInfo(e.result.MESSAGE),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!1),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-upload")}),e.on("fileuploadfail",function(e,o){OCDLR.Utils.PrintError(t("ocdownloader","Error while uploading torrent file"))}),OCDLR.Utils.GetCounters()}); +$(document).ready(function(){$("#ball").Badger("..."),$("#bcompletes").Badger("..."),$("#bactives").Badger("..."),$("#bwaitings").Badger("..."),$("#bstopped").Badger("..."),$("#bremoved").Badger("..."),OCDLR.Utils.UpdateQueue(!0,"add"),$("#NewDL").bind("click",function(){$(this).children("ul").is(":visible")?$(this).children("ul").hide():$(this).children("ul").show()}),$("#NewDL").children("div").children("p").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#NewDL").children("div").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#option-ftp-pasv").prop("checked",!0),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0),$("#option-bt-rmtorrent").prop("checked",!0),$("#TorrentsList").bind("click",function(){OCDLR.Utils.GetTorrentsList($(this).children("ul"))}),$("#app-content-wrapper .content-page[rel=OCDHTTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"http",e.val(),{HTTPUser:$("#option-http-user").val(),HTTPPasswd:$("#option-http-pwd").val(),HTTPReferer:$("#option-http-referer").val(),HTTPUseragent:$("#option-http-useragent").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-http-user").val(""),$("#option-http-pwd").val(""),$("#option-http-referer").val(""),$("#option-http-useragent").val("")}),$("#app-content-wrapper .content-page[rel=OCDFTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"ftp",e.val(),{FTPUser:$("#option-ftp-user").val(),FTPPasswd:$("#option-ftp-pwd").val(),FTPPasv:$("#option-ftp-pasv").prop("checked"),FTPReferer:$("#option-ftp-referer").val(),FTPUseragent:$("#option-ftp-useragent").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-ftp-user").val(""),$("#option-ftp-pwd").val(""),$("#option-ftp-pasv").prop("checked",!0),$("#option-ftp-referer").val(""),$("#option-ftp-useragent").val("")}),$("#app-content-wrapper .content-page[rel=OCDYT] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"yt",e.val(),{YTExtractAudio:$("#option-yt-extractaudio").prop("checked"),YTForceIPv4:$("#option-yt-forceipv4").prop("checked")}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0)}),$("#app-content-wrapper .content-page[rel=OCDBT] div.launch").bind("click",function(){var e=$("#TorrentsList").children("a"),o=t("ocdownloader","Select a file.torrent");e.text().trim()!=o.trim()&&"File"==e.prop("data-rel")&&OCDLR.Utils.AddDownload($(this),"bt",e.text(),{BTRMTorrent:$("#option-bt-rmtorrent").prop("checked")}),e.text(o),$("#option-bt-rmtorrent").prop("checked",!0)});var e=$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile #uploadfile").fileupload({autoUpload:!0,sequentialUploads:!0,type:"POST",dataType:"json"});e.on("fileuploadstart",function(t,e){$("#TorrentsList").children("ul").hide(),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-upload"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!0)}),e.on("fileuploaddone",function(t,e){e.result.ERROR?OCDLR.Utils.PrintError(e.result.MESSAGE):OCDLR.Utils.PrintInfo(e.result.MESSAGE),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!1),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-upload")}),e.on("fileuploadfail",function(e,o){OCDLR.Utils.PrintError(t("ocdownloader","Error while uploading torrent file"))}),OCDLR.Utils.GetCounters()}); \ No newline at end of file diff --git a/js/ocdownloader.min.js b/js/ocdownloader.min.js index 3d06a4a..593e815 100644 --- a/js/ocdownloader.min.js +++ b/js/ocdownloader.min.js @@ -1,10 +1 @@ -/** - * ownCloud - OCDLR - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the LICENSE file. - * - * @author Xavier Beurois - * @copyright Xavier Beurois 2015 - */ -OCDLR={},function(){OCDLR.Utils={BaseURL:"/apps/ocdownloader/",BaseID:"#app-content-wrapper ",MenuID:"#app-navigation ",Queue:"",QueueHeader:"",QueueElt:"",DownloadsFolder:"",TorrentsFolder:"",WhichDownloader:"",BadgerStatus:[],ValidURL:function(e){return/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},PrintError:function(e){$(OCDLRSelf.BaseID+"span.muted").removeClass("info alert"),$(OCDLRSelf.BaseID+"span.muted").addClass("alert").text(e)},PrintInfo:function(e){$(OCDLRSelf.BaseID+"span.muted").removeClass("info alert"),$(OCDLRSelf.BaseID+"span.muted").addClass("info").text(e)},CheckVersion:function(){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"updater/check"),method:"GET",dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(e){!e.ERROR&&e.RESULT&&($(OCDLRSelf.MenuID+".nav-updater").show(),$(OCDLRSelf.MenuID+".nav-updater .button").bind("click",function(){OCDLRSelf.AddDownload($(this),"http","https://github.com/DjazzLab/ocdownloader/archive/master.zip",{HTTPUser:"",HTTPPasswd:""})}))}})},UpdateQueue:function(e,a){var t=setInterval(function(){clearInterval(t),$(OCDLRSelf.QueueElt).length>0&&($(OCDLRSelf.BaseID+".loadingtext").show(),$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/get"),method:"POST",data:{VIEW:a},dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(t){if(t.ERROR)OCDLRSelf.PrintError(t.MESSAGE);else{0!=$(OCDLRSelf.QueueElt+'[data-rel="LOADER"]').length&&$(OCDLRSelf.QueueElt+'[data-rel="LOADER"]').remove(),$("#ball").Badger(t.COUNTER.ALL),$("#bcompletes").Badger(t.COUNTER.COMPLETES),$("#bactives").Badger(t.COUNTER.ACTIVES),$("#bwaitings").Badger(t.COUNTER.WAITINGS),$("#bstopped").Badger(t.COUNTER.STOPPED),$("#bremoved").Badger(t.COUNTER.REMOVED);var l=[];$.each(t.QUEUE,function(t,d){var n=OCDLRSelf.QueueElt+'[data-rel="'+d.GID+'"]';l.push(d.GID),e&&0==$(n).length&&OCDLRSelf.PrependToQueue(d,a),0==$(n+' > td[data-rel="ACTION"] > div.icon-pause').length&&1==d.STATUSID&&OCDLRSelf.ActionPause($(n+' > td[data-rel="ACTION"]'),a),0==$(n+' > td[data-rel="ACTION"] > div.icon-play').length&&3==d.STATUSID&&OCDLRSelf.ActionUnPause($(n+' > td[data-rel="ACTION"]'),a),"100%"==d.PROGRESSVAL?($(n+' > td[data-rel="FILENAME"]').html(''+d.FILENAME_SHORT+""),d.ISTORRENT&&"--"!=d.SPEED?$(n+' > td[data-rel="SPEED"]').html('
'+d.SPEED):($(n+' > td[data-rel="SPEED"]').html(d.SPEED),d.ISTORRENT||($(n+' > td[data-rel="ACTION"] > div.icon-pause').remove(),$(n+' > td[data-rel="ACTION"] > div.icon-play').remove()))):$(n+' > td[data-rel="SPEED"]').html("--"!=d.SPEED?'
'+d.SPEED:d.SPEED),$(n+' > td[data-rel="MESSAGE"] > div.pb-wrap > div.pb-value > div.pb-text').html(d.PROGRESS),$(n+' > td[data-rel="MESSAGE"] > div.pb-wrap > div.pb-value').css("width",d.PROGRESSVAL),$(n+' > td[data-rel="STATUS"]').text(d.STATUS)}),OCDLRSelf.RemoveQueueItems(l)}$(OCDLRSelf.BaseID+".loadingtext").hide()}})),OCDLRSelf.UpdateQueue("add"==a?!1:!0,a)},3e3)},RemoveQueueItem:function(e){1==e.parent().children().length&&$(OCDLRSelf.Queue+' th[data-rel="ACTION"] > div').remove(),e.remove()},RemoveQueueItems:function(e){$(OCDLRSelf.QueueElt).each(function(){-1==e.indexOf($(this).attr("data-rel"))&&$(this).remove()}),0==$(OCDLRSelf.QueueElt).length&&$(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div').remove()},HideFromQueue:function(e){e.addClass("icon-loading-small"),e.removeClass("icon-close");var a=e.parent().parent(),l=a.attr("data-rel");l?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/hide"),method:"POST",dataType:"json",data:{GID:l},async:!0,cache:!1,timeout:3e4,success:function(t){t.ERROR?(OCDLRSelf.PrintError(t.MESSAGE),e.addClass("icon-close"),e.removeClass("icon-loading-small")):(OCDLRSelf.PrintInfo(t.MESSAGE+" ("+l+")"),OCDLRSelf.RemoveQueueItem(a))}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},HideAllFromQueue:function(e){e.addClass("icon-loading-small"),e.removeClass("icon-close");var a=[];$(OCDLRSelf.QueueElt+' td[data-rel="ACTION"] > div.icon-close').each(function(){$(this).addClass("icon-loading-small"),$(this).removeClass("icon-close"),a.push($(this).parent().parent().attr("data-rel"))}),a.length>0?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/hideall"),method:"POST",dataType:"json",data:{GIDS:a},async:!0,cache:!1,timeout:3e4,success:function(e){e.ERROR?OCDLRSelf.PrintError(e.MESSAGE):(OCDLRSelf.PrintInfo(e.MESSAGE),$.each(e.QUEUE,function(e,a){$(OCDLRSelf.QueueElt+'[data-rel="'+a.GID+'"]').remove()}),$(OCDLRSelf.Queue+' th[data-rel="ACTION"] > div.icon-loading-small').remove())}}):OCDLRSelf.PrintError(t("ocdownloader","No downloads in the queue ..."))},PauseDownload:function(e,a){e.addClass("icon-loading-small"),e.removeClass("icon-pause"),$("#bactives").Badger("-1"),$("#bstopped").Badger("+1");var l=e.parent().parent(),d=l.attr("data-rel");d?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/pause"),method:"POST",dataType:"json",data:{GID:d},async:!0,cache:!1,timeout:3e4,success:function(n){n.ERROR?(OCDLRSelf.PrintError(n.MESSAGE),e.addClass("icon-pause")):(OCDLRSelf.PrintInfo(n.MESSAGE+" ("+d+")"),["add","all"].indexOf(a)>-1?(e.addClass("icon-play"),e.parent().parent().children('td[data-rel="STATUS"]').attr("data-statusid",3),e.parent().parent().children('td[data-rel="STATUS"]').text(t("ocdownloader","Paused")),e.unbind("click"),e.bind("click",function(){OCDLRSelf.UnPauseDownload($(this),a)})):OCDLRSelf.RemoveQueueItem(l)),e.removeClass("icon-loading-small")}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},UnPauseDownload:function(e,a){e.addClass("icon-loading-small"),e.removeClass("icon-play"),$("#bactives").Badger("+1"),$("#bstopped").Badger("-1");var l=e.parent().parent(),d=l.attr("data-rel");d?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/unpause"),method:"POST",dataType:"json",data:{GID:d},async:!0,cache:!1,timeout:3e4,success:function(n){n.ERROR?(OCDLRSelf.PrintError(n.MESSAGE),e.addClass("icon-play")):(OCDLRSelf.PrintInfo(n.MESSAGE+" ("+d+")"),["add","all"].indexOf(a)>-1?(e.addClass("icon-pause"),e.parent().parent().children('td[data-rel="STATUS"]').attr("data-statusid",1),e.parent().parent().children('td[data-rel="STATUS"]').text(t("ocdownloader","Active")),e.unbind("click"),e.bind("click",function(){OCDLRSelf.PauseDownload($(this),a)})):OCDLRSelf.RemoveQueueItem(l)),e.removeClass("icon-loading-small")}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},RemoveFromQueue:function(e,a,l){e.addClass("icon-loading-small"),e.removeClass("icon-delete");var d=e.parent().parent(),n=d.attr("data-rel");n?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/"+a+"remove"),method:"POST",dataType:"json",data:{GID:n},async:!0,cache:!1,timeout:3e4,success:function(o){if(o.ERROR)OCDLRSelf.PrintError(o.MESSAGE),e.addClass("icon-delete"),e.removeClass("icon-loading-small");else if(OCDLRSelf.PrintInfo(o.MESSAGE+" ("+n+")"),"all"!=l||a.length>0)OCDLRSelf.RemoveQueueItem(d);else if("3"==d.children('td[data-rel="STATUS"]').attr("data-statusid"))$("#bremoved").Badger("-1"),$("#ball").Badger("-1"),OCDLRSelf.RemoveFromQueue(e,"completely",l);else{var i=e.parent();i.children("div").remove(),i.parent().children('td[data-rel="STATUS"]').text(t("ocdownloader","Removed")),OCDLRSelf.ActionDeleteCompletely(i)}}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},RemoveAllFromQueue:function(e,a,l){e.addClass("icon-loading-small"),e.removeClass("icon-delete");var d=[];$(OCDLRSelf.QueueElt+' td[data-rel="ACTION"] > div.icon-delete').each(function(){$(this).addClass("icon-loading-small"),$(this).removeClass("icon-delete"),d.push($(this).parent().parent().attr("data-rel"))}),d.length>0?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/"+a+"removeall"),method:"POST",dataType:"json",data:{GIDS:d},async:!0,cache:!1,timeout:3e4,success:function(e){e.ERROR?OCDLRSelf.PrintError(e.MESSAGE):(OCDLRSelf.PrintInfo(e.MESSAGE),OCDLRSelf.RemoveQueueItems(e.GIDS),a.length>0?($("#bremoved").Badger("-"+d.length),$("#ball").Badger("-"+d.length)):($("#bremoved").Badger("+"+d.length),$("#b"+l).Badger("-"+d.length)))}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},GetPersonalSettings:function(){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"personalsettings/get"),method:"GET",dataType:"json",async:!1,cache:!1,timeout:3e4,success:function(Data){Data.ERROR||$.each(Data.VALS,function(Key,Value){eval("OCDLRSelf."+Key+'="'+Value+'"')})}})},GetAdminSettings:function(KEYS){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"adminsettings/get"),method:"POST",dataType:"json",data:{KEYS:KEYS},async:!1,cache:!1,timeout:3e4,success:function(Data){Data.ERROR||$.each(Data.VALS,function(Key,Value){eval("OCDLRSelf."+Key+'="'+Value+'"')})}})},GetTorrentsList:function(e){e.is(":visible")?e.hide():(e.empty(),e.append('
  • '),e.show(),$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"btdownloader/listtorrentfiles"),method:"POST",dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(a){if(a.ERROR)OCDLRSelf.PrintError(a.MESSAGE);else if(e.empty(),0==a.FILES.length)e.append("
  • "+t("ocdownloader","No Torrent Files")+', '+t("ocdownloader","Upload")+"

  • ");else{for(var l=0;l

    '+a.FILES[l].name+"

    ");e.children("li").children("p.clickable").bind("click",function(){e.parent().children("a").prop("data-rel","File"),e.parent().children("a").html($(this).text()+'
    ')})}}}))},GetCounters:function(){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/count"),method:"POST",dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(e){e.ERROR?OCDLRSelf.PrintError(e.MESSAGE):($("#ball").Badger(e.COUNTER.ALL),$("#bcompletes").Badger(e.COUNTER.COMPLETES),$("#bactives").Badger(e.COUNTER.ACTIVES),$("#bwaitings").Badger(e.COUNTER.WAITINGS),$("#bstopped").Badger(e.COUNTER.STOPPED),$("#bremoved").Badger(e.COUNTER.REMOVED))}})},PrependToQueue:function(e,a){$(OCDLRSelf.Queue+"> tbody").prepend(''+e.FILENAME_SHORT+''+t("ocdownloader",e.PROTO)+'
    '+e.PROGRESS+"
    "+(["add","actives","all"].indexOf(a)>-1?''+e.SPEED+"":"")+(["add","all"].indexOf(a)>-1?''+e.STATUS+"":"")+'');var l=$(OCDLRSelf.QueueElt+'[data-rel="'+e.GID+'"] > td[data-rel="ACTION"]');if(["add"].indexOf(a)>-1){OCDLRSelf.ActionHide(l),1==e.STATUSID?OCDLRSelf.ActionPause(l,a):3==e.STATUSID&&OCDLRSelf.ActionPlay(l,a);var d=OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div.icon-close';0==$(d).length&&($(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"]').append('
    '),$(d).bind("click",function(){OCDLRSelf.HideAllFromQueue($(this))}))}if(["completes","waitings","stopped","actives"].indexOf(a)>-1){OCDLRSelf.ActionDelete(l,OCDLRSelf.BadgerStatus[e.STATUSID],a);var n=OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div.icon-delete';0==$(n).length&&($(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"]').append('
    '),$(n).bind("click",function(){OCDLRSelf.RemoveAllFromQueue($(this),"",a)}))}if("all"==a&&(4==e.STATUSID?OCDLRSelf.ActionDeleteCompletely(l):(OCDLRSelf.ActionDelete(l,OCDLRSelf.BadgerStatus[e.STATUSID],a),1==e.STATUSID?OCDLRSelf.ActionPause(l,a):3==e.STATUSID&&OCDLRSelf.ActionPlay(l,a))),"actives"==a&&OCDLRSelf.ActionPause(l,a),"stopped"==a&&OCDLRSelf.ActionPlay(l,a),"removed"==a){OCDLRSelf.ActionDeleteCompletely(l);var o=OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div.icon-delete';0==$(o).length&&($(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"]').append('
    '),$(o).bind("click",function(){OCDLRSelf.RemoveAllFromQueue($(this),"completely",a)}))}},AddDownload:function(e,a,t,l){var d=!1;return e.hasClass("icon-loading-small")||(e.children("a").css("display","none"),e.addClass("icon-loading-small"),$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+a+"downloader/add"),method:"POST",dataType:"json",data:{FILE:t,OPTIONS:l},async:!0,cache:!1,timeout:3e4,success:function(a){a.ERROR?OCDLRSelf.PrintError(a.MESSAGE):(OCDLRSelf.PrintInfo(a.MESSAGE+" ("+a.GID+")"),OCDLRSelf.PrependToQueue(a,"add"),$("#ball").Badger("+1"),1==a.STATUSID&&$("#bactives").Badger("+1"),3==a.STATUSID&&$("#bwaitings").Badger("+1"),d=!0),e.children("a").css("display","block"),e.removeClass("icon-loading-small")}})),d},ActionHide:function(e){e.append('
    '),e.children("div.icon-close").bind("click",function(){OCDLRSelf.HideFromQueue($(this))})},ActionPause:function(e,a){"ARIA2"==OCDLRSelf.WhichDownloader&&(e.append('
    '),e.children("div.icon-pause").bind("click",function(){OCDLRSelf.PauseDownload($(this),a)}))},ActionPlay:function(e,a){"ARIA2"==OCDLRSelf.WhichDownloader&&(e.append('
    '),e.children("div.icon-play").bind("click",function(){OCDLRSelf.UnPauseDownload($(this),a)}))},ActionDelete:function(e,a,t){e.append('
    '),e.children("div.icon-delete").bind("click",function(){$("#bremoved").Badger("+1"),$("#b"+a).Badger("-1"),OCDLRSelf.RemoveFromQueue($(this),"",t)})},ActionDeleteCompletely:function(e){e.append('
    '),e.children("div.icon-delete").bind("click",function(){$("#bremoved").Badger("-1"),$("#ball").Badger("-1"),OCDLRSelf.RemoveFromQueue($(this),"completely","removed")})}};var OCDLRSelf=OCDLR.Utils;OCDLRSelf.GetPersonalSettings(),OCDLRSelf.GetAdminSettings(["WhichDownloader"]),OCDLRSelf.Queue=OCDLRSelf.BaseID+"#Queue ",OCDLRSelf.QueueHeader=OCDLRSelf.Queue+"thead tr",OCDLRSelf.QueueElt=OCDLRSelf.Queue+"tbody tr",OCDLRSelf.BadgerStatus=["completes","actives","waitings","stopped"]}(); +OCDLR={},function(){OCDLR.Utils={BaseURL:"/apps/ocdownloader/",BaseID:"#app-content-wrapper ",MenuID:"#app-navigation ",Queue:"",QueueHeader:"",QueueElt:"",DownloadsFolder:"",TorrentsFolder:"",WhichDownloader:"",BadgerStatus:[],ValidURL:function(e){return/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},PrintError:function(e){$(OCDLRSelf.BaseID+"span.muted").removeClass("info alert"),$(OCDLRSelf.BaseID+"span.muted").addClass("alert").text(e)},PrintInfo:function(e){$(OCDLRSelf.BaseID+"span.muted").removeClass("info alert"),$(OCDLRSelf.BaseID+"span.muted").addClass("info").text(e)},CheckVersion:function(){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"updater/check"),method:"GET",dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(e){!e.ERROR&&e.RESULT&&($(OCDLRSelf.MenuID+".nav-updater").show(),$(OCDLRSelf.MenuID+".nav-updater .button").bind("click",function(){OCDLRSelf.AddDownload($(this),"http","https://github.com/e-alfred/ocdownloader/archive/master.zip",{HTTPUser:"",HTTPPasswd:""})}))}})},UpdateQueue:function(e,a){var t=setInterval(function(){clearInterval(t),$(OCDLRSelf.QueueElt).length>0&&($(OCDLRSelf.BaseID+".loadingtext").show(),$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/get"),method:"POST",data:{VIEW:a},dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(t){if(t.ERROR)OCDLRSelf.PrintError(t.MESSAGE);else{0!=$(OCDLRSelf.QueueElt+'[data-rel="LOADER"]').length&&$(OCDLRSelf.QueueElt+'[data-rel="LOADER"]').remove(),$("#ball").Badger(t.COUNTER.ALL),$("#bcompletes").Badger(t.COUNTER.COMPLETES),$("#bactives").Badger(t.COUNTER.ACTIVES),$("#bwaitings").Badger(t.COUNTER.WAITINGS),$("#bstopped").Badger(t.COUNTER.STOPPED),$("#bremoved").Badger(t.COUNTER.REMOVED);var l=[];$.each(t.QUEUE,function(t,d){var n=OCDLRSelf.QueueElt+'[data-rel="'+d.GID+'"]';l.push(d.GID),e&&0==$(n).length&&OCDLRSelf.PrependToQueue(d,a),0==$(n+' > td[data-rel="ACTION"] > div.icon-pause').length&&1==d.STATUSID&&OCDLRSelf.ActionPause($(n+' > td[data-rel="ACTION"]'),a),0==$(n+' > td[data-rel="ACTION"] > div.icon-play').length&&3==d.STATUSID&&OCDLRSelf.ActionUnPause($(n+' > td[data-rel="ACTION"]'),a),"100%"==d.PROGRESSVAL?($(n+' > td[data-rel="FILENAME"]').html(''+d.FILENAME_SHORT+""),d.ISTORRENT&&"--"!=d.SPEED?$(n+' > td[data-rel="SPEED"]').html('
    '+d.SPEED):($(n+' > td[data-rel="SPEED"]').html(d.SPEED),d.ISTORRENT||($(n+' > td[data-rel="ACTION"] > div.icon-pause').remove(),$(n+' > td[data-rel="ACTION"] > div.icon-play').remove()))):"--"!=d.SPEED?$(n+' > td[data-rel="SPEED"]').html('
    '+d.SPEED):$(n+' > td[data-rel="SPEED"]').html(d.SPEED),$(n+' > td[data-rel="MESSAGE"] > div.pb-wrap > div.pb-value > div.pb-text').html(d.PROGRESS),$(n+' > td[data-rel="MESSAGE"] > div.pb-wrap > div.pb-value').css("width",d.PROGRESSVAL),$(n+' > td[data-rel="STATUS"]').text(d.STATUS)}),OCDLRSelf.RemoveQueueItems(l)}$(OCDLRSelf.BaseID+".loadingtext").hide()}})),OCDLRSelf.UpdateQueue("add"!=a,a)},3e3)},RemoveQueueItem:function(e){1==e.parent().children().length&&$(OCDLRSelf.Queue+' th[data-rel="ACTION"] > div').remove(),e.remove()},RemoveQueueItems:function(e){$(OCDLRSelf.QueueElt).each(function(){-1==e.indexOf($(this).attr("data-rel"))&&$(this).remove()}),0==$(OCDLRSelf.QueueElt).length&&$(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div').remove()},HideFromQueue:function(e){e.addClass("icon-loading-small"),e.removeClass("icon-close");var a=e.parent().parent(),l=a.attr("data-rel");l?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/hide"),method:"POST",dataType:"json",data:{GID:l},async:!0,cache:!1,timeout:3e4,success:function(t){t.ERROR?(OCDLRSelf.PrintError(t.MESSAGE),e.addClass("icon-close"),e.removeClass("icon-loading-small")):(OCDLRSelf.PrintInfo(t.MESSAGE+" ("+l+")"),OCDLRSelf.RemoveQueueItem(a))}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},HideAllFromQueue:function(e){e.addClass("icon-loading-small"),e.removeClass("icon-close");var a=[];$(OCDLRSelf.QueueElt+' td[data-rel="ACTION"] > div.icon-close').each(function(){$(this).addClass("icon-loading-small"),$(this).removeClass("icon-close"),a.push($(this).parent().parent().attr("data-rel"))}),a.length>0?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/hideall"),method:"POST",dataType:"json",data:{GIDS:a},async:!0,cache:!1,timeout:3e4,success:function(e){e.ERROR?OCDLRSelf.PrintError(e.MESSAGE):(OCDLRSelf.PrintInfo(e.MESSAGE),$.each(e.QUEUE,function(e,a){$(OCDLRSelf.QueueElt+'[data-rel="'+a.GID+'"]').remove()}),$(OCDLRSelf.Queue+' th[data-rel="ACTION"] > div.icon-loading-small').remove())}}):OCDLRSelf.PrintError(t("ocdownloader","No downloads in the queue ..."))},PauseDownload:function(e,a){e.addClass("icon-loading-small"),e.removeClass("icon-pause"),$("#bactives").Badger("-1"),$("#bstopped").Badger("+1");var l=e.parent().parent(),d=l.attr("data-rel");d?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/pause"),method:"POST",dataType:"json",data:{GID:d},async:!0,cache:!1,timeout:3e4,success:function(n){n.ERROR?(OCDLRSelf.PrintError(n.MESSAGE),e.addClass("icon-pause")):(OCDLRSelf.PrintInfo(n.MESSAGE+" ("+d+")"),["add","all"].indexOf(a)>-1?(e.addClass("icon-play"),e.parent().parent().children('td[data-rel="STATUS"]').attr("data-statusid",3),e.parent().parent().children('td[data-rel="STATUS"]').text(t("ocdownloader","Paused")),e.unbind("click"),e.bind("click",function(){OCDLRSelf.UnPauseDownload($(this),a)})):OCDLRSelf.RemoveQueueItem(l)),e.removeClass("icon-loading-small")}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},UnPauseDownload:function(e,a){e.addClass("icon-loading-small"),e.removeClass("icon-play"),$("#bactives").Badger("+1"),$("#bstopped").Badger("-1");var l=e.parent().parent(),d=l.attr("data-rel");d?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/unpause"),method:"POST",dataType:"json",data:{GID:d},async:!0,cache:!1,timeout:3e4,success:function(n){n.ERROR?(OCDLRSelf.PrintError(n.MESSAGE),e.addClass("icon-play")):(OCDLRSelf.PrintInfo(n.MESSAGE+" ("+d+")"),["add","all"].indexOf(a)>-1?(e.addClass("icon-pause"),e.parent().parent().children('td[data-rel="STATUS"]').attr("data-statusid",1),e.parent().parent().children('td[data-rel="STATUS"]').text(t("ocdownloader","Active")),e.unbind("click"),e.bind("click",function(){OCDLRSelf.PauseDownload($(this),a)})):OCDLRSelf.RemoveQueueItem(l)),e.removeClass("icon-loading-small")}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},RemoveFromQueue:function(e,a,l){e.addClass("icon-loading-small"),e.removeClass("icon-delete");var d=e.parent().parent(),n=d.attr("data-rel");n?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/"+a+"remove"),method:"POST",dataType:"json",data:{GID:n},async:!0,cache:!1,timeout:3e4,success:function(o){if(o.ERROR)OCDLRSelf.PrintError(o.MESSAGE),e.addClass("icon-delete"),e.removeClass("icon-loading-small");else if(OCDLRSelf.PrintInfo(o.MESSAGE+" ("+n+")"),"all"!=l||a.length>0)OCDLRSelf.RemoveQueueItem(d);else if("3"==d.children('td[data-rel="STATUS"]').attr("data-statusid"))$("#bremoved").Badger("-1"),$("#ball").Badger("-1"),OCDLRSelf.RemoveFromQueue(e,"completely",l);else{var i=e.parent();i.children("div").remove(),i.parent().children('td[data-rel="STATUS"]').text(t("ocdownloader","Removed")),OCDLRSelf.ActionDeleteCompletely(i)}}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},RemoveAllFromQueue:function(e,a,l){e.addClass("icon-loading-small"),e.removeClass("icon-delete");var d=[];$(OCDLRSelf.QueueElt+' td[data-rel="ACTION"] > div.icon-delete').each(function(){$(this).addClass("icon-loading-small"),$(this).removeClass("icon-delete"),d.push($(this).parent().parent().attr("data-rel"))}),d.length>0?$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/"+a+"removeall"),method:"POST",dataType:"json",data:{GIDS:d},async:!0,cache:!1,timeout:3e4,success:function(e){e.ERROR?OCDLRSelf.PrintError(e.MESSAGE):(OCDLRSelf.PrintInfo(e.MESSAGE),OCDLRSelf.RemoveQueueItems(e.GIDS),a.length>0?($("#bremoved").Badger("-"+d.length),$("#ball").Badger("-"+d.length)):($("#bremoved").Badger("+"+d.length),$("#b"+l).Badger("-"+d.length)))}}):OCDLRSelf.PrintError(t("ocdownloader","Unable to find the GID for this download ..."))},GetPersonalSettings:function(){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"personalsettings/get"),method:"GET",dataType:"json",async:!1,cache:!1,timeout:3e4,success:function(Data){Data.ERROR||$.each(Data.VALS,function(Key,Value){eval("OCDLRSelf."+Key+'="'+Value+'"')})}})},GetAdminSettings:function(KEYS){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"adminsettings/get"),method:"POST",dataType:"json",data:{KEYS:KEYS},async:!1,cache:!1,timeout:3e4,success:function(Data){Data.ERROR||$.each(Data.VALS,function(Key,Value){eval("OCDLRSelf."+Key+'="'+Value+'"')})}})},GetTorrentsList:function(e){e.is(":visible")?e.hide():(e.empty(),e.append('
  • '),e.show(),$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"btdownloader/listtorrentfiles"),method:"POST",dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(a){if(a.ERROR)OCDLRSelf.PrintError(a.MESSAGE);else if(e.empty(),0==a.FILES.length)e.append("
  • "+t("ocdownloader","No Torrent Files")+', '+t("ocdownloader","Upload")+"

  • ");else{for(var l=0;l

    '+a.FILES[l].name+"

    ");e.children("li").children("p.clickable").bind("click",function(){e.parent().children("a").prop("data-rel","File"),e.parent().children("a").html($(this).text()+'
    ')})}}}))},GetCounters:function(){$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+"queue/count"),method:"POST",dataType:"json",async:!0,cache:!1,timeout:3e4,success:function(e){e.ERROR?OCDLRSelf.PrintError(e.MESSAGE):($("#ball").Badger(e.COUNTER.ALL),$("#bcompletes").Badger(e.COUNTER.COMPLETES),$("#bactives").Badger(e.COUNTER.ACTIVES),$("#bwaitings").Badger(e.COUNTER.WAITINGS),$("#bstopped").Badger(e.COUNTER.STOPPED),$("#bremoved").Badger(e.COUNTER.REMOVED))}})},PrependToQueue:function(e,a){$(OCDLRSelf.Queue+"> tbody").prepend(''+e.FILENAME_SHORT+''+t("ocdownloader",e.PROTO)+'
    '+e.PROGRESS+"
    "+(["add","actives","all"].indexOf(a)>-1?''+e.SPEED+"":"")+(["add","all"].indexOf(a)>-1?''+e.STATUS+"":"")+'');var l=$(OCDLRSelf.QueueElt+'[data-rel="'+e.GID+'"] > td[data-rel="ACTION"]');if(["add"].indexOf(a)>-1){OCDLRSelf.ActionHide(l),1==e.STATUSID?OCDLRSelf.ActionPause(l,a):3==e.STATUSID&&OCDLRSelf.ActionPlay(l,a);var d=OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div.icon-close';0==$(d).length&&($(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"]').append('
    '),$(d).bind("click",function(){OCDLRSelf.HideAllFromQueue($(this))}))}if(["completes","waitings","stopped","actives"].indexOf(a)>-1){OCDLRSelf.ActionDelete(l,OCDLRSelf.BadgerStatus[e.STATUSID],a);var n=OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div.icon-delete';0==$(n).length&&($(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"]').append('
    '),$(n).bind("click",function(){OCDLRSelf.RemoveAllFromQueue($(this),"",a)}))}if("all"==a&&(4==e.STATUSID?OCDLRSelf.ActionDeleteCompletely(l):(OCDLRSelf.ActionDelete(l,OCDLRSelf.BadgerStatus[e.STATUSID],a),1==e.STATUSID?OCDLRSelf.ActionPause(l,a):3==e.STATUSID&&OCDLRSelf.ActionPlay(l,a))),"actives"==a&&OCDLRSelf.ActionPause(l,a),"stopped"==a&&OCDLRSelf.ActionPlay(l,a),"removed"==a){OCDLRSelf.ActionDeleteCompletely(l);var o=OCDLRSelf.Queue+'> thead th[data-rel="ACTION"] > div.icon-delete';0==$(o).length&&($(OCDLRSelf.Queue+'> thead th[data-rel="ACTION"]').append('
    '),$(o).bind("click",function(){OCDLRSelf.RemoveAllFromQueue($(this),"completely",a)}))}},AddDownload:function(e,a,t,l){var d=!1;return e.hasClass("icon-loading-small")||(e.children("a").css("display","none"),e.addClass("icon-loading-small"),$.ajax({url:OC.generateUrl(OCDLRSelf.BaseURL+a+"downloader/add"),method:"POST",dataType:"json",data:{FILE:t,OPTIONS:l},async:!0,cache:!1,timeout:3e4,success:function(a){a.ERROR?OCDLRSelf.PrintError(a.MESSAGE):(OCDLRSelf.PrintInfo(a.MESSAGE+" ("+a.GID+")"),OCDLRSelf.PrependToQueue(a,"add"),$("#ball").Badger("+1"),1==a.STATUSID&&$("#bactives").Badger("+1"),3==a.STATUSID&&$("#bwaitings").Badger("+1"),d=!0),e.children("a").css("display","block"),e.removeClass("icon-loading-small")}})),d},ActionHide:function(e){e.append('
    '),e.children("div.icon-close").bind("click",function(){OCDLRSelf.HideFromQueue($(this))})},ActionPause:function(e,a){"ARIA2"==OCDLRSelf.WhichDownloader&&(e.append('
    '),e.children("div.icon-pause").bind("click",function(){OCDLRSelf.PauseDownload($(this),a)}))},ActionPlay:function(e,a){"ARIA2"==OCDLRSelf.WhichDownloader&&(e.append('
    '),e.children("div.icon-play").bind("click",function(){OCDLRSelf.UnPauseDownload($(this),a)}))},ActionDelete:function(e,a,t){e.append('
    '),e.children("div.icon-delete").bind("click",function(){$("#bremoved").Badger("+1"),$("#b"+a).Badger("-1"),OCDLRSelf.RemoveFromQueue($(this),"",t)})},ActionDeleteCompletely:function(e){e.append('
    '),e.children("div.icon-delete").bind("click",function(){$("#bremoved").Badger("-1"),$("#ball").Badger("-1"),OCDLRSelf.RemoveFromQueue($(this),"completely","removed")})}};var OCDLRSelf=OCDLR.Utils;OCDLRSelf.GetPersonalSettings(),OCDLRSelf.GetAdminSettings(["WhichDownloader"]),OCDLRSelf.Queue=OCDLRSelf.BaseID+"#Queue ",OCDLRSelf.QueueHeader=OCDLRSelf.Queue+"thead tr",OCDLRSelf.QueueElt=OCDLRSelf.Queue+"tbody tr",OCDLRSelf.BadgerStatus=["completes","actives","waitings","stopped"]}(); \ No newline at end of file