diff --git a/metadata/dbms/editrecord.js b/metadata/dbms/editrecord.js index 9d883ba..d68af1c 100644 --- a/metadata/dbms/editrecord.js +++ b/metadata/dbms/editrecord.js @@ -139,8 +139,8 @@ class EdtRec str+=' '; str+=' '; str+=' '; - str+=' '+_('Name')+''; - str+=' '+_('Value')+''; + str+=' '+trt('Name')+''; + str+=' '+trt('Value')+''; str+=' '; str+=' '; str+=' '; @@ -379,11 +379,11 @@ class EdtRec select.appendChild( option ); option = document.createElement("option"); option.setAttribute("value","1"); - option.appendChild(document.createTextNode(_('Yes'))); + option.appendChild(document.createTextNode(trt('Yes'))); select.appendChild( option ); option = document.createElement("option"); option.setAttribute("value","0"); - option.appendChild(document.createTextNode(_('Not'))); + option.appendChild(document.createTextNode(trt('Not'))); select.appendChild( option ); }else { @@ -406,7 +406,7 @@ class EdtRec if(vt=="i4") { - //alert2(_('Alert'),"prop name = "+nodeProp.getAttribute("n")); + //alert2(trt('Alert'),"prop name = "+nodeProp.getAttribute("n")); //If there is a node "list" with the elements "CheckBox" then create them. var opt=findNode(nodeProp, "options"); @@ -456,7 +456,7 @@ class EdtRec button.className='button-secondary'; button.setAttribute("type","button"); button.setAttribute("value","+"); - button.setAttribute("title",_("Increase_by_1")); + button.setAttribute("title",trt("Increase_by_1")); button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;"; button.onclick=function(inp){return function(){inp.value=getIntVal(inp.value)+1;}}(input); @@ -466,7 +466,7 @@ class EdtRec button.className='button-secondary'; button.setAttribute("type","button"); button.setAttribute("value","-"); - button.setAttribute("title",_("Decrease_by_1")); + button.setAttribute("title",trt("Decrease_by_1")); button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;"; button.onclick=function(inp){return function(){inp.value=getIntVal(inp.value)-1;}}(input); newCell3.appendChild( button ); @@ -606,21 +606,29 @@ class EdtRec }*/ } }else - if(vt=="text") - { - var ta = document.createElement('textarea') - ta.setAttribute("id","prop_"+this.uid+"_"+nodeProp.getAttribute("n")); - ta.style.cssText="width: 100%;"; - ta.setAttribute("rows",4); - ta.setAttribute("name",nodeProp.getAttribute("n")); - ta.setAttribute("value",value); - td2.appendChild( ta ); + if(vt=="text") { + let ta = document.createElement('textarea') + ta.setAttribute("id", "prop_" + this.uid + "_" + nodeProp.getAttribute("n")); + ta.style.cssText = "width: 100%;"; + ta.setAttribute("rows", 4); + ta.setAttribute("name", nodeProp.getAttribute("n")); + ta.setAttribute("value", value); + td2.appendChild(ta); + + }else + if(vt=="html"){ + let ta = document.createElement('textarea') + ta.setAttribute("id", "prop_" + this.uid + "_" + nodeProp.getAttribute("n")); + ta.style.cssText = "width: 100%;"; + ta.setAttribute("rows", 4); + ta.setAttribute("name", nodeProp.getAttribute("n")); + ta.setAttribute("value", value); + td2.appendChild(ta); /*var cdv=document.createElement('div'); cdv.innerHTML+='[Show]'; cdv.innerHTML+=' [Hide]'; td2.appendChild( cdv );*/ - }else if(vt=="blob" || vt=="file") { @@ -657,7 +665,7 @@ class EdtRec btnSel.className='button-secondary'; btnSel.setAttribute("type","button"); btnSel.setAttribute("value","..."); - btnSel.setAttribute("title",_('Upload')); + btnSel.setAttribute("title",trt('Upload')); btnSel.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;"; newCell2.appendChild(btnSel); @@ -666,13 +674,13 @@ class EdtRec button2.className='button-secondary'; button2.setAttribute("type","button"); button2.setAttribute("value","X"); - button2.setAttribute("title",_('Delete')); + button2.setAttribute("title",trt('Delete')); button2.style.cssText="height:22px;width:22px;margin:0px;padding:0px;"; button2.onclick=function(inp,ifr){return function(){ inp.value=''; getIframeDocument(ifr).forms["form"].reset(); }}(input,ifr); newCell3.appendChild(button2); //Download button - newCell4.innerHTML='
' + newCell4.innerHTML='
' td2.appendChild( tbl_b ); @@ -768,7 +776,7 @@ class EdtRec var td = document.createElement('td'); td.style.cssText="padding: 5px; vertical-align: bottom;"; td.setAttribute("colspan", "2"); - if (this.record_id==-1) td.innerHTML=''; + if (this.record_id==-1) td.innerHTML=''; tr.appendChild(td); //var td = document.createElement('td'); td.setAttribute("align","right"); @@ -776,7 +784,7 @@ class EdtRec button.className='button-secondary'; button.setAttribute("type","button"); button.style.cssText="margin:0px;margin-right:1px;"; - button.setAttribute("value",_('Apply')); + button.setAttribute("value",trt('Apply')); button.onclick=function(thiz){ return function(){ thiz.sendData(); @@ -788,8 +796,8 @@ class EdtRec button.setAttribute("type","button"); button.className='button-secondary'; button.style.cssText="margin:0px;"; - button.setAttribute("value",_('Cancel')); - //button.onclick=function f_exit(this) { alert2(_('Alert'),this.win.div); } + button.setAttribute("value",trt('Cancel')); + //button.onclick=function f_exit(this) { alert2(trt('Alert'),this.win.div); } button.onclick=function(thiz){ return function(){thiz.win.Close();};}(this); td.appendChild( button ); tr.appendChild(td); @@ -798,13 +806,13 @@ class EdtRec //Height adjust the height of the page //this.win.div.style.width="400px" //this.win.div.style.height="100px" - //alert2(_('Alert'),document.documentElement.scrollTop) - //alert2(_('Alert'),document.documentElement.clientHeight) + //alert2(trt('Alert'),document.documentElement.scrollTop) + //alert2(trt('Alert'),document.documentElement.clientHeight) this.win.setHeight(eTable.offsetHeight+40); //this.win.div.style.height=(eTable.offsetHeight+40)+"px"; - //alert2(_('Alert'),this.win.div.style.width) - //alert2(_('Alert'),this.win.div.style.height) + //alert2(trt('Alert'),this.win.div.style.width) + //alert2(trt('Alert'),this.win.div.style.height) this.win.setCenter(); @@ -1115,7 +1123,7 @@ class EdtRec nodeProp=nodeProp.nextSibling; } - if(count==0) alert2(_('Alert'),_("No_results_were_found_for_your_search")); + if(count==0) alert2(trt('Alert'),trt("No_results_were_found_for_your_search")); else if(count==1) //1 item has been selected, fill in the field. { @@ -1153,7 +1161,7 @@ class EdtRec var win=new TWin(); win.BuildGUI(pageX-280,pageY-7); win.setContent(htmlString); - win.setCaption(document.createTextNode(_("Selection"))); + win.setCaption(document.createTextNode(trt("Selection"))); win.setParent(this.win); //win.obj=this } @@ -1161,10 +1169,10 @@ class EdtRec }; applyReq(req,fn,node,xmldoc,win) - { //alert2(_('Alert'),"erec XML=\n"+getXMLNodeSerialisation(node)); + { //alert2(trt('Alert'),"erec XML=\n"+getXMLNodeSerialisation(node)); if (fn==-1) { - alert2(_('Alert'),findFirstNode(node,'#cdata-section').nodeValue); + alert2(trt('Alert'),findFirstNode(node,'#cdata-section').nodeValue); //this.pBarCnt=0; this.hideProgressBar(); }else @@ -1204,7 +1212,7 @@ class EdtRec this.setData(node); }else { - alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); + alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); this.hideProgressBar(); } }; @@ -1230,7 +1238,7 @@ class EdtRec } }else { - alert2(_('Alert'),'Field "'+prop_id+'" not find!'); + alert2(trt('Alert'),'Field "'+prop_id+'" not find!'); } }; @@ -1242,7 +1250,7 @@ class EdtRec //filterName - filter name callFilterVal(typeName,name,value,htmlid,filterName) { - //alert2(_('Alert')," typeName="+typeName+" name="+name+" value="+value+" htmlid="+htmlid); + //alert2(trt('Alert')," typeName="+typeName+" name="+name+" value="+value+" htmlid="+htmlid); if(value!="") { var xml=''; @@ -1274,8 +1282,8 @@ class EdtRec { var nProps1=findFirstNode(node, 'properties') var nProps2=findFirstNode(this.nodeMetadata, 'properties') //Since the values came in abbreviated XML - if(nProps1==null){ alert2(_('Alert'),'Error, node='+getXMLNodeSerialisation(node)); return; } - if(nProps2==null){ alert2(_('Alert'),'Error, nodeMetadata='+getXMLNodeSerialisation(this.nodeMetadata)); return; } + if(nProps1==null){ alert2(trt('Alert'),'Error, node='+getXMLNodeSerialisation(node)); return; } + if(nProps2==null){ alert2(trt('Alert'),'Error, nodeMetadata='+getXMLNodeSerialisation(this.nodeMetadata)); return; } var nProp1=nProps1.firstChild while(nProp1!=null) { @@ -1406,7 +1414,7 @@ class EdtRec //Проверяю тип дпнных и заполненость полей if (!this.checkData(value,nodeProp.getAttribute("vt"),nodeProp.getAttribute("maybenull"))) { - alert2(_('Alert'),_("The_field_data_is_incorrect")+" \""+nodeProp.getAttribute("d")+"\"=\""+value+"\"!"); + alert2(trt('Alert'),trt("The_field_data_is_incorrect")+" \""+nodeProp.getAttribute("d")+"\"=\""+value+"\"!"); return; } s+=' \n'; @@ -1416,7 +1424,7 @@ class EdtRec s+=' \n'; s+='\n'; s+=''; - //alert2(_('Alert'),s); + //alert2(trt('Alert'),s); if(this.request.callServer(ScriptName,s,true)) { this.showProgressBar(); @@ -1451,7 +1459,7 @@ class EdtRec //inserting the selected record setPropVal(id,caption,prop_id) { - //alert2(_('Alert'),"id="+id+" caption="+caption+" prop_id="+prop_id) + //alert2(trt('Alert'),"id="+id+" caption="+caption+" prop_id="+prop_id) var prop=document.getElementById("prop_"+this.uid+"_"+prop_id); var propvis=document.getElementById("prop_"+this.uid+"_"+prop_id+"_visible"); if ((prop!=null)&&(propvis!=null)) @@ -1477,9 +1485,9 @@ class EdtRec let readd=document.getElementById("readd_"+this.uid); if(readd!==null && readd.checked){ - //if(!confirm(_("Successfully_added_data")+".\n"+_("Add_more")+"?")) this.win.Close(); + //if(!confirm(trt("Successfully_added_data")+".\n"+trt("Add_more")+"?")) this.win.Close(); - confirm2(_('Warning'),_("Successfully_added_data")+"
"+_("Add_more")+"?",null,function(thiz){return function(){thiz.win.Close();};}(this)); + confirm2(trt('Warning'),trt("Successfully_added_data")+"
"+trt("Add_more")+"?",null,function(thiz){return function(){thiz.win.Close();};}(this)); }else diff --git a/metadata/dbms/login.js b/metadata/dbms/login.js index 4483dd2..2aa66b9 100644 --- a/metadata/dbms/login.js +++ b/metadata/dbms/login.js @@ -61,7 +61,7 @@ class DBMSUser { if(findNode(node,'#cdata-section').nodeValue=="0") //if not logged { - alert(_('Invalid_username_and_or_password')); + alert(trt('Invalid_username_and_or_password')); }else { //location.reload(); @@ -76,7 +76,7 @@ class DBMSUser { //if(findNode(node,'#cdata-section').nodeValue=="1") //if register //{ - // alert(_('New_user_is_registered')+'\n'+_('The_password_has_been_sent_to_you_by_Email')); + // alert(trt('New_user_is_registered')+'\n'+trt('The_password_has_been_sent_to_you_by_Email')); // location.reload(); //} } @@ -91,7 +91,7 @@ class DBMSUser { this.win=new TWin(true); this.win.BuildGUI(10,10); - this.win.setCaption(_('Authorization')); + this.win.setCaption(trt('Authorization')); this.win.setSize("350px","200px"); @@ -101,7 +101,7 @@ class DBMSUser \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ @@ -111,7 +111,7 @@ class DBMSUser \n\ \n\ \n\ - \n\ + \n\
'+_('Login')+' (E-mail):'+trt('Login')+' (E-mail):
\n\ \n\ \n\ @@ -241,7 +241,7 @@ class DBMSUser \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ @@ -251,7 +251,7 @@ class DBMSUser \n\ \n\ \n\ - \n\ + \n\
'+_('Login')+' (E-mail):'+trt('Login')+' (E-mail):
\n\ \n\ \n\ @@ -281,7 +281,7 @@ class DBMSUser var password=document.getElementById('tcPassword'+this.uid).value; if(login=='' || password=='') { str="Not filled in the required fields: "; - if(login=='') str+='"'+_('Login')+' (E-mail)"'; + if(login=='') str+='"'+trt('Login')+' (E-mail)"'; if(login=='' && password=='') str+=', '; if(password=='') str+='"Password"'; str+='!'; @@ -434,16 +434,16 @@ function showRestoreForm() { var win=new TWin(true); win.BuildGUI(10,10); - win.setCaption(_("Password_recovery")); + win.setCaption(trt("Password_recovery")); str='
\n\ \n\ \n\ - \n\ + \n\ \n\ \n\ - \n\ + \n\
'+_('Login')+' (E-mail)'+trt('Login')+' (E-mail)\n\
\n\ \n\
'; @@ -471,8 +471,8 @@ function showRestoreForm() var em=document.getElementById(win.uid+'_email').value; - if(em==''){ document.getElementById(win.uid+'_email').select(); alert(_('Not_filled_Email_address')); win.hideProgressBar(); return; } - if(! isEmail(em)){ document.getElementById(win.uid+'_email').select(); alert(_('Please_enter_a_valid_email_address')); win.hideProgressBar(); return; } + if(em==''){ document.getElementById(win.uid+'_email').select(); alert(trt('Not_filled_Email_address')); win.hideProgressBar(); return; } + if(! isEmail(em)){ document.getElementById(win.uid+'_email').select(); alert(trt('Please_enter_a_valid_email_address')); win.hideProgressBar(); return; } //Send AJAX reqwest to server var xml='\ @@ -495,12 +495,12 @@ function showRestoreForm() //загрузился xml документ начинаем его разбирать (по id функции в документе) var xmldoc = xmlHttpRequest.responseXML if(xmldoc==null) { - alert2(_('Alert'), _('Wrong_XML_document') + "!\n" + xmlHttpRequest.responseText); + alert2(trt('Alert'), trt('Wrong_XML_document') + "!\n" + xmlHttpRequest.responseText); return; } var node = xmldoc.documentElement; - if((node==null)||(node.getAttribute("fn")==null)) alert(_('Error')+"\n "+_("No_data")+"!\n"+xmlHttpRequest.responseText); + if((node==null)||(node.getAttribute("fn")==null)) alert(trt('Error')+"\n "+trt("No_data")+"!\n"+xmlHttpRequest.responseText); else { //alert("Принятый браузером XML=\n"+getXMLNodeSerialisation(node)); @@ -518,7 +518,7 @@ function showRestoreForm() } }else { - if(confirm(_('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nRedo the request?")) + if(confirm(trt('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nRedo the request?")) { var call=new myXMLHttpRequest(this); call.callServer(url,xmlString); diff --git a/metadata/dbms/records.php b/metadata/dbms/records.php index 2ed014b..26274a5 100644 --- a/metadata/dbms/records.php +++ b/metadata/dbms/records.php @@ -153,7 +153,7 @@ } //Функция для перевода текста без применения GetText - function __($text) + function trt($text) { global $db,$lng,$Schema; @@ -202,7 +202,7 @@ if($pos2 !== false) { $result.=substr($text, $cut, $pos1 - $cut ); - $result.=__(substr($text, $pos1+3, $pos2 - $pos1 - 3 )); + $result.=trt(substr($text, $pos1+3, $pos2 - $pos1 - 3 )); $cut=$pos2+2; $from = $pos2 + 2; } diff --git a/metadata/dbms/session.js b/metadata/dbms/session.js index 690f5a7..b083c49 100644 --- a/metadata/dbms/session.js +++ b/metadata/dbms/session.js @@ -25,7 +25,7 @@ function CheckSession(path) clearTimeout(this.timer); //alert('Ваша сессия завершилась!'); //location.reload(); - alert2(_("Alert"),'Ваша сессия завершилась! При нажатии на “OK” страница перезагрузится, а при нажатии на “X“ закроется сообщение.').onclick=function(){ location.reload(); }; + alert2(trt("Alert"),'Ваша сессия завершилась! При нажатии на “OK” страница перезагрузится, а при нажатии на “X“ закроется сообщение.').onclick=function(){ location.reload(); }; } } } diff --git a/metadata/dbms/showrecord.js b/metadata/dbms/showrecord.js index 2054fd6..1e01ded 100644 --- a/metadata/dbms/showrecord.js +++ b/metadata/dbms/showrecord.js @@ -46,17 +46,17 @@ class SRec applyReq(req,fn,node,xmldoc) { - //alert2(_('Alert'),getXMLNodeSerialisation(node)); + //alert2(trt('Alert'),getXMLNodeSerialisation(node)); this.hideProgressBar(); this.xmldoc=node.ownerDocument; //xmldoc; if (fn==-1) //Information menu { - alert2(_('Alert'),findFirstNode(node,'#cdata-section').nodeValue); + alert2(trt('Alert'),findFirstNode(node,'#cdata-section').nodeValue); }else if (fn==0) { - //alert2(_('Alert'),getXMLNodeSerialisation(node)); + //alert2(trt('Alert'),getXMLNodeSerialisation(node)); this.setMetadata(node); this.updateSize(); }else @@ -81,10 +81,10 @@ class SRec if(this.rwin!=null) { this.rwin.hideProgressBar(); - this.rwin.setContent('
'+_('Download_report')+': "'+this.win.getCaption().innerHTML+'".
'); + this.rwin.setContent('
'+trt('Download_report')+': "'+this.win.getCaption().innerHTML+'".
'); } }else - alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); + alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); } //Edit the GUI filter from the xml string. @@ -150,11 +150,11 @@ class SRec \ \ \ - \ - \ - \ +
adddelexcel
\ + \ + \ \ - \ + \
adddelexcel refresh
refresh
\ \
\ @@ -234,7 +234,7 @@ class SRec //Function to fill the drop-down lists (here it is necessary to ensure that everywhere there is a "var" in front of the variables). setDataSelect(node) { - //alert2(_('Alert'),"setDataSelect = " + getXMLNodeSerialisation(node)); + //alert2(trt('Alert'),"setDataSelect = " + getXMLNodeSerialisation(node)); let nodeType,prop_id,prop,option,nodeProp,id,value,cdataNode; nodeType=findFirstNode(node, 'type'); @@ -247,7 +247,7 @@ class SRec let nodeCur=findNodeOnAttribute(nodeFilter, 'column', 'n', prop_id); if(nodeCur!=null) selector=nodeCur.getAttribute("selector"); - //alert2(_('Alert'),"nodeCur = " + getXMLNodeSerialisation(nodeCur)); + //alert2(trt('Alert'),"nodeCur = " + getXMLNodeSerialisation(nodeCur)); /*nodeCur=nodeFilter.firstChild while(nodeCur!=null) @@ -324,7 +324,7 @@ class SRec } if(count==0) { - alert2(_('Alert'),_("No_results_were_found_for_your_search")); + alert2(trt('Alert'),trt("No_results_were_found_for_your_search")); }else if(count==1) //fill without window { @@ -361,7 +361,7 @@ class SRec win.BuildGUI(pageX-10,pageY-10); win.setHeight(400); win.setContent(htmlString); - win.setCaption(document.createTextNode(_('Selection'))); + win.setCaption(document.createTextNode(trt('Selection'))); win.setParent(this.win); //win.obj=this } @@ -401,7 +401,7 @@ class SRec } }else { - alert2(_('Alert'),'Filter "'+prop_id+'" not find!'); + alert2(trt('Alert'),'Filter "'+prop_id+'" not find!'); } } @@ -435,7 +435,7 @@ class SRec columnNode = columnNode.nextSibling; } } - //alert2(_('Alert'),getXMLNodeSerialisation(this.nodeMetadata)); + //alert2(trt('Alert'),getXMLNodeSerialisation(this.nodeMetadata)); } /** Function to send filter data to the server @@ -476,7 +476,7 @@ class SRec xs+='\n'; xs+=''; - //alert2(_('Alert'),xs); + //alert2(trt('Alert'),xs); if(this.request.callServer(ScriptName,xs)) { @@ -494,7 +494,7 @@ class SRec let td,tr,td1,td2; let nodeFilter=null; let tablefilter=document.getElementById('idfilter'+this.uid); - if (tablefilter.tBodies==null) alert2(_('Alert'),'tablefilter=null'); + if (tablefilter.tBodies==null) alert2(trt('Alert'),'tablefilter=null'); let nodeType=findFirstNode(node, "type"); this.f_pI=nodeType.getAttribute("ins");//access rights this.f_pU=nodeType.getAttribute("upd"); @@ -679,12 +679,12 @@ class SRec select.appendChild( option ); option=document.createElement("option"); option.setAttribute("value","1"); - option.appendChild(document.createTextNode(_('Yes'))); + option.appendChild(document.createTextNode(trt('Yes'))); if(value=="1") option.selected=true; select.appendChild( option ); option=document.createElement("option"); option.setAttribute("value","0"); - option.appendChild(document.createTextNode(_('Not'))); + option.appendChild(document.createTextNode(trt('Not'))); if(value=="0") option.selected=true; select.appendChild( option ); }else @@ -893,7 +893,7 @@ class SRec } td2.appendChild( table ); - }else alert2(_('Alert'),"Unknown type = "+columnNode.getAttribute("vt")); + }else alert2(trt('Alert'),"Unknown type = "+columnNode.getAttribute("vt")); tablefilter.tBodies[0].appendChild(tr); } columnNode = columnNode.nextSibling; @@ -909,7 +909,7 @@ class SRec let button = document.createElement('input'); button.className='button-secondary'; button.setAttribute("type","button"); - button.setAttribute("value",_("Filtering")); + button.setAttribute("value",trt("Filtering")); button.setAttribute("id","btnfilter_"+this.uid); button.onclick=function(obj){ return function() @@ -1039,7 +1039,7 @@ class SRec tr.appendChild(th); th=document.createElement('th'); th.appendChild( document.createTextNode('Del')); - th.title = _('Invert_selection'); + th.title = trt('Invert_selection'); th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;'; th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; }; th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; }; @@ -1435,7 +1435,7 @@ class SRec dataalert() { let error_msg=""; - if (error_msg!="") alert2(_('Alert'),"ShowRecords: \n"+error_msg); + if (error_msg!="") alert2(trt('Alert'),"ShowRecords: \n"+error_msg); } showreport(ext) @@ -1446,8 +1446,8 @@ class SRec 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.rwin.setCaption(trt('Report')); + this.rwin.setContent('
'+trt('Preparing_of_report')+'
'); this.appendFilter(); //Call data from server @@ -1508,7 +1508,7 @@ class SRec if(this.f_State=="1") //select one record { //Send the id of the selected record to the parent of the selected record and close the window - //alert2(_('Alert'),"id="+id+" f_PropName="+this.f_PropName+" f_TypeName="+this.f_TypeName); + //alert2(trt('Alert'),"id="+id+" f_PropName="+this.f_PropName+" f_TypeName="+this.f_TypeName); this.opener.setFilterObject(this.f_TypeName,this.f_PropName,id); this.win.Close(); }else @@ -1520,7 +1520,7 @@ class SRec //We run through the marked records and request their removal deleteRecord(recordid) { - if (confirm(_("Are_you_sure_you_want_to_delete_the_entries")+'?')) + if (confirm(trt("Are_you_sure_you_want_to_delete_the_entries")+'?')) { for(let i=0;i'+_('OK')+'\n\ + \n\ \n\ '; @@ -205,8 +205,8 @@ function confirm2(title,text,okFunc,cancelFunc) \n\ \n\  \n\ - \n\ - \\n\ + \n\ + \\n\ \n\ '; @@ -982,12 +982,12 @@ class TRequest //загрузился xml документ начинаем его разбирать (по id функции в документе) var xmldoc = xmlHttpRequest.responseXML; if(xmldoc==null){ - alert2(_('Alert'),_('Wrong_XML_document')+"!\nXML=("+xmlHttpRequest.responseText+')\nURL=('+url+')\nxmlString=('+xmlString+')'); + alert2(trt('Alert'),trt('Wrong_XML_document')+"!\nXML=("+xmlHttpRequest.responseText+')\nURL=('+url+')\nxmlString=('+xmlString+')'); return; } var node = xmldoc.documentElement; - if((node==null)||(node.getAttribute("fn")==null)) alert(_('Error')+"\n"+_('No_data')+"!\n"+xmlHttpRequest.responseText); + if((node==null)||(node.getAttribute("fn")==null)) alert(trt('Error')+"\n"+trt('No_data')+"!\n"+xmlHttpRequest.responseText); else { //alert("XML=\n"+getXMLNodeSerialisation(node)); @@ -1006,7 +1006,7 @@ class TRequest } }else { - if(confirm(_('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nПовторить запрос?")) + if(confirm(trt('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nПовторить запрос?")) { this.callServer(url,xmlString); }; diff --git a/metadata/tree/tree.js b/metadata/tree/tree.js index 33ec3e2..57f3304 100644 --- a/metadata/tree/tree.js +++ b/metadata/tree/tree.js @@ -151,18 +151,18 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню //загрузился xml документ начинаем его разбирать (по id функции в документе) let xmldoc = xmlHttpRequest.responseXML; if(xmldoc==null){ - alert2(_('Alert'),_('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); + alert2(trt('Alert'),trt('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); return; } let node = xmldoc.documentElement; - //alert2(_('Alert'),"Данные=\n"+xmlHttpRequest.responseText); - if((node==null)||(node.getAttribute("fn")==null)) alert2(_('Alert'),_('Error')+"\n"+_('No_data')+"!\n"+xmlHttpRequest.responseText); + //alert2(trt('Alert'),"Данные=\n"+xmlHttpRequest.responseText); + if((node==null)||(node.getAttribute("fn")==null)) alert2(trt('Alert'),trt('Error')+"\n"+trt('No_data')+"!\n"+xmlHttpRequest.responseText); else { var fn = node.getAttribute("fn"); if (fn=='0') { - alert2(_('Alert'),findFirstNode(node,"#cdata-section").nodeValue); + alert2(trt('Alert'),findFirstNode(node,"#cdata-section").nodeValue); }else if (fn=='1') { var tn=this.findNode(node.getAttribute("htmlid")); //Родительский узел @@ -183,11 +183,11 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню var cnt=document.getElementById(this.m_pr+tn.htmlid+'tb'); if(cnt!=null) this.createList(tn.htmlid); //Создать HTML кнопки }else - alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); + alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); } }else { - alert2(_('Alert'),_('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); + alert2(trt('Alert'),trt('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); } } }; @@ -549,7 +549,7 @@ function TMenu(v_obj,v_scr,v_treepath) //Горизонтальное меню //Добавить слушателя нажатия на кнопку this.addListener=function(listener) - { if(listener.OnClickNode==null) alert2(_('Alert'),'У объекта нет функции "OnClickNode()"!'); + { if(listener.OnClickNode==null) alert2(trt('Alert'),'У объекта нет функции "OnClickNode()"!'); this.m_ls[this.m_ls.length]=listener; }; //Удалить слушателя @@ -651,28 +651,28 @@ function TTree(v_obj,v_pr,v_scr,v_pth,v_imgsize) //Дерево //загрузился xml документ начинаем его разбирать (по id функции в документе) let xmldoc = xmlHttpRequest.responseXML; if(xmldoc==null){ - alert2(_('Alert'),_('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); + alert2(trt('Alert'),trt('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText); return; } let node = xmldoc.documentElement; - if((node==null)||(node.getAttribute("fn")==null)) alert2(_('Alert'),_('Error')+"\n"+_('No_data')+"!\n"+xmlHttpRequest.responseText); + if((node==null)||(node.getAttribute("fn")==null)) alert2(trt('Alert'),trt('Error')+"\n"+trt('No_data')+"!\n"+xmlHttpRequest.responseText); else { var fn = node.getAttribute("fn"); if (fn==0) { - alert2(_('Alert'),findFirstNode(node,"#cdata-section").nodeValue); + alert2(trt('Alert'),findFirstNode(node,"#cdata-section").nodeValue); }else if (fn==1) { this.addNode(node); this.OpenTreeOnPath(this.m_path); }else - alert2(_('Alert'),"Unknown function! fn=\""+fn+"\"" ); + alert2(trt('Alert'),"Unknown function! fn=\""+fn+"\"" ); } }else { - alert2(_('Alert'),_('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); + alert2(trt('Alert'),trt('Failed_to_get_data')+"\n URL: "+url+"\n" + xmlHttpRequest.statusText); } } }; @@ -905,7 +905,7 @@ function TTree(v_obj,v_pr,v_scr,v_pth,v_imgsize) //Дерево //Добавить слушателя this.addListener=function(listener) - { if(listener.OnClickNode==null) alert2(_('Alert'),'У объекта нет функции "OnClickNode()"!'); + { if(listener.OnClickNode==null) alert2(trt('Alert'),'У объекта нет функции "OnClickNode()"!'); this.m_ls[this.m_ls.length]=listener; }; //Удалить слушателя @@ -917,7 +917,7 @@ function TTree(v_obj,v_pr,v_scr,v_pth,v_imgsize) //Дерево }; //Добавить слушателя this.addListenerLoad=function(listener) - { if(listener.OnLoadNode==null) alert2(_('Alert'),'У объекта нет функции "OnLoadNode(node)"!'); + { if(listener.OnLoadNode==null) alert2(trt('Alert'),'У объекта нет функции "OnLoadNode(node)"!'); this.m_lsl[this.m_lsl.length]=listener; }; //Удалить слушателя