Тема через CSS

This commit is contained in:
2021-11-09 23:53:56 +06:00
parent 0ee4dd3d48
commit 07a7e2fff6
4 changed files with 20 additions and 18 deletions

View File

@ -264,8 +264,8 @@ class EdtRec
{ {
rpos++; rpos++;
tr = document.createElement('tr'); tr = document.createElement('tr');
if (rpos%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2; if (rpos%2==0) bgColor='var(--row-color-1)'; else bgColor='var(--row-color-2)';
tr.setAttribute("bgColor",bgColor); tr.style.backgroundColor=bgColor;
if(nodeProp.getAttribute("visible")=='0') tr.style.display='none'; if(nodeProp.getAttribute("visible")=='0') tr.style.display='none';
td1 = document.createElement('td'); td1 = document.createElement('td');
td2 = document.createElement('td'); td2 = document.createElement('td');

View File

@ -81,7 +81,7 @@ class SRec
if(this.rwin!=null) if(this.rwin!=null)
{ {
this.rwin.hideProgressBar(); this.rwin.hideProgressBar();
this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: '+g_backColor1+';"><tr><td align="center"><a href="'+ScriptRName+(ScriptRName.indexOf('?')!=-1 ? '&file=' : '?file=')+findFirstNode(node,'#cdata-section').nodeValue+'" target="_blank">'+trt('Download_report')+': "'+this.win.getCaption().innerHTML+'".</a></td></tr></table>'); this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: var(--back-color-1);"><tr><td align="center"><a href="'+ScriptRName+(ScriptRName.indexOf('?')!=-1 ? '&file=' : '?file=')+findFirstNode(node,'#cdata-section').nodeValue+'" target="_blank">'+trt('Download_report')+': "'+this.win.getCaption().innerHTML+'".</a></td></tr></table>');
} }
}else }else
alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" );
@ -149,7 +149,7 @@ class SRec
let str='\ let str='\
<div id="eDiv'+this.uid+'" style="width: 100%; height: 100%; position: relative;">\ <div id="eDiv'+this.uid+'" style="width: 100%; height: 100%; position: relative;">\
<table class="SFilter" style="width: 100%; height: 100%;"><tr><td>\ <table class="SFilter" style="width: 100%; height: 100%;"><tr><td>\
<table id="idfilter'+this.uid+'" cellspacing="2" cellpadding="0" style="border: 1px solid rgb(99, 99, 99); table-layout: auto;" width="100%" bgcolor="'+g_rowColor2+'">\ <table id="idfilter'+this.uid+'" cellspacing="2" cellpadding="0" style="border: 1px solid rgb(99, 99, 99); table-layout: auto;background-color: var(--row-color-2);" width="100%">\
<caption></caption><tbody></tbody>\ <caption></caption><tbody></tbody>\
</table>\ </table>\
</td></tr><tr><td>\ </td></tr><tr><td>\
@ -342,7 +342,7 @@ class SRec
}else }else
if(count>1) //The item selection window is displayed. if(count>1) //The item selection window is displayed.
{ {
let htmlString='<table width="100%" bgcolor="'+g_rowColor2+'">'; let htmlString='<table width="100%" style="background-color: var(--row-color-2)">';
nodeProp=nodeType.firstChild nodeProp=nodeType.firstChild
i=0; i=0;
while (nodeProp!=null) while (nodeProp!=null)
@ -1071,7 +1071,7 @@ class SRec
th.appendChild( document.createTextNode(trt('Del'))); th.appendChild( document.createTextNode(trt('Del')));
th.title = trt('Invert_selection'); th.title = trt('Invert_selection');
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;'; th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; }; th.onmouseover=function(){ this.style.backgroundColor='var(--row-color-2)'; };
th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; }; th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; };
th.onclick= ()=>{ for(let i=0;i<this.masChBox.length;i++){ if(!this.masChBox[i].disabled) this.masChBox[i].checked = ! this.masChBox[i].checked; }}; th.onclick= ()=>{ for(let i=0;i<this.masChBox.length;i++){ if(!this.masChBox[i].disabled) this.masChBox[i].checked = ! this.masChBox[i].checked; }};
tr.appendChild(th); tr.appendChild(th);
@ -1147,7 +1147,7 @@ class SRec
{ {
let bgColor='var(--btn-color)'; let bgColor='var(--btn-color)';
if (i%2==0) bgColor='var(--btn-color3)'; if (i%2==0) bgColor='var(--btn-color3)';
if (this.pagepos==i) bgColor='DodgerBlue'; if (this.pagepos==i) bgColor='var(--btn-color)';
let newCell = newRow.insertCell(-1); let newCell = newRow.insertCell(-1);
newCell.style.backgroundColor = bgColor; newCell.style.backgroundColor = bgColor;
newCell.style.cursor="pointer"; newCell.style.cursor="pointer";
@ -1196,10 +1196,11 @@ class SRec
{ {
let bgColor=''; let bgColor='';
let i=theTable.rows.length; //number of rows in the table let i=theTable.rows.length; //number of rows in the table
if (i%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2; if (i%2==0) bgColor='var(--row-color-1)'; else bgColor='var(--row-color-2)';
if(nColor>=0) //Color from Result if(nColor>=0) //Color from Result
{ bgColorT=findNodeOnNum(nodeRecord,"#cdata-section",nColor).nodeValue; {
let bgColorT=findNodeOnNum(nodeRecord,"#cdata-section",nColor).nodeValue;
if(bgColorT!="") bgColor=bgColorT; if(bgColorT!="") bgColor=bgColorT;
} }
let id=nodeRecord.getAttribute("id"); let id=nodeRecord.getAttribute("id");
@ -1208,7 +1209,8 @@ class SRec
tr.onmouseover=function(){ this.style.backgroundColor="var(--btn-color2)"; }; tr.onmouseover=function(){ this.style.backgroundColor="var(--btn-color2)"; };
tr.onmouseout=function(val1,val2){return function(){val1.style.backgroundColor=val2;}}(tr,bgColor); tr.onmouseout=function(val1,val2){return function(){val1.style.backgroundColor=val2;}}(tr,bgColor);
tr.setAttribute("id",id+'_'+this.uid); tr.setAttribute("id",id+'_'+this.uid);
tr.setAttribute("bgColor",bgColor); tr.style.backgroundColor=bgColor;
//sequential record number //sequential record number
let td = document.createElement('td'); let td = document.createElement('td');
td.appendChild( document.createTextNode( i+100*this.pagepos ) ); td.appendChild( document.createTextNode( i+100*this.pagepos ) );
@ -1480,7 +1482,7 @@ class SRec
this.rwin.setParent(this.win); this.rwin.setParent(this.win);
this.rwin.setSize(280,130); this.rwin.setSize(280,130);
this.rwin.setCaption(trt('Report')); this.rwin.setCaption(trt('Report'));
this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: '+g_backColor1+';"><tr><td align="center"><b>'+trt('Preparing_of_report')+'</b></td></tr></table>'); this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: var(--back-color-1);"><tr><td align="center"><b>'+trt('Preparing_of_report')+'</b></td></tr></table>');
this.appendFilter(); this.appendFilter();
//Call data from server //Call data from server

View File

@ -15,7 +15,7 @@ class tcTabs
tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;' tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
this.btt=document.createElement('div'); this.btt=document.createElement('div');
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;background-color: '+g_backColor2+';color:'+g_textColor1+';'; this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;background-color:var(--back-color-2);color:var(--text-color-1);';
tr.appendChild(this.btt); tr.appendChild(this.btt);
this.wra.appendChild(tr); this.wra.appendChild(tr);
@ -91,11 +91,11 @@ class tcTab
//Сам таб на который нажимаем (ушко) //Сам таб на который нажимаем (ушко)
this.div=document.createElement('div') this.div=document.createElement('div')
this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: '+config.float+'; border: 1px solid #b3b3b3; border-radius: 5px 5px 0px 0px; padding: 1px; padding-right: 4px; padding-left: 4px; margin-left: 2px; margin-right: 2px;' this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: '+config.float+'; border: 1px solid #b3b3b3; border-radius: 5px 5px 0px 0px; padding: 1px; padding-right: 4px; padding-left: 4px; margin-left: 2px; margin-right: 2px;'
this.div.style.background = g_backColor1; this.div.style.background = 'var(--back-color-1)';
this.div.innerHTML=config.caption; this.div.innerHTML=config.caption;
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_rowColor1; }}(this); this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = 'var(--row-color-1)'; }}(this);
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_backColor1; }}(this); this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = 'var(--back-color-1)'; }}(this);
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this) this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
} }
@ -124,12 +124,12 @@ class tcTab
setSel() setSel()
{ {
for(let i=0;i<this.par.tbs.length;i++) for(let i=0;i<this.par.tbs.length;i++)
{ this.par.tbs[i].div.style.background = g_backColor1; { this.par.tbs[i].div.style.background = 'var(--back-color-1)';
this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3" this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3"
this.par.tbs[i].sel=false this.par.tbs[i].sel=false
this.par.tbs[i].con.style.display='none' this.par.tbs[i].con.style.display='none'
} }
this.div.style.background = g_rowColor2; this.div.style.background = 'var(--row-color-2)';
this.div.style.borderBottom = '1px solid var(--back-color)' this.div.style.borderBottom = '1px solid var(--back-color)'
//this.con.style.display='inline' //this.con.style.display='inline'
this.con.style.display='block'; this.con.style.display='block';

View File

@ -1275,7 +1275,7 @@ class TWin
let imgB='g_b.png'; let imgB='g_b.png';
let imgX='x_w.png'; let imgX='x_w.png';
if(g_textColor1=='#000000') { //Если тёмный стиль if(document.body.getAttribute('data-theme')!='1') { //Если тёмный стиль
imgB = 'g_w.gif'; imgB = 'g_w.gif';
imgX = 'x_b.gif'; imgX = 'x_b.gif';
} }