mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge remote-tracking branch 'origin/grabberDiscovery' into mediafoundation
This commit is contained in:
@@ -3,110 +3,24 @@
|
||||
<div class="col-xs-12">
|
||||
<h3 class="page-header"><i class="fa fa-info fa-fw"></i><span data-i18n="support_label_title">Support Hyperion</span></h3>
|
||||
<div id="supp_intro"></div>
|
||||
<div style="display:none">
|
||||
<h4 style="font-weight: bold" data-i18n="support_label_spreadtheword">Spread the word</h4>
|
||||
<a href="https://www.facebook.com/Hyperion-1415088231896140/" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-facebook bg-color-fb"></i>
|
||||
<h4>Facebook</h4>
|
||||
<p data-i18n="support_label_fbtext">Share our Hyperion Facebook page and get a notice when new updates are released</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://twitter.com/HyperionAmbient" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-twitter bg-color-tw"></i>
|
||||
<h4>Twitter</h4>
|
||||
<p data-i18n="support_label_twtext">Share and follow on Twitter, be always up to date with latest post about the Hyperion development</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://plus.google.com/103082579494653418604" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-google-plus bg-color-g"></i>
|
||||
<h4>Google+</h4>
|
||||
<p data-i18n="support_label_ggtext">Circle us on Google +!</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://www.youtube.com/channel/UCCah_idbSMqgo4UwP6R9H-A" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-youtube bg-color-g"></i>
|
||||
<h4>Youtube</h4>
|
||||
<p data-i18n="support_label_yttext">Bored from pictures? Checkout our Youtube channel!</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://www.instagram.com/hyperionambient/" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-instagram bg-color-ig"></i>
|
||||
<h4>Instagram</h4>
|
||||
<p data-i18n="support_label_igtext"></p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12" style="display:none">
|
||||
<hr>
|
||||
<h4 style="font-weight: bold" data-i18n="support_label_donate">Donate or use our affiliate links</h4>
|
||||
<ol>
|
||||
<li data-i18n="support_label_affinstr1">Click on the appropriate link of your country</li>
|
||||
<li data-i18n="support_label_affinstr2">Everything you buy (doesn’t matter what) we get a small fee based on your turnover</li>
|
||||
<li data-i18n="support_label_affinstr3">You ALWAYS pay the same price, there is absolutely no difference. Try it out!</li>
|
||||
</ol>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-amazon bg-color-am"></i>
|
||||
<h4>Amazon</h4>
|
||||
<ul>
|
||||
<li><a href="https://www.amazon.de/?tag=hyperionproje-21" target="_blank" data-i18n="general_country_de">Germany</a></li>
|
||||
<li><a href="https://www.amazon.com/?tag=hyperionpro05-20" target="_blank" data-i18n="general_country_us">United States</a></li>
|
||||
<li><a href="https://www.amazon.co.uk/?tag=hyperionpro02-21" target="_blank" data-i18n="general_country_uk">United Kingdom</a></li>
|
||||
<li><a href="https://www.amazon.fr/?tag=hyperionpro0c-21" target="_blank" data-i18n="general_country_fr">France</a></li>
|
||||
<li><a href="https://www.amazon.es/?tag=hyperionpro07-21" target="_blank" data-i18n="general_country_es">Spain</a></li>
|
||||
<li><a href="https://www.amazon.it/?tag=hyperionpro00-21" target="_blank" data-i18n="general_country_it">Italy</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-shopping-cart bg-color-am"></i>
|
||||
<h4>eBay</h4>
|
||||
<ul>
|
||||
<li><a href="https://rover.ebay.com/rover/1/707-53477-19255-0/1?pub=5575174930&toolid=10001&campid=707-53477-19255-0&customid=&mpt=9592320&mpre=https%3A%2F%2Fwww.ebay.de" target="_blank" data-i18n="general_country_de">Germany</a></li>
|
||||
<li><a href="https://rover.ebay.com/rover/1/711-53200-19255-0/1?pub=5575174930&toolid=10001&campid=711-53200-19255-0&customid=&mpt=8091563&mpre=https%3A%2F%2Fwww.ebay.com" target="_blank" data-i18n="general_country_us">United States</a></li>
|
||||
<li><a href="https://rover.ebay.com/rover/1/710-53481-19255-0/1?pub=5575174930&toolid=10001&campid=710-53481-19255-0&customid=&mpt=9837178&mpre=https%3A%2F%2Fwww.ebay.co.uk" target="_blank" data-i18n="general_country_uk">United Kingdom</a></li>
|
||||
<li><a href="https://rover.ebay.com/rover/1/1346-53482-19255-0/1?pub=5575174930&toolid=10001&campid=1346-53482-19255-0&customid=&mpt=9890408&mpre=https%3A%2F%2Fwww.ebay.nl" target="_blank" data-i18n="general_country_nl">Netherlands</a></li>
|
||||
<li><a href="https://rover.ebay.com/rover/1/709-53476-19255-0/1?pub=5575174930&toolid=10001&campid=709-53476-19255-0&customid=&mpt=9865977&mpre=https%3A%2F%2Fwww.ebay.fr" target="_blank" data-i18n="general_country_fr">France</a></li>
|
||||
<li><a href="https://rover.ebay.com/rover/1/1185-53479-19255-0/1?pub=5575174930&toolid=10001&campid=1185-53479-19255-0&customid=&mpt=1016300&mpre=https%3A%2F%2Fwww.ebay.es" target="_blank" data-i18n="general_country_es">Spain</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-paypal bg-color-pp"></i>
|
||||
<h4>PayPal</h4>
|
||||
<p data-i18n="support_label_donationpp">Donation:</p><a href="https://www.paypal.me/hyperionproject/10" target="_blank">Paypal</a>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-btc bg-color-btc"></i>
|
||||
<h4>Bitcoin</h4>
|
||||
<p data-i18n="support_label_btctext">Address:</p>
|
||||
<p style="word-break: break-all;">1GGZbsT6fH3cGq25H5HS2PfisPfDnffSJR</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<hr>
|
||||
<h4 style="font-weight: bold" data-i18n="support_label_webrestitle">Information and help ressources</h4>
|
||||
<a href="https://www.hyperion-project.org?pk_campaign=WebUI&pk_kwd=support_webpage" target="_blank" class="unlink">
|
||||
<a href="https://hyperion-project.org" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-globe bg-color-wf"></i>
|
||||
<h4 data-i18n="support_label_webpagetitle">Webpage</h4>
|
||||
<p data-i18n="support_label_webpagetext">Home of Hyperion</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://wiki.hyperion-project.org?pk_campaign=WebUI&pk_kwd=support_wiki" target="_blank" class="unlink">
|
||||
<a href="https://docs.hyperion-project.org" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-book bg-color-wf"></i>
|
||||
<h4 data-i18n="support_label_wikititle">Wiki</h4>
|
||||
<h4 data-i18n="support_label_wikititle">Documentation</h4>
|
||||
<p data-i18n="support_label_wikitext">The A to Z source for almost everything Hyperion related</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://forum.hyperion-project.org?pk_campaign=WebUI&pk_kwd=support_forum" target="_blank" class="unlink">
|
||||
<a href="https://hyperion-project.org/forum/" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-comments bg-color-wf"></i>
|
||||
<h4 data-i18n="support_label_forumtitle">Forum</h4>
|
||||
|
@@ -874,7 +874,7 @@
|
||||
"wiz_cc_chooseid": "Wähle einen Namen für dieses Farb-Profil.",
|
||||
"wiz_cc_intro1": "Der Assistent wird dich durch die Kalibrierung deiner LEDs leiten. Sofern du Kodi nutzt, können die Bilder und Testvideos direkt an Kodi geschickt werden. Andernfalls musst du das Material selbst herunterladen und anwenden.",
|
||||
"wiz_cc_kodicon": "Kodi Webserver gefunden, fahre mit Kodi-Unterstützung fort.",
|
||||
"wiz_cc_kodidiscon": "Kodi Webserver nicht gefunden, fahre ohne Kodi-Unterstützung fort.",
|
||||
"wiz_cc_kodidiscon": "Kodi Webserver nicht gefunden, fahre ohne Kodi-Unterstützung fort (prüfe, ob Fernsteuerung durch Programme auf anderen Rechnern erlaubt ist).",
|
||||
"wiz_cc_kodidisconlink": "Download Link Bilder:",
|
||||
"wiz_cc_kodimsg_start": "Test bestanden - Zeit zu beginnen",
|
||||
"wiz_cc_kodishould": "Kodi sollte jetzt folgendes Bild anzeigen: $1",
|
||||
|
@@ -291,6 +291,7 @@
|
||||
"edt_conf_enum_logverbose": "Verbose",
|
||||
"edt_conf_enum_logwarn": "Warning",
|
||||
"edt_conf_enum_multicolor_mean": "Multicolor",
|
||||
"edt_conf_enum_please_select": "Please Select",
|
||||
"edt_conf_enum_rbg": "RBG",
|
||||
"edt_conf_enum_rgb": "RGB",
|
||||
"edt_conf_enum_right_left": "Right to left",
|
||||
@@ -844,6 +845,8 @@
|
||||
"remote_maptype_label_multicolor_mean": "Multicolor",
|
||||
"remote_maptype_label_unicolor_mean": "Unicolor",
|
||||
"remote_optgroup_syseffets": "Provided Effects",
|
||||
"remote_optgroup_templates_custom": "User Templates",
|
||||
"remote_optgroup_templates_system": "System Templates",
|
||||
"remote_optgroup_usreffets": "User Effects",
|
||||
"remote_videoMode_2D": "2D",
|
||||
"remote_videoMode_3DSBS": "3DSBS",
|
||||
@@ -870,7 +873,7 @@
|
||||
"support_label_webpagetitle": "Webpage",
|
||||
"support_label_webrestitle": "Information and help resources",
|
||||
"support_label_wikitext": "The A to Z source for almost everything Hyperion related",
|
||||
"support_label_wikititle": "Wiki",
|
||||
"support_label_wikititle": "Documentation",
|
||||
"support_label_yttext": "Bored from pictures? Check out our YouTube channel!",
|
||||
"update_button_changelog": "Full changelog",
|
||||
"update_button_install": "Install",
|
||||
@@ -891,7 +894,7 @@
|
||||
"wiz_cc_chooseid": "Define a name for this color profile.",
|
||||
"wiz_cc_intro1": "This wizard will guide you through your led calibration. If you are using Kodi, the calibration pictures and videos can be sent directly to it. Prerequisite: You need to enable \"Allow remote control from applications on other systems\" in Kodi.<br />Alternatively, you might want downloading these files yourself and display them when the wizard asks you to adjust the setting.",
|
||||
"wiz_cc_kodicon": "Kodi found, proceed with Kodi support.",
|
||||
"wiz_cc_kodidiscon": "Kodi not found, proceed without Kodi support.",
|
||||
"wiz_cc_kodidiscon": "Kodi not found, proceed without Kodi support (please check, if remote control by other systems is activated).",
|
||||
"wiz_cc_kodidisconlink": "Download link pictures:",
|
||||
"wiz_cc_kodimsg_start": "Test success - time to proceed!",
|
||||
"wiz_cc_kodishould": "Kodi should show the following picture: $1",
|
||||
|
@@ -1,204 +1,246 @@
|
||||
$(document).ready( function() {
|
||||
performTranslation();
|
||||
var oldDelList = [];
|
||||
var effectName = "";
|
||||
var imageData = "";
|
||||
var effects_editor = null;
|
||||
var effectPy = "";
|
||||
var testrun;
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
var oldDelList = [];
|
||||
var effectName = "";
|
||||
var imageData = "";
|
||||
var effects_editor = null;
|
||||
var effectPyScript = "";
|
||||
var testrun;
|
||||
|
||||
if(window.showOptHelp)
|
||||
createHintH("intro", $.i18n('effectsconfigurator_label_intro'), "intro_effc");
|
||||
if (window.showOptHelp)
|
||||
createHintH("intro", $.i18n('effectsconfigurator_label_intro'), "intro_effc");
|
||||
|
||||
function updateDelEffectlist(){
|
||||
var newDelList = window.serverInfo.effects;
|
||||
if(newDelList.length != oldDelList.length)
|
||||
{
|
||||
$('#effectsdellist').html("");
|
||||
var usrEffArr = [];
|
||||
var sysEffArr = [];
|
||||
for(var idx=0; idx<newDelList.length; idx++)
|
||||
{
|
||||
if(!/^\:/.test(newDelList[idx].file))
|
||||
usrEffArr.push('ext_'+newDelList[idx].name+':'+newDelList[idx].name);
|
||||
else
|
||||
sysEffArr.push('int_'+newDelList[idx].name+':'+newDelList[idx].name);
|
||||
}
|
||||
$('#effectsdellist').append(createSel(usrEffArr, $.i18n('remote_optgroup_usreffets'), true)).append(createSel(sysEffArr, $.i18n('remote_optgroup_syseffets'), true)).trigger('change');
|
||||
oldDelList = newDelList;
|
||||
}
|
||||
}
|
||||
|
||||
function triggerTestEffect() {
|
||||
testrun = true;
|
||||
var args = effects_editor.getEditor('root.args');
|
||||
requestTestEffect(effectName, ":/effects/" + effectPy.slice(1), JSON.stringify(args.getValue()), imageData);
|
||||
};
|
||||
|
||||
// Specify upload handler for image files
|
||||
JSONEditor.defaults.options.upload = function(type, file, cbs) {
|
||||
var fileReader = new FileReader();
|
||||
|
||||
//check file
|
||||
if (!file.type.startsWith('image')) {
|
||||
imageData = "";
|
||||
cbs.failure('File upload error');
|
||||
// TODO clear file dialog.
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_writeimage_error_text', file.name));
|
||||
return;
|
||||
}
|
||||
|
||||
fileReader.onload = function () {
|
||||
imageData = this.result.split(',')[1];
|
||||
cbs.success(file.name);
|
||||
};
|
||||
|
||||
fileReader.readAsDataURL(file);
|
||||
};
|
||||
|
||||
$("#effectslist").off().on("change", function(event) {
|
||||
if(effects_editor != null)
|
||||
effects_editor.destroy();
|
||||
|
||||
for(var idx=0; idx<effects.length; idx++){
|
||||
if (effects[idx].schemaContent.script == this.value)
|
||||
{
|
||||
effects_editor = createJsonEditor('editor_container', {
|
||||
args : effects[idx].schemaContent,
|
||||
},false, true, false);
|
||||
|
||||
effectPy = ':';
|
||||
effectPy += effects[idx].schemaContent.script;
|
||||
imageData = "";
|
||||
$("#name-input").trigger("change");
|
||||
|
||||
$("#eff_desc").html(createEffHint($.i18n(effects[idx].schemaContent.title),$.i18n(effects[idx].schemaContent.title+'_desc')));
|
||||
break;
|
||||
}
|
||||
}
|
||||
effects_editor.on('change',function() {
|
||||
if ($("#btn_cont_test").hasClass("btn-success") && effects_editor.validate().length == 0 && effectName != "")
|
||||
{
|
||||
triggerTestEffect();
|
||||
}
|
||||
if( effects_editor.validate().length == 0 && effectName != "")
|
||||
{
|
||||
$('#btn_start_test').attr('disabled', false);
|
||||
!window.readOnlyMode ? $('#btn_write').attr('disabled', false) : $('#btn_write').attr('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#btn_start_test, #btn_write').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// disable or enable control elements
|
||||
$("#name-input").on('change keyup', function(event) {
|
||||
effectName = $(this).val();
|
||||
if ($(this).val() == '') {
|
||||
effects_editor.disable();
|
||||
$("#eff_footer").children().attr('disabled',true);
|
||||
} else {
|
||||
effects_editor.enable();
|
||||
$("#eff_footer").children().attr('disabled',false);
|
||||
!window.readOnlyMode ? $('#btn_write').attr('disabled', false) : $('#btn_write').attr('disabled', true);
|
||||
function updateDelEffectlist() {
|
||||
var newDelList = window.serverInfo.effects;
|
||||
if (newDelList.length != oldDelList.length) {
|
||||
$('#effectsdellist').html("");
|
||||
var usrEffArr = [];
|
||||
var sysEffArr = [];
|
||||
for (var idx = 0; idx < newDelList.length; idx++) {
|
||||
if (newDelList[idx].file.startsWith(":")) {
|
||||
sysEffArr.push(idx);
|
||||
}
|
||||
else {
|
||||
usrEffArr.push(idx);
|
||||
}
|
||||
}
|
||||
|
||||
if (usrEffArr.length > 0) {
|
||||
var usrEffGrp = createSelGroup($.i18n('remote_optgroup_usreffets'));
|
||||
for (var idx = 0; idx < usrEffArr.length; idx++)
|
||||
{
|
||||
usrEffGrp.appendChild(createSelOpt('ext_' + newDelList[usrEffArr[idx]].name, newDelList[usrEffArr[idx]].name));
|
||||
}
|
||||
$('#effectsdellist').append(usrEffGrp);
|
||||
}
|
||||
|
||||
var sysEffGrp = createSelGroup($.i18n('remote_optgroup_syseffets'));
|
||||
for (var idx = 0; idx < sysEffArr.length; idx++)
|
||||
{
|
||||
sysEffGrp.appendChild(createSelOpt('int_' + newDelList[sysEffArr[idx]].name, newDelList[sysEffArr[idx]].name));
|
||||
}
|
||||
$('#effectsdellist').append(sysEffGrp);
|
||||
|
||||
$("#effectsdellist").trigger("change");
|
||||
|
||||
oldDelList = newDelList;
|
||||
}
|
||||
}
|
||||
|
||||
function triggerTestEffect() {
|
||||
testrun = true;
|
||||
|
||||
var args = effects_editor.getEditor('root.args');
|
||||
requestTestEffect(effectName, effectPyScript, JSON.stringify(args.getValue()), imageData);
|
||||
};
|
||||
|
||||
// Specify upload handler for image files
|
||||
JSONEditor.defaults.options.upload = function (type, file, cbs) {
|
||||
var fileReader = new FileReader();
|
||||
|
||||
//check file
|
||||
if (!file.type.startsWith('image')) {
|
||||
imageData = "";
|
||||
cbs.failure('File upload error');
|
||||
// TODO clear file dialog.
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_writeimage_error_text', file.name));
|
||||
return;
|
||||
}
|
||||
|
||||
fileReader.onload = function () {
|
||||
imageData = this.result.split(',')[1];
|
||||
cbs.success(file.name);
|
||||
};
|
||||
|
||||
fileReader.readAsDataURL(file);
|
||||
};
|
||||
|
||||
$("#effectslist").off().on("change", function (event) {
|
||||
if (effects_editor != null)
|
||||
effects_editor.destroy();
|
||||
|
||||
for (var idx = 0; idx < effects.length; idx++) {
|
||||
if (effects[idx].script == this.value) {
|
||||
effects_editor = createJsonEditor('editor_container', {
|
||||
args: effects[idx].schemaContent,
|
||||
}, false, true, false);
|
||||
|
||||
effectPyScript = effects[idx].script;
|
||||
|
||||
imageData = "";
|
||||
$("#name-input").trigger("change");
|
||||
|
||||
var desc = $.i18n(effects[idx].schemaContent.title + '_desc');
|
||||
if (desc === effects[idx].schemaContent.title + '_desc') {
|
||||
desc = ""
|
||||
}
|
||||
|
||||
$("#eff_desc").html(createEffHint($.i18n(effects[idx].schemaContent.title), desc));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
effects_editor.on('change', function () {
|
||||
if ($("#btn_cont_test").hasClass("btn-success") && effects_editor.validate().length == 0 && effectName != "") {
|
||||
triggerTestEffect();
|
||||
}
|
||||
if (effects_editor.validate().length == 0 && effectName != "") {
|
||||
$('#btn_start_test').attr('disabled', false);
|
||||
!window.readOnlyMode ? $('#btn_write').attr('disabled', false) : $('#btn_write').attr('disabled', true);
|
||||
}
|
||||
else {
|
||||
$('#btn_start_test, #btn_write').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// disable or enable control elements
|
||||
$("#name-input").on('change keyup', function (event) {
|
||||
effectName = $(this).val();
|
||||
if ($(this).val() == '') {
|
||||
effects_editor.disable();
|
||||
$("#eff_footer").children().attr('disabled', true);
|
||||
} else {
|
||||
effects_editor.enable();
|
||||
$("#eff_footer").children().attr('disabled', false);
|
||||
!window.readOnlyMode ? $('#btn_write').attr('disabled', false) : $('#btn_write').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
// Save Effect
|
||||
$('#btn_write').off().on('click', function () {
|
||||
requestWriteEffect(effectName, effectPyScript, JSON.stringify(effects_editor.getValue()), imageData);
|
||||
$(window.hyperion).one("cmd-create-effect", function (event) {
|
||||
if (event.response.success)
|
||||
showInfoDialog('success', "", $.i18n('infoDialog_effconf_created_text', effectName));
|
||||
});
|
||||
|
||||
// Save Effect
|
||||
$('#btn_write').off().on('click',function() {
|
||||
requestWriteEffect(effectName,effectPy,JSON.stringify(effects_editor.getValue()),imageData);
|
||||
$(window.hyperion).one("cmd-create-effect", function(event) {
|
||||
if (event.response.success)
|
||||
showInfoDialog('success', "", $.i18n('infoDialog_effconf_created_text', effectName));
|
||||
});
|
||||
if (testrun)
|
||||
setTimeout(requestPriorityClear, 100);
|
||||
});
|
||||
|
||||
if (testrun)
|
||||
setTimeout(requestPriorityClear,100);
|
||||
// Start test
|
||||
$('#btn_start_test').off().on('click', function () {
|
||||
triggerTestEffect();
|
||||
});
|
||||
|
||||
});
|
||||
// Stop test
|
||||
$('#btn_stop_test').off().on('click', function () {
|
||||
requestPriorityClear();
|
||||
testrun = false;
|
||||
});
|
||||
|
||||
// Start test
|
||||
$('#btn_start_test').off().on('click',function() {
|
||||
triggerTestEffect();
|
||||
});
|
||||
// Continuous test
|
||||
$('#btn_cont_test').off().on('click', function () {
|
||||
toggleClass('#btn_cont_test', "btn-success", "btn-danger");
|
||||
});
|
||||
|
||||
// Stop test
|
||||
$('#btn_stop_test').off().on('click',function() {
|
||||
requestPriorityClear();
|
||||
testrun = false;
|
||||
});
|
||||
// Delete Effect
|
||||
$('#btn_delete').off().on('click', function () {
|
||||
var name = $("#effectsdellist").val().split("_")[1];
|
||||
requestDeleteEffect(name);
|
||||
$(window.hyperion).one("cmd-delete-effect", function (event) {
|
||||
if (event.response.success)
|
||||
showInfoDialog('success', "", $.i18n('infoDialog_effconf_deleted_text', name));
|
||||
});
|
||||
});
|
||||
|
||||
// Continuous test
|
||||
$('#btn_cont_test').off().on('click',function() {
|
||||
toggleClass('#btn_cont_test', "btn-success", "btn-danger");
|
||||
});
|
||||
// Disable or enable Delete Effect Button
|
||||
$('#effectsdellist').off().on('change', function () {
|
||||
$(this).val() == null ? $('#btn_edit, #btn_delete').prop('disabled', true) : "";
|
||||
$(this).val().startsWith("int_") ? $('#btn_delete').prop('disabled', true) : $('#btn_delete').prop('disabled', false);
|
||||
});
|
||||
|
||||
// Delete Effect
|
||||
$('#btn_delete').off().on('click',function() {
|
||||
var name = $("#effectsdellist").val().split("_")[1];
|
||||
requestDeleteEffect(name);
|
||||
$(window.hyperion).one("cmd-delete-effect", function(event) {
|
||||
if (event.response.success)
|
||||
showInfoDialog('success', "", $.i18n('infoDialog_effconf_deleted_text', name));
|
||||
});
|
||||
});
|
||||
// Load Effect
|
||||
$('#btn_edit').off().on('click', function () {
|
||||
|
||||
// disable or enable Delete Effect Button
|
||||
$('#effectsdellist').off().on('change', function(){
|
||||
$(this).val() == null ? $('#btn_edit, #btn_delete').prop('disabled',true) : "";
|
||||
$(this).val().startsWith("int_") ? $('#btn_delete').prop('disabled',true) : $('#btn_delete').prop('disabled',false);
|
||||
});
|
||||
var name = $("#effectsdellist").val().replace("ext_", "");
|
||||
if (name.startsWith("int_")) {
|
||||
name = name.split("_").pop();
|
||||
$("#name-input").val("My Modded Effect");
|
||||
}
|
||||
else {
|
||||
name = name.split("_").pop();
|
||||
$("#name-input").val(name);
|
||||
}
|
||||
|
||||
// Load Effect
|
||||
$('#btn_edit').off().on('click', function(){
|
||||
var name = $("#effectsdellist").val().replace("ext_","");
|
||||
var efx = window.serverInfo.effects;
|
||||
for (var i = 0; i < efx.length; i++) {
|
||||
if (efx[i].name == name) {
|
||||
var py = efx[i].script;
|
||||
$("#effectslist").val(py).trigger("change");
|
||||
|
||||
if(name.startsWith("int_"))
|
||||
{ name = name.split("_").pop();
|
||||
$("#name-input").val("My Modded Effect");
|
||||
}
|
||||
else
|
||||
{
|
||||
name = name.split("_").pop();
|
||||
$("#name-input").val(name);
|
||||
}
|
||||
for (var key in efx[i].args) {
|
||||
var ed = effects_editor.getEditor('root.args.' + [key]);
|
||||
if (ed)
|
||||
ed.setValue(efx[i].args[key]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var efx = window.serverInfo.effects;
|
||||
for(var i = 0; i<efx.length; i++)
|
||||
{
|
||||
if(efx[i].name == name)
|
||||
{
|
||||
var py = efx[i].script.split("/").pop();
|
||||
$("#effectslist").val(py).trigger("change");
|
||||
//Create effect template list
|
||||
var effects = window.serverSchema.properties.effectSchemas;
|
||||
|
||||
for(var key in efx[i].args)
|
||||
{
|
||||
var ed = effects_editor.getEditor('root.args.'+[key]);
|
||||
if(ed)
|
||||
ed.setValue(efx[i].args[key]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#effectslist').html("");
|
||||
var custTemplatesIDs = [];
|
||||
var sysTemplatesIDs = [];
|
||||
|
||||
//create basic effect list
|
||||
var effects = window.serverSchema.properties.effectSchemas.internal;
|
||||
for(var idx=0; idx<effects.length; idx++)
|
||||
{
|
||||
$("#effectslist").append(createSelOpt(effects[idx].schemaContent.script, $.i18n(effects[idx].schemaContent.title)));
|
||||
}
|
||||
$("#effectslist").trigger("change");
|
||||
for (var idx = 0; idx < effects.length; idx++) {
|
||||
if (effects[idx].type === "custom")
|
||||
custTemplatesIDs.push(idx);
|
||||
else
|
||||
sysTemplatesIDs.push(idx);
|
||||
}
|
||||
|
||||
updateDelEffectlist();
|
||||
//Cannot use createSel(), as Windows filenames include colons ":"
|
||||
if (custTemplatesIDs.length > 0) {
|
||||
var custTmplGrp = createSelGroup($.i18n('remote_optgroup_templates_custom'));
|
||||
for (var idx = 0; idx < custTemplatesIDs.length; idx++)
|
||||
{
|
||||
custTmplGrp.appendChild(createSelOpt(effects[custTemplatesIDs[idx]].script, $.i18n(effects[custTemplatesIDs[idx]].schemaContent.title)));
|
||||
}
|
||||
$('#effectslist').append(custTmplGrp);
|
||||
}
|
||||
|
||||
//interval update
|
||||
$(window.hyperion).on("cmd-effects-update", function(event){
|
||||
window.serverInfo.effects = event.response.data.effects
|
||||
updateDelEffectlist();
|
||||
});
|
||||
var sysTmplGrp = createSelGroup($.i18n('remote_optgroup_templates_system'));
|
||||
for (var idx = 0; idx < sysTemplatesIDs.length; idx++)
|
||||
{
|
||||
sysTmplGrp.appendChild(createSelOpt(effects[sysTemplatesIDs[idx]].script, $.i18n(effects[sysTemplatesIDs[idx]].schemaContent.title)));
|
||||
}
|
||||
$('#effectslist').append(sysTmplGrp);
|
||||
|
||||
removeOverlay();
|
||||
$("#effectslist").trigger("change");
|
||||
|
||||
updateDelEffectlist();
|
||||
|
||||
//interval update
|
||||
$(window.hyperion).on("cmd-effects-update", function (event) {
|
||||
window.serverInfo.effects = event.response.data.effects
|
||||
updateDelEffectlist();
|
||||
});
|
||||
|
||||
removeOverlay();
|
||||
});
|
||||
|
||||
|
@@ -11,12 +11,12 @@ $(document).ready(function () {
|
||||
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
||||
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
|
||||
|
||||
// Framegrabber
|
||||
// Screen-Grabber
|
||||
$('#conf_cont').append(createRow('conf_cont_screen'));
|
||||
$('#conf_cont_screen').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_screengrabber', 'btn_submit_screengrabber'));
|
||||
$('#conf_cont_screen').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
||||
|
||||
// V4L2 - hide if not available
|
||||
// Video-Grabber - hide if not available
|
||||
if (VIDEOGRABBER_AVAIL) {
|
||||
$('#conf_cont').append(createRow('conf_cont_video'));
|
||||
$('#conf_cont_video').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_videograbber', 'btn_submit_videograbber'));
|
||||
@@ -36,7 +36,7 @@ $(document).ready(function () {
|
||||
instCapture: window.schema.instCapture
|
||||
}, true, true);
|
||||
|
||||
// Hide V4L2 elements, if not available
|
||||
// Hide Video-Grabber elements, if not available
|
||||
if (!VIDEOGRABBER_AVAIL) {
|
||||
$('[data-schemapath*="root.instCapture.v4lEnable' + '"]').hide();
|
||||
$('[data-schemapath*="root.instCapture.v4lPriority' + '"]').hide();
|
||||
@@ -67,6 +67,15 @@ $(document).ready(function () {
|
||||
conf_editor_instCapt.validate().length || window.readOnlyMode ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
||||
});
|
||||
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.systemEnable', () => {
|
||||
var systemEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
||||
if (systemEnable) {
|
||||
discoverInputSources("screen");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.v4lEnable', () => {
|
||||
if (VIDEOGRABBER_AVAIL) {
|
||||
var videoEnable = conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").getValue();
|
||||
@@ -131,43 +140,18 @@ $(document).ready(function () {
|
||||
updateJsonEditorRange(editor.getEditor(path), 'cropBottom', 0, height);
|
||||
}
|
||||
|
||||
// Framegrabber
|
||||
// Screen-Grabber
|
||||
conf_editor_screen = createJsonEditor('editor_container_screengrabber', {
|
||||
framegrabber: window.schema.framegrabber
|
||||
}, true, true);
|
||||
|
||||
conf_editor_screen.on('ready', function () {
|
||||
var availableGrabbers = window.serverInfo.grabbers.available;
|
||||
var screenGrabberOptions = conf_editor_screen.getEditor('root.framegrabber');
|
||||
var orginalGrabberTypes = screenGrabberOptions.schema.properties.type.enum;
|
||||
var orginalGrabberTitles = screenGrabberOptions.schema.properties.type.options.enum_titles;
|
||||
|
||||
var enumVals = [];
|
||||
var enumTitelVals = [];
|
||||
var enumDefaultVal = "";
|
||||
|
||||
for (var i = 0; i < orginalGrabberTypes.length; i++) {
|
||||
var grabberType = orginalGrabberTypes[i];
|
||||
if ($.inArray(grabberType, availableGrabbers) != -1) {
|
||||
enumVals.push(grabberType);
|
||||
enumTitelVals.push(orginalGrabberTitles[i]);
|
||||
}
|
||||
var screenEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
||||
if (screenEnable) {
|
||||
discoverInputSources("screen");
|
||||
}
|
||||
|
||||
var activeGrabbers = window.serverInfo.grabbers.active.map(v => v.toLowerCase());
|
||||
|
||||
// Select first active platform grabber
|
||||
for (var i = 0; i < enumVals.length; i++) {
|
||||
var grabberType = enumVals[i];
|
||||
if ($.inArray(grabberType, activeGrabbers) != -1) {
|
||||
enumDefaultVal = grabberType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
updateJsonEditorSelection(screenGrabberOptions, "type", {}, enumVals, enumTitelVals, enumDefaultVal);
|
||||
});
|
||||
|
||||
conf_editor_screen.on('ready', function () {
|
||||
updateCropForWidth(conf_editor_screen, "root.framegrabber");
|
||||
updateCropForHeight(conf_editor_screen, "root.framegrabber");
|
||||
});
|
||||
@@ -181,6 +165,182 @@ $(document).ready(function () {
|
||||
filterScreenInputOptions(selectedType);
|
||||
});
|
||||
|
||||
conf_editor_screen.watch('root.framegrabber.available_devices', () => {
|
||||
var deviceSelected = conf_editor_screen.getEditor("root.framegrabber.available_devices").getValue();
|
||||
if (deviceSelected === "NONE" || deviceSelected === "") {
|
||||
$('#btn_submit_screengrabber').attr('disabled', true);
|
||||
}
|
||||
else {
|
||||
var addSchemaElements = {};
|
||||
var enumVals = [];
|
||||
var enumTitelVals = [];
|
||||
var enumDefaultVal = "";
|
||||
|
||||
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
||||
|
||||
//Update hidden input element
|
||||
conf_editor_screen.getEditor("root.framegrabber.device").setValue(deviceProperties.device);
|
||||
|
||||
var video_inputs = deviceProperties.video_inputs;
|
||||
if (video_inputs.length <= 1) {
|
||||
addSchemaElements.access = "expert";
|
||||
}
|
||||
|
||||
for (const video_input of video_inputs) {
|
||||
enumVals.push(video_input.inputIdx);
|
||||
enumTitelVals.push(video_input.name);
|
||||
}
|
||||
|
||||
if (enumVals.length > 0) {
|
||||
if (deviceSelected === configuredDevice) {
|
||||
var configuredVideoInput = window.serverConfig.framegrabber.input;
|
||||
if ($.inArray(configuredVideoInput, enumVals) != -1) {
|
||||
enumDefaultVal = configuredVideoInput;
|
||||
}
|
||||
}
|
||||
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
||||
'device_inputs', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
||||
}
|
||||
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_screengrabber').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor_screen.watch('root.framegrabber.device_inputs', () => {
|
||||
var deviceSelected = conf_editor_screen.getEditor("root.framegrabber.available_devices").getValue();
|
||||
var videoInputSelected = conf_editor_screen.getEditor("root.framegrabber.device_inputs").getValue();
|
||||
|
||||
//Update hidden input element
|
||||
conf_editor_screen.getEditor("root.framegrabber.input").setValue(parseInt(videoInputSelected));
|
||||
|
||||
var addSchemaElements = {};
|
||||
var enumVals = [];
|
||||
var enumTitelVals = [];
|
||||
var enumDefaultVal = "";
|
||||
|
||||
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
||||
|
||||
var formats = deviceProperties.video_inputs[videoInputSelected].formats;
|
||||
var formatIdx = 0;
|
||||
/*
|
||||
if (formatSelected !== "NONE") {
|
||||
formatIdx = formats.findIndex(x => x.format === formatSelected);
|
||||
}
|
||||
*/
|
||||
|
||||
var resolutions = formats[formatIdx].resolutions;
|
||||
if (resolutions.length <= 1) {
|
||||
addSchemaElements.access = "advanced";
|
||||
} else {
|
||||
resolutions.sort(compareTwoValues('width', 'height', 'asc'));
|
||||
}
|
||||
|
||||
for (var i = 0; i < resolutions.length; i++) {
|
||||
enumVals.push(i);
|
||||
var resolutionText = resolutions[i].width + "x" + resolutions[i].height;
|
||||
enumTitelVals.push(resolutionText);
|
||||
}
|
||||
|
||||
if (enumVals.length > 0) {
|
||||
if (deviceSelected === configuredDevice) {
|
||||
var configuredResolutionText = window.serverConfig.framegrabber.width + "x" + window.serverConfig.framegrabber.height;
|
||||
var idx = $.inArray(configuredResolutionText, enumTitelVals)
|
||||
if (idx != -1) {
|
||||
enumDefaultVal = idx;
|
||||
}
|
||||
}
|
||||
|
||||
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
||||
'resolutions', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
||||
}
|
||||
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_videograbber').attr('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor_screen.watch('root.framegrabber.resolutions', () => {
|
||||
var deviceSelected = conf_editor_screen.getEditor("root.framegrabber.available_devices").getValue();
|
||||
var videoInputSelected = conf_editor_screen.getEditor("root.framegrabber.device_inputs").getValue();
|
||||
var resolutionSelected = conf_editor_screen.getEditor("root.framegrabber.resolutions").getValue();
|
||||
|
||||
var addSchemaElements = {};
|
||||
var enumVals = [];
|
||||
var enumDefaultVal = "";
|
||||
|
||||
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
||||
|
||||
var formats = deviceProperties.video_inputs[videoInputSelected].formats;
|
||||
var formatIdx = 0;
|
||||
/*
|
||||
if (formatSelected !== "NONE") {
|
||||
formatIdx = formats.findIndex(x => x.format === formatSelected);
|
||||
}
|
||||
*/
|
||||
|
||||
//Update hidden resolution related elements
|
||||
var width = parseInt(formats[formatIdx].resolutions[resolutionSelected].width);
|
||||
conf_editor_screen.getEditor("root.framegrabber.width").setValue(width);
|
||||
|
||||
var height = parseInt(formats[formatIdx].resolutions[resolutionSelected].height);
|
||||
conf_editor_screen.getEditor("root.framegrabber.height").setValue(height);
|
||||
|
||||
//Update crop rage depending on selected resolution
|
||||
updateCropForWidth(conf_editor_screen, "root.framegrabber");
|
||||
updateCropForHeight(conf_editor_screen, "root.framegrabber");
|
||||
|
||||
var fps = formats[formatIdx].resolutions[resolutionSelected].fps;
|
||||
if (!fps) {
|
||||
enumVals.push("NONE");
|
||||
addSchemaElements.options = { "hidden": true };
|
||||
} else {
|
||||
fps.sort((a, b) => a - b);
|
||||
for (var i = 0; i < fps.length; i++) {
|
||||
enumVals.push(fps[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (enumVals.length <= 1) {
|
||||
addSchemaElements.access = "expert";
|
||||
}
|
||||
|
||||
if (enumVals.length > 0) {
|
||||
if (deviceSelected === configuredDevice) {
|
||||
var configuredFps = window.serverConfig.framegrabber.fps;
|
||||
if ($.inArray(configuredFps, enumVals) != -1) {
|
||||
enumDefaultVal = configuredFps;
|
||||
}
|
||||
}
|
||||
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
||||
'framerates', addSchemaElements, enumVals, [], enumDefaultVal, false);
|
||||
}
|
||||
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_screengrabber').attr('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor_screen.watch('root.framegrabber.framerates', () => {
|
||||
//Update hidden fps element
|
||||
var fps = 0;
|
||||
var framerates = conf_editor_screen.getEditor("root.framegrabber.framerates").getValue();
|
||||
if (framerates !== "NONE") {
|
||||
fps = parseInt(framerates);
|
||||
}
|
||||
|
||||
//Show Frameskipping only when more than 2 fps
|
||||
if (fps > 2 && storedAccess === "expert") {
|
||||
showVideoInputOptions(["fpsSoftwareDecimation"], true);
|
||||
}
|
||||
else {
|
||||
showVideoInputOptions(["fpsSoftwareDecimation"], false);
|
||||
}
|
||||
conf_editor_screen.getEditor("root.framegrabber.fps").setValue(fps);
|
||||
});
|
||||
|
||||
|
||||
conf_editor_screen.watch('root.framegrabber.width', () => {
|
||||
updateCropForWidth(conf_editor_screen, "root.framegrabber");
|
||||
});
|
||||
@@ -227,7 +387,13 @@ $(document).ready(function () {
|
||||
};
|
||||
|
||||
$('#btn_submit_screengrabber').off().on('click', function () {
|
||||
requestWriteConfig(conf_editor_screen.getValue());
|
||||
var saveOptions = conf_editor_screen.getValue();
|
||||
|
||||
var instCaptOptions = window.serverConfig.instCapture;
|
||||
instCaptOptions.systemEnable = true;
|
||||
saveOptions.instCapture = instCaptOptions;
|
||||
|
||||
requestWriteConfig(saveOptions);
|
||||
});
|
||||
|
||||
// External Input Sources (Video-Grabbers)
|
||||
@@ -251,8 +417,16 @@ $(document).ready(function () {
|
||||
conf_editor_video.on('change', function () {
|
||||
var deviceSelected = conf_editor_video.getEditor("root.grabberV4L2.available_devices").getValue();
|
||||
if (!conf_editor_video.validate().length) {
|
||||
if (deviceSelected !== "NONE") {
|
||||
window.readOnlyMode ? $('#btn_submit_videograbber').attr('disabled', true) : $('#btn_submit_videograbber').attr('disabled', false);
|
||||
|
||||
switch (deviceSelected) {
|
||||
case "SELECT":
|
||||
showAllVideoInputOptions(conf_editor_video, "grabberV4L2", false);
|
||||
break;
|
||||
case "NONE":
|
||||
break;
|
||||
default:
|
||||
window.readOnlyMode ? $('#btn_submit_videograbber').attr('disabled', true) : $('#btn_submit_videograbber').attr('disabled', false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -262,7 +436,7 @@ $(document).ready(function () {
|
||||
|
||||
conf_editor_video.watch('root.grabberV4L2.available_devices', () => {
|
||||
var deviceSelected = conf_editor_video.getEditor("root.grabberV4L2.available_devices").getValue();
|
||||
if (deviceSelected === "NONE" || deviceSelected === "") {
|
||||
if (deviceSelected === "NONE" || deviceSelected === "SELECT" || deviceSelected === "") {
|
||||
$('#btn_submit_videograbber').attr('disabled', true);
|
||||
}
|
||||
else {
|
||||
@@ -293,6 +467,7 @@ $(document).ready(function () {
|
||||
enumDefaultVal = configuredVideoInput;
|
||||
}
|
||||
}
|
||||
|
||||
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
||||
'device_inputs', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
||||
}
|
||||
@@ -389,7 +564,7 @@ $(document).ready(function () {
|
||||
|
||||
var resolutions = formats[formatIdx].resolutions;
|
||||
if (resolutions.length <= 1) {
|
||||
addSchemaElements.access = "expert";
|
||||
addSchemaElements.access = "advanced";
|
||||
} else {
|
||||
resolutions.sort(compareTwoValues('width', 'height', 'asc'));
|
||||
}
|
||||
@@ -497,8 +672,13 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$('#btn_submit_videograbber').off().on('click', function () {
|
||||
var v4l2Options = conf_editor_video.getValue();
|
||||
requestWriteConfig(v4l2Options);
|
||||
var saveOptions = conf_editor_video.getValue();
|
||||
|
||||
var instCaptOptions = window.serverConfig.instCapture;
|
||||
instCaptOptions.v4lEnable = true;
|
||||
saveOptions.instCapture = instCaptOptions;
|
||||
|
||||
requestWriteConfig(saveOptions);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -514,35 +694,69 @@ $(document).ready(function () {
|
||||
|
||||
removeOverlay();
|
||||
|
||||
// build dynamic enum
|
||||
var updateVideoSourcesList = function (type, discoveryInfo) {
|
||||
// build dynamic screen input enum
|
||||
var updateScreenSourcesList = function (type, discoveryInfo) {
|
||||
var enumVals = [];
|
||||
var enumTitelVals = [];
|
||||
var enumDefaultVal = "";
|
||||
|
||||
if (jQuery.isEmptyObject(discoveryInfo)) {
|
||||
enumVals.push("NONE");
|
||||
enumTitelVals.push($.i18n('edt_conf_grabber_discovered_none'));
|
||||
|
||||
conf_editor_screen.getEditor('root.framegrabber').disable();
|
||||
showAllVideoInputOptions(conf_editor_screen, "framegrabber", false);
|
||||
}
|
||||
else {
|
||||
for (const device of discoveryInfo) {
|
||||
enumVals.push(device.device_name);
|
||||
}
|
||||
conf_editor_screen.getEditor('root.framegrabber').enable();
|
||||
}
|
||||
|
||||
if (enumVals.length > 0) {
|
||||
configuredDevice = window.serverConfig.framegrabber.available_devices;
|
||||
if ($.inArray(configuredDevice, enumVals) != -1) {
|
||||
enumDefaultVal = configuredDevice;
|
||||
}
|
||||
|
||||
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
||||
'available_devices', {}, enumVals, enumTitelVals, enumDefaultVal, false);
|
||||
}
|
||||
}
|
||||
|
||||
// build dynamic video input enum
|
||||
var updateVideoSourcesList = function (type, discoveryInfo) {
|
||||
var enumVals = [];
|
||||
var enumTitelVals = [];
|
||||
var enumDefaultVal = "";
|
||||
var addSelect = false;
|
||||
|
||||
if (jQuery.isEmptyObject(discoveryInfo)) {
|
||||
enumVals.push("NONE");
|
||||
enumTitelVals.push($.i18n('edt_conf_grabber_discovered_none'));
|
||||
|
||||
conf_editor_video.getEditor('root.grabberV4L2').disable();
|
||||
showAllVideoInputOptions(false);
|
||||
showAllVideoInputOptions(conf_editor_video, "grabberV4L2", false);
|
||||
}
|
||||
else {
|
||||
for (const device of discoveryInfo) {
|
||||
enumVals.push(device.device_name);
|
||||
}
|
||||
conf_editor_video.getEditor('root.grabberV4L2').enable();
|
||||
}
|
||||
|
||||
if (enumVals.length > 0) {
|
||||
configuredDevice = window.serverConfig.grabberV4L2.available_devices;
|
||||
|
||||
if ($.inArray(configuredDevice, enumVals) != -1) {
|
||||
enumDefaultVal = configuredDevice;
|
||||
}
|
||||
|
||||
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
||||
'available_devices', {}, enumVals, enumTitelVals, enumDefaultVal, false);
|
||||
else {
|
||||
addSelect = true;
|
||||
showAllVideoInputOptions(conf_editor_video, "grabberV4L2", false);
|
||||
}
|
||||
}
|
||||
|
||||
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
||||
'available_devices', {}, enumVals, enumTitelVals, enumDefaultVal, addSelect);
|
||||
}
|
||||
|
||||
async function discoverInputSources(type, params) {
|
||||
@@ -557,9 +771,18 @@ $(document).ready(function () {
|
||||
"video_sources": []
|
||||
}
|
||||
}
|
||||
|
||||
//console.log("discoveryResult", discoveryResult);
|
||||
discoveredInputSources = discoveryResult.video_sources;
|
||||
|
||||
updateVideoSourcesList(type, discoveredInputSources);
|
||||
switch (type) {
|
||||
case "screen":
|
||||
updateScreenSourcesList(type, discoveredInputSources);
|
||||
break;
|
||||
case "video":
|
||||
updateVideoSourcesList(type, discoveredInputSources);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function getPropertiesOfDevice(deviceName) {
|
||||
@@ -573,20 +796,20 @@ $(document).ready(function () {
|
||||
return deviceProperties;
|
||||
}
|
||||
|
||||
function showVideoInputOptions(elements, state) {
|
||||
function showVideoInputOptions(path, elements, state) {
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
$('[data-schemapath*="root.grabberV4L2.' + elements[i] + '"]').toggle(state);
|
||||
$('[data-schemapath*="'+ path + '.' + elements[i] + '"]').toggle(state);
|
||||
}
|
||||
}
|
||||
|
||||
function showAllVideoInputOptions(state) {
|
||||
function showAllVideoInputOptions(editor, item, state) {
|
||||
var elements = [];
|
||||
for (var key in conf_editor_video.schema.properties.grabberV4L2.properties) {
|
||||
for (var key in editor.schema.properties[item].properties) {
|
||||
|
||||
if (key !== "available_devices") {
|
||||
elements.push(key);
|
||||
}
|
||||
}
|
||||
showVideoInputOptions(elements, state);
|
||||
showVideoInputOptions("root." + item, elements, state);
|
||||
}
|
||||
});
|
||||
|
@@ -53,7 +53,7 @@ function updateSessions() {
|
||||
if (sess && sess.length) {
|
||||
window.wSess = [];
|
||||
for (var i = 0; i < sess.length; i++) {
|
||||
if (sess[i].type == "_hyperiond-http._tcp.") {
|
||||
if (sess[i].type == "_http._tcp." || sess[i].type == "_https._tcp." || sess[i].type == "_hyperiond-http._tcp.") {
|
||||
window.wSess.push(sess[i]);
|
||||
}
|
||||
}
|
||||
@@ -461,7 +461,7 @@ function createJsonEditor(container, schema, setconfig, usePanel, arrayre) {
|
||||
return editor;
|
||||
}
|
||||
|
||||
function updateJsonEditorSelection(editor, key, addElements, newEnumVals, newTitelVals, newDefaultVal, addCustom) {
|
||||
function updateJsonEditorSelection(editor, key, addElements, newEnumVals, newTitelVals, newDefaultVal, addSelect, addCustom, addCustomAsFirst, customText) {
|
||||
var orginalProperties = editor.schema.properties[key];
|
||||
|
||||
var newSchema = [];
|
||||
@@ -494,8 +494,22 @@ function updateJsonEditorSelection(editor, key, addElements, newEnumVals, newTit
|
||||
}
|
||||
|
||||
if (addCustom) {
|
||||
newEnumVals.push("custom");
|
||||
newTitelVals.push("edt_conf_enum_custom");
|
||||
|
||||
if (newTitelVals.length === 0) {
|
||||
newTitelVals = [...newEnumVals];
|
||||
}
|
||||
|
||||
if (!!!customText) {
|
||||
customText = "edt_conf_enum_custom";
|
||||
}
|
||||
|
||||
if (addCustomAsFirst) {
|
||||
newEnumVals.unshift("CUSTOM");
|
||||
newTitelVals.unshift(customText);
|
||||
} else {
|
||||
newEnumVals.push("CUSTOM");
|
||||
newTitelVals.push(customText);
|
||||
}
|
||||
|
||||
if (newSchema[key].options.infoText) {
|
||||
var customInfoText = newSchema[key].options.infoText + "_custom";
|
||||
@@ -503,6 +517,12 @@ function updateJsonEditorSelection(editor, key, addElements, newEnumVals, newTit
|
||||
}
|
||||
}
|
||||
|
||||
if (addSelect) {
|
||||
newEnumVals.unshift("SELECT");
|
||||
newTitelVals.unshift("edt_conf_enum_please_select");
|
||||
newDefaultVal = "SELECT";
|
||||
}
|
||||
|
||||
if (newEnumVals) {
|
||||
newSchema[key]["enum"] = newEnumVals;
|
||||
}
|
||||
|
Reference in New Issue
Block a user