mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 16:46:35 +00:00
doif.js: add functionality
git-svn-id: https://svn.fhem.de/fhem/trunk@15515 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fa1f3900c4
commit
c8adb81fc2
@ -3,12 +3,56 @@ FW_version["doif.js"] = "$Id$";
|
||||
|
||||
function doifUpdateCell(doifname,attrname,attrcont,content,style) {
|
||||
$("table[uitabid='DOIF-"+doifname+"']").find("div["+attrname+"='"+attrcont+"']").each(function() {
|
||||
if(this.setValueFn) { // change widget value
|
||||
this.setValueFn(content.replace(/\n/g, '\u2424'));
|
||||
} else {
|
||||
$(this).html(content+"");
|
||||
if(style)
|
||||
$(this).attr("style",style);
|
||||
if(this.setValueFn) { // change widget value
|
||||
this.setValueFn(content.replace(/\n/g, '\u2424'));
|
||||
} else {
|
||||
$(this).html(content+"");
|
||||
if(style)
|
||||
$(this).attr("style",style);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*function doifUpdateIconColor(doifname,doifid,fillcolor) {
|
||||
$("table[uitabid='DOIF-"+doifname+"']").find("svg."+doifid).each(function() {
|
||||
if(fillcolor.length>0) {
|
||||
var html = $(this).html().replace(/fill=\".*?\"/gi,'fill="'+fillcolor+'"')
|
||||
.replace(/fill:.*?[;\s]/gi,'fill:'+fillcolor+';');
|
||||
$(this).html(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
function doifTablePopUp(hash,name,doif,table) {
|
||||
FW_cmd(FW_root+"?cmd={DOIF_RegisterEvalAll(\$defs{"+name+"},\""+name+"\",\""+table+"\")}&XHR=1", function(data){
|
||||
FW_okDialog(data,$("[uitabid='DOIF-"+doif+"']"));
|
||||
});
|
||||
}
|
||||
|
||||
$(window).ready(function(){
|
||||
var room = $("#content").attr("room");
|
||||
$("table[uitabid]").each(function() {
|
||||
var uitabid = $(this).attr("uitabid").replace(/DOIF-/, '');
|
||||
var nodl = $(this).attr("doifnodevline");
|
||||
var atfi = $(this).attr("doifattrfirst");
|
||||
var tabl = "uiTable", t = $(this).attr("class").match(/(uiTable|uiState)doif/);
|
||||
if (t && t[1])
|
||||
tabl = t[1];
|
||||
|
||||
// console.log("[readyFn] room",room,"nodl",nodl,"atfi",atfi,"tabl",tabl);
|
||||
if(room === undefined && atfi !== undefined && atfi != "" && atfi != "0" ) {
|
||||
$('.makeTable.wide.internals').before($('.makeTable.wide.attributes'));
|
||||
$('.makeTable.wide.attributes').before($('[cmd="attr"]'));
|
||||
$("div>a:contains("+tabl+")").closest('td').attr('valign','top');
|
||||
}
|
||||
if(room !== undefined && nodl !== undefined && nodl != "") {
|
||||
var re1 = new RegExp(nodl);
|
||||
if (room !="all" && room.match(re1))
|
||||
$('#'+uitabid).closest('tr').css('display','none');
|
||||
}
|
||||
if($(this).attr("doifnostate") == 1) {
|
||||
$('#'+uitabid).remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user