Move function add_channel to api.js.
This commit is contained in:
parent
1f2c43278a
commit
ba1f17da75
2 changed files with 10 additions and 9 deletions
|
@ -3,6 +3,15 @@ var api = {};
|
|||
/**************************************************************************************************/
|
||||
api.channels = {};
|
||||
|
||||
api.channels.add_channel =
|
||||
function add_channel(channel_id, callback)
|
||||
{
|
||||
var url = "/add_channel";
|
||||
data = new FormData();
|
||||
data.append("channel_id", channel_id);
|
||||
return common.post(url, data, callback);
|
||||
}
|
||||
|
||||
api.channels.refresh_channel =
|
||||
function refresh_channel(channel_id, force, callback)
|
||||
{
|
||||
|
|
|
@ -80,7 +80,7 @@ function add_channel_form(event)
|
|||
{
|
||||
if (box.value !== "")
|
||||
{
|
||||
add_channel(box.value, add_channel_callback);
|
||||
api.channels.add_channel(box.value, add_channel_callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,13 +91,5 @@ function add_channel_callback(response)
|
|||
window.location.href = "/channel/" + response["data"]["id"];
|
||||
}
|
||||
}
|
||||
|
||||
function add_channel(channel_id, callback)
|
||||
{
|
||||
var url = "/add_channel";
|
||||
data = new FormData();
|
||||
data.append("channel_id", channel_id);
|
||||
return common.post(url, data, callback);
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue