Skip to content
Permalink
Browse files

Minor updates

* Properties history layout updates
* Simple Devices on click color change
  • Loading branch information...
sergejey committed Jul 9, 2019
1 parent 92403e4 commit e446648ba6cf9abbb9559b8178bd40402e50a3fb
@@ -321,7 +321,7 @@ function delete_objects($id)
*/
function loadObject($id)
{
$rec = SQLSelectOne("SELECT * FROM objects WHERE ID='" . DBSafe($id) . "'");
$rec = SQLSelectOne("SELECT * FROM objects WHERE ID=".(int)$id);
if (IsSet($rec['ID'])) {
$this->id = $rec['ID'];
$this->object_title = $rec['TITLE'];

Large diffs are not rendered by default.

@@ -1,8 +1,8 @@
<div class="device-widget button" onClick='callMethod("%.object_title%.pressed");
$("#icon%.object_id%_light").addClass("pressed");
setTimeout("$(\"#icon%.object_id%_light\").removeClass(\"pressed\");",300);
$(".icon%.object_id%_light").addClass("pressed");
setTimeout("$(\".icon%.object_id%_light\").removeClass(\"pressed\");",300);
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));'>
<div class="device-icon button" id="icon%.object_id%_light" style='%.icon|"background-image:url(%.icon%)"%'></div>
<div class="device-icon button icon%.object_id%_light" id="icon%.object_id%_light" style='%.icon|"background-image:url(%.icon%)"%'></div>
<div class="device-header">%.object_description%</div>
</div>

@@ -1,8 +1,8 @@
<div class="device-widget controller loadtype_%.loadType%"
onClick='$("#icon%.object_id%_light").addClass("pressed");
setTimeout("$(\"#icon%.object_id%_light\").removeClass(\"pressed\");",300);
onClick='$(".icon%.object_id%_light").addClass("pressed");
setTimeout("$(\".icon%.object_id%_light\").removeClass(\"pressed\");",300);
callMethod("%.object_title%.switch");
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));'>
<div class="device-icon %.status|"off;on"%" id="icon%.object_id%_light" style='%.icon|"background-image:url(%.icon%)"%'></div>
<div class="device-icon %.status|"off;on"% icon%.object_id%_light" id="icon%.object_id%_light" style='%.icon|"background-image:url(%.icon%)"%'></div>
<div class="device-header">%.object_description%</div>
</div>
@@ -29,11 +29,10 @@
}
</script>
<div class="device-widget controller loadtype_%.loadType%">
<div onClick='$("#icon%.object_id%_light").addClass("pressed");
setTimeout("$(\"#icon%.object_id%_light\").removeClass(\"pressed\");",300);
<div onClick='$(".icon%.object_id%_light").addClass("pressed");setTimeout("$(\".icon%.object_id%_light\").removeClass(\"pressed\");",300);
callMethod("%.object_title%.switch");
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));'>
<div class="device-icon %.status|"off;on"%" id="icon%.object_id%_light" style='%.icon|"background-image:url(%.icon%)"%'></div>
<div class="device-icon %.status|"off;on"% icon%.object_id%_light" id="icon%.object_id%_light" style='%.icon|"background-image:url(%.icon%)"%'></div>
<div class="device-header">%.object_description%</div>
</div>
<div class="device-details"> <span id="dimmer%.object_id%_level">%.level%</span>%
@@ -1,27 +1,32 @@
<div class="device-widget thermostat %.alive|"offline;online"%" id='deviceid_%.object_title%'>
<div class="device-icon thermostat %.relay_status|"off;on"%"></div>
<div class="device-icon thermostat %.relay_status|"off;on"% icon%.object_id%_thermostat"></div>
<div class="device-header">%.object_description%</div>
<div class="device-details"><#LANG_DEVICES_THERMOSTAT_CURRENT_TARGET_TEMP#>:<br/>
<a href="#" class="btn btn-default btn-sm" onClick='callMethod("%.object_title%.tempDown");
<a href="#" class="btn btn-default btn-sm" onClick='$(".icon%.object_id%_thermostat").addClass("pressed");setTimeout("$(\".icon%.object_id%_thermostat\").removeClass(\"pressed\");",300);
callMethod("%.object_title%.tempDown");
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));
return false;'>-</a>
%.currentTargetValue%
<a href="#" class="btn btn-default btn-sm" onClick='callMethod("%.object_title%.tempUp");
<a href="#" class="btn btn-default btn-sm" onClick='$(".icon%.object_id%_thermostat").addClass("pressed");setTimeout("$(\".icon%.object_id%_thermostat\").removeClass(\"pressed\");",300);
callMethod("%.object_title%.tempUp");
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));
return false;'>+</a>
</div>
<div class="device-details"><#LANG_DEVICES_THERMOSTAT_CURRENT_TEMP#>: %.value% [<a href="#" onclick="var url=('/pChart/?p[]=%.object_title%'+'.value&p[]=%.object_title%'+'.relay_status&op=log&subop=24h&minimal=1');parent.$.fancybox.open({ src: url, type: 'iframe',iframe:{preload:false} });return false;"><#LANG_HISTORY#></a>]</div>
<div class="device-details"><#LANG_DEVICES_THERMOSTAT_MODE#>:
<a href="#" onClick='callMethod("%.object_title%.switchEnable");
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));
$(".icon%.object_id%_thermostat").addClass("pressed");setTimeout("$(\".icon%.object_id%_thermostat\").removeClass(\"pressed\");",300);
return false;' class="status_text status_%.disabled|"enabled;disabled"%"><#LANG_DEVICES_THERMOSTAT_MODE_OFF#></a>
&nbsp;&nbsp;
<a href="#" onClick='callMethod("%.object_title%.enable");
<a href="#" onClick='$(".icon%.object_id%_thermostat").addClass("pressed");setTimeout("$(\".icon%.object_id%_thermostat\").removeClass(\"pressed\");",300);
callMethod("%.object_title%.enable");
callMethod("%.object_title%.turnOff");
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));
return false;' class="status_text status_eco_%.status|"off;on"%_%.disabled|"enabled;disabled"%"><#LANG_DEVICES_THERMOSTAT_MODE_ECO#></a>
&nbsp;&nbsp;
<a href="#" onClick='callMethod("%.object_title%.enable");
<a href="#" onClick='$(".icon%.object_id%_thermostat").addClass("pressed");setTimeout("$(\".icon%.object_id%_thermostat\").removeClass(\"pressed\");",300);
callMethod("%.object_title%.enable");
callMethod("%.object_title%.turnOn");
$.get("/ajax/devices.html?op=clicked&object="+encodeURIComponent("%.object_title%"));
return false;' class="status_text status_normal_%.status|"off;on"%_%.disabled|"enabled;disabled"%"><#LANG_DEVICES_THERMOSTAT_MODE_NORMAL#></a>
@@ -2,7 +2,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">

<link href="<#ROOTHTML#>css/devices.css" rel="stylesheet" type="text/css"/>
<link href="<#ROOTHTML#>css/devices.css?v=2019-07-09" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="<#ROOTHTML#>3rdparty/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="<#ROOTHTML#>3rdparty/jquery/jquery-migrate-3.0.0.min.js"></script>
@@ -20,7 +20,7 @@
<script type="text/javascript" src="<#ROOTHTML#>3rdparty/fancybox/jquery.fancybox.min.js?v=3.3.5"></script>

<script type="text/javascript" src="<#ROOTHTML#>3rdparty/long-press-event/long-press-event.js"></script>
<script language="javascript" type="text/javascript" src="<#ROOTHTML#>js/scripts.js?v=2019-05-02" ></script>
<script language="javascript" type="text/javascript" src="<#ROOTHTML#>js/scripts.js?v=2019-07-09" ></script>

<link rel="stylesheet" type="text/css" href="<#ROOTHTML#>css/umbra-css2/style.css" title="theme"/>
<script language="javascript" type="text/javascript" src="<#ROOTHTML#>js/jWindow.js"></script>

0 comments on commit e446648

Please sign in to comment.
You can’t perform that action at this time.