1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-07-07 00:59:18 +02:00
Files
Sonarr/UI/Shared/NotificationModel.js

40 lines
1.0 KiB
JavaScript
Raw Normal View History

2013-06-21 23:24:24 -07:00
'use strict';
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') {
2013-06-21 23:24:24 -07:00
return 'icon-info-sign';
} else if (this.get('level') === 'success') {
return 'icon-ok-sign';
} else if (this.get('level') === 'error') {
return 'icon-warning-sign';
}
2013-06-21 23:24:24 -07:00
return '';
2013-01-31 19:15:19 -08:00
}
},
defaults: {
2013-06-21 23:24:24 -07:00
'level' : 'info',
'title' : '',
'message': ''
}
});
2013-06-21 23:24:24 -07:00
});