Passed
Push — master ( 998e10...1efe83 )
by Marcel
06:10
created

js/settings/admin.js (9 issues)

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';
0 ignored issues
show
Use the function form of "use strict".
Loading history...
12
13
$(document).ready(function () {
0 ignored issues
show
$ does not seem to be defined.
Loading history...
document does not seem to be defined.
Loading history...
14
15
    $('#sonos').on('click', function () {
0 ignored issues
show
$ does not seem to be defined.
Loading history...
16
        var user_value;
17
        if ($('#sonos').prop('checked')) {
0 ignored issues
show
$ does not seem to be defined.
Loading history...
18
            user_value = 'checked';
19
        }
20
        else {
21
            user_value = '';
22
        }
23
        $.ajax({
0 ignored issues
show
$ does not seem to be defined.
Loading history...
24
            type: 'POST',
25
            url: OC.generateUrl('apps/audioplayer/admin'),
0 ignored issues
show
OC does not seem to be defined.
Loading history...
26
            data: {
27
                'type': 'sonos',
28
                'value': user_value
29
            },
30
            success: function () {
31
                OC.Notification.showTemporary(t('audioplayer', 'saved'));
0 ignored issues
show
OC does not seem to be defined.
Loading history...
t does not seem to be defined.
Loading history...
32
            }
33
        });
34
    });
35
});