fixes #358 - Weather validation in Server configuration

This commit is contained in:
Luke Pulverenti 2013-06-23 11:02:53 -04:00
parent 2819522ca5
commit 85f129c738
4 changed files with 1 additions and 37 deletions

View File

@ -1245,24 +1245,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
});
};
/**
* Gets weather info
* @param {String} location - us zip code / city, state, country / city, country
* Omit location to get weather info using stored server configuration value
*/
self.getWeatherInfo = function (location) {
var url = self.getUrl("weather", {
location: location
});
return self.ajax({
type: "GET",
url: url,
dataType: "json"
});
};
/**
* Gets all users from the server
*/

View File

@ -11,20 +11,6 @@
<form id="clientSettingsForm">
<ul data-role="listview" class="ulForm">
<li>
<label for="txtWeatherLocation">Weather location: </label>
<input id="txtWeatherLocation" name="txtWeatherLocation" type="text" />
<div class="fieldDescription">
US zip code / City, State, Country / City, Country
</div>
</li>
<li>
<label for="selectWeatherUnit">Weather display unit: </label>
<select id="selectWeatherUnit" name="selectWeatherUnit">
<option value="Celsius">Celsius</option>
<option value="Fahrenheit">Fahrenheit</option>
</select>
</li>
<li>
<label for="txtMinResumePct">Min resume percentage: </label>
<input type="number" id="txtMinResumePct" name="txtMinResumePct" pattern="[0-9]*" required="required" min="0" max="100" />

View File

@ -8,11 +8,9 @@
ApiClient.getServerConfiguration().done(function (config) {
$('#txtWeatherLocation', page).val(config.WeatherLocation);
$('#txtMinResumePct', page).val(config.MinResumePct);
$('#txtMaxResumePct', page).val(config.MaxResumePct);
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
$('#selectWeatherUnit', page).val(config.WeatherUnit).selectmenu("refresh");
$('input:first', page).focus();
@ -31,8 +29,6 @@
ApiClient.getServerConfiguration().done(function (config) {
config.WeatherLocation = $('#txtWeatherLocation', form).val();
config.WeatherUnit = $('#selectWeatherUnit', form).val();
config.MinResumePct = $('#txtMinResumePct', form).val();
config.MaxResumePct = $('#txtMaxResumePct', form).val();
config.MinResumeDurationSeconds = $('#txtMinResumeDuration', form).val();

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.124" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.125" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.54" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.54" targetFramework="net45" />
</packages>