remove ajax_demo template

This commit is contained in:
Marcos Pinto 2008-08-02 10:20:32 +00:00
parent 2c2717b90e
commit 5d9ff4b28a
4 changed files with 0 additions and 1265 deletions

View File

@ -1,162 +0,0 @@
$def with (torrent_list, organize_filters)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
$:render.header(_("AJAX index"), 'home')
<!--
Using this lib because it was linked from http://json-rpc.org/wiki/implementations
http://code.google.com/p/json-xml-rpc/wiki/DocumentationForJavaScript
-->
<script language="javascript" src="/template/static/js/rpc.js"></script>
<div class="info">Just a demo template for damoxc
(or anyone else who wants to make an ajax template)</div>
<script language="javascript">
var service = new rpc.ServiceProxy("$base/json/rpc", {/*options*/});
function get_session_state( ) {
service.get_session_state({params:[],
onSuccess:function(result){
alert("session_state: " + result);
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
function get_torrents_status(torrent_ids) {
//alert("start status:");
service.get_torrents_status({
params:[torrent_ids,["name","progress"]],
onSuccess:function(torrent_list){
for (var torrent_id in torrent_list){
torrent = torrent_list[torrent_id]
//alert(torrent);
alert(torrent.name + " " + torrent.progress + "%");
}
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
function list_torrents() {
service.get_session_state({params:[],
onSuccess:function(torrent_ids){
get_torrents_status(torrent_ids)
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
function update_torrent(torrent) {
alert(torrent.name);
};
function get_stats() {
service.get_stats({params:[],
onSuccess:function(stats){
alert(service.__toJSON(stats));
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
function update_ui() {
service.update_ui({params:[ ["name","state","label","tracker_host"],{"state":"Seeding"} ],
onSuccess:function(data){
alert(service.__toJSON(data));
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
function get_webui_config() {
service.get_webui_config({params:[ ],
onSuccess:function(data){
alert(service.__toJSON(data));
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
function set_webui_config(cfg_dict) {
service.set_webui_config({params:[cfg_dict],
onSuccess:function(data){
alert(service.__toJSON(data));
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
function get_webui_templates() {
service.get_webui_templates({params:[ ],
onSuccess:function(data){
alert(service.__toJSON(data));
},
onException:function(errorObj){
alert("Error: " + errorObj);
}
});
};
</script>
<h1>ui.client</h1>
<a href="http://dev.deluge-torrent.org/wiki/Development/UiClient#Remoteapi">docs</a> <br>
<button onclick="get_session_state()">get_session_state()</button>
<button onclick="list_torrents()">List torrents using get_session_state() + get_torrents_status()</button> <br>
<h1>json extra:</h1>
<a href="http://dev.deluge-torrent.org/wiki/Development/WebUi/Json">Docs</a><br>
<button onclick="get_stats()">get_stats()</button>
<button onclick="update_ui()">update_ui() filter on "Seeding"</button>
<br>
<button onclick="set_webui_config({'button_style':1})">set_webui_config({'button_style':1})</button>
<button onclick="set_webui_config({'button_style':2})">set_webui_config({'button_style':2})</button>
<button onclick="get_webui_config()">get_webui_config()</button>
<button onclick="get_webui_templates()">get_webui_templates()</button>
<div id="torrent_list">
<h1>add+auto-close</h1>
<button onclick="
window.open('$base/torrent/add','add_torrent','height=200,width=800,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes'); return false;"
>Add torrent</button>
</div>
$:render.footer()

View File

@ -1,8 +0,0 @@
{
'authors':['Martijn Voncken <mvoncken@gmail.com>'],
'inherits':['classic', 'white'],
'comment':"""
Demo template for external ajax devs.
"""
}

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
$def with (add_form, options_form, error)
<html>
<head>
<title>Deluge:add torrent</title>
<link rel="icon" href="/static/images/deluge_icon.gif" type="image/gif" />
<link rel="shortcut icon" href="/static/images/deluge_icon.gif" type="image/gif" />
<link rel="stylesheet" type="text/css" href="/template_style.css" />
<script language="javascript" src="/static/deluge.js"></script>
</head>
<div class="panel">
<h2>$_("Add Torrent")</h2>
<form method="POST" action="$base/torrent/add" ENCTYPE="multipart/form-data">
<input type="hidden" name="redir" value="/close">
$if error:
<div class="error">$error</div>
<div id="torrent_add" >
<table>
$:add_form.as_table()
</table>
<a onclick="javascript:toggle_options()">$_('Options')</a>
<!--todo: cookie setting for last-used options display or not-->
<br>
<div id="torrent_add_options" style="display:none">
<table>
$:options_form.as_table()
</table>
</div>
<div class="form_row">
<span class="form_label"></span>
<input type="submit" name="submit"
value="$_('Submit')" class="form_input">
</div>
</form>
</div>
<script language="javascript">
function toggle_options(){
el = document.getElementById("torrent_add_options");
if (el.style.display == "block"){
el.style.display = "none";
setCookie("torrent_add_options","hide");
}
else{
el.style.display = "block";
setCookie("torrent_add_options","show");
}
}
if (getCookie("torrent_add_options") == "show") {
el = document.getElementById("torrent_add_options");
el.style.display = "block";
}
</script>
$:render.footer()