mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 19:36:02 +00:00
AttrTemplate.pm: enable dialog-input for multiple devices (Forum #123709)
git-svn-id: https://svn.fhem.de/fhem/trunk@25149 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e8325b7524
commit
374008b34a
@ -292,12 +292,12 @@ AttrTemplate_Set($$@)
|
|||||||
return
|
return
|
||||||
"<html>".
|
"<html>".
|
||||||
"<input type='hidden' value='set $name attrTemplate $entry'>".
|
"<input type='hidden' value='set $name attrTemplate $entry'>".
|
||||||
"<p>Specify the unknown parameters for $entry:</p>".
|
"<p>Specify the unknown parameters for $name/$entry:</p>".
|
||||||
"<table class='block wide'><tr>".
|
"<table class='block wide'><tr>".
|
||||||
join("</tr><tr>", map {
|
join("</tr><tr>", map {
|
||||||
my @t=split("= with ",$_,2);
|
my @t=split("= with ",$_,2);
|
||||||
"<td>$t[1]</td><td>" .($t[0] =~ m/^RADIO_/ ?
|
"<td>$t[1]</td><td>" .($t[0] =~ m/^RADIO_/ ?
|
||||||
"<input type='radio' name='s' value='$t[0]'>":
|
"<input type='radio' name='$name.s' value='$t[0]'>":
|
||||||
"<input type='text' name='$t[0]' size='20'></td>")
|
"<input type='text' name='$t[0]' size='20'></td>")
|
||||||
} @mComm)."</tr></table>".
|
} @mComm)."</tr></table>".
|
||||||
'<script>
|
'<script>
|
||||||
@ -306,10 +306,10 @@ AttrTemplate_Set($$@)
|
|||||||
$("#FW_okDialog").parent().find("button").css("display","block");
|
$("#FW_okDialog").parent().find("button").css("display","block");
|
||||||
$("#FW_okDialog").parent().find(".ui-dialog-buttonpane button")
|
$("#FW_okDialog").parent().find(".ui-dialog-buttonpane button")
|
||||||
.unbind("click").click(function(){
|
.unbind("click").click(function(){
|
||||||
var cmd;
|
var cmd = "";
|
||||||
$("#FW_okDialog input").each(function(){
|
$("#FW_okDialog input").each(function(){
|
||||||
var t=$(this).attr("type");
|
var t=$(this).attr("type");
|
||||||
if(t=="hidden") cmd = $(this).val();
|
if(t=="hidden")cmd +=";"+$(this).val();
|
||||||
if(t=="text") cmd +=" "+$(this).attr("name")+"="+$(this).val();
|
if(t=="text") cmd +=" "+$(this).attr("name")+"="+$(this).val();
|
||||||
if(t=="radio") cmd +=" "+$(this).val()+"="+
|
if(t=="radio") cmd +=" "+$(this).val()+"="+
|
||||||
($(this).prop("checked") ? 1:0);
|
($(this).prop("checked") ? 1:0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user