1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 17:57:43 +00:00
Sonarr/NzbDrone.Backbone/Shared/NotificationModel.js

38 lines
1,008 B
JavaScript
Raw Normal View History

define(['app'], function () {
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
mutators:{
preFormattedMessage:function () {
return this.get('message').replace(/\\r\\n/g, '<br>');
},
isPreFormatted:function () {
return this.get('message').indexOf('\\r\\n') !== -1;
},
iconClass:function () {
if (this.has('icon')) {
return 'icon';
}
if (this.get('level') === 'info') {
return "icon-info-sign";
} else if (this.get('level') === 'success') {
return 'icon-ok-sign';
} else if (this.get('level') === 'error') {
return 'icon-warning-sign';
}
return "";
2013-02-01 03:15:19 +00:00
}
},
defaults:{
"level":'info',
"title":'',
"message":''
}
});
});