2013-03-04 03:09:43 +03:00
|
|
|
'use strict';
|
2013-06-14 02:19:24 +03:00
|
|
|
define(['app',
|
|
|
|
'Settings/Naming/NamingModel',
|
|
|
|
'Settings/SyncNotification'], function () {
|
2013-03-04 03:09:43 +03:00
|
|
|
|
|
|
|
NzbDrone.Settings.Naming.NamingView = Backbone.Marionette.ItemView.extend({
|
2013-03-30 02:28:58 +03:00
|
|
|
template : 'Settings/Naming/NamingTemplate',
|
2013-03-04 03:09:43 +03:00
|
|
|
|
2013-03-30 02:28:58 +03:00
|
|
|
initialize: function () {
|
2013-04-25 07:27:49 +03:00
|
|
|
this.model = new NzbDrone.Settings.Naming.NamingModel();
|
|
|
|
this.model.fetch();
|
|
|
|
|
|
|
|
NzbDrone.vent.on(NzbDrone.Commands.SaveSettings, this.saveSettings, this);
|
2013-03-07 11:01:18 +03:00
|
|
|
},
|
|
|
|
|
2013-04-25 07:27:49 +03:00
|
|
|
saveSettings: function () {
|
2013-06-14 02:19:24 +03:00
|
|
|
this.model.saveIfChanged(undefined, NzbDrone.Settings.SyncNotificaiton.callback({
|
2013-06-01 03:22:47 +03:00
|
|
|
successMessage: 'Naming Settings saved',
|
|
|
|
errorMessage: "Failed to save Naming Settings"
|
|
|
|
}));
|
2013-03-04 03:09:43 +03:00
|
|
|
}
|
|
|
|
});
|
2013-04-25 07:27:49 +03:00
|
|
|
})
|
|
|
|
;
|