AutoComplete is now using jQuery UI AutoComplete.

Removed jquery.liveQuery.
This commit is contained in:
Mark McDowall 2011-09-08 20:26:48 -07:00
commit d330c65165
14 changed files with 107 additions and 380 deletions

View file

@ -4,7 +4,6 @@ using System.IO;
using System.Linq;
using System.Web.Mvc;
using NLog;
using NzbDrone.Core.Helpers;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Providers.Jobs;
@ -170,12 +169,16 @@ namespace NzbDrone.Web.Controllers
}
[HttpGet]
public JsonResult LookupSeries(string q)
public JsonResult LookupSeries(string term)
{
var tvDbResults = _tvDbProvider.SearchSeries(term).Select(r => new TvDbSearchResultModel
{
Id = r.Id,
Title = r.SeriesName,
FirstAired = r.FirstAired.ToShortDateString()
}).ToList();
var dataVal = _tvDbProvider.SearchSeries(q);
return Json(dataVal.Select(c => new KeyValuePair<int, string>(c.Id, c.SeriesName)), JsonRequestBehavior.AllowGet);
return Json(tvDbResults, JsonRequestBehavior.AllowGet);
}
public ActionResult RootList()

View file

@ -29,26 +29,26 @@ namespace NzbDrone.Web.Controllers
}
[HttpGet]
public JsonResult GetDirectories(string q)
public JsonResult GetDirectories(string term)
{
string[] dirs = null;
try
{
//Windows (Including UNC)
var windowsSep = q.LastIndexOf('\\');
var windowsSep = term.LastIndexOf('\\');
if (windowsSep > -1)
{
dirs = _diskProvider.GetDirectories(q.Substring(0, windowsSep + 1));
dirs = _diskProvider.GetDirectories(term.Substring(0, windowsSep + 1));
}
//Unix
var index = q.LastIndexOf('/');
var index = term.LastIndexOf('/');
if (index > -1)
{
dirs = _diskProvider.GetDirectories(q.Substring(0, index + 1));
dirs = _diskProvider.GetDirectories(term.Substring(0, index + 1));
}
}
catch

View file

@ -45,9 +45,13 @@ namespace NzbDrone.Web.Controllers
return View();
}
public ActionResult TestPartial()
public JsonResult TestResults(string q)
{
return View();
var results = new List<TvDbSearchResultModel>();
results.Add(new TvDbSearchResultModel { Id = 1, Title = "30 Rock", FirstAired = DateTime.Today.ToShortDateString() });
results.Add(new TvDbSearchResultModel { Id = 2, Title = "The Office", FirstAired = DateTime.Today.AddDays(-1).ToShortDateString() });
return Json(results, JsonRequestBehavior.AllowGet );
}
public ActionResult Index()