mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-27 23:16:58 -04:00
rjs -> webpack
This commit is contained in:
@@ -1,28 +1,19 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'vent',
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView',
|
||||
'Mixins/AsValidatedView',
|
||||
'Mixins/DirectoryAutoComplete',
|
||||
'Mixins/FileBrowser'
|
||||
], function (vent, Marionette, AsModelBoundView, AsValidatedView) {
|
||||
var vent = require('../../../vent');
|
||||
var Marionette = require('marionette');
|
||||
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
|
||||
var AsValidatedView = require('../../../Mixins/AsValidatedView');
|
||||
require('../../../Mixins/DirectoryAutoComplete');
|
||||
require('../../../Mixins/FileBrowser');
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/MediaManagement/FileManagement/FileManagementViewTemplate',
|
||||
|
||||
ui: {
|
||||
recyclingBin : '.x-path'
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.ui.recyclingBin.fileBrowser();
|
||||
}
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
|
||||
return view;
|
||||
module.exports = (function(){
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/MediaManagement/FileManagement/FileManagementViewTemplate',
|
||||
ui : {recyclingBin : '.x-path'},
|
||||
onShow : function(){
|
||||
this.ui.recyclingBin.fileBrowser();
|
||||
}
|
||||
});
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
return view;
|
||||
}).call(this);
|
||||
@@ -1,34 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Settings/MediaManagement/Naming/NamingView',
|
||||
'Settings/MediaManagement/Sorting/SortingView',
|
||||
'Settings/MediaManagement/FileManagement/FileManagementView',
|
||||
'Settings/MediaManagement/Permissions/PermissionsView'
|
||||
], function (Marionette, NamingView, SortingView, FileManagementView, PermissionsView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Settings/MediaManagement/MediaManagementLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
episodeNaming : '#episode-naming',
|
||||
sorting : '#sorting',
|
||||
fileManagement : '#file-management',
|
||||
permissions : '#permissions'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
this.settings = options.settings;
|
||||
this.namingSettings = options.namingSettings;
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.episodeNaming.show(new NamingView({ model: this.namingSettings }));
|
||||
this.sorting.show(new SortingView({ model: this.settings }));
|
||||
this.fileManagement.show(new FileManagementView({ model: this.settings }));
|
||||
this.permissions.show(new PermissionsView({ model: this.settings }));
|
||||
}
|
||||
});
|
||||
});
|
||||
var Marionette = require('marionette');
|
||||
var NamingView = require('./Naming/NamingView');
|
||||
var SortingView = require('./Sorting/SortingView');
|
||||
var FileManagementView = require('./FileManagement/FileManagementView');
|
||||
var PermissionsView = require('./Permissions/PermissionsView');
|
||||
|
||||
module.exports = Marionette.Layout.extend({
|
||||
template : 'Settings/MediaManagement/MediaManagementLayoutTemplate',
|
||||
regions : {
|
||||
episodeNaming : '#episode-naming',
|
||||
sorting : '#sorting',
|
||||
fileManagement : '#file-management',
|
||||
permissions : '#permissions'
|
||||
},
|
||||
initialize : function(options){
|
||||
this.settings = options.settings;
|
||||
this.namingSettings = options.namingSettings;
|
||||
},
|
||||
onShow : function(){
|
||||
this.episodeNaming.show(new NamingView({model : this.namingSettings}));
|
||||
this.sorting.show(new SortingView({model : this.settings}));
|
||||
this.fileManagement.show(new FileManagementView({model : this.settings}));
|
||||
this.permissions.show(new PermissionsView({model : this.settings}));
|
||||
}
|
||||
});
|
||||
@@ -1,11 +1,7 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Settings/SettingsModelBase'
|
||||
], function (SettingsModelBase) {
|
||||
return SettingsModelBase.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/config/mediamanagement',
|
||||
successMessage: 'Media management settings saved',
|
||||
errorMessage : 'Failed to save media managemnent settings'
|
||||
});
|
||||
});
|
||||
var SettingsModelBase = require('../SettingsModelBase');
|
||||
|
||||
module.exports = SettingsModelBase.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/config/mediamanagement',
|
||||
successMessage : 'Media management settings saved',
|
||||
errorMessage : 'Failed to save media managemnent settings'
|
||||
});
|
||||
@@ -1,9 +1,3 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
var Backbone = require('backbone');
|
||||
|
||||
});
|
||||
});
|
||||
module.exports = Backbone.Model.extend({});
|
||||
@@ -1,133 +1,105 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'underscore',
|
||||
'marionette',
|
||||
'Config',
|
||||
'Settings/MediaManagement/Naming/NamingSampleModel',
|
||||
'Settings/MediaManagement/Naming/Basic/BasicNamingModel',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (_, Marionette, Config, NamingSampleModel, BasicNamingModel, AsModelBoundView) {
|
||||
var _ = require('underscore');
|
||||
var Marionette = require('marionette');
|
||||
var Config = require('../../../../Config');
|
||||
var NamingSampleModel = require('../NamingSampleModel');
|
||||
var BasicNamingModel = require('./BasicNamingModel');
|
||||
var AsModelBoundView = require('../../../../Mixins/AsModelBoundView');
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/MediaManagement/Naming/Basic/BasicNamingViewTemplate',
|
||||
|
||||
ui: {
|
||||
namingOptions : '.x-naming-options',
|
||||
singleEpisodeExample : '.x-single-episode-example',
|
||||
multiEpisodeExample : '.x-multi-episode-example',
|
||||
dailyEpisodeExample : '.x-daily-episode-example'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
this.namingModel = options.model;
|
||||
this.model = new BasicNamingModel();
|
||||
|
||||
this._parseNamingModel();
|
||||
|
||||
this.listenTo(this.model, 'change', this._buildFormat);
|
||||
this.listenTo(this.namingModel, 'sync', this._parseNamingModel);
|
||||
},
|
||||
|
||||
_parseNamingModel: function () {
|
||||
var standardFormat = this.namingModel.get('standardEpisodeFormat');
|
||||
|
||||
var includeSeriesTitle = standardFormat.match(/\{Series[-_. ]Title\}/i);
|
||||
var includeEpisodeTitle = standardFormat.match(/\{Episode[-_. ]Title\}/i);
|
||||
var includeQuality = standardFormat.match(/\{Quality[-_. ]Title\}/i);
|
||||
var numberStyle = standardFormat.match(/s?\{season(?:\:0+)?\}[ex]\{episode(?:\:0+)?\}/i);
|
||||
var replaceSpaces = standardFormat.indexOf(' ') === -1;
|
||||
var separator = standardFormat.match(/\}( - |\.-\.|\.| )|( - |\.-\.|\.| )\{/i);
|
||||
|
||||
if (separator === null || separator[1] === '.-.') {
|
||||
separator = ' - ';
|
||||
}
|
||||
|
||||
else {
|
||||
separator = separator[1];
|
||||
}
|
||||
|
||||
if (numberStyle === null) {
|
||||
numberStyle = 'S{season:00}E{episode:00}';
|
||||
}
|
||||
|
||||
else {
|
||||
numberStyle = numberStyle[0];
|
||||
}
|
||||
|
||||
this.model.set({
|
||||
includeSeriesTitle: includeSeriesTitle !== null,
|
||||
includeEpisodeTitle: includeEpisodeTitle !== null,
|
||||
includeQuality: includeQuality !== null,
|
||||
numberStyle: numberStyle,
|
||||
replaceSpaces: replaceSpaces,
|
||||
separator: separator
|
||||
}, { silent: true });
|
||||
},
|
||||
|
||||
_buildFormat: function () {
|
||||
if (Config.getValueBoolean(Config.Keys.AdvancedSettings)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var standardEpisodeFormat = '';
|
||||
var dailyEpisodeFormat = '';
|
||||
|
||||
if (this.model.get('includeSeriesTitle')) {
|
||||
if (this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat += '{Series.Title}';
|
||||
dailyEpisodeFormat += '{Series.Title}';
|
||||
}
|
||||
|
||||
else {
|
||||
standardEpisodeFormat += '{Series Title}';
|
||||
dailyEpisodeFormat += '{Series Title}';
|
||||
}
|
||||
|
||||
standardEpisodeFormat += this.model.get('separator');
|
||||
dailyEpisodeFormat += this.model.get('separator');
|
||||
}
|
||||
|
||||
standardEpisodeFormat += this.model.get('numberStyle');
|
||||
dailyEpisodeFormat += '{Air-Date}';
|
||||
|
||||
if (this.model.get('includeEpisodeTitle')) {
|
||||
standardEpisodeFormat += this.model.get('separator');
|
||||
dailyEpisodeFormat += this.model.get('separator');
|
||||
|
||||
if (this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat += '{Episode.Title}';
|
||||
dailyEpisodeFormat += '{Episode.Title}';
|
||||
}
|
||||
|
||||
else {
|
||||
standardEpisodeFormat += '{Episode Title}';
|
||||
dailyEpisodeFormat += '{Episode Title}';
|
||||
}
|
||||
}
|
||||
|
||||
if (this.model.get('includeQuality')) {
|
||||
if (this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat += ' {Quality.Title}';
|
||||
dailyEpisodeFormat += ' {Quality.Title}';
|
||||
}
|
||||
|
||||
else {
|
||||
standardEpisodeFormat += ' {Quality Title}';
|
||||
dailyEpisodeFormat += ' {Quality Title}';
|
||||
}
|
||||
}
|
||||
|
||||
if (this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat = standardEpisodeFormat.replace(/\s/g, '.');
|
||||
dailyEpisodeFormat = dailyEpisodeFormat.replace(/\s/g, '.');
|
||||
}
|
||||
|
||||
this.namingModel.set('standardEpisodeFormat', standardEpisodeFormat);
|
||||
this.namingModel.set('dailyEpisodeFormat', dailyEpisodeFormat);
|
||||
this.namingModel.set('animeEpisodeFormat', standardEpisodeFormat);
|
||||
module.exports = (function(){
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/MediaManagement/Naming/Basic/BasicNamingViewTemplate',
|
||||
ui : {
|
||||
namingOptions : '.x-naming-options',
|
||||
singleEpisodeExample : '.x-single-episode-example',
|
||||
multiEpisodeExample : '.x-multi-episode-example',
|
||||
dailyEpisodeExample : '.x-daily-episode-example'
|
||||
},
|
||||
initialize : function(options){
|
||||
this.namingModel = options.model;
|
||||
this.model = new BasicNamingModel();
|
||||
this._parseNamingModel();
|
||||
this.listenTo(this.model, 'change', this._buildFormat);
|
||||
this.listenTo(this.namingModel, 'sync', this._parseNamingModel);
|
||||
},
|
||||
_parseNamingModel : function(){
|
||||
var standardFormat = this.namingModel.get('standardEpisodeFormat');
|
||||
var includeSeriesTitle = standardFormat.match(/\{Series[-_. ]Title\}/i);
|
||||
var includeEpisodeTitle = standardFormat.match(/\{Episode[-_. ]Title\}/i);
|
||||
var includeQuality = standardFormat.match(/\{Quality[-_. ]Title\}/i);
|
||||
var numberStyle = standardFormat.match(/s?\{season(?:\:0+)?\}[ex]\{episode(?:\:0+)?\}/i);
|
||||
var replaceSpaces = standardFormat.indexOf(' ') === -1;
|
||||
var separator = standardFormat.match(/\}( - |\.-\.|\.| )|( - |\.-\.|\.| )\{/i);
|
||||
if(separator === null || separator[1] === '.-.') {
|
||||
separator = ' - ';
|
||||
}
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
else {
|
||||
separator = separator[1];
|
||||
}
|
||||
if(numberStyle === null) {
|
||||
numberStyle = 'S{season:00}E{episode:00}';
|
||||
}
|
||||
else {
|
||||
numberStyle = numberStyle[0];
|
||||
}
|
||||
this.model.set({
|
||||
includeSeriesTitle : includeSeriesTitle !== null,
|
||||
includeEpisodeTitle : includeEpisodeTitle !== null,
|
||||
includeQuality : includeQuality !== null,
|
||||
numberStyle : numberStyle,
|
||||
replaceSpaces : replaceSpaces,
|
||||
separator : separator
|
||||
}, {silent : true});
|
||||
},
|
||||
_buildFormat : function(){
|
||||
if(Config.getValueBoolean(Config.Keys.AdvancedSettings)) {
|
||||
return;
|
||||
}
|
||||
var standardEpisodeFormat = '';
|
||||
var dailyEpisodeFormat = '';
|
||||
if(this.model.get('includeSeriesTitle')) {
|
||||
if(this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat += '{Series.Title}';
|
||||
dailyEpisodeFormat += '{Series.Title}';
|
||||
}
|
||||
else {
|
||||
standardEpisodeFormat += '{Series Title}';
|
||||
dailyEpisodeFormat += '{Series Title}';
|
||||
}
|
||||
standardEpisodeFormat += this.model.get('separator');
|
||||
dailyEpisodeFormat += this.model.get('separator');
|
||||
}
|
||||
standardEpisodeFormat += this.model.get('numberStyle');
|
||||
dailyEpisodeFormat += '{Air-Date}';
|
||||
if(this.model.get('includeEpisodeTitle')) {
|
||||
standardEpisodeFormat += this.model.get('separator');
|
||||
dailyEpisodeFormat += this.model.get('separator');
|
||||
if(this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat += '{Episode.Title}';
|
||||
dailyEpisodeFormat += '{Episode.Title}';
|
||||
}
|
||||
else {
|
||||
standardEpisodeFormat += '{Episode Title}';
|
||||
dailyEpisodeFormat += '{Episode Title}';
|
||||
}
|
||||
}
|
||||
if(this.model.get('includeQuality')) {
|
||||
if(this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat += ' {Quality.Title}';
|
||||
dailyEpisodeFormat += ' {Quality.Title}';
|
||||
}
|
||||
else {
|
||||
standardEpisodeFormat += ' {Quality Title}';
|
||||
dailyEpisodeFormat += ' {Quality Title}';
|
||||
}
|
||||
}
|
||||
if(this.model.get('replaceSpaces')) {
|
||||
standardEpisodeFormat = standardEpisodeFormat.replace(/\s/g, '.');
|
||||
dailyEpisodeFormat = dailyEpisodeFormat.replace(/\s/g, '.');
|
||||
}
|
||||
this.namingModel.set('standardEpisodeFormat', standardEpisodeFormat);
|
||||
this.namingModel.set('dailyEpisodeFormat', dailyEpisodeFormat);
|
||||
this.namingModel.set('animeEpisodeFormat', standardEpisodeFormat);
|
||||
}
|
||||
});
|
||||
return AsModelBoundView.call(view);
|
||||
}).call(this);
|
||||
@@ -1,11 +1,7 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Settings/SettingsModelBase'
|
||||
], function (ModelBase) {
|
||||
return ModelBase.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/config/naming',
|
||||
successMessage: 'MediaManagement settings saved',
|
||||
errorMessage : 'Couldn\'t save naming settings'
|
||||
});
|
||||
});
|
||||
var ModelBase = require('../../SettingsModelBase');
|
||||
|
||||
module.exports = ModelBase.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/config/naming',
|
||||
successMessage : 'MediaManagement settings saved',
|
||||
errorMessage : 'Couldn\'t save naming settings'
|
||||
});
|
||||
@@ -1,9 +1,3 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
url: window.NzbDrone.ApiRoot + '/config/naming/samples'
|
||||
});
|
||||
});
|
||||
var Backbone = require('backbone');
|
||||
|
||||
module.exports = Backbone.Model.extend({url : window.NzbDrone.ApiRoot + '/config/naming/samples'});
|
||||
@@ -1,111 +1,87 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'underscore',
|
||||
'marionette',
|
||||
'Settings/MediaManagement/Naming/NamingSampleModel',
|
||||
'Settings/MediaManagement/Naming/Basic/BasicNamingView',
|
||||
'Mixins/AsModelBoundView',
|
||||
'Mixins/AsValidatedView'
|
||||
], function (_, Marionette, NamingSampleModel, BasicNamingView, AsModelBoundView, AsValidatedView) {
|
||||
var _ = require('underscore');
|
||||
var Marionette = require('marionette');
|
||||
var NamingSampleModel = require('./NamingSampleModel');
|
||||
var BasicNamingView = require('./Basic/BasicNamingView');
|
||||
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
|
||||
var AsValidatedView = require('../../../Mixins/AsValidatedView');
|
||||
|
||||
var view = Marionette.Layout.extend({
|
||||
template: 'Settings/MediaManagement/Naming/NamingViewTemplate',
|
||||
|
||||
ui: {
|
||||
namingOptions : '.x-naming-options',
|
||||
renameEpisodesCheckbox : '.x-rename-episodes',
|
||||
singleEpisodeExample : '.x-single-episode-example',
|
||||
multiEpisodeExample : '.x-multi-episode-example',
|
||||
dailyEpisodeExample : '.x-daily-episode-example',
|
||||
animeEpisodeExample : '.x-anime-episode-example',
|
||||
animeMultiEpisodeExample : '.x-anime-multi-episode-example',
|
||||
namingTokenHelper : '.x-naming-token-helper',
|
||||
multiEpisodeStyle : '.x-multi-episode-style',
|
||||
seriesFolderExample : '.x-series-folder-example',
|
||||
seasonFolderExample : '.x-season-folder-example'
|
||||
},
|
||||
|
||||
events: {
|
||||
'change .x-rename-episodes' : '_setFailedDownloadOptionsVisibility',
|
||||
'click .x-show-wizard' : '_showWizard',
|
||||
'click .x-naming-token-helper a' : '_addToken',
|
||||
'change .x-multi-episode-style' : '_multiEpisodeFomatChanged'
|
||||
},
|
||||
|
||||
regions: {
|
||||
basicNamingRegion: '.x-basic-naming'
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
if (!this.model.get('renameEpisodes')) {
|
||||
this.ui.namingOptions.hide();
|
||||
}
|
||||
|
||||
var basicNamingView = new BasicNamingView({ model: this.model });
|
||||
this.basicNamingRegion.show(basicNamingView);
|
||||
this.namingSampleModel = new NamingSampleModel();
|
||||
|
||||
this.listenTo(this.model, 'change', this._updateSamples);
|
||||
this.listenTo(this.namingSampleModel, 'sync', this._showSamples);
|
||||
this._updateSamples();
|
||||
},
|
||||
|
||||
_setFailedDownloadOptionsVisibility: function () {
|
||||
var checked = this.ui.renameEpisodesCheckbox.prop('checked');
|
||||
if (checked) {
|
||||
this.ui.namingOptions.slideDown();
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.namingOptions.slideUp();
|
||||
}
|
||||
},
|
||||
|
||||
_updateSamples: function () {
|
||||
this.namingSampleModel.fetch({ data: this.model.toJSON() });
|
||||
},
|
||||
|
||||
_showSamples: function () {
|
||||
this.ui.singleEpisodeExample.html(this.namingSampleModel.get('singleEpisodeExample'));
|
||||
this.ui.multiEpisodeExample.html(this.namingSampleModel.get('multiEpisodeExample'));
|
||||
this.ui.dailyEpisodeExample.html(this.namingSampleModel.get('dailyEpisodeExample'));
|
||||
this.ui.animeEpisodeExample.html(this.namingSampleModel.get('animeEpisodeExample'));
|
||||
this.ui.animeMultiEpisodeExample.html(this.namingSampleModel.get('animeMultiEpisodeExample'));
|
||||
this.ui.seriesFolderExample.html(this.namingSampleModel.get('seriesFolderExample'));
|
||||
this.ui.seasonFolderExample.html(this.namingSampleModel.get('seasonFolderExample'));
|
||||
},
|
||||
|
||||
_addToken: function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
var target = e.target;
|
||||
var token = '';
|
||||
var input = this.$(target).closest('.x-helper-input').children('input');
|
||||
|
||||
if (this.$(target).attr('data-token')) {
|
||||
token = '{{0}}'.format(this.$(target).attr('data-token'));
|
||||
}
|
||||
|
||||
else {
|
||||
token = this.$(target).attr('data-separator');
|
||||
}
|
||||
|
||||
input.val(input.val() + token);
|
||||
input.change();
|
||||
|
||||
this.ui.namingTokenHelper.removeClass('open');
|
||||
input.focus();
|
||||
},
|
||||
|
||||
multiEpisodeFormatChanged: function () {
|
||||
this.model.set('multiEpisodeStyle', this.ui.multiEpisodeStyle.val());
|
||||
module.exports = (function(){
|
||||
var view = Marionette.Layout.extend({
|
||||
template : 'Settings/MediaManagement/Naming/NamingViewTemplate',
|
||||
ui : {
|
||||
namingOptions : '.x-naming-options',
|
||||
renameEpisodesCheckbox : '.x-rename-episodes',
|
||||
singleEpisodeExample : '.x-single-episode-example',
|
||||
multiEpisodeExample : '.x-multi-episode-example',
|
||||
dailyEpisodeExample : '.x-daily-episode-example',
|
||||
animeEpisodeExample : '.x-anime-episode-example',
|
||||
animeMultiEpisodeExample : '.x-anime-multi-episode-example',
|
||||
namingTokenHelper : '.x-naming-token-helper',
|
||||
multiEpisodeStyle : '.x-multi-episode-style',
|
||||
seriesFolderExample : '.x-series-folder-example',
|
||||
seasonFolderExample : '.x-season-folder-example'
|
||||
},
|
||||
events : {
|
||||
"change .x-rename-episodes" : '_setFailedDownloadOptionsVisibility',
|
||||
"click .x-show-wizard" : '_showWizard',
|
||||
"click .x-naming-token-helper a" : '_addToken',
|
||||
"change .x-multi-episode-style" : '_multiEpisodeFomatChanged'
|
||||
},
|
||||
regions : {basicNamingRegion : '.x-basic-naming'},
|
||||
onRender : function(){
|
||||
if(!this.model.get('renameEpisodes')) {
|
||||
this.ui.namingOptions.hide();
|
||||
}
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
|
||||
return view;
|
||||
var basicNamingView = new BasicNamingView({model : this.model});
|
||||
this.basicNamingRegion.show(basicNamingView);
|
||||
this.namingSampleModel = new NamingSampleModel();
|
||||
this.listenTo(this.model, 'change', this._updateSamples);
|
||||
this.listenTo(this.namingSampleModel, 'sync', this._showSamples);
|
||||
this._updateSamples();
|
||||
},
|
||||
_setFailedDownloadOptionsVisibility : function(){
|
||||
var checked = this.ui.renameEpisodesCheckbox.prop('checked');
|
||||
if(checked) {
|
||||
this.ui.namingOptions.slideDown();
|
||||
}
|
||||
else {
|
||||
this.ui.namingOptions.slideUp();
|
||||
}
|
||||
},
|
||||
_updateSamples : function(){
|
||||
this.namingSampleModel.fetch({data : this.model.toJSON()});
|
||||
},
|
||||
_showSamples : function(){
|
||||
this.ui.singleEpisodeExample.html(this.namingSampleModel.get('singleEpisodeExample'));
|
||||
this.ui.multiEpisodeExample.html(this.namingSampleModel.get('multiEpisodeExample'));
|
||||
this.ui.dailyEpisodeExample.html(this.namingSampleModel.get('dailyEpisodeExample'));
|
||||
this.ui.animeEpisodeExample.html(this.namingSampleModel.get('animeEpisodeExample'));
|
||||
this.ui.animeMultiEpisodeExample.html(this.namingSampleModel.get('animeMultiEpisodeExample'));
|
||||
this.ui.seriesFolderExample.html(this.namingSampleModel.get('seriesFolderExample'));
|
||||
this.ui.seasonFolderExample.html(this.namingSampleModel.get('seasonFolderExample'));
|
||||
},
|
||||
_addToken : function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var target = e.target;
|
||||
var token = '';
|
||||
var input = this.$(target).closest('.x-helper-input').children('input');
|
||||
if(this.$(target).attr('data-token')) {
|
||||
token = '{{0}}'.format(this.$(target).attr('data-token'));
|
||||
}
|
||||
else {
|
||||
token = this.$(target).attr('data-separator');
|
||||
}
|
||||
input.val(input.val() + token);
|
||||
input.change();
|
||||
this.ui.namingTokenHelper.removeClass('open');
|
||||
input.focus();
|
||||
},
|
||||
multiEpisodeFormatChanged : function(){
|
||||
this.model.set('multiEpisodeStyle', this.ui.multiEpisodeStyle.val());
|
||||
}
|
||||
});
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
return view;
|
||||
}).call(this);
|
||||
@@ -1,17 +1,10 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView',
|
||||
'Mixins/AsValidatedView'
|
||||
], function (Marionette, AsModelBoundView, AsValidatedView) {
|
||||
var Marionette = require('marionette');
|
||||
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
|
||||
var AsValidatedView = require('../../../Mixins/AsValidatedView');
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/MediaManagement/Permissions/PermissionsViewTemplate'
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
|
||||
return view;
|
||||
});
|
||||
module.exports = (function(){
|
||||
var view = Marionette.ItemView.extend({template : 'Settings/MediaManagement/Permissions/PermissionsViewTemplate'});
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
return view;
|
||||
}).call(this);
|
||||
@@ -1,17 +1,10 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView',
|
||||
'Mixins/AsValidatedView'
|
||||
], function (Marionette, AsModelBoundView, AsValidatedView) {
|
||||
var Marionette = require('marionette');
|
||||
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
|
||||
var AsValidatedView = require('../../../Mixins/AsValidatedView');
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/MediaManagement/Sorting/SortingViewTemplate'
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
|
||||
return view;
|
||||
});
|
||||
module.exports = (function(){
|
||||
var view = Marionette.ItemView.extend({template : 'Settings/MediaManagement/Sorting/SortingViewTemplate'});
|
||||
AsModelBoundView.call(view);
|
||||
AsValidatedView.call(view);
|
||||
return view;
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user