diff options
author | Joas Schilling <coding@schilljs.com> | 2016-08-30 17:50:33 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-08-30 17:50:33 +0300 |
commit | 4f8681deae9e43e6804f9f4453a529061559d4f3 (patch) | |
tree | 7ba2658300fde090b8fcbfc749a74165160aaa63 /js | |
parent | 3b2cd54279f1a0ebaac87eeca489f9c91e135cf4 (diff) |
Add admin section to select the groups to notify
Diffstat (limited to 'js')
-rw-r--r-- | js/admin.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/js/admin.js b/js/admin.js new file mode 100644 index 0000000..4f7c0a5 --- /dev/null +++ b/js/admin.js @@ -0,0 +1,33 @@ +/** + * @copyright Copyright (c) 2016, Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +$(document).ready(function() { + var $groups = $('#nextcloud_announcements').find('.notification_groups'); + + OC.Settings.setupGroupsSelect($groups); + + $groups.change(function(event) { + var groups = event.val || ['admin']; + groups = JSON.stringify(groups); + OC.AppConfig.setValue('nextcloud_announcements', 'notification_groups', groups); + }); +}); |