Completed
Push — master ( e4d488...d7a2df )
by Sander
30s
created

js/lib/API/notifications.js (2 issues)

1
/*
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
7
8
/* global API */
9
API.notifications = {
10
    create: function(title, message){
11
        var opt = {
12
            type: "basic",
13
            title: title,
14
            message: message,
15
            iconUrl: "icons/icon32.png"
16
        };
17
        return API.api.notifications.create('PiCast', opt, function(id) { console.log("Last error:", chrome.runtime.lastError); });
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
The parameter id is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
18
    },
19
    update: API.api.notifications.update,
20
    clear: API.api.notifications.clear,
21
22
    getAll: function () {
23
        if (API.promise) {
24
            return API.api.notifications.getAll(details);
25
        }
26
        else {
27
            return new C_Promise(function () {
28
                API.api.notifications.getAll(details, (function (notifications) {
29
                    this.call_then(notifications);
30
                }).bind(this));
31
            });
32
        }
33
    },
34
    /**
35
     * Event handlers from now on
36
     */
37
    onClosed: API.api.notifications.onClosed,
38
    onClicked: API.api.notifications.onClicked,
39
    onButtonClicked: API.api.notifications.onButtonClicked,
40
41
};