1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 09:18:34 +00:00
Sonarr/UI/Shared/NotificationModel.js
kay.one 769331d45d updated jshint to 2.1.3
single quotes
2013-06-21 23:24:24 -07:00

39 lines
1 KiB
JavaScript

'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') {
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 '';
}
},
defaults: {
'level' : 'info',
'title' : '',
'message': ''
}
});
});