update/fix remote

This commit is contained in:
brindosch 2017-03-02 11:52:27 +01:00
parent 976dd7873f
commit 19f8928869
6 changed files with 35 additions and 36 deletions

View File

@ -63,7 +63,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<button data-i18n="remote_color_button_reset" type="button" class="btn btn-warning" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button> <button data-i18n="remote_color_button_reset" type="button" class="btn btn-primary" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -253,7 +253,6 @@
"infoDialog_general_error_title" : "Fehler", "infoDialog_general_error_title" : "Fehler",
"infoDialog_general_warning_title" : "Warnung", "infoDialog_general_warning_title" : "Warnung",
"infoDialog_checklist_title" : "Checkliste!", "infoDialog_checklist_title" : "Checkliste!",
"InfoDialog_leds_validfail_title" : "JSON Überprüfung fehlgeschlagen!",
"infoDialog_effconf_deleted_text" : "Der Effekt \"$1\" wurde erfolgreich entfernt!", "infoDialog_effconf_deleted_text" : "Der Effekt \"$1\" wurde erfolgreich entfernt!",
"infoDialog_effconf_created_text" : "Der Effekt \"$1\" wurde erfolgreich erstellt!", "infoDialog_effconf_created_text" : "Der Effekt \"$1\" wurde erfolgreich erstellt!",
"InfoDialog_lang_title" : "Spracheinstellung", "InfoDialog_lang_title" : "Spracheinstellung",

View File

@ -253,7 +253,6 @@
"infoDialog_general_error_title" : "Error", "infoDialog_general_error_title" : "Error",
"infoDialog_general_warning_title" : "Warning", "infoDialog_general_warning_title" : "Warning",
"infoDialog_checklist_title" : "Checklist!", "infoDialog_checklist_title" : "Checklist!",
"InfoDialog_leds_validfail_title" : "JSON Validation failed!",
"infoDialog_effconf_deleted_text" : "The effect \"$1\" has been deleted successfully!", "infoDialog_effconf_deleted_text" : "The effect \"$1\" has been deleted successfully!",
"infoDialog_effconf_created_text" : "The effect \"$1\" has been created successfully!", "infoDialog_effconf_created_text" : "The effect \"$1\" has been created successfully!",
"InfoDialog_lang_title" : "Language setting", "InfoDialog_lang_title" : "Language setting",

View File

@ -92,7 +92,15 @@ $(document).ready(function() {
for(i = 0; i < prios.length; i++) for(i = 0; i < prios.length; i++)
{ {
var origin = prios[i].origin; var origin = prios[i].origin;
var ip = "xxx.xxx.xxx.xxx"; if(typeof origin !== "undefined" && origin != "")
{
origin = origin.split("@");
var ip = origin[1];
origin = origin[0];
}
else
origin = "System";
var owner = prios[i].owner; var owner = prios[i].owner;
var active = prios[i].active; var active = prios[i].active;
var visible = prios[i].visible; var visible = prios[i].visible;
@ -102,7 +110,7 @@ $(document).ready(function() {
var btn_type = "default"; var btn_type = "default";
var btn_text = $.i18n('remote_input_setsource_btn'); var btn_text = $.i18n('remote_input_setsource_btn');
var btn_state = "enabled"; var btn_state = "enabled";
if (active) btn_type = "warning"; if (active) btn_type = "primary";
if (visible) if (visible)
{ {
btn_state = "disabled"; btn_state = "disabled";
@ -111,26 +119,26 @@ $(document).ready(function() {
} }
if(ip) if(ip)
origin += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_ip')+' '+ip+'</span>'; origin += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_ip')+' '+ip+'</span>';
if(compId == "10") if(compId == 10)
owner = $.i18n('remote_effects_label_effects')+' '+owner; owner = $.i18n('remote_effects_label_effects')+' '+owner;
if(compId == "9") if(compId == 9)
owner = $.i18n('remote_color_label_color')+' '+'<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb('+prios[i].value.RGB+'); display:inline-block" title="RGB: ('+prios[i].value.RGB+')"></div>'; owner = $.i18n('remote_color_label_color')+' '+'<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb('+prios[i].value.RGB+'); display:inline-block" title="RGB: ('+prios[i].value.RGB+')"></div>';
if(compId == "7") if(compId == 7)
owner = $.i18n('general_comp_GRABBER')+': ('+owner+')'; owner = $.i18n('general_comp_GRABBER')+': ('+owner+')';
if(compId == "8") if(compId == 8)
owner = $.i18n('general_comp_V4L')+': ('+owner+')'; owner = $.i18n('general_comp_V4L')+': ('+owner+')';
if(compId == "6") if(compId == 6)
owner = $.i18n('general_comp_BOBLIGHTSERVER'); owner = $.i18n('general_comp_BOBLIGHTSERVER');
if(compId == "5") if(compId == 5)
owner = $.i18n('general_comp_UDPLISTENER'); owner = $.i18n('general_comp_UDPLISTENER');
if(owner == "Off") if(owner == "Off")
owner = $.i18n('general_btn_off'); owner = $.i18n('general_btn_off');
if(duration) if(duration && compId != 7 && compId != 11)
owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>'; owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>';
var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>'; var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>';
if((compId == "10" || compId == "9") && priority != 254) if((compId == 10 || compId == 9) && priority != 254)
btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear('+priority+');"><i class="fa fa-close"></button>'; btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear('+priority+');"><i class="fa fa-close"></button>';
if(btn_type != 'default') if(btn_type != 'default')
@ -159,7 +167,7 @@ $(document).ready(function() {
if(mapping == mappingList[ix]) if(mapping == mappingList[ix])
btn_style = 'btn-success'; btn_style = 'btn-success';
else else
btn_style = 'btn-warning'; btn_style = 'btn-primary';
$('#mappingsbutton').append('<button type="button" id="lmBtn_'+mappingList[ix]+'" class="btn '+btn_style+'" style="margin:10px;min-width:200px" onclick="requestMappingType(\''+mappingList[ix]+'\');">'+$.i18n('remote_maptype_label_'+mappingList[ix])+'</button><br/>'); $('#mappingsbutton').append('<button type="button" id="lmBtn_'+mappingList[ix]+'" class="btn '+btn_style+'" style="margin:10px;min-width:200px" onclick="requestMappingType(\''+mappingList[ix]+'\');">'+$.i18n('remote_maptype_label_'+mappingList[ix])+'</button><br/>');
} }

View File

@ -219,33 +219,18 @@ function requestPriorityClear(prio)
} }
function requestPlayEffect(effectName, duration) function requestPlayEffect(effectName, duration)
{ {
if(typeof duration === "undefined" || duration < 0) sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
duration = 0;
else
duration *= 1000;
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+duration+',"origin":"'+webOrigin+'"');
} }
function requestSetColor(r,g,b,duration) function requestSetColor(r,g,b,duration)
{ {
if(typeof duration === "undefined" || duration < 0) sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
duration = 0;
else
duration *= 1000;
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+duration+',"origin":"'+webOrigin+'"');
} }
function requestSetImage(data,width,height,duration) function requestSetImage(data,width,height,duration)
{ {
if(typeof duration === "undefined" || duration < 0) sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+validateDuration(duration)+'');
duration = 0;
else
duration *= 1000;
sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+duration+'');
} }
function requestSetComponentState(comp, state) function requestSetComponentState(comp, state)
@ -292,7 +277,7 @@ function requestWriteEffect(effectName,effectPy,effectArgs)
function requestTestEffect(effectName,effectPy,effectArgs) function requestTestEffect(effectName,effectPy,effectArgs)
{ {
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'},"priority":'+webPrio+', "pythonScript":"'+effectPy+'"}'); sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+webPrio+', "origin":"'+webOrigin+'", "pythonScript":"'+effectPy+'"}');
} }
function requestDeleteEffect(effectName) function requestDeleteEffect(effectName)

View File

@ -48,6 +48,14 @@ function debugMessage(msg)
} }
} }
function validateDuration(d)
{
if(typeof d === "undefined" || d < 0)
return d = 0;
else
return d *= 1000;
}
function getHashtag() function getHashtag()
{ {
if(getStorage('lasthashtag', true) != null) if(getStorage('lasthashtag', true) != null)