refactor and update

This commit is contained in:
YouROK
2020-11-11 17:04:52 +03:00
parent 0d9f68c3c8
commit 3f2bd4fa5f

View File

@@ -40,6 +40,20 @@ function torrent(action, link, hash, title, poster, save, done, fail){
// //
function sendApi(action, obj, path, done, fail){
obj[action]=action;
var req = JSON.stringify(obj);
$.post(path,req)
.done(function( data ) {
if (done)
done(data);
})
.fail(function( data ) {
if (fail)
fail(data);
});
}
function humanizeSize(size) { function humanizeSize(size) {
if (typeof size == 'undefined' || size == 0) if (typeof size == 'undefined' || size == 0)
return ""; return "";