From 427b54a7840ecaaa78167514953ec93a515bf11b Mon Sep 17 00:00:00 2001 From: irigm Date: Fri, 19 Jun 2020 11:53:03 +0600 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=82=20=D1=81=D1=82=D0=B0=D1=80=D1=8C=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadata/dbms/editrecord.js | 6 -- metadata/dbms/tabs.js | 120 ++++++++++++++++++------------------ metadata/dbms/tools.js | 2 +- metadata/include/tools.php | 35 +++++++++++ 4 files changed, 97 insertions(+), 66 deletions(-) diff --git a/metadata/dbms/editrecord.js b/metadata/dbms/editrecord.js index 0af797a..76bb38f 100644 --- a/metadata/dbms/editrecord.js +++ b/metadata/dbms/editrecord.js @@ -1,12 +1,6 @@ //Copyright (C) 2008 Ivanov I.M. irigm@mail.ru +77051809750 //For find non english chars: [^\x00-\x7F]+ -//Порядок работы: -//Запрашиваю GUI XML если он не передан через параметры функции. -//Как GUI XML пришел запрашиваю данные полей с сервера (если это нужно) и с разу же пытаюсь построить GUI по XML. -//Как данные полей придут запрашиваю данные для выпадающих списков (как как они могут зависеть от данных). - - //Заглушки function setPropVal(uid,id,c,p){ ERec_mas[uid].setPropVal(id,c,p); diff --git a/metadata/dbms/tabs.js b/metadata/dbms/tabs.js index d04828d..7eff280 100644 --- a/metadata/dbms/tabs.js +++ b/metadata/dbms/tabs.js @@ -1,7 +1,25 @@ -function tcTab(caption) +class tcTab { - this.setConText=function(txt) + constructor(caption){ + this.id=0; + this.par=null; + this.sel=false; + this.con=null; //Элемент с содержимым + this.href=''; + + //Сам таб на который нажимаем (ушко) + 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.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.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this) + } + + setConText(txt) { if(this.con!=null) this.con.parent.removeChild(this.con) this.con=document.createElement('div') this.con.style.cssText='width: 100%; height: 100%;' @@ -11,23 +29,21 @@ function tcTab(caption) return this.con } - this.setConObj=function(val) + setConObj(val) { if(this.con!=null) this.con.parent.removeChild(this.con) - if (typeof val === 'string' || val instanceof String) + if (typeof val === 'string' || val instanceof String) val=document.getElementById(val); if(val===null || typeof(val)=='undefined') return; - this.con=val; if(!this.sel) this.con.style.display='none'; this.par.ctt.appendChild(this.con); - return val; } - - this.setSel=function() + + setSel() { - for(var i=0;i