From 59a7d8b94783e2c5f10da90e135a30664919d5b0 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Mon, 30 Jun 2008 17:48:40 +0000 Subject: [PATCH] json:add get_stats method --- .../ui/webui/templates/ajax_demo/index.html | 1 - deluge/ui/webui/utils.py | 31 +++---------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/deluge/ui/webui/templates/ajax_demo/index.html b/deluge/ui/webui/templates/ajax_demo/index.html index 887f92b8e..88828080e 100644 --- a/deluge/ui/webui/templates/ajax_demo/index.html +++ b/deluge/ui/webui/templates/ajax_demo/index.html @@ -56,7 +56,6 @@ function list_torrents() { }); }; - function update_torrent(torrent) { alert(torrent.name); }; diff --git a/deluge/ui/webui/utils.py b/deluge/ui/webui/utils.py index 827e8e8cc..e7896d7b0 100644 --- a/deluge/ui/webui/utils.py +++ b/deluge/ui/webui/utils.py @@ -87,36 +87,13 @@ def self_url(**kwargs): return config["base"] + changequery(**kwargs) def do_redirect(): - """for redirects after a POST""" - vars = web.input(redir = None) - ck = cookies() - url_vars = {} - + """go to /index unless the redir var is set.""" + vars = web.input(redir=None) if vars.redir: w_seeother(vars.redir) #redir variable contains base return - - #for the filters: - if ("order" in ck and "sort" in ck): - url_vars.update({'sort':ck['sort'] ,'order':ck['order'] }) - - organize = False - try: - organize = ('Organize' in sclient.get_enabled_plugins()) - except: - pass - - if organize: - #todo:DRY - if ("state" in ck) and ck['state']: - url_vars['state'] = ck['state'] - if ("tracker" in ck) and ck['tracker']: - url_vars['tracker'] = ck['tracker'] - if ("keyword" in ck) and ck['keyword']: - url_vars['keyword'] = ck['keyword'] - - #redirect. - w_seeother(url("/index", **url_vars)) + #default: + seeother('/index') def getcookie(key, default = None): "because i'm too lazy to type 3 lines for something this simple"