mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
new module: FB_CALLLIST for creating a call list based on events generated by FB_CALLMONITOR (original idea by Elektolurch, Forum: #27218)
git-svn-id: https://svn.fhem.de/fhem/trunk@8739 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
df0862fcce
commit
ee3465b8be
@ -1,5 +1,7 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- feature: new module FB_CALLLIST for creating a call list based on
|
||||
events generated by FB_CALLMONITOR (original idea by Elektolurch)
|
||||
- feature: 01_FHEMWEB: add cmdIcon
|
||||
- bugfix: 10_pilight_ctrl: set reset - lost connection to submodules
|
||||
- bugfix: 70_Pushalot: corrected parameter order for image
|
||||
|
1179
fhem/FHEM/72_FB_CALLLIST.pm
Executable file
1179
fhem/FHEM/72_FB_CALLLIST.pm
Executable file
File diff suppressed because it is too large
Load Diff
@ -215,6 +215,7 @@ FHEM/71_YAMAHA_AVR.pm markusbloch http://forum.fhem.de Multimedi
|
||||
FHEM/71_YAMAHA_BD.pm markusbloch http://forum.fhem.de Multimedia
|
||||
FHEM/71_YAMAHA_NP.pm ra666ack http://forum.fhem.de Multimedia
|
||||
FHEM/72_FB_CALLMONITOR.pm markusbloch http://forum.fhem.de Unterstuetzende Dienste
|
||||
FHEM/72_FB_CALLLIST.pm markusbloch http://forum.fhem.de Frontends
|
||||
FHEM/72_FRITZBOX.pm tupol http://forum.fhem.de FRITZBOX (link als PM an tupol)
|
||||
FHEM/73_km200.pm sailor http://forum.fhem.de Heizungssteuerung/Raumklima
|
||||
FHEM/73_PRESENCE.pm markusbloch http://forum.fhem.de Unterstuetzende Dienste
|
||||
@ -346,6 +347,7 @@ www/images/* ulimaass http://forum.fhem.de Frontends
|
||||
www/pgm2/dashboard/* svenson08 http://forum.fhem.de Frontends
|
||||
www/pgm2/fhemweb_readingsHistory.js justme1968 http://forum.fhem.de Frontends
|
||||
www/pgm2/fhemweb_sortable.js markusbloch http://forum.fhem.de Frontends
|
||||
www/pgm2/fhemweb_fbcalllist.js markusbloch http://forum.fhem.de Frontends
|
||||
www/pgm2/fhemweb_uzsu.js justme1968 http://forum.fhem.de Frontends
|
||||
www/pgm2/* rudolfkoenig http://forum.fhem.de Frontends
|
||||
www/jscolor/* justme1968 http://forum.fhem.de Frontends
|
||||
|
@ -105,6 +105,7 @@
|
||||
<a href="#FHEM2FHEM">FHEM2FHEM</a>
|
||||
<a href="#FHEMWEB">FHEMWEB</a>
|
||||
<a href="#FB_CALLMONITOR">FB_CALLMONITOR</a>
|
||||
<a href="#FB_CALLLIST">FB_CALLLIST</a>
|
||||
<a href="#FileLog">FileLog</a>
|
||||
<a href="#FLOORPLAN">FLOORPLAN</a>
|
||||
<a href="#GEOFANCY">GEOFANCY</a>
|
||||
|
@ -103,6 +103,7 @@
|
||||
<a href="#FHEM2FHEM">FHEM2FHEM</a>
|
||||
<a href="#FHEMWEB">FHEMWEB</a>
|
||||
<a href="#FB_CALLMONITOR">FB_CALLMONITOR</a>
|
||||
<a href="#FB_CALLLIST">FB_CALLLIST</a>
|
||||
<a href="#FileLog">FileLog</a>
|
||||
<a href="#FLOORPLAN">FLOORPLAN</a>
|
||||
<a href="#GEOFANCY">GEOFANCY</a>
|
||||
|
95
fhem/www/pgm2/fhemweb_fbcalllist.js
Executable file
95
fhem/www/pgm2/fhemweb_fbcalllist.js
Executable file
@ -0,0 +1,95 @@
|
||||
// $Id$
|
||||
|
||||
// WORKAROUND - should be removed if a more suitable solution is found
|
||||
// remove all similar informid's in all parent elements to ensure further updates
|
||||
$(function () {
|
||||
$("div[arg=fbcalllist][informid]").each(function (index, obj) {
|
||||
name = $(obj).attr("dev");
|
||||
$(obj).parents("[informid="+name+"]").removeAttr("informid");
|
||||
});
|
||||
});
|
||||
|
||||
function FW_processCallListUpdate(data)
|
||||
{
|
||||
var table = $(this).find("table.fbcalllist").first();
|
||||
|
||||
// clear the list if data starts with "clear"
|
||||
if(/^clear/.test(data))
|
||||
{
|
||||
// if the table isn't already empty
|
||||
if(!table.find("tr[name=empty]").length)
|
||||
{
|
||||
var tmp = data.split(",");
|
||||
|
||||
table.find("tr[number]").remove();
|
||||
table.append("<tr align=\"center\" name=\"empty\"><td style=\"padding:10px;\" colspan=\""+tmp[1]+"\"><i>"+tmp[2]+"</i></td></tr>");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// clear all lines greater than max-lines (e.g. after activate a filter statement)
|
||||
if(/^max-lines/.test(data))
|
||||
{
|
||||
var tmp = data.split(",");
|
||||
table.find("tr[number]").filter(function(index,obj) {return ($(obj).attr("number") > tmp[1]);}).remove();
|
||||
return;
|
||||
}
|
||||
|
||||
// else it's JSON data with row updates
|
||||
var json_data = jQuery.parseJSON(data)
|
||||
|
||||
if(table.find("tr[number="+json_data.line+"]").length)
|
||||
{
|
||||
$.each(json_data, function (key, val) {
|
||||
|
||||
if(key == "line")
|
||||
{ return true; }
|
||||
|
||||
FW_setCallListValue(table,json_data.line,key,val);
|
||||
});
|
||||
}
|
||||
else // add new tr row with the values)
|
||||
{
|
||||
// delete the empty tr row if it may exist
|
||||
table.find("tr[name=empty]").remove();
|
||||
|
||||
var new_tr = '<tr align="center" number="'+json_data.line+'" class="'+((json_data.line % 2) == 1 ? "odd" : "even")+'">';
|
||||
var style = "style=\"padding-left:6px;padding-right:6px;\"";
|
||||
|
||||
|
||||
// create the corresponding <td> tags with the received data
|
||||
$.each(json_data, function (key, val) {
|
||||
if(key == "line")
|
||||
{ return true; }
|
||||
new_tr += '<td name="'+key+'" '+style+'>'+val+'</td>';
|
||||
});
|
||||
|
||||
new_tr += "</tr>";
|
||||
|
||||
// insert new tr into table
|
||||
table.append(new_tr);
|
||||
}
|
||||
}
|
||||
|
||||
function FW_setCallListValue(table,line,key,val)
|
||||
{
|
||||
table.find("tr[number="+line+"] td[name="+key+"]").each(function(index, obj) {
|
||||
$(obj).html(val);
|
||||
});
|
||||
}
|
||||
|
||||
function FW_FbCalllistCreate(elName, devName, vArr, currVal, set, params, cmd)
|
||||
{
|
||||
if(vArr[0] == "fbcalllist")
|
||||
{
|
||||
var newEl = $('div[informid='+devName+']').get(0);
|
||||
|
||||
newEl.setValueFn = FW_processCallListUpdate;
|
||||
|
||||
return newEl;
|
||||
}
|
||||
}
|
||||
|
||||
FW_widgets['fbcalllist'] = {
|
||||
createFn:FW_FbCalllistCreate
|
||||
};
|
Loading…
Reference in New Issue
Block a user