1 | /** |
||
2 | * Audio Player |
||
3 | * |
||
4 | * This file is licensed under the Affero General Public License version 3 or |
||
5 | * later. See the LICENSE.md file. |
||
6 | * |
||
7 | * @author Marcel Scherello <[email protected]> |
||
8 | * @copyright 2016-2019 Marcel Scherello |
||
9 | */ |
||
10 | |||
11 | 'use strict'; |
||
12 | |||
13 | $(document).ready(function () { |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
14 | |||
15 | $('#sonos').on('click', function () { |
||
0 ignored issues
–
show
|
|||
16 | var user_value; |
||
17 | if ($('#sonos').prop('checked')) { |
||
0 ignored issues
–
show
|
|||
18 | user_value = 'checked'; |
||
19 | } |
||
20 | else { |
||
21 | user_value = ''; |
||
22 | } |
||
23 | $.ajax({ |
||
0 ignored issues
–
show
|
|||
24 | type: 'POST', |
||
25 | url: OC.generateUrl('apps/audioplayer/admin'), |
||
0 ignored issues
–
show
|
|||
26 | data: { |
||
27 | 'type': 'sonos', |
||
28 | 'value': user_value |
||
29 | }, |
||
30 | success: function () { |
||
31 | OC.Notification.showTemporary(t('audioplayer', 'saved')); |
||
0 ignored issues
–
show
|
|||
32 | } |
||
33 | }); |
||
34 | }); |
||
35 | }); |