mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 20:44:00 +02:00
Added examples to naming settings
This commit is contained in:
@@ -10,7 +10,9 @@ define(
|
||||
|
||||
ui: {
|
||||
namingOptions : '.x-naming-options',
|
||||
renameEpisodesCheckbox: '.x-rename-episodes'
|
||||
renameEpisodesCheckbox: '.x-rename-episodes',
|
||||
singleEpisodeExample : '.x-single-episode-example',
|
||||
multiEpisodeExample : '.x-multi-episode-example'
|
||||
},
|
||||
|
||||
events: {
|
||||
@@ -21,6 +23,9 @@ define(
|
||||
if(!this.model.get('renameEpisodes')){
|
||||
this.ui.namingOptions.hide();
|
||||
}
|
||||
|
||||
this.listenTo(this.model, 'change', this._buildExamples);
|
||||
this._buildExamples();
|
||||
},
|
||||
|
||||
_setNamingOptionsVisibility: function () {
|
||||
@@ -32,6 +37,24 @@ define(
|
||||
else {
|
||||
this.ui.namingOptions.slideUp();
|
||||
}
|
||||
},
|
||||
|
||||
_buildExamples: function () {
|
||||
var self = this;
|
||||
|
||||
var data = this.model.toJSON();
|
||||
data.id = 0;
|
||||
|
||||
var promise = $.ajax({
|
||||
type: 'POST',
|
||||
url : window.ApiRoot + '/naming',
|
||||
data: JSON.stringify(data)
|
||||
});
|
||||
|
||||
promise.done(function (result) {
|
||||
self.ui.singleEpisodeExample.html(result.singleEpisodeExample);
|
||||
self.ui.multiEpisodeExample.html(result.multiEpisodeExample);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user