1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add tuner setup to startup wizard

This commit is contained in:
Luke Pulverenti 2015-08-20 16:54:00 -04:00
parent 5f0a0abec5
commit c51d10dbc6
7 changed files with 147 additions and 15 deletions

View file

@ -662,6 +662,11 @@ h1 .imageLink {
padding-top: 5px; padding-top: 5px;
} }
paper-input + .fieldDescription {
padding-top: 5px;
opacity: .9;
}
.warningFieldDescription { .warningFieldDescription {
padding: 5px; padding: 5px;
border: 1px solid #f4c63f; border: 1px solid #f4c63f;

View file

@ -0,0 +1,86 @@
(function ($, document) {
function save(page) {
Dashboard.showLoadingMsg();
var apiClient = ApiClient;
// After saving chapter task, now save server config
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
config.LiveTvTunerType = $('#selectTunerType', page).val();
config.LiveTvTunerPath = $('.txtDevicePath', page).val();
apiClient.ajax({
type: 'POST',
data: config,
url: apiClient.getUrl('Startup/Configuration')
}).done(function () {
Dashboard.hideLoadingMsg();
navigateToNextPage();
});
});
}
function reload(page) {
Dashboard.showLoadingMsg();
var apiClient = ApiClient;
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
$('#selectTunerType', page).val(config.LiveTvTunerType || '').selectmenu("refresh");
page.querySelector('.txtDevicePath').value = config.LiveTvTunerPath || '';
Dashboard.hideLoadingMsg();
});
}
function navigateToNextPage() {
skip();
}
function skip() {
var apiClient = ApiClient;
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
if (info.SupportsRunningAsService) {
Dashboard.navigate('wizardservice.html');
} else {
Dashboard.navigate('wizardagreement.html');
}
});
}
function onSubmit() {
var form = this;
save(form);
return false;
}
$(document).on('pageinitdepends', "#wizardTunerPage", function () {
var page = this;
$('form', page).off('submit', onSubmit).on('submit', onSubmit);
$('.btnSkip', page).on('click', skip);
}).on('pageshowready', "#wizardTunerPage", function () {
var page = this;
reload(page);
});
})(jQuery, document, window);

View file

@ -59,17 +59,7 @@
function navigateToNextPage() { function navigateToNextPage() {
var apiClient = ApiClient; Dashboard.navigate('wizardlivetvtuner.html');
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
if (info.SupportsRunningAsService) {
Dashboard.navigate('wizardservice.html');
} else {
Dashboard.navigate('wizardagreement.html');
}
});
} }
function onSubmit() { function onSubmit() {

View file

@ -1524,5 +1524,8 @@
"HeaderMetadata": "Metadata", "HeaderMetadata": "Metadata",
"HeaderRecordingOptions": "Recording Options", "HeaderRecordingOptions": "Recording Options",
"ButtonShare": "Share", "ButtonShare": "Share",
"HeaderUpcomingForKids": "Upcoming for Kids" "HeaderUpcomingForKids": "Upcoming for Kids",
"HeaderSetupLiveTV": "Setup Live TV",
"LabelTunerType": "Tuner type:",
"HelpMoreTunersCanBeAdded": "More tuners can be added later within the Live TV section."
} }

View file

@ -381,13 +381,16 @@ paper-menu-item {
paper-input label, paper-textarea label { paper-input label, paper-textarea label {
font-size: 18px !important; font-size: 18px !important;
font-family: inherit !important; font-family: inherit !important;
color: #858585 !important;
} }
.ui-page-theme-b paper-input label, .ui-page-theme-b paper-textarea label { .ui-page-theme-b paper-input label, .ui-page-theme-b paper-textarea label {
color: #858585 !important; color: #858585 !important;
} }
.ui-page-theme-a paper-input label, .ui-page-theme-a paper-textarea label {
color: #222 !important;
}
.ui-page-theme-a .label-is-highlighted label { .ui-page-theme-a .label-is-highlighted label {
color: green !important; color: green !important;
} }

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<title>Emby</title>
</head>
<body>
<div id="wizardTunerPage" data-role="page" class="page standalonePage wizardPage" data-require="scripts/wizardlivetvtuner">
<div data-role="content">
<div class="ui-corner-all ui-shadow wizardContent">
<form>
<div>
<h1 style="display:inline-block;">
<img src="css/images/mblogoicon.png" style="height:30px;vertical-align:middle;margin-right:5px;" />${HeaderSetupLiveTV}
</h1>
<a href="https://github.com/MediaBrowser/Wiki/wiki/Live%20TV" target="_blank" class="clearLink" style="margin-top:-10px;display:inline-block;vertical-align:middle;margin-left:2em;"><paper-button raised class="secondary mini"><iron-icon icon="info"></iron-icon><span>${ButtonHelp}</span></paper-button></a>
</div>
<br />
<div>
<label for="selectTunerType">${LabelTunerType}</label>
<select id="selectTunerType" data-mini="true" required="required">
<option value="hdhomerun">HDHomerun</option>
</select>
</div>
<div>
<paper-input class="txtDevicePath" label="${LabelTunerIpAddress}" required="required"></paper-input>
<div class="fieldDescription">${HelpMoreTunersCanBeAdded}</div>
</div>
<br />
<br />
<div class="wizardNavigation">
<button type="button" data-role="none" class="clearButton" style="width:auto;" onclick="history.back();"><paper-button raised class="subdued"><iron-icon icon="arrow-back"></iron-icon><span>${LabelPrevious}</span></paper-button></button>
<button type="submit" data-role="none" class="clearButton" style="width:auto;"><paper-button raised class="accent"><iron-icon icon="arrow-forward"></iron-icon><span>${LabelNext}</span></paper-button></button>
<button type="button" data-role="none" class="clearButton btnSkip" style="width:auto;"><paper-button raised style="background:#ccc;"><iron-icon icon="arrow-forward"></iron-icon><span>${ButtonSkip}</span></paper-button></button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>

View file

@ -17,8 +17,8 @@
<paper-checkbox class="chkEnableInternetProviders" checked>${LabelDownloadInternetMetadata}</paper-checkbox> <paper-checkbox class="chkEnableInternetProviders" checked>${LabelDownloadInternetMetadata}</paper-checkbox>
<div class="fieldDescription paperCheckboxFieldDescription">${LabelDownloadInternetMetadataHelp}</div> <div class="fieldDescription paperCheckboxFieldDescription">${LabelDownloadInternetMetadataHelp}</div>
</div> </div>
<div style="margin: 2em 0;"> <div>
<paper-checkbox class="chkSaveLocalMetadata">${LabelSaveLocalMetadataHelp}</paper-checkbox> <paper-checkbox class="chkSaveLocalMetadata">${LabelSaveLocalMetadata}</paper-checkbox>
<div class="fieldDescription paperCheckboxFieldDescription">${LabelSaveLocalMetadataHelp}</div> <div class="fieldDescription paperCheckboxFieldDescription">${LabelSaveLocalMetadataHelp}</div>
</div> </div>