\
- \
+ \
\
@@ -173,32 +173,32 @@ class SRec
if(htmlElement==null || typeof(htmlElement) == "undefined")
{
this.win=new TWin();
- this.win.TWin(pageX-10,pageY-10);
+ this.win.BuildGUI(pageX-10,pageY-10);
this.win.setHeight(400);
//this.win.setLeftTop()
-
+
this.win.setContent(str);
this.win.obj=this;
-
+
this.win.addResizeListener(function(obj){return function(){obj.updateSize();}}(this));
-
- }else{
+
+ }else{
htmlElement.innerHTML=str;
}
document.getElementById('SRec_Add_'+this.uid).onclick=function(thiz){return function(){thiz.insertRecord();};}(this);
document.getElementById('SRec_Del_'+this.uid).onclick=function(thiz){return function(){thiz.deleteRecord();};}(this);
- document.getElementById('SRec_Exc_'+this.uid).onclick=function(thiz){return function(){thiz.showreport('xls');};}(this);
- document.getElementById('SRec_Rfr_'+this.uid).onclick=function(thiz){return function(){thiz.appendFilter(); thiz.sendFilter(-1,0);};}(this);
+ document.getElementById('SRec_Exc_'+this.uid).onclick=function(thiz){return function(){thiz.showreport('xls');};}(this);
+ document.getElementById('SRec_Rfr_'+this.uid).onclick=function(thiz){return function(){thiz.appendFilter(); thiz.sendFilter(-1,0);};}(this);
}
-
+
//Update dimensions of the elements (the main table in absolute coordinates).
updateSize()
{
let dv1=document.getElementById("tblSContainer_"+this.uid);
let dv2=document.getElementById("tblContainer_"+this.uid);
if(dv1!=null && dv2!=null)
- {
+ {
dv1.style.width = dv2.offsetWidth+"px";
dv1.style.height = dv2.offsetHeight+"px";
}
@@ -235,7 +235,7 @@ class SRec
setDataSelect(node)
{
//alert("setDataSelect = " + getXMLNodeSerialisation(node));
-
+
let nodeType,prop_id,prop,option,nodeProp,id,value,cdataNode;
nodeType=findFirstNode(node, 'type');
prop_id=nodeType.getAttribute("pn");//Field name
@@ -246,9 +246,9 @@ class SRec
let nodeFilter=findNodeOnPath(this.nodeMetadata,"type/objects-list/filter");
let nodeCur=findNodeOnAttribute(nodeFilter, 'column', 'n', prop_id);
if(nodeCur!=null) selector=nodeCur.getAttribute("selector");
-
- //alert("nodeCur = " + getXMLNodeSerialisation(nodeCur));
-
+
+ //alert("nodeCur = " + getXMLNodeSerialisation(nodeCur));
+
/*nodeCur=nodeFilter.firstChild
while(nodeCur!=null)
{
@@ -262,7 +262,7 @@ class SRec
if(selector==="combo") //if the drop-down list
{
prop.innerHTML = "";
-
+
//Select the value for this list
let val=null;
let nodeFilter=findNodeOnPath(this.nodeMetadata,"type/objects-list/filter");
@@ -271,7 +271,7 @@ class SRec
{
if((nodeCol.nodeName==="column")&&(nodeCol.getAttribute("n")==prop_id))
{
- val=getCdataValue(nodeCol);
+ val=getCdataValue(nodeCol);
break;
}
nodeCol=nodeCol.nextSibling;
@@ -338,7 +338,7 @@ class SRec
}else
if(count>1) //The item selection window is displayed.
{
- let htmlString='';
+ let htmlString='';
nodeProp=nodeType.firstChild
i=0;
while (nodeProp!=null)
@@ -358,7 +358,7 @@ class SRec
htmlString+=' ';
let win=new TWin();
- win.TWin(pageX-10,pageY-10);
+ win.BuildGUI(pageX-10,pageY-10);
win.setHeight(400);
win.setContent(htmlString);
win.setCaption(document.createTextNode(_('Selection')));
@@ -407,7 +407,7 @@ class SRec
//The function to collect data from HTML fields in XML
appendFilter()
- {
+ {
let nodeType=findFirstNode(this.nodeMetadata, "type");
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
if (nodeFilter!=null)
@@ -420,15 +420,15 @@ class SRec
let value = '';
let input = document.getElementById('filter_'+this.uid+'_'+columnNode.getAttribute("n"));
if(input!=null) value=input.value;
-
+
//'2016-02-27 00:00:00'
if(columnNode.getAttribute("vt")=="dateTime" || columnNode.getAttribute("vt")=="date") //If field is "dateTime" then transmit in UnixTime format in second
{
if(value!=""){
let date = new Date(value.replace(/-/g, "/"));
- value=date.getTime()/1000;// - date.getTimezoneOffset()*60;
+ value=date.getTime()/1000;// - date.getTimezoneOffset()*60;
if(isNaN(value)) value='';
- }
+ }
}
getCdata(columnNode).nodeValue=value; //TODO do check for data type
}
@@ -463,12 +463,12 @@ class SRec
{
xs+='';
xs+='';
- xs+='\n';
+ xs+='\n';
}else
{
xs+='';
xs+='';
- xs+='\n';
+ xs+='\n';
}
}
nextNode=nextNode.nextSibling;
@@ -477,7 +477,7 @@ class SRec
xs+='';
//alert(xs);
-
+
if(this.request.callServer(ScriptName,xs))
{
this.showProgressBar();
@@ -488,7 +488,7 @@ class SRec
setMetadata(node)
{
this.nodeMetadata=node;
- this.setXMLSettings(this.f_Settings); //Appending settings to nodeMetadata
+ this.setXMLSettings(this.f_Settings); //Appending settings to nodeMetadata
//Create GUI filter
let td,tr,td1,td2;
@@ -509,7 +509,7 @@ class SRec
this.nodeMetadataObjList=findNode(nodeType, "objects-list");
if(this.win!=null) this.win.setWidth(this.nodeMetadataObjList.getAttribute("width"));
nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
-
+
//let id=-1;
//After loading the metadata, we request the data by sending an XML filter.
@@ -543,7 +543,7 @@ class SRec
td1.appendChild(table);
nRow=table.insertRow(0);
}
-
+
if(row>1)
{
td1 = nRow.insertCell(-1);
@@ -585,8 +585,8 @@ class SRec
input.setAttribute("name",columnNode.getAttribute("n"));
if(columnNode.getAttribute("size")!=null)
input.setAttribute("maxlength",columnNode.getAttribute("size"),0);
-
- input.setAttribute("value",isNaN(value) || value=='' ? '' : (new Date(value*1000)).toString());
+
+ input.setAttribute("value",isNaN(value) || value=='' ? '' : (new Date(value*1000)).toString());
input.setAttribute("id",'filter_'+this.uid+'_'+columnNode.getAttribute("n"));
newCell1.appendChild( input );
@@ -736,6 +736,7 @@ class SRec
newCell1.appendChild( input );
let button = document.createElement('input');
+ button.className='button-secondary';
button.setAttribute("type","button");
button.setAttribute("value","+");
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
@@ -743,6 +744,7 @@ class SRec
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)+1; }}(input);
button = document.createElement('input');
+ button.className='button-secondary';
button.setAttribute("type","button");
button.setAttribute("value","-");
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
@@ -788,11 +790,12 @@ class SRec
//select.setAttribute("name",columnNode.getAttribute("n"))
select.setAttribute("value",value);
select.setAttribute("id",'filter_'+this.uid+'_'+columnNode.getAttribute("n"));
- select.onchange = function(thiz,node){ return function(){ thiz.onComboObjectChangeHandler(node);}; }(this,columnNode);
-
+ select.onchange = function(thiz,node){ return function(){ thiz.onComboObjectChangeHandler(node);}; }(this,columnNode);
+
newCell1.appendChild(select);
let button = document.createElement('input');
+ button.className='button-secondary';
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="display:block; box-sizing: border-box; margin: 0px; padding: 0px;width:100%; height:100%; font-size: 9pt;";
@@ -807,8 +810,8 @@ class SRec
nTypeF.setAttribute("c",fc);
nTypeF.setAttribute("pn",columnNode.getAttribute("n"));
nTypeF.setAttribute("fn",columnNode.getAttribute("n"));
-
- let strXMLF = getXMLNodeSerialisation(nTypeF);
+
+ let strXMLF = getXMLNodeSerialisation(nTypeF);
let nColF=nodeFilter.firstChild;
while(nColF != null)
{
@@ -816,7 +819,7 @@ class SRec
{
let valF=getCdataValue(nColF);
strXMLF=strXMLF.replace('${'+nColF.getAttribute('n')+'}', valF);
- }
+ }
nColF = nColF.nextSibling;
}
strXMLF=''+strXMLF+'';
@@ -826,7 +829,7 @@ class SRec
this.showProgressBar();
}
}else
- {
+ {
if(this.request.callServer(ScriptName,'',true))
{
this.showProgressBar();
@@ -861,6 +864,7 @@ class SRec
newCell1.appendChild(hidden);
let button = document.createElement('input');
+ button.className='button-secondary';
button.setAttribute("type","button");
button.setAttribute("value","...");
button.style.cssText="width:30px; height:100%;margin: 0px; padding: 0px;";
@@ -895,6 +899,7 @@ class SRec
td.setAttribute("align","right");
let button = document.createElement('input');
+ button.className='button-secondary';
button.setAttribute("type","button");
button.setAttribute("value",_("Filtering"));
button.setAttribute("id","btnfilter_"+this.uid);
@@ -928,15 +933,15 @@ class SRec
if (this.win!=null && this.win.getTop()!=40)
this.win.setCenter();
-
+
//Building the columns of the data table
this.buildHead();
-
+
//this.sendFilter(id,0);
this.sendFilter(-1,0);
}
- /** The event occurs when you change the list of the referenced to "vt = Object" and if there is a dependency, then the field is updated.
+ /** The event occurs when you change the list of the referenced to "vt = Object" and if there is a dependency, then the field is updated.
*/
onComboObjectChangeHandler(node)
{
@@ -975,7 +980,7 @@ class SRec
}
nColF = nColF.nextSibling;
}
-
+
strXMLF=''+strXMLF+'';
if(this.request.callServer(ScriptName,strXMLF,true))
{
@@ -988,7 +993,7 @@ class SRec
}
}
}
-
+
//We ask the server for a list of values almost like a drop-down list.
//typeName - The name of the object (TODO if the current is the variable f TypeName)
//name - the name of the column for selecting the values (must match the name of any filter in typeName)
@@ -1010,7 +1015,7 @@ class SRec
this.sendFilter(-1,0);
}
}
-
+
//Building a table header for the data
buildHead()
{
@@ -1019,7 +1024,7 @@ class SRec
let thetable = document.getElementById('thetable'+this.uid);
delChild(thetable.tHead);
let tr=document.createElement('tr');
- tr.style.cssText='background-color: #dadada;';
+ tr.style.cssText='background-color: var(--header-color);';
let th=document.createElement('th');
th.appendChild( document.createTextNode('№'));
th.style.cssText='width: 1%;';
@@ -1028,8 +1033,8 @@ class SRec
th.appendChild( document.createTextNode('Del'));
th.title = _('Invert_selection');
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
- th.onmouseover=function(){ this.style.backgroundColor='#C2D7FC'; };
- th.onmouseout=function(){ this.style.backgroundColor='#dadada'; };
+ th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; };
+ th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; };
th.onclick=function(thiz){return function(){ for(let i=0;i=0) //Color from Result
{ bgColorT=findNodeOnNum(nodeRecord,"#cdata-section",nColor).nodeValue;
@@ -1172,7 +1177,7 @@ class SRec
tr.appendChild(td);
//CheckBuck to delete records
- td = document.createElement('td');
+ td = document.createElement('td');
td.style.cssText="text-align: center;";
if(!(this.f_pD!="1" || nodeRecord.getAttribute("a").indexOf("d")==-1))
{
@@ -1261,7 +1266,7 @@ class SRec
}
return null;
}
-
+
//Name the column number
getColNumOnName(name)
{
@@ -1363,7 +1368,7 @@ class SRec
let tr=document.getElementById(id+'_'+this.uid);
if (tr==null)
- {
+ {
this.insertRows(node,false); //If not then insert
}else
{
@@ -1380,7 +1385,7 @@ class SRec
while(tr.childNodes[jj+2].childNodes[0])
tr.childNodes[jj+2].removeChild(tr.childNodes[jj+2].childNodes[0]);
tr.childNodes[jj+2].appendChild(document.createTextNode(cdataNode.nodeValue));
-
+
jj++;
}
ii++;
@@ -1429,16 +1434,16 @@ class SRec
showreport(ext)
{
if(this.rwin!=null) this.rwin.Close();
-
+
this.rwin=new TWin();
- this.rwin.TWin(pageX-10,pageY-10);
+ this.rwin.BuildGUI(pageX-10,pageY-10);
this.rwin.setParent(this.win);
this.rwin.setSize(280,130);
this.rwin.setCaption(_('Report'));
this.rwin.setContent('| '+_('Preparing_of_report')+' |  | ');
-
+
this.appendFilter();
- //Call data from server
+ //Call data from server
let nodeType=findFirstNode(this.nodeMetadata, "type");
let typename=nodeType.getAttribute("n");
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
@@ -1454,11 +1459,11 @@ class SRec
{
xs+='';
xs+='';
- xs+='\n';
+ xs+='\n';
}
nextNode=nextNode.nextSibling;
}
- xs+=' \n';
+ xs+=' \n';
xs+=' \n';
xs+='';
if(this.request.callServer(ScriptName,xs))
@@ -1469,7 +1474,7 @@ class SRec
chp(page)
{
- //The current filter values are sent to the script to form a page change
+ //The current filter values are sent to the script to form a page change
document.forms.filter.xml_page.value=page;
document.forms.filter.submit();
}
@@ -1511,13 +1516,13 @@ class SRec
if (confirm(_("Are_you_sure_you_want_to_delete_the_entries")+'?'))
{
for(let i=0;i',true))
{
this.showProgressBar();
- }
+ }
}
}
}
@@ -1527,8 +1532,8 @@ class SRec
//Update HTML data after update record
ApplyDelRec(node)
{
- nodeType=findFirstNode(node, "type");
- typeName=nodeType.getAttribute("n");
+ let nodeType=findFirstNode(node, "type");
+ let typeName=nodeType.getAttribute("n");
id=nodeType.getAttribute("id");
deleteHTML(id+'_'+this.uid);
//Rebuild sequential numbering of rows (first column)
@@ -1540,7 +1545,7 @@ class SRec
theTable.rows[i].cells[0].appendChild(document.createTextNode(i));
}
}
-
+
callData(typeName,settings)
{
this.f_TypeName=typeName;
@@ -1557,12 +1562,12 @@ class SRec
//Convert XML to array
function nodeToTable(node)
{
- let result=new Array();
-
+ let result=new Array();
+
let nType=findFirstNode(node, "type");
//Read name fields
let nList=findFirstNode(node, "objects-list");
- let cols=new Array();
+ let cols=new Array();
let pos=0;
let nCols=nList.firstChild;
while(nCols != null)
@@ -1583,7 +1588,7 @@ function nodeToTable(node)
{
result[pos]['id']=nRecord.getAttribute("id");
let i=0; //column number
-
+
cdataNode = nRecord.firstChild;
while (cdataNode!=null)
{
@@ -1601,4 +1606,4 @@ function nodeToTable(node)
}
return result;
-}
\ No newline at end of file
+}
diff --git a/metadata/dbms/tabs.js b/metadata/dbms/tabs.js
index 7eff280..9faa1f5 100644
--- a/metadata/dbms/tabs.js
+++ b/metadata/dbms/tabs.js
@@ -1,7 +1,13 @@
class tcTab
{
- constructor(caption){
+ constructor(config){
+
+ this.bColor="";
+
+
+ if(typeof config.float == 'undefined'){ config.float='left'; }
+
this.id=0;
this.par=null;
this.sel=false;
@@ -10,12 +16,12 @@ class tcTab
//Сам таб на который нажимаем (ушко)
this.div=document.createElement('div')
- this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: left; 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 = '#dfdfdf';
- this.div.innerHTML=caption;
+ 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.innerHTML=config.caption;
- this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#f0f0f0';}}(this);
- this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#dfdfdf' }}(this);
+ this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_rowColor1; }}(this);
+ this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_backColor1; }}(this);
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
}
@@ -44,12 +50,12 @@ class tcTab
setSel()
{
for(let i=0;i';
- str+=' | | | ';
+ str+=' | | | ';
str+=' ';
str+='  | ';
str+=' | ';
@@ -1277,10 +1281,10 @@ class TWin
for(var i=0;i
\ No newline at end of file
+?>
| |