diff --git a/src/server/web/pages/template/apijs.go b/src/server/web/pages/template/apijs.go index 77cdfc7..40681e8 100644 --- a/src/server/web/pages/template/apijs.go +++ b/src/server/web/pages/template/apijs.go @@ -37,9 +37,23 @@ function torrent(action, link, hash, title, poster, save, done, fail){ // // Settings - + // +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) { if (typeof size == 'undefined' || size == 0) return "";