mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update sat/ip discovery
This commit is contained in:
parent
5c4854b777
commit
4fb729169f
10 changed files with 210 additions and 92 deletions
|
@ -16,12 +16,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.1.44",
|
"version": "1.1.45",
|
||||||
"_release": "1.1.44",
|
"_release": "1.1.45",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.1.44",
|
"tag": "1.1.45",
|
||||||
"commit": "b1b66d4e81e6abad2f5369b442107577d0dac74e"
|
"commit": "4096a916053ab04935ebbe0dec9bbc491d66ae9d"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "~1.1.5",
|
"_target": "~1.1.5",
|
||||||
|
|
|
@ -13,38 +13,74 @@
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getOffsets(elems) {
|
||||||
|
|
||||||
|
var doc = document;
|
||||||
|
var results = [];
|
||||||
|
|
||||||
|
if (!doc) {
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
var docElem = doc.documentElement;
|
||||||
|
var docElemValues = {
|
||||||
|
clientTop: docElem.clientTop,
|
||||||
|
clientLeft: docElem.clientLeft
|
||||||
|
};
|
||||||
|
|
||||||
|
var win = doc.defaultView;
|
||||||
|
var winValues = {
|
||||||
|
pageXOffset: win.pageXOffset,
|
||||||
|
pageYOffset: win.pageYOffset
|
||||||
|
};
|
||||||
|
|
||||||
|
var box;
|
||||||
|
var elem;
|
||||||
|
|
||||||
|
for (var i = 0, length = elems.length; i < length; i++) {
|
||||||
|
|
||||||
|
elem = elems[i];
|
||||||
|
// Support: BlackBerry 5, iOS 3 (original iPhone)
|
||||||
|
// If we don't have gBCR, just use 0,0 rather than error
|
||||||
|
if (elem.getBoundingClientRect) {
|
||||||
|
box = elem.getBoundingClientRect();
|
||||||
|
} else {
|
||||||
|
box = { top: 0, left: 0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
results[i] = {
|
||||||
|
top: box.top,
|
||||||
|
left: box.left
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
function getPosition(options) {
|
function getPosition(options) {
|
||||||
|
|
||||||
var windowHeight = $(window).height();
|
var windowHeight = window.innerHeight;
|
||||||
|
|
||||||
if (windowHeight < 540) {
|
if (windowHeight < 540) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pos = $(options.positionTo).offset();
|
var pos = getOffsets([options.positionTo])[0];
|
||||||
|
|
||||||
pos.top += $(options.positionTo).innerHeight() / 2;
|
pos.top += options.positionTo.offsetHeight / 2;
|
||||||
pos.left += $(options.positionTo).innerWidth() / 2;
|
pos.left += options.positionTo.offsetWidth / 2;
|
||||||
|
|
||||||
// Account for margins
|
|
||||||
pos.top -= 24;
|
|
||||||
pos.left -= 24;
|
|
||||||
|
|
||||||
// Account for popup size - we can't predict this yet so just estimate
|
// Account for popup size - we can't predict this yet so just estimate
|
||||||
pos.top -= (55 * options.items.length) / 2;
|
pos.top -= (55 * options.items.length) / 2;
|
||||||
pos.left -= 80;
|
pos.left -= 80;
|
||||||
|
|
||||||
// Account for scroll position
|
|
||||||
pos.top -= $(window).scrollTop();
|
|
||||||
pos.left -= $(window).scrollLeft();
|
|
||||||
|
|
||||||
// Avoid showing too close to the bottom
|
// Avoid showing too close to the bottom
|
||||||
pos.top = Math.min(pos.top, windowHeight - 300);
|
pos.top = Math.min(pos.top, windowHeight - 300);
|
||||||
pos.left = Math.min(pos.left, $(window).width() - 300);
|
pos.left = Math.min(pos.left, window.innerWidth - 300);
|
||||||
|
|
||||||
// Do some boundary checking
|
// Do some boundary checking
|
||||||
pos.top = Math.max(pos.top, 0);
|
pos.top = Math.max(pos.top, 10);
|
||||||
pos.left = Math.max(pos.left, 0);
|
pos.left = Math.max(pos.left, 10);
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
@ -58,13 +94,16 @@
|
||||||
|
|
||||||
function show(options) {
|
function show(options) {
|
||||||
|
|
||||||
|
var pos = options.positionTo ? getPosition(options) : null;
|
||||||
|
|
||||||
// items
|
// items
|
||||||
// positionTo
|
// positionTo
|
||||||
// showCancel
|
// showCancel
|
||||||
// title
|
// title
|
||||||
var dialogOptions = {
|
var dialogOptions = {
|
||||||
removeOnClose: true,
|
removeOnClose: true,
|
||||||
enableHistory: options.enableHistory
|
enableHistory: options.enableHistory,
|
||||||
|
refit: pos == null
|
||||||
};
|
};
|
||||||
|
|
||||||
var backButton = false;
|
var backButton = false;
|
||||||
|
@ -82,7 +121,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var dlg = paperdialoghelper.createDialog(dialogOptions);
|
var dlg = paperdialoghelper.createDialog(dialogOptions);
|
||||||
var pos = options.positionTo ? getPosition(options) : null;
|
|
||||||
|
|
||||||
dlg.classList.add('actionSheet');
|
dlg.classList.add('actionSheet');
|
||||||
|
|
||||||
|
@ -155,12 +193,6 @@
|
||||||
|
|
||||||
dlg.innerHTML = html;
|
dlg.innerHTML = html;
|
||||||
|
|
||||||
if (pos) {
|
|
||||||
dlg.style.position = 'fixed';
|
|
||||||
dlg.style.left = pos.left + 'px';
|
|
||||||
dlg.style.top = pos.top + 'px';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (layoutManager.tv) {
|
if (layoutManager.tv) {
|
||||||
addCenterFocus(dlg);
|
addCenterFocus(dlg);
|
||||||
}
|
}
|
||||||
|
@ -198,6 +230,12 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
paperdialoghelper.open(dlg);
|
paperdialoghelper.open(dlg);
|
||||||
|
|
||||||
|
if (pos) {
|
||||||
|
dlg.style.position = 'fixed';
|
||||||
|
dlg.style.left = pos.left + 'px';
|
||||||
|
dlg.style.top = pos.top + 'px';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,13 +67,6 @@
|
||||||
dlg.addEventListener('iron-overlay-closed', onDialogClosed);
|
dlg.addEventListener('iron-overlay-closed', onDialogClosed);
|
||||||
dlg.open();
|
dlg.open();
|
||||||
|
|
||||||
// It's not being positioned properly in firefox
|
|
||||||
if (!browser.chrome && !dlg.classList.contains('fixedSize')) {
|
|
||||||
setTimeout(function () {
|
|
||||||
dlg.refit();
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dlg.getAttribute('data-lockscroll') == 'true' && !document.body.classList.contains('noScroll')) {
|
if (dlg.getAttribute('data-lockscroll') == 'true' && !document.body.classList.contains('noScroll')) {
|
||||||
document.body.classList.add('noScroll');
|
document.body.classList.add('noScroll');
|
||||||
removeScrollLockOnClose = true;
|
removeScrollLockOnClose = true;
|
||||||
|
@ -211,49 +204,9 @@
|
||||||
return dlg;
|
return dlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
function positionTo(dlg, elem) {
|
|
||||||
|
|
||||||
var windowHeight = $(window).height();
|
|
||||||
|
|
||||||
// If the window height is under a certain amount, don't bother trying to position
|
|
||||||
// based on an element.
|
|
||||||
if (windowHeight >= 540) {
|
|
||||||
|
|
||||||
var pos = $(elem).offset();
|
|
||||||
|
|
||||||
pos.top += elem.offsetHeight / 2;
|
|
||||||
pos.left += elem.offsetWidth / 2;
|
|
||||||
|
|
||||||
// Account for margins
|
|
||||||
pos.top -= 24;
|
|
||||||
pos.left -= 24;
|
|
||||||
|
|
||||||
// Account for popup size - we can't predict this yet so just estimate
|
|
||||||
pos.top -= $(dlg).height() / 2;
|
|
||||||
pos.left -= $(dlg).width() / 2;
|
|
||||||
|
|
||||||
// Account for scroll position
|
|
||||||
pos.top -= $(window).scrollTop();
|
|
||||||
pos.left -= $(window).scrollLeft();
|
|
||||||
|
|
||||||
// Avoid showing too close to the bottom
|
|
||||||
pos.top = Math.min(pos.top, windowHeight - 300);
|
|
||||||
pos.left = Math.min(pos.left, $(window).width() - 300);
|
|
||||||
|
|
||||||
// Do some boundary checking
|
|
||||||
pos.top = Math.max(pos.top, 0);
|
|
||||||
pos.left = Math.max(pos.left, 0);
|
|
||||||
|
|
||||||
dlg.style.position = 'fixed';
|
|
||||||
dlg.style.left = pos.left + 'px';
|
|
||||||
dlg.style.top = pos.top + 'px';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
open: open,
|
open: open,
|
||||||
close: close,
|
close: close,
|
||||||
createDialog: createDialog,
|
createDialog: createDialog
|
||||||
positionTo: positionTo
|
|
||||||
};
|
};
|
||||||
});
|
});
|
|
@ -32,14 +32,14 @@
|
||||||
"web-component-tester": "^4.0.0",
|
"web-component-tester": "^4.0.0",
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/polymerelements/iron-icon",
|
"homepage": "https://github.com/PolymerElements/iron-icon",
|
||||||
"_release": "1.0.8",
|
"_release": "1.0.8",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.8",
|
"tag": "v1.0.8",
|
||||||
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
|
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/polymerelements/iron-icon.git",
|
"_source": "git://github.com/PolymerElements/iron-icon.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "polymerelements/iron-icon"
|
"_originalSource": "PolymerElements/iron-icon"
|
||||||
}
|
}
|
|
@ -36,7 +36,7 @@
|
||||||
"tag": "v1.2.5",
|
"tag": "v1.2.5",
|
||||||
"commit": "06bd256eacfd70f959c4aed8c03c221f01074c0f"
|
"commit": "06bd256eacfd70f959c4aed8c03c221f01074c0f"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/polymerelements/iron-selector.git",
|
"_source": "git://github.com/PolymerElements/iron-selector.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "polymerelements/iron-selector"
|
"_originalSource": "PolymerElements/iron-selector"
|
||||||
}
|
}
|
|
@ -2,15 +2,6 @@
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-body-b a:visited {
|
|
||||||
color: #007AFF /*{b-link-visited}*/;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-body-b a {
|
|
||||||
color: #007AFF /*{b-link-color}*/;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-body-b select {
|
.ui-body-b select {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<div class="readOnlyContent" style="margin-top: 2em;">
|
<div class="readOnlyContent" style="margin-top: 2em;">
|
||||||
|
|
||||||
<h1>HD Homerun Setup</h1>
|
<h1>HD Homerun</h1>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<div>
|
<div>
|
||||||
|
|
41
dashboard-ui/livetvtunerprovider-satip.html
Normal file
41
dashboard-ui/livetvtunerprovider-satip.html
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>${TitleLiveTV}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="liveTvTunerProviderSatPage" data-role="page" class="page type-interior liveTvSettingsPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Live%20TV" data-require="scripts/livetvtunerprovider-satip,paper-input">
|
||||||
|
|
||||||
|
<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>DVB</h1>
|
||||||
|
|
||||||
|
<form>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<paper-input class="txtDevicePath" label="${LabelPath}" required="required" readonly></paper-input>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<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>
|
|
@ -74,7 +74,11 @@
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '</paper-item-body>';
|
html += '</paper-item-body>';
|
||||||
html += '<paper-icon-button icon="refresh" data-tunerid="' + tuner.Id + '" title="' + Globalize.translate('ButtonResetTuner') + '" class="btnResetTuner"></paper-icon-button>';
|
|
||||||
|
if (tuner.CanReset) {
|
||||||
|
html += '<paper-icon-button icon="refresh" data-tunerid="' + tuner.Id + '" title="' + Globalize.translate('ButtonResetTuner') + '" class="btnResetTuner"></paper-icon-button>';
|
||||||
|
}
|
||||||
|
|
||||||
html += '</paper-icon-item>';
|
html += '</paper-icon-item>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +205,7 @@
|
||||||
html += '<paper-item-body two-line>';
|
html += '<paper-item-body two-line>';
|
||||||
html += '<a class="clearLink" href="' + href + '">';
|
html += '<a class="clearLink" href="' + href + '">';
|
||||||
html += '<div>';
|
html += '<div>';
|
||||||
html += getTunerName(device.Type);
|
html += device.FriendlyName || getTunerName(device.Type);
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div secondary>';
|
html += '<div secondary>';
|
||||||
|
@ -367,6 +371,8 @@
|
||||||
return 'M3U Playlist';
|
return 'M3U Playlist';
|
||||||
case 'hdhomerun':
|
case 'hdhomerun':
|
||||||
return 'HDHomerun';
|
return 'HDHomerun';
|
||||||
|
case 'satip':
|
||||||
|
return 'DVB';
|
||||||
default:
|
default:
|
||||||
return 'Unknown';
|
return 'Unknown';
|
||||||
}
|
}
|
||||||
|
@ -445,6 +451,11 @@
|
||||||
|
|
||||||
var menuItems = [];
|
var menuItems = [];
|
||||||
|
|
||||||
|
//menuItems.push({
|
||||||
|
// name: getTunerName('satip'),
|
||||||
|
// id: 'satip'
|
||||||
|
//});
|
||||||
|
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: 'HDHomerun',
|
name: 'HDHomerun',
|
||||||
id: 'hdhomerun'
|
id: 'hdhomerun'
|
||||||
|
|
84
dashboard-ui/scripts/livetvtunerprovider-satip.js
Normal file
84
dashboard-ui/scripts/livetvtunerprovider-satip.js
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
(function ($, document, window) {
|
||||||
|
|
||||||
|
function reload(page, providerId) {
|
||||||
|
|
||||||
|
page.querySelector('.txtDevicePath').value = '';
|
||||||
|
|
||||||
|
if (providerId) {
|
||||||
|
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||||
|
|
||||||
|
var info = config.TunerHosts.filter(function (i) {
|
||||||
|
return i.Id == providerId;
|
||||||
|
})[0];
|
||||||
|
|
||||||
|
page.querySelector('.txtDevicePath').value = info.Url || '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitForm(page) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var id = getParameterByName('id');
|
||||||
|
|
||||||
|
if (id) {
|
||||||
|
|
||||||
|
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||||
|
|
||||||
|
var info = config.TunerHosts.filter(function (i) {
|
||||||
|
return i.Id == id;
|
||||||
|
})[0];
|
||||||
|
|
||||||
|
info.Url = page.querySelector('.txtDevicePath').value;
|
||||||
|
|
||||||
|
submitTunerInfo(page, info);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var info = {
|
||||||
|
Type: 'satip',
|
||||||
|
Url: page.querySelector('.txtDevicePath').value
|
||||||
|
};
|
||||||
|
|
||||||
|
submitTunerInfo(page, info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitTunerInfo(page, info) {
|
||||||
|
ApiClient.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: ApiClient.getUrl('LiveTv/TunerHosts'),
|
||||||
|
data: JSON.stringify(info),
|
||||||
|
contentType: "application/json"
|
||||||
|
|
||||||
|
}).then(function () {
|
||||||
|
|
||||||
|
Dashboard.processServerConfigurationUpdateResult();
|
||||||
|
Dashboard.navigate('livetvstatus.html');
|
||||||
|
|
||||||
|
}, function () {
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
Dashboard.alert({
|
||||||
|
message: Globalize.translate('ErrorSavingTvProvider')
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on('pageinit', "#liveTvTunerProviderSatPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$('form', page).on('submit', function () {
|
||||||
|
submitForm(page);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
}).on('pageshow', "#liveTvTunerProviderSatPage", function () {
|
||||||
|
|
||||||
|
var providerId = getParameterByName('id');
|
||||||
|
var page = this;
|
||||||
|
reload(page, providerId);
|
||||||
|
});
|
||||||
|
|
||||||
|
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue