You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/UI/ProgressMessaging/ProgressMessageCollection.js

48 lines
1.2 KiB

11 years ago
'use strict';
define(
[
11 years ago
'app',
'backbone',
'Shared/Messenger',
'Mixins/backbone.signalr.mixin'
11 years ago
], function (App, Backbone, Messenger) {
var ProgressMessageCollection = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/progressmessage',
11 years ago
model: Backbone.Model,
initialize: function(){
}
});
11 years ago
var collection = new ProgressMessageCollection();//.bindSignalR();
11 years ago
/* collection.signalRconnection.received(function (message) {
11 years ago
var type = getMessengerType(message.status);
var hideAfter = type === 'info' ? 60 :5;
11 years ago
Messenger.show({
id : message.commandId,
message : message.message,
type : type,
hideAfter: hideAfter
});
});*/
var getMessengerType = function (status) {
switch (status) {
case 'completed':
return 'success';
case 'failed':
return 'error';
default:
return 'info';
}
};
return collection;
});