2016-02-09 21:58:29 +03:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2016 ownCloud Inc
|
|
|
|
*
|
|
|
|
* @author Lukas Reschke <lukas@owncloud.com>
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3
|
|
|
|
* or later.
|
|
|
|
*
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new authentication token and loads the updater URL
|
|
|
|
*/
|
|
|
|
$(document).ready(function(){
|
2016-03-04 15:56:13 +03:00
|
|
|
$('#release-channel').change(function() {
|
|
|
|
var newChannel = $('#release-channel').find(":selected").val();
|
2016-05-09 10:43:06 +03:00
|
|
|
|
|
|
|
if (newChannel === 'git' || newChannel === 'daily') {
|
2016-05-10 12:04:24 +03:00
|
|
|
$('#oca_updatenotification_groups em').removeClass('hidden');
|
2016-05-09 10:43:06 +03:00
|
|
|
} else {
|
2016-05-10 12:04:24 +03:00
|
|
|
$('#oca_updatenotification_groups em').addClass('hidden');
|
2016-05-09 10:43:06 +03:00
|
|
|
}
|
|
|
|
|
2016-03-04 15:56:13 +03:00
|
|
|
$.post(
|
|
|
|
OC.generateUrl('/apps/updatenotification/channel'),
|
|
|
|
{
|
|
|
|
'channel': newChannel
|
|
|
|
},
|
|
|
|
function(data){
|
|
|
|
OC.msg.finishedAction('#channel_save_msg', data);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
2016-05-09 10:43:06 +03:00
|
|
|
|
|
|
|
var $notificationTargetGroups = $('#oca_updatenotification_groups_list');
|
|
|
|
OC.Settings.setupGroupsSelect($notificationTargetGroups);
|
|
|
|
$notificationTargetGroups.change(function(ev) {
|
|
|
|
var groups = ev.val || [];
|
|
|
|
groups = JSON.stringify(groups);
|
|
|
|
OC.AppConfig.setValue('updatenotification', 'notify_groups', groups);
|
|
|
|
});
|
2016-02-09 21:58:29 +03:00
|
|
|
});
|