mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update search
This commit is contained in:
parent
11aebfd219
commit
6b85af3c7e
16 changed files with 474 additions and 482 deletions
|
@ -1,87 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleLiveTV}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="liveTvGuideProviderScdPage" data-role="page" class="page type-interior liveTvSettingsPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Live%20TV" data-require="scripts/livetvguideprovider-scd">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="livetvstatus.html" data-role="button" class="ui-btn-active">${TabTuners}</a>
|
||||
<a href="livetvsettings.html" data-role="button">${TabSettings}</a>
|
||||
<a href="appservices.html?context=livetv" data-role="button">${TabExternalServices}</a>
|
||||
</div>
|
||||
|
||||
<div class="readOnlyContent" style="margin-top: 2em;">
|
||||
|
||||
<h1>Schedules Direct</h1>
|
||||
<p class="createAccountHelp"></p>
|
||||
<div style="font-size:16px;">
|
||||
<div style="display:inline-block;background-color:rgba(82,181,75,.8);color:#fff;padding:2px 10px;font-size:20px;border-radius:1000px;vertical-align:middle;">
|
||||
1
|
||||
</div>
|
||||
<div style="display:inline-block;vertical-align:middle;margin-left:5px;">
|
||||
${GuideProviderLogin}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="formLogin">
|
||||
<div>
|
||||
<div>
|
||||
<paper-input class="txtUser" label="${LabelUsername}" required="required" autocomplete="off"></paper-input>
|
||||
</div>
|
||||
<div>
|
||||
<paper-input class="txtPass" label="${LabelPassword}" required="required" autocomplete="off" type="password"></paper-input>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<div style="font-size:16px;">
|
||||
<div style="display:inline-block;background-color:rgba(82,181,75,.8);color:#fff;padding:2px 10px;font-size:20px;border-radius:1000px;vertical-align:middle;">
|
||||
2
|
||||
</div>
|
||||
<div style="display:inline-block;vertical-align:middle;margin-left:5px;">
|
||||
${GuideProviderSelectListings}
|
||||
</div>
|
||||
</div>
|
||||
<form class="formListings">
|
||||
<div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="selectCountry">${LabelCountry}</label>
|
||||
<select id="selectCountry" data-mini="true" required="required">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<paper-input class="txtZipCode" label="${LabelZipCode}" required="required"></paper-input>
|
||||
</div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="selectListing">${LabelLineup}</label>
|
||||
<select id="selectListing" data-mini="true" required="required"></select>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -15,36 +15,8 @@
|
|||
<a href="appservices.html?context=livetv" data-role="button">${TabExternalServices}</a>
|
||||
</div>
|
||||
|
||||
<div class="readOnlyContent" style="margin-top: 2em;">
|
||||
<div class="readOnlyContent providerTemplate" style="margin-top: 2em;">
|
||||
|
||||
<h1>${HeaderEmbyGuide}</h1>
|
||||
|
||||
<form class="formListings">
|
||||
<div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="selectCountry">${LabelCountry}</label>
|
||||
<select id="selectCountry" data-mini="true" required="required">
|
||||
<option value="ca">Canada</option>
|
||||
<option value="us" selected>United States</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<paper-input class="txtZipCode" label="${LabelZipCode}" required="required"></paper-input>
|
||||
</div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="selectListing">${LabelLineup}</label>
|
||||
<select id="selectListing" data-mini="true" required="required"></select>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -135,6 +135,8 @@
|
|||
|
||||
function translateDocument(html, dictionaryName) {
|
||||
|
||||
dictionaryName = dictionaryName || 'html';
|
||||
|
||||
var glossary = getDictionary(dictionaryName, currentCulture) || {};
|
||||
return translateHtml(html, glossary);
|
||||
}
|
||||
|
|
|
@ -1815,7 +1815,7 @@
|
|||
// cardContent
|
||||
html += '</a>';
|
||||
|
||||
if (options.overlayPlayButton) {
|
||||
if (options.overlayPlayButton && !item.IsPlaceHolder && (item.LocationType != 'Virtual' || !item.MediaType)) {
|
||||
html += '<paper-icon-button icon="play-arrow" class="cardOverlayPlayButton" onclick="return false;"></paper-icon-button>';
|
||||
}
|
||||
if (options.overlayMoreButton) {
|
||||
|
|
|
@ -1,233 +0,0 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
var listingsId;
|
||||
|
||||
function reload(page, providerId) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
})[0] || {};
|
||||
|
||||
listingsId = info.ListingsId;
|
||||
$('#selectListing', page).val(info.ListingsId || '').selectmenu('refresh');
|
||||
page.querySelector('.txtUser').value = info.Username || '';
|
||||
page.querySelector('.txtPass').value = info.Username || '';
|
||||
|
||||
page.querySelector('.txtZipCode').value = info.ZipCode || '';
|
||||
|
||||
setCountry(page, info);
|
||||
});
|
||||
}
|
||||
|
||||
function setCountry(page, info) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('LiveTv/ListingProviders/SchedulesDirect/Countries')).done(function (result) {
|
||||
|
||||
var countryList = [];
|
||||
var i, length;
|
||||
|
||||
for (var region in result) {
|
||||
var countries = result[region];
|
||||
|
||||
if (countries.length && region !== 'ZZZ') {
|
||||
for (i = 0, length = countries.length; i < length; i++) {
|
||||
countryList.push({
|
||||
name: countries[i].fullName,
|
||||
value: countries[i].shortName
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
countryList.sort(function (a, b) {
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
}
|
||||
if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
// a must be equal to b
|
||||
return 0;
|
||||
});
|
||||
|
||||
$('#selectCountry', page).html(countryList.map(function (c) {
|
||||
|
||||
return '<option value="' + c.value + '">' + c.name + '</option>';
|
||||
|
||||
}).join('')).val(info.Country || '').selectmenu('refresh');
|
||||
|
||||
$(page.querySelector('.txtZipCode')).trigger('change');
|
||||
|
||||
}).fail(function () {
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorGettingTvLineups')
|
||||
});
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function submitLoginForm(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var info = {
|
||||
Type: 'SchedulesDirect',
|
||||
Username: page.querySelector('.txtUser').value,
|
||||
Password: CryptoJS.SHA1(page.querySelector('.txtPass').value).toString()
|
||||
};
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var id = providerId;
|
||||
|
||||
if (id) {
|
||||
info.Id = id;
|
||||
}
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
ValidateLogin: true
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
Dashboard.navigate('livetvguideprovider-scd.html?id=' + result.Id);
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function submitListingsForm(page) {
|
||||
|
||||
var selectedListingsId = $('#selectListing', page).val();
|
||||
|
||||
if (!selectedListingsId) {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorPleaseSelectLineup')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var id = providerId;
|
||||
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id == id;
|
||||
})[0];
|
||||
|
||||
info.ZipCode = page.querySelector('.txtZipCode').value;
|
||||
info.Country = $('#selectCountry', page).val();
|
||||
info.ListingsId = selectedListingsId;
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
ValidateListings: true
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function refreshListings(page, value) {
|
||||
|
||||
if (!value) {
|
||||
$('#selectListing', page).html('').selectmenu('refresh');
|
||||
return;
|
||||
}
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
|
||||
Dashboard.showModalLoadingMsg();
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "GET",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders/Lineups', {
|
||||
Id: providerId,
|
||||
Location: value,
|
||||
Country: $('#selectCountry', page).val()
|
||||
}),
|
||||
dataType: 'json'
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
$('#selectListing', page).html(result.map(function (o) {
|
||||
|
||||
return '<option value="' + o.Id + '">' + o.Name + '</option>';
|
||||
|
||||
})).selectmenu('refresh');
|
||||
|
||||
if (listingsId) {
|
||||
$('#selectListing', page).val(listingsId).selectmenu('refresh');
|
||||
}
|
||||
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
|
||||
}).fail(function (result) {
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorGettingTvLineups')
|
||||
});
|
||||
refreshListings(page, '');
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#liveTvGuideProviderScdPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.formLogin', page).on('submit', function () {
|
||||
submitLoginForm(page);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.formListings', page).on('submit', function () {
|
||||
submitListingsForm(page);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.txtZipCode', page).on('change', function () {
|
||||
refreshListings(page, this.value);
|
||||
});
|
||||
|
||||
$('.createAccountHelp', page).html(Globalize.translate('MessageCreateAccountAt', '<a href="http://www.schedulesdirect.org" target="_blank">http://www.schedulesdirect.org</a>'));
|
||||
|
||||
}).on('pageshowready', "#liveTvGuideProviderScdPage", function () {
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var page = this;
|
||||
reload(page, providerId);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
|
@ -1,146 +1,43 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
var listingsId;
|
||||
function init(page, type, providerId) {
|
||||
|
||||
function reload(page, providerId) {
|
||||
var url = 'tvproviders/' + type + '.js';
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
require([url], function (factory) {
|
||||
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
var instance = new factory(page, providerId, {
|
||||
});
|
||||
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
})[0];
|
||||
|
||||
info = info || {};
|
||||
|
||||
listingsId = info.ListingsId;
|
||||
$('#selectListing', page).val(info.ListingsId || '').selectmenu('refresh');
|
||||
|
||||
page.querySelector('.txtZipCode').value = info.ZipCode || '';
|
||||
|
||||
setCountry(page, info);
|
||||
instance.init();
|
||||
});
|
||||
}
|
||||
|
||||
function setCountry(page, info) {
|
||||
function loadTemplate(page, type, providerId) {
|
||||
|
||||
$('#selectCountry', page).val(info.Country || '').selectmenu('refresh');
|
||||
ApiClient.ajax({
|
||||
|
||||
$(page.querySelector('.txtZipCode')).trigger('change');
|
||||
type: 'GET',
|
||||
url: 'tvproviders/' + type + '.template.html'
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
}).done(function (html) {
|
||||
|
||||
function submitListingsForm(page) {
|
||||
var elem = page.querySelector('.providerTemplate');
|
||||
elem.innerHTML = Globalize.translateDocument(html);
|
||||
$(elem).trigger('create');
|
||||
|
||||
var selectedListingsId = $('#selectListing', page).val();
|
||||
|
||||
if (!selectedListingsId) {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorPleaseSelectLineup')
|
||||
init(page, type, providerId);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$(document).on('pageshowready', "#liveTvGuideProviderPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
|
||||
})[0] || {};
|
||||
|
||||
info.ZipCode = page.querySelector('.txtZipCode').value;
|
||||
info.Country = $('#selectCountry', page).val();
|
||||
info.ListingsId = selectedListingsId;
|
||||
info.Type = 'emby';
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function refreshListings(page, value) {
|
||||
|
||||
if (!value) {
|
||||
$('#selectListing', page).html('').selectmenu('refresh');
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.showModalLoadingMsg();
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "GET",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders/Lineups', {
|
||||
Type: 'emby',
|
||||
Location: value,
|
||||
Country: $('#selectCountry', page).val()
|
||||
}),
|
||||
dataType: 'json'
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
$('#selectListing', page).html(result.map(function (o) {
|
||||
|
||||
return '<option value="' + o.Id + '">' + o.Name + '</option>';
|
||||
|
||||
})).selectmenu('refresh');
|
||||
|
||||
if (listingsId) {
|
||||
$('#selectListing', page).val(listingsId).selectmenu('refresh');
|
||||
}
|
||||
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
|
||||
}).fail(function (result) {
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorGettingTvLineups')
|
||||
});
|
||||
refreshListings(page, '');
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#liveTvGuideProviderPage", function () {
|
||||
|
||||
var type = getParameterByName('type');
|
||||
var page = this;
|
||||
|
||||
$('.formListings', page).on('submit', function () {
|
||||
submitListingsForm(page);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.txtZipCode', page).on('change', function () {
|
||||
refreshListings(page, this.value);
|
||||
});
|
||||
|
||||
}).on('pageshowready', "#liveTvGuideProviderPage", function () {
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var page = this;
|
||||
reload(page, providerId);
|
||||
loadTemplate(page, type, providerId);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
function getRegistration(programId) {
|
||||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
if (registrationInfo && lastRegId == programId) {
|
||||
|
||||
if (registrationInfo && (lastRegId == programId)) {
|
||||
deferred.resolveWith(null, [registrationInfo]);
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
registrationInfo = null;
|
||||
lastRegId = programId;
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('LiveTv/Registration', {
|
||||
|
|
|
@ -304,7 +304,7 @@
|
|||
|
||||
html += '<paper-item-body two-line>';
|
||||
|
||||
html += '<a class="clearLink" href="' + getProviderConfigurationUrl(provider.Type) + '?id=' + provider.Id + '">';
|
||||
html += '<a class="clearLink" href="' + getProviderConfigurationUrl(provider.Type) + '&id=' + provider.Id + '">';
|
||||
|
||||
html += '<div>';
|
||||
html += getProviderName(provider.Type);
|
||||
|
@ -390,9 +390,9 @@
|
|||
switch (providerId) {
|
||||
|
||||
case 'schedulesdirect':
|
||||
return 'livetvguideprovider-scd.html';
|
||||
return 'livetvguideprovider.html?type=schedulesdirect';
|
||||
case 'emby':
|
||||
return 'livetvguideprovider.html';
|
||||
return 'livetvguideprovider.html?type=emby';
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
77
dashboard-ui/scripts/wizardlivetvguide.js
Normal file
77
dashboard-ui/scripts/wizardlivetvguide.js
Normal file
|
@ -0,0 +1,77 @@
|
|||
(function ($, document) {
|
||||
|
||||
var guideController;
|
||||
|
||||
function init(page, type, providerId) {
|
||||
|
||||
var url = 'tvproviders/' + type + '.js';
|
||||
|
||||
require([url], function (factory) {
|
||||
|
||||
var instance = new factory(page, providerId, {
|
||||
showCancelButton: false,
|
||||
showSubmitButton: false
|
||||
});
|
||||
|
||||
instance.init();
|
||||
guideController = instance;
|
||||
});
|
||||
}
|
||||
|
||||
function loadTemplate(page, type, providerId) {
|
||||
|
||||
guideController = null;
|
||||
|
||||
ApiClient.ajax({
|
||||
|
||||
type: 'GET',
|
||||
url: 'tvproviders/' + type + '.template.html'
|
||||
|
||||
}).done(function (html) {
|
||||
|
||||
var elem = page.querySelector('.providerTemplate');
|
||||
elem.innerHTML = Globalize.translateDocument(html);
|
||||
$(elem).trigger('create');
|
||||
|
||||
init(page, type, providerId);
|
||||
});
|
||||
}
|
||||
|
||||
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 next() {
|
||||
guideController.submit();
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#wizardGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#selectType', page).on('change', function () {
|
||||
|
||||
loadTemplate(page, this.value);
|
||||
});
|
||||
|
||||
$('.btnSkip', page).on('click', skip);
|
||||
$('.btnNext', page).on('click', next);
|
||||
|
||||
}).on('pageshowready', "#wizardGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#selectType', page).trigger('change');
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
|
@ -21,7 +21,7 @@
|
|||
}).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
navigateToNextPage();
|
||||
navigateToNextPage(config);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -42,9 +42,14 @@
|
|||
});
|
||||
}
|
||||
|
||||
function navigateToNextPage() {
|
||||
function navigateToNextPage(config) {
|
||||
|
||||
if (config.LiveTvTunerPath && config.LiveTvTunerType) {
|
||||
Dashboard.navigate('wizardlivetvguide.html');
|
||||
} else {
|
||||
skip();
|
||||
}
|
||||
}
|
||||
|
||||
function skip() {
|
||||
var apiClient = ApiClient;
|
||||
|
|
|
@ -1527,6 +1527,8 @@
|
|||
"HeaderUpcomingForKids": "Upcoming for Kids",
|
||||
"HeaderSetupLiveTV": "Setup Live TV",
|
||||
"LabelTunerType": "Tuner type:",
|
||||
"HelpMoreTunersCanBeAdded": "More tuners can be added later within the Live TV section.",
|
||||
"MessageActiveSupporterMembershipRequiredSeriesRecordings": "An active Emby Supporter membership is required in order to create automated series recordings."
|
||||
"HelpMoreTunersCanBeAdded": "Additional tuners can be added later within the Live TV section.",
|
||||
"MessageActiveSupporterMembershipRequiredSeriesRecordings": "An active Emby Supporter membership is required in order to create automated series recordings.",
|
||||
"HeaderSetupTVGuide": "Setup TV Guide",
|
||||
"LabelDataProvider": "Data provider:"
|
||||
}
|
||||
|
|
|
@ -173,6 +173,13 @@ paper-button.mini {
|
|||
}
|
||||
|
||||
|
||||
|
||||
paper-button.mini iron-icon {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
|
||||
paper-toast {
|
||||
z-index: 9999999;
|
||||
}
|
||||
|
|
244
dashboard-ui/tvproviders/schedulesdirect.js
Normal file
244
dashboard-ui/tvproviders/schedulesdirect.js
Normal file
|
@ -0,0 +1,244 @@
|
|||
define([], function () {
|
||||
|
||||
return function (page, providerId, options) {
|
||||
|
||||
var self = this;
|
||||
|
||||
var listingsId;
|
||||
|
||||
function reload() {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
})[0] || {};
|
||||
|
||||
listingsId = info.ListingsId;
|
||||
$('#selectListing', page).val(info.ListingsId || '').selectmenu('refresh');
|
||||
page.querySelector('.txtUser').value = info.Username || '';
|
||||
page.querySelector('.txtPass').value = info.Username || '';
|
||||
|
||||
page.querySelector('.txtZipCode').value = info.ZipCode || '';
|
||||
|
||||
setCountry(info);
|
||||
});
|
||||
}
|
||||
|
||||
function setCountry(info) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('LiveTv/ListingProviders/SchedulesDirect/Countries')).done(function (result) {
|
||||
|
||||
var countryList = [];
|
||||
var i, length;
|
||||
|
||||
for (var region in result) {
|
||||
var countries = result[region];
|
||||
|
||||
if (countries.length && region !== 'ZZZ') {
|
||||
for (i = 0, length = countries.length; i < length; i++) {
|
||||
countryList.push({
|
||||
name: countries[i].fullName,
|
||||
value: countries[i].shortName
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
countryList.sort(function (a, b) {
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
}
|
||||
if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
// a must be equal to b
|
||||
return 0;
|
||||
});
|
||||
|
||||
$('#selectCountry', page).html(countryList.map(function (c) {
|
||||
|
||||
return '<option value="' + c.value + '">' + c.name + '</option>';
|
||||
|
||||
}).join('')).val(info.Country || '').selectmenu('refresh');
|
||||
|
||||
$(page.querySelector('.txtZipCode')).trigger('change');
|
||||
|
||||
}).fail(function () {
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorGettingTvLineups')
|
||||
});
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function submitLoginForm() {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var info = {
|
||||
Type: 'SchedulesDirect',
|
||||
Username: page.querySelector('.txtUser').value,
|
||||
Password: CryptoJS.SHA1(page.querySelector('.txtPass').value).toString()
|
||||
};
|
||||
|
||||
var id = providerId;
|
||||
|
||||
if (id) {
|
||||
info.Id = id;
|
||||
}
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
ValidateLogin: true
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
providerId = result.Id;
|
||||
reload();
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function submitListingsForm() {
|
||||
|
||||
var selectedListingsId = $('#selectListing', page).val();
|
||||
|
||||
if (!selectedListingsId) {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorPleaseSelectLineup')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var id = providerId;
|
||||
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id == id;
|
||||
})[0];
|
||||
|
||||
info.ZipCode = page.querySelector('.txtZipCode').value;
|
||||
info.Country = $('#selectCountry', page).val();
|
||||
info.ListingsId = selectedListingsId;
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
ValidateListings: true
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function refreshListings(value) {
|
||||
|
||||
if (!value) {
|
||||
$('#selectListing', page).html('').selectmenu('refresh');
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.showModalLoadingMsg();
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "GET",
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders/Lineups', {
|
||||
Id: providerId,
|
||||
Location: value,
|
||||
Country: $('#selectCountry', page).val()
|
||||
}),
|
||||
dataType: 'json'
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
$('#selectListing', page).html(result.map(function (o) {
|
||||
|
||||
return '<option value="' + o.Id + '">' + o.Name + '</option>';
|
||||
|
||||
})).selectmenu('refresh');
|
||||
|
||||
if (listingsId) {
|
||||
$('#selectListing', page).val(listingsId).selectmenu('refresh');
|
||||
}
|
||||
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
|
||||
}).fail(function (result) {
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorGettingTvLineups')
|
||||
});
|
||||
refreshListings('');
|
||||
Dashboard.hideModalLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
||||
self.submit = function () {
|
||||
page.querySelector('.btnSubmitListingsContainer').click();
|
||||
};
|
||||
|
||||
self.init = function () {
|
||||
|
||||
options = options || {};
|
||||
|
||||
if (options.showCancelButton !== false) {
|
||||
page.querySelector('.btnCancel').classList.remove('hide');
|
||||
} else {
|
||||
page.querySelector('.btnCancel').classList.add('hide');
|
||||
}
|
||||
|
||||
if (options.showSubmitButton !== false) {
|
||||
page.querySelector('.btnSubmitListings').classList.remove('hide');
|
||||
} else {
|
||||
page.querySelector('.btnSubmitListings').classList.add('hide');
|
||||
}
|
||||
|
||||
$('.formLogin', page).on('submit', function () {
|
||||
submitLoginForm();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.formListings', page).on('submit', function () {
|
||||
submitListingsForm();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.txtZipCode', page).on('change', function () {
|
||||
refreshListings(this.value);
|
||||
});
|
||||
|
||||
$('.createAccountHelp', page).html(Globalize.translate('MessageCreateAccountAt', '<a href="http://www.schedulesdirect.org" target="_blank">http://www.schedulesdirect.org</a>'));
|
||||
|
||||
reload();
|
||||
};
|
||||
}
|
||||
});
|
61
dashboard-ui/tvproviders/schedulesdirect.template.html
Normal file
61
dashboard-ui/tvproviders/schedulesdirect.template.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
<h1>Schedules Direct</h1>
|
||||
<p class="createAccountHelp"></p>
|
||||
<div style="font-size:16px;">
|
||||
<div style="display:inline-block;background-color:rgba(82,181,75,.8);color:#fff;padding:2px 10px;font-size:20px;border-radius:1000px;vertical-align:middle;">
|
||||
1
|
||||
</div>
|
||||
<div style="display:inline-block;vertical-align:middle;margin-left:5px;">
|
||||
${GuideProviderLogin}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="formLogin">
|
||||
<div>
|
||||
<div>
|
||||
<paper-input class="txtUser" label="${LabelUsername}" required="required" autocomplete="off"></paper-input>
|
||||
</div>
|
||||
<div>
|
||||
<paper-input class="txtPass" label="${LabelPassword}" required="required" autocomplete="off" type="password"></paper-input>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<div style="font-size:16px;">
|
||||
<div style="display:inline-block;background-color:rgba(82,181,75,.8);color:#fff;padding:2px 10px;font-size:20px;border-radius:1000px;vertical-align:middle;">
|
||||
2
|
||||
</div>
|
||||
<div style="display:inline-block;vertical-align:middle;margin-left:5px;">
|
||||
${GuideProviderSelectListings}
|
||||
</div>
|
||||
</div>
|
||||
<form class="formListings">
|
||||
<div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="selectCountry">${LabelCountry}</label>
|
||||
<select id="selectCountry" data-mini="true" required="required"></select>
|
||||
</div>
|
||||
<div>
|
||||
<paper-input class="txtZipCode" label="${LabelZipCode}" required="required"></paper-input>
|
||||
</div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="selectListing">${LabelLineup}</label>
|
||||
<select id="selectListing" data-mini="true" required="required"></select>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" data-role="none" class="clearButton btnSubmitListingsContainer">
|
||||
<paper-button raised class="submit block btnSubmitListings hide"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
<paper-button raised class="cancel block btnCancel hide" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
43
dashboard-ui/wizardlivetvguide.html
Normal file
43
dashboard-ui/wizardlivetvguide.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Emby</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wizardGuidePage" data-role="page" class="page standalonePage wizardPage" data-require="scripts/wizardlivetvguide">
|
||||
|
||||
<div data-role="content">
|
||||
|
||||
<div class="ui-corner-all ui-shadow wizardContent">
|
||||
|
||||
<div>
|
||||
<h1 style="display:inline-block;">
|
||||
${HeaderSetupTVGuide}
|
||||
</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="selectType">${LabelDataProvider}</label>
|
||||
<select id="selectType" data-mini="true" required="required">
|
||||
<option value="schedulesdirect">Schedules Direct</option>
|
||||
</select>
|
||||
</div>
|
||||
<br />
|
||||
<div class="providerTemplate">
|
||||
|
||||
</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="button" data-role="none" class="clearButton btnNext" 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:#607D8B;color:#fff;"><iron-icon icon="arrow-forward"></iron-icon><span>${ButtonSkip}</span></paper-button></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -35,7 +35,7 @@
|
|||
<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>
|
||||
<button type="button" data-role="none" class="clearButton btnSkip" style="width:auto;"><paper-button raised style="background:#607D8B;color:#fff;"><iron-icon icon="arrow-forward"></iron-icon><span>${ButtonSkip}</span></paper-button></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue