diff --git a/deluge/ui/webui/templates/ajax/static/js/Rpc.js b/deluge/ui/webui/templates/ajax/static/js/Rpc.js index 2d068da19..fe00c2e7d 100644 --- a/deluge/ui/webui/templates/ajax/static/js/Rpc.js +++ b/deluge/ui/webui/templates/ajax/static/js/Rpc.js @@ -1,14 +1,36 @@ /* * Script: Rpc.js - * A JSON-RPC proxy + * A JSON-RPC proxy built ontop of mootools. * * Copyright: - * Damien Churchill (c) 2008 + * Damien Churchill (c) 2008 */ /* * A class that creates a proxy for sending remote procedure calls over JSON */ + +/* + Class: JSON.RPC + Class to create a proxy to a json-rpc interface on a server. + + Example: + client = new JSON.RPC('/json/rpc'); + client.hello_world({ + onSuccess: function(result) { + alert(result); + } + }); + alert(client.hello_world({async: true;})); + client.add_name('Damien', { + onSuccess: function(result) { + alert(result); + } + }); + + Returns: + The proxy that can be used to directly call methods on the server. +*/ JSON.RPC = new Class({ Implements: Options,