tvheadend/ajaxui/tvheadend.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

function switchtab(name, index)
{
a = new Ajax.Updater(name + 'deck', '/ajax/' + name + 'tab/' + index,
{ asynchronous: true,
method: 'get',
evalScripts: true});
a = new Ajax.Updater(name + 'menu', '/ajax/' + name + 'menu/' + index,
{ asynchronous: true,
method: 'get',
evalScripts: true});
};
function updatelistonserver(listid, url, resultid)
{
// document.getElementById(resultid).innerHTML = "Updating...";
a = new Ajax.Updater(resultid, url,
{ asynchronous: true,
evalScripts: true,
parameters:Sortable.serialize(listid)});
};
function addlistentry(listid, url, name)
{
if(name == null || name == "") {
alert("Emtpy name is not allowed");
} else {
a = new Ajax.Updater(listid, url,
{ asynchronous: true,
evalScripts: true,
parameters: { name: name },
insertion: Insertion.Bottom
});
}
}
function dellistentry(url, id, name)
{
if(confirm("Are you sure you want to delete '" + name + "'") == true) {
a = new Ajax.Request(url, { parameters: { id: id }});
}
}
function addlistentry_by_widget(listid, url, widget)
{
name = $F(widget);
$(widget).clear();
addlistentry(listid, url, name);
}