mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Moved NzbDrone scripts to Scripts/NzbDrone.
Moved Plugin scripts to Scripts (Compatibility with Nuget). jquery.validate.unobtrusive.min.js no longer uses CDN (Now a Nuget package).
This commit is contained in:
parent
3e3551f4d0
commit
86eb70bcbb
47 changed files with 5736 additions and 55 deletions
133
NzbDrone.Web/Scripts/NzbDrone/addSeries.js
Normal file
133
NzbDrone.Web/Scripts/NzbDrone/addSeries.js
Normal file
|
@ -0,0 +1,133 @@
|
|||
//URLs
|
||||
var addSeriesUrl = '../AddSeries/AddExistingSeries';
|
||||
var addNewSeriesUrl = '../AddSeries/AddNewSeries';
|
||||
var quickAddNewSeriesUrl = '../AddSeries/QuickAddNewSeries';
|
||||
var existingSeriesUrl = '../AddSeries/ExistingSeries';
|
||||
var addNewUrl = '../AddSeries/AddNew';
|
||||
|
||||
var deleteRootDirUrl = '../AddSeries/DeleteRootDir';
|
||||
var saveRootDirUrl = '../AddSeries/SaveRootDir';
|
||||
var rootListUrl = '../AddSeries/RootList';
|
||||
|
||||
|
||||
//ExistingSeries
|
||||
$(".masterQualitySelector").live('change', function () {
|
||||
|
||||
var profileId = $(this).val();
|
||||
$("#existingSeries").find(".qualitySelector").each(function () {
|
||||
$(this).val(profileId);
|
||||
});
|
||||
});
|
||||
|
||||
$(".addExistingButton").live('click', function () {
|
||||
|
||||
var root = $(this).parents(".existingSeries");
|
||||
|
||||
var title = $(this).siblings(".seriesLookup").val();
|
||||
var seriesId = $(this).siblings(".seriesId").val();
|
||||
var qualityId = $(this).siblings(".qualitySelector").val();
|
||||
|
||||
var path = root.find(".seriesPathValue Label").text();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: addSeriesUrl,
|
||||
data: jQuery.param({ path: path, seriesName: title, seriesId: seriesId, qualityProfileId: qualityId }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not add " + path + " at this time. " + error);
|
||||
},
|
||||
success: function () {
|
||||
root.hide('highlight', 'fast');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function reloadExistingSeries() {
|
||||
$.get(existingSeriesUrl, function (data) {
|
||||
$('#existingSeries').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
//RootDir
|
||||
$('#rootDirs .actionButton img').live('click', function (image) {
|
||||
var path = $(image.target).attr('id');
|
||||
$.post(deleteRootDirUrl, { Path: path }, function () {
|
||||
refreshRoot();
|
||||
});
|
||||
});
|
||||
|
||||
$('#saveDir').live('click', saveRootDir);
|
||||
|
||||
function saveRootDir() {
|
||||
var path = $("#rootDirInput").val();
|
||||
if (path) {
|
||||
$.post(saveRootDirUrl, { Path: path }, function () {
|
||||
refreshRoot();
|
||||
$("#rootDirInput").val('');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function refreshRoot() {
|
||||
$.get(rootListUrl, function (data) {
|
||||
$('#rootDirs').html(data);
|
||||
});
|
||||
reloadAddNew();
|
||||
reloadExistingSeries();
|
||||
}
|
||||
|
||||
|
||||
//AddNew
|
||||
$('#saveNewSeries').live('click', function () {
|
||||
var seriesTitle = $("#newSeriesLookup").val();
|
||||
var seriesId = $("#newSeriesId").val();
|
||||
var qualityId = $("#qualityList").val();
|
||||
var path = $('#newSeriesPath').val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: addNewSeriesUrl,
|
||||
data: jQuery.param({ path: path, seriesName: seriesTitle, seriesId: seriesId, qualityProfileId: qualityId }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not add " + path + " at this time. " + error);
|
||||
},
|
||||
success: function () {
|
||||
$("#newSeriesLookup").val("");
|
||||
//$('#newSeriesPath').val("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function reloadAddNew() {
|
||||
$.get(addNewUrl, function (data) {
|
||||
$('#addNewSeries').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//QuickAddNew
|
||||
$('#quickAddNew').live('click', function () {
|
||||
var seriesTitle = $("#newSeriesLookup").val();
|
||||
var seriesId = $("#newSeriesId").val();
|
||||
var qualityId = $("#qualityList").val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: quickAddNewSeriesUrl,
|
||||
data: jQuery.param({ seriesName: seriesTitle, seriesId: seriesId, qualityProfileId: qualityId }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not add " + path + " at this time. " + error);
|
||||
},
|
||||
success: function () {
|
||||
$("#newSeriesLookup").val("");
|
||||
//$('#newSeriesPath').val("");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//On load
|
||||
jQuery(document).ready(function () {
|
||||
//RootDir
|
||||
$('#rootDirInput').watermark('Enter your new root folder path...');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue