2013-02-14 17:18:29 +00:00
|
|
|
|
define(['app'], function () {
|
|
|
|
|
|
|
|
|
|
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
|
2013-02-15 03:10:03 +00:00
|
|
|
|
mutators:{
|
|
|
|
|
pre:function () {
|
|
|
|
|
try {
|
|
|
|
|
if (this.get('message')) {
|
|
|
|
|
return this.get('message').lines().lenght > 1;
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
return false;
|
2013-02-14 17:18:29 +00:00
|
|
|
|
}
|
2013-02-15 03:10:03 +00:00
|
|
|
|
|
2013-02-14 17:18:29 +00:00
|
|
|
|
},
|
2013-02-15 03:10:03 +00:00
|
|
|
|
iconClass:function () {
|
2013-02-14 17:18:29 +00:00
|
|
|
|
|
|
|
|
|
if (this.has('icon')) {
|
2013-02-15 03:10:03 +00:00
|
|
|
|
return 'icon';
|
2013-02-14 17:18:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2013-01-29 01:59:18 +00:00
|
|
|
|
},
|
|
|
|
|
|
2013-02-15 03:10:03 +00:00
|
|
|
|
defaults:{
|
|
|
|
|
"level":'info',
|
|
|
|
|
"title":'',
|
|
|
|
|
"message":''
|
2013-01-29 01:59:18 +00:00
|
|
|
|
}
|
2013-02-14 17:18:29 +00:00
|
|
|
|
});
|
|
|
|
|
});
|