mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
parent
ef62af75df
commit
b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions
|
@ -1,79 +1,81 @@
|
|||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'app', 'marionette', 'Mixins/AsModelBoundView', 'bootstrap'
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView',
|
||||
'bootstrap'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
|
||||
], function (App, Marionette, AsModelBoundView) {
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/DownloadClientTemplate',
|
||||
className: 'form-horizontal',
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/DownloadClientTemplate',
|
||||
className: 'form-horizontal',
|
||||
ui: {
|
||||
bsSwitch : '.switch',
|
||||
tooltip : '.help-inline i',
|
||||
pathInput : '.x-path',
|
||||
sabConfig : '.x-sab-config',
|
||||
blackholeConfig : '.x-blackhole-config',
|
||||
pneumaticConfig : '.x-pneumatic-config',
|
||||
nzbGetConfig : '.x-nzbget-config',
|
||||
downloadClientSelect: '.x-download-client'
|
||||
},
|
||||
|
||||
ui: {
|
||||
bsSwitch : '.switch',
|
||||
tooltip : '.help-inline i',
|
||||
pathInput : '.x-path',
|
||||
sabConfig : '.x-sab-config',
|
||||
blackholeConfig : '.x-blackhole-config',
|
||||
pneumaticConfig : '.x-pneumatic-config',
|
||||
nzbGetConfig : '.x-nzbget-config',
|
||||
downloadClientSelect: '.x-download-client'
|
||||
},
|
||||
events: {
|
||||
'change .x-download-client': 'downloadClientChanged'
|
||||
},
|
||||
|
||||
events: {
|
||||
'change .x-download-client': 'downloadClientChanged'
|
||||
},
|
||||
onRender: function () {
|
||||
this.ui.pathInput.autoComplete('/directories');
|
||||
this.refreshUIVisibility(this.model.get('downloadClient'));
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
this.ui.pathInput.autoComplete('/directories');
|
||||
this.refreshUIVisibility(this.model.get('downloadClient'));
|
||||
},
|
||||
downloadClientChanged: function () {
|
||||
var clientId = this.ui.downloadClientSelect.val();
|
||||
this.refreshUIVisibility(clientId);
|
||||
},
|
||||
|
||||
downloadClientChanged: function () {
|
||||
var clientId = this.ui.downloadClientSelect.val();
|
||||
this.refreshUIVisibility(clientId);
|
||||
},
|
||||
refreshUIVisibility: function (clientId) {
|
||||
|
||||
refreshUIVisibility: function (clientId) {
|
||||
if (!clientId) {
|
||||
clientId = 'sabnzbd';
|
||||
}
|
||||
|
||||
if (!clientId) {
|
||||
clientId = 'sabnzbd';
|
||||
switch (clientId.toString()) {
|
||||
case 'sabnzbd':
|
||||
this.ui.sabConfig.show();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'blackhole':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.show();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'pneumatic':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.show();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'nzbget':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.show();
|
||||
break;
|
||||
|
||||
default :
|
||||
throw 'unknown download client id' + clientId;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
switch (clientId.toString()) {
|
||||
case 'sabnzbd':
|
||||
this.ui.sabConfig.show();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'blackhole':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.show();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'pneumatic':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.show();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'nzbget':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.show();
|
||||
break;
|
||||
|
||||
default :
|
||||
throw 'unknown download client id' + clientId;
|
||||
}
|
||||
}
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue