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