2013-01-29 04:59:18 +03:00
|
|
|
/// <reference path="../app.js" />
|
|
|
|
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
|
|
|
|
|
|
|
|
mutators: {
|
|
|
|
pre: function () {
|
2013-02-01 06:15:19 +03:00
|
|
|
if (this.get('message')) {
|
|
|
|
return this.get('message').lines().lenght > 1;
|
|
|
|
}
|
2013-01-29 04:59:18 +03:00
|
|
|
},
|
|
|
|
iconClass: function () {
|
|
|
|
|
|
|
|
if (this.has('icon')) {
|
|
|
|
return "icon";
|
|
|
|
}
|
|
|
|
|
2013-01-30 09:52:31 +03:00
|
|
|
if (this.get('level') === 'info') {
|
2013-01-29 04:59:18 +03:00
|
|
|
return "icon-info-sign";
|
|
|
|
}
|
2013-01-30 09:52:31 +03:00
|
|
|
else if (this.get('level') === 'success') {
|
2013-01-29 04:59:18 +03:00
|
|
|
return 'icon-ok-sign';
|
|
|
|
}
|
2013-01-30 09:52:31 +03:00
|
|
|
else if (this.get('level') === 'error') {
|
2013-01-29 04:59:18 +03:00
|
|
|
return 'icon-warning-sign';
|
|
|
|
}
|
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
defaults: {
|
|
|
|
"level": "info",
|
|
|
|
"title": "",
|
|
|
|
"message": "",
|
|
|
|
}
|
|
|
|
});
|
2013-02-01 01:40:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.Shared.NotificationCollection = Backbone.Collection.extend({
|
|
|
|
|
|
|
|
model: NzbDrone.Shared.NotificationModel,
|
|
|
|
|
|
|
|
});
|