source formating;

some uninitialized vars;
This commit is contained in:
Sebastian Mendel
2007-03-27 15:41:28 +00:00
parent 6d8aefd4d2
commit e67b47daa1
2 changed files with 764 additions and 692 deletions

View File

@@ -12,28 +12,28 @@ var http_request = false;
var xmldoc; var xmldoc;
var textdoc; var textdoc;
/**
*
*/
function makeRequest(url, parameters) function makeRequest(url, parameters)
{ {
http_request = false; http_request = false;
if (window.XMLHttpRequest) if (window.XMLHttpRequest) {
{ // Mozilla, Safari,... // Mozilla, Safari,...
http_request = new XMLHttpRequest(); http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
} }
else } else if (window.ActiveXObject) {
if (window.ActiveXObject) // IE
{ // IE
try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) catch (e) {
{
try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); }
catch (e) {} catch (e) {}
} }
} }
if (!http_request) if (!http_request) {
{
alert('Giving up :( Cannot create an XMLHTTP instance'); alert('Giving up :( Cannot create an XMLHTTP instance');
return false; return false;
} }
@@ -44,69 +44,70 @@ function makeRequest(url, parameters)
http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close"); http_request.setRequestHeader("Connection", "close");
http_request.send(parameters); http_request.send(parameters);
return true;
} }
/**
*
*/
function alertContents() function alertContents()
{ {
if (http_request.readyState == 1 ) if (http_request.readyState == 1) {
{
document.getElementById("layer_action").style.left = document.body.clientWidth + document.body.scrollLeft - 85; document.getElementById("layer_action").style.left = document.body.clientWidth + document.body.scrollLeft - 85;
document.getElementById("layer_action").style.top = document.body.scrollTop + 10; document.getElementById("layer_action").style.top = document.body.scrollTop + 10;
document.getElementById("layer_action").style.visibility = 'visible'; document.getElementById("layer_action").innerHTML = 'Loading...'; document.getElementById("layer_action").style.visibility = 'visible'; document.getElementById("layer_action").innerHTML = 'Loading...';
} }
if (http_request.readyState == 2 ) document.getElementById("layer_action").innerHTML = 'Loaded'; if (http_request.readyState == 2) {
if (http_request.readyState == 3 ) document.getElementById("layer_action").innerHTML = 'Loading 99%'; document.getElementById("layer_action").innerHTML = 'Loaded';
if (http_request.readyState == 4 ) }
{ if (http_request.readyState == 3) {
if (http_request.status == 200) document.getElementById("layer_action").innerHTML = 'Loading 99%';
{ }
if (http_request.readyState == 4) {
if (http_request.status == 200) {
textdoc = http_request.responseText; textdoc = http_request.responseText;
//alert(textdoc); //alert(textdoc);
xmldoc = http_request.responseXML; xmldoc = http_request.responseXML;
PrintXML(); PrintXML();
document.getElementById("layer_action").style.visibility = 'hidden'; document.getElementById("layer_action").style.visibility = 'hidden';
} } else {
else
{
alert('There was a problem with the request.'); alert('There was a problem with the request.');
} }
} }
} }
/**
*
*/
function PrintXML() function PrintXML()
{ {
var root = xmldoc.getElementsByTagName('root').item(0); //root var root = xmldoc.getElementsByTagName('root').item(0); //root
//alert(xmldoc.getElementsByTagName('root').item(1)); //alert(xmldoc.getElementsByTagName('root').item(1));
if(root==null) // if error if (root == null) {
{ // if error
myWin=window.open('','Report','width=400, height=250, resizable=1, scrollbars=1, status=1'); myWin=window.open('','Report','width=400, height=250, resizable=1, scrollbars=1, status=1');
var tmp = myWin.document; var tmp = myWin.document;
tmp.write(textdoc); tmp.write(textdoc);
tmp.close(); tmp.close();
} } else {
else
{
//alert(xmldoc.getElementsByTagName('root')[0]); //alert(xmldoc.getElementsByTagName('root')[0]);
//alert(root.attributes[0].nodeValue); //alert(root.attributes[0].nodeValue);
//alert(xmldoc.getElementsByTagName('root')[0].attributes[0].nodeValue); //alert(xmldoc.getElementsByTagName('root')[0].attributes[0].nodeValue);
//xmldoc.getElementsByTagName('root')[0].getAttribute("act") //xmldoc.getElementsByTagName('root')[0].getAttribute("act")
if(root.getAttribute('act') == 'save_pos') if (root.getAttribute('act') == 'save_pos') {
alert(strLang[root.getAttribute('return')]); alert(strLang[root.getAttribute('return')]);
if(root.getAttribute('act') == 'relation_upd') }
{ if (root.getAttribute('act') == 'relation_upd') {
alert(strLang[root.getAttribute('return')]); alert(strLang[root.getAttribute('return')]);
if(root.getAttribute('b')=='1') if (root.getAttribute('b') == '1') {
{
contr.splice(root.getAttribute('K'), 1); contr.splice(root.getAttribute('K'), 1);
Re_load(); Re_load();
} }
} }
if(root.getAttribute('act') == 'relation_new') if (root.getAttribute('act') == 'relation_new') {
{
alert(strLang[root.getAttribute('return')]); alert(strLang[root.getAttribute('return')]);
if(root.getAttribute('b')=='1') if (root.getAttribute('b') == '1') {
{
var i = contr.length; var i = contr.length;
var t1 = root.getAttribute('DB1') + '.' + root.getAttribute('T1'); var t1 = root.getAttribute('DB1') + '.' + root.getAttribute('T1');
var f1 = root.getAttribute('F1'); var f1 = root.getAttribute('F1');
@@ -123,7 +124,3 @@ function PrintXML()
} }
} }
} }

View File

@@ -6,11 +6,12 @@
*/ */
/** /**
* * init
*/ */
var dx, dy, dy2; var dx, dy, dy2;
var cur_click; var cur_click;
var sm_x = 2, sm_y = 2; // update in Main() // update in Main()
var sm_x = 2, sm_y = 2;
var sm_s = 0; var sm_s = 0;
var sm_add = 10; var sm_add = 10;
var s_left = 0; var s_left = 0;
@@ -18,7 +19,8 @@ var s_right = 0;
var ON_relation = 0; var ON_relation = 0;
var ON_grid = 0; var ON_grid = 0;
var ON_display_field = 0; var ON_display_field = 0;
var ON_angular_direct = 1; // relation_style: 0 - angular 1 - direct // relation_style: 0 - angular 1 - direct
var ON_angular_direct = 1;
var click_field = 0; var click_field = 0;
var link_relation = ""; var link_relation = "";
var id_hint; var id_hint;
@@ -33,9 +35,9 @@ var layer_menu_cur_click = 0;
var step = 10; var step = 10;
var old_class; var old_class;
//--------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
//window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP); //window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);
@@ -44,9 +46,9 @@ document.onmousedown = MouseDown;
document.onmouseup = MouseUp; document.onmouseup = MouseUp;
document.onmousemove = MouseMove; document.onmousemove = MouseMove;
isIE = document.all && !window.opera; var isIE = document.all && !window.opera;
isNN = !document.all && document.getElementById; var isNN = !document.all && document.getElementById;
isN4 = document.layers; var isN4 = document.layers;
if (isIE) { if (isIE) {
window.onscroll = General_scroll; window.onscroll = General_scroll;
@@ -56,8 +58,7 @@ if (isIE) {
//document.onmouseup = function(){General_scroll_end();} //document.onmouseup = function(){General_scroll_end();}
function MouseDown(e) function MouseDown(e)
{ {
if (cur_click != null) if (cur_click != null) {
{
offsetx = isIE ? event.clientX + document.body.scrollLeft : e.pageX; offsetx = isIE ? event.clientX + document.body.scrollLeft : e.pageX;
offsety = isIE ? event.clientY + document.body.scrollTop : e.pageY; offsety = isIE ? event.clientY + document.body.scrollTop : e.pageY;
dx = offsetx - parseInt(cur_click.style.left); dx = offsetx - parseInt(cur_click.style.left);
@@ -70,11 +71,11 @@ function MouseDown(e)
dx = e.pageX - left; dx = e.pageX - left;
dy = e.pageY - top; dy = e.pageY - top;
alert(" dx = " + dx + " dy = " +dy);*/ alert(" dx = " + dx + " dy = " +dy);
*/
cur_click.style.zIndex = 2; cur_click.style.zIndex = 2;
} }
if(layer_menu_cur_click) if (layer_menu_cur_click) {
{
offsetx = isIE ? event.clientX + document.body.scrollLeft: e.pageX; offsetx = isIE ? event.clientX + document.body.scrollLeft: e.pageX;
dx = offsetx - parseInt(document.getElementById("layer_menu").style.width); dx = offsetx - parseInt(document.getElementById("layer_menu").style.width);
} }
@@ -82,7 +83,6 @@ function MouseDown(e)
function MouseMove(e) function MouseMove(e)
{ {
//Glob_X = e.pageX; //Glob_X = e.pageX;
//Glob_Y = e.pageY; //Glob_Y = e.pageY;
Glob_X = isIE ? event.clientX + document.body.scrollLeft: e.pageX; Glob_X = isIE ? event.clientX + document.body.scrollLeft: e.pageX;
@@ -94,15 +94,13 @@ function MouseMove(e)
//window.status = "X = "+ Glob_X + " Y = "+ Glob_Y; //window.status = "X = "+ Glob_X + " Y = "+ Glob_Y;
var mGx, mGy; var mGx, mGy;
if (cur_click != null) if (cur_click != null) {
{
mGx = Glob_X - dx; mGx = Glob_X - dx;
mGy = Glob_Y - dy; mGy = Glob_Y - dy;
mGx = mGx > 0 ? mGx : 0; mGx = mGx > 0 ? mGx : 0;
mGy = mGy > 0 ? mGy : 0; mGy = mGy > 0 ? mGy : 0;
if(ON_grid) if (ON_grid) {
{
mGx = mGx % step < step / 2 ? mGx - mGx % step : mGx - mGx % step + step; mGx = mGx % step < step / 2 ? mGx - mGx % step : mGx - mGx % step + step;
mGy = mGy % step < step / 2 ? mGy - mGy % step : mGy - mGy % step + step; mGy = mGy % step < step / 2 ? mGy - mGy % step : mGy - mGy % step + step;
} }
@@ -111,14 +109,12 @@ function MouseMove(e)
cur_click.style.top = mGy; cur_click.style.top = mGy;
} }
if (ON_relation || ON_display_field) if (ON_relation || ON_display_field) {
{
document.getElementById('hint').style.left = Glob_X + 20; document.getElementById('hint').style.left = Glob_X + 20;
document.getElementById('hint').style.top = Glob_Y + 20; document.getElementById('hint').style.top = Glob_Y + 20;
} }
if(layer_menu_cur_click) if (layer_menu_cur_click) {
{
document.getElementById("layer_menu").style.width = Glob_X - dx>=150?Glob_X - dx:150; document.getElementById("layer_menu").style.width = Glob_X - dx>=150?Glob_X - dx:150;
//document.getElementById("layer_menu").style.height = Glob_Y - dy>=200?Glob_Y - dy:200; //document.getElementById("layer_menu").style.height = Glob_Y - dy>=200?Glob_Y - dy:200;
//document.getElementById("id_scroll_tab").style.height = Glob_Y - dy2; //document.getElementById("id_scroll_tab").style.height = Glob_Y - dy2;
@@ -127,8 +123,7 @@ function MouseMove(e)
function MouseUp(e) function MouseUp(e)
{ {
if (cur_click != null) if (cur_click != null) {
{
document.getElementById("canvas").style.visibility = 'visible'; document.getElementById("canvas").style.visibility = 'visible';
Re_load(); Re_load();
cur_click.style.zIndex = 1; cur_click.style.zIndex = 1;
@@ -137,9 +132,9 @@ function MouseUp(e)
layer_menu_cur_click = 0; layer_menu_cur_click = 0;
//window.releaseEvents(Event.MOUSEMOVE); //window.releaseEvents(Event.MOUSEMOVE);
} }
//--------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
//function ToInt(s) //function ToInt(s)
@@ -152,8 +147,7 @@ function Canvas_pos()
canvas_width = document.getElementById('canvas').width = osn_tab_width - 3; canvas_width = document.getElementById('canvas').width = osn_tab_width - 3;
canvas_height = document.getElementById('canvas').height = osn_tab_height - 3; canvas_height = document.getElementById('canvas').height = osn_tab_height - 3;
if(isIE) if (isIE) {
{
document.getElementById('canvas').style.width = (osn_tab_width - 3)?(osn_tab_width - 3):0; document.getElementById('canvas').style.width = (osn_tab_width - 3)?(osn_tab_width - 3):0;
document.getElementById('canvas').style.height = (osn_tab_height - 3)?(osn_tab_height - 3):0; document.getElementById('canvas').style.height = (osn_tab_height - 3)?(osn_tab_height - 3):0;
} }
@@ -167,10 +161,10 @@ function Osn_tab_pos()
function Main() function Main()
{ //alert( document.getElementById('osn_tab').offsetTop);
//---CROSS
if(isIE)
{ {
//alert( document.getElementById('osn_tab').offsetTop);
//---CROSS
if (isIE) {
document.getElementById('top_menu').style.position = 'absolute'; document.getElementById('top_menu').style.position = 'absolute';
document.getElementById('layer_menu').style.position = 'absolute'; document.getElementById('layer_menu').style.position = 'absolute';
} }
@@ -189,14 +183,14 @@ function Main()
} }
//---------------------------------------- new ----------------------------------------- //-------------------------------- new -----------------------------------------
function Rezize_osn_tab() function Rezize_osn_tab()
{ {
var max_X = max_Y = 0; var max_X = 0;
for (key in j_tabs) var max_Y = 0;
{ for (key in j_tabs) {
k_x = parseInt(document.getElementById(key).style.left) + document.getElementById(key).offsetWidth; var k_x = parseInt(document.getElementById(key).style.left) + document.getElementById(key).offsetWidth;
k_y = parseInt(document.getElementById(key).style.top) + document.getElementById(key).offsetHeight; var k_y = parseInt(document.getElementById(key).style.top) + document.getElementById(key).offsetHeight;
max_X = max_X < k_x ? k_x : max_X; max_X = max_X < k_x ? k_x : max_X;
max_Y = max_Y < k_y ? k_y : max_Y; max_Y = max_Y < k_y ? k_y : max_Y;
} }
@@ -206,13 +200,15 @@ function Rezize_osn_tab()
document.getElementById('osn_tab').style.width = osn_tab_width; document.getElementById('osn_tab').style.width = osn_tab_width;
document.getElementById('osn_tab').style.height = osn_tab_height; document.getElementById('osn_tab').style.height = osn_tab_height;
} }
//-------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
function Re_load() function Re_load()
{ {
Rezize_osn_tab(); Rezize_osn_tab();
var n; var n;
var x1;
var x2;
var a = new Array(); var a = new Array();
Clear(); Clear();
for (K in contr) for (K in contr)
@@ -226,22 +222,46 @@ function Re_load()
var x1_right = x1_left + document.getElementById(key2).offsetWidth; var x1_right = x1_left + document.getElementById(key2).offsetWidth;
var x2_left = document.getElementById(contr[K][key][key2][key3][0]).offsetLeft; var x2_left = document.getElementById(contr[K][key][key2][key3][0]).offsetLeft;
var x2_right = x2_left + document.getElementById(contr[K][key][key2][key3][0]).offsetWidth; var x2_right = x2_left + document.getElementById(contr[K][key][key2][key3][0]).offsetWidth;
a[0] = Math.abs( x1_left - x2_left ); a[1] = Math.abs(x1_left - x2_right); a[0] = Math.abs(x1_left - x2_left);
a[2] = Math.abs( x1_right - x2_left ); a[3] = Math.abs(x1_right - x2_right); a[1] = Math.abs(x1_left - x2_right);
a[2] = Math.abs(x1_right - x2_left);
a[3] = Math.abs(x1_right - x2_right);
n = s_left = s_right = 0; n = s_left = s_right = 0;
for(var i=1;i<4;i++) for (var i = 1; i < 4; i++) {
if(a[n]>a[i])n=i; if (a[n] > a[i]) {
if(n==1){ x1 = x1_left-sm_s; x2 = x2_right+sm_s; if(x1<x2)n=0;} n=i;
if(n==2){ x1 = x1_right+sm_s; x2 = x2_left-sm_s; if(x1>x2)n=0;} }
if(n==3){ x1 = x1_right+sm_s; x2 = x2_right+sm_s; s_right = 1; } }
if(n==0){ x1 = x1_left-sm_s; x2 = x2_left-sm_s; s_left = 1; } if (n == 1) {
x1 = x1_left - sm_s;
x2 = x2_right + sm_s;
if (x1 < x2) {
n = 0;
}
}
if (n == 2) {
x1 = x1_right + sm_s;
x2 = x2_left - sm_s;
if (x1 > x2) {
n = 0;
}
}
if (n == 3) {
x1 = x1_right + sm_s;
x2 = x2_right + sm_s;
s_right = 1;
}
if (n == 0) {
x1 = x1_left - sm_s;
x2 = x2_left - sm_s;
s_left = 1;
}
//alert(key2+"."+key3); //alert(key2+"."+key3);
var y1 = document.getElementById(key2).offsetTop + document.getElementById(key2 + "." + key3).offsetTop + height_field; var y1 = document.getElementById(key2).offsetTop + document.getElementById(key2 + "." + key3).offsetTop + height_field;
//alert(1); //alert(1);
var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop + var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop +
document.getElementById(contr[K][key][key2][key3][0] + "." + contr[K][key][key2][key3][1]).offsetTop + height_field; document.getElementById(contr[K][key][key2][key3][0] + "." + contr[K][key][key2][key3][1]).offsetTop + height_field;
Line0(x1 - sm_x, y1 - sm_y, x2 - sm_x, y2 - sm_y, "rgba(0,100,150,1)"); Line0(x1 - sm_x, y1 - sm_y, x2 - sm_x, y2 - sm_y, "rgba(0,100,150,1)");
} }
} }
@@ -259,11 +279,12 @@ function Line(x1,y1,x2,y2,color_line)
function Line0(x1, y1, x2, y2, color_line) function Line0(x1, y1, x2, y2, color_line)
{ {
if(ON_angular_direct) if (ON_angular_direct) {
Line2(x1, y1, x2, y2, color_line); Line2(x1, y1, x2, y2, color_line);
else } else {
Line3(x1, y1, x2, y2, color_line); Line3(x1, y1, x2, y2, color_line);
} }
}
function Line2(x1, y1, x2, y2, color_line) function Line2(x1, y1, x2, y2, color_line)
{ {
@@ -273,18 +294,19 @@ function Line2(x1,y1,x2,y2,color_line)
Circle(x1, y1, 3, 3, "rgba(0,0,255,1)"); Circle(x1, y1, 3, 3, "rgba(0,0,255,1)");
Rect(x2 - 1, y2 - 2, 4, 4, "rgba(0,0,255,1)"); Rect(x2 - 1, y2 - 2, 4, 4, "rgba(0,0,255,1)");
if(s_right) if (s_right) {
{ x1_ += sm_add;
x1_ += sm_add; x2_ += sm_add; x2_ += sm_add;
} else if (s_left) {
x1_ -= sm_add;
x2_ -= sm_add;
} else if (x1 < x2) {
x1_ += sm_add;
x2_ -= sm_add;
} else {
x1_ -= sm_add;
x2_ += sm_add;
} }
else if(s_left)
{
x1_ -= sm_add; x2_ -= sm_add;
}
else
if(x1 < x2) { x1_ += sm_add; x2_ -= sm_add; }
else { x1_ -= sm_add; x2_ += sm_add; }
Line(x1, y1, x1_, y1, color_line); Line(x1, y1, x1_, y1, color_line);
Line(x2, y2, x2_, y2, color_line); Line(x2, y2, x2_, y2, color_line);
@@ -299,30 +321,40 @@ function Line3(x1,y1,x2,y2,color_line)
Rect(x2 - 1, y2 - 2, 4, 4, "rgba(0,0,255,1)"); Rect(x2 - 1, y2 - 2, 4, 4, "rgba(0,0,255,1)");
var x_s = (x1 + x2) / 2; var x_s = (x1 + x2) / 2;
if(s_right) if (s_right) {
{ if (x1 < x2) {
if(x1 < x2) { x1_ += x2 - x1 + sm_add; x2_ += sm_add; } x1_ += x2 - x1 + sm_add;
else { x2_ += x1 - x2 + sm_add; x1_ += sm_add; } x2_ += sm_add;
} else {
Line(x1,y1,x1_,y1,color_line); x2_ += x1 - x2 + sm_add;
Line(x2,y2,x2_,y2,color_line); x1_ += sm_add;
Line(x1_,y1,x2_,y2,color_line);
return 0;
} }
if(s_left)
{
if(x1 < x2) { x2_ -= x2 - x1 + sm_add; x1_ -= sm_add; }
else { x1_ -= x1 - x2 + sm_add; x2_ -= sm_add; }
Line(x1, y1, x1_, y1, color_line); Line(x1, y1, x1_, y1, color_line);
Line(x2, y2, x2_, y2, color_line); Line(x2, y2, x2_, y2, color_line);
Line(x1_, y1, x2_, y2, color_line); Line(x1_, y1, x2_, y2, color_line);
return 0; return; //0
}
if (s_left) {
if (x1 < x2) {
x2_ -= x2 - x1 + sm_add;
x1_ -= sm_add;
} else {
x1_ -= x1 - x2 + sm_add;
x2_ -= sm_add;
}
Line(x1, y1, x1_, y1, color_line);
Line(x2, y2, x2_, y2, color_line);
Line(x1_, y1, x2_, y2, color_line);
return; //0
} }
Line(x1, y1, x_s, y1, color_line); Line(x1, y1, x_s, y1, color_line);
Line(x_s, y2, x2, y2, color_line); Line(x_s, y2, x2, y2, color_line);
Line(x_s, y1, x_s, y2, color_line); Line(x_s, y1, x_s, y2, color_line);
//return ???
} }
function Circle(x, y, r, w, color) function Circle(x, y, r, w, color)
@@ -350,11 +382,10 @@ function Rect(x1,y1,w,h,color)
ctx.fillRect(x1, y1, w, h); ctx.fillRect(x1, y1, w, h);
} }
//---------------------------------------------- SAVE --------------------------------------------------- //------------------------------ SAVE ------------------------------------------
function Save(url) // (del?) no for pdf function Save(url) // (del?) no for pdf
{ {
for (key in j_tabs) for (key in j_tabs) {
{
document.getElementById('t_x['+key+']').value=parseInt(document.getElementById(key).style.left); document.getElementById('t_x['+key+']').value=parseInt(document.getElementById(key).style.left);
document.getElementById('t_y['+key+']').value=parseInt(document.getElementById(key).style.top); document.getElementById('t_y['+key+']').value=parseInt(document.getElementById(key).style.top);
document.getElementById('t_v['+key+']').value=document.getElementById('_|_tbody_'+key).style.display == 'none' ? 0 : 1; document.getElementById('t_v['+key+']').value=document.getElementById('_|_tbody_'+key).style.display == 'none' ? 0 : 1;
@@ -367,8 +398,7 @@ function Save(url) // (del?) no for pdf
function Get_url_pos() function Get_url_pos()
{ {
var poststr = ''; var poststr = '';
for (key in j_tabs) for (key in j_tabs) {
{
poststr += '&t_x['+key+']=' + parseInt(document.getElementById(key).style.left); poststr += '&t_x['+key+']=' + parseInt(document.getElementById(key).style.left);
poststr += '&t_y['+key+']=' + parseInt(document.getElementById(key).style.top); poststr += '&t_y['+key+']=' + parseInt(document.getElementById(key).style.top);
poststr += '&t_v['+key+']=' + (document.getElementById('_|_tbody_'+key).style.display == 'none' ? 0 : 1); poststr += '&t_v['+key+']=' + (document.getElementById('_|_tbody_'+key).style.display == 'none' ? 0 : 1);
@@ -393,8 +423,7 @@ function Grid()
if (isIE) { // correct for IE if (isIE) { // correct for IE
document.getElementById('grid_button').className = 'M_butt_Selected_down_IE'; document.getElementById('grid_button').className = 'M_butt_Selected_down_IE';
} }
} } else {
else {
document.getElementById('grid_button').className = 'M_butt'; document.getElementById('grid_button').className = 'M_butt';
ON_grid = 0; ON_grid = 0;
} }
@@ -409,20 +438,20 @@ function Angular_direct()
if (isIE) { // correct for IE if (isIE) { // correct for IE
document.getElementById('angular_direct_button').className = 'M_butt_Selected_down_IE'; document.getElementById('angular_direct_button').className = 'M_butt_Selected_down_IE';
} }
} } else {
else {
ON_angular_direct = 1; ON_angular_direct = 1;
document.getElementById('angular_direct_button').className = 'M_butt'; document.getElementById('angular_direct_button').className = 'M_butt';
} }
Re_load(); Re_load();
} }
//+++++++++++++++++++++++++++++++++++++++++++++++++++++ RELATION ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++ RELATION ++++++++++++++++++++++++++++++++++++++
function Start_relation() function Start_relation()
{ {
if(ON_display_field) return; if (ON_display_field) {
return;
}
if(!ON_relation ) if (!ON_relation) {
{
document.getElementById('InnoDB_relation').style.display = ''; document.getElementById('InnoDB_relation').style.display = '';
ON_relation = 1; ON_relation = 1;
document.getElementById('hint').innerHTML = LangSelectReferencedKey; document.getElementById('hint').innerHTML = LangSelectReferencedKey;
@@ -432,9 +461,7 @@ function Start_relation()
if (isIE) { // correct for IE if (isIE) { // correct for IE
document.getElementById('rel_button').className = 'M_butt_Selected_down_IE'; document.getElementById('rel_button').className = 'M_butt_Selected_down_IE';
} }
} } else {
else
{
document.getElementById('hint').innerHTML = ""; document.getElementById('hint').innerHTML = "";
document.getElementById('hint').style.visibility = "hidden"; document.getElementById('hint').style.visibility = "hidden";
document.getElementById('rel_button').className = 'M_butt'; document.getElementById('rel_button').className = 'M_butt';
@@ -445,20 +472,24 @@ function Start_relation()
function Click_field(T, f, PK) // table field function Click_field(T, f, PK) // table field
{ {
if (ON_relation) if (ON_relation) {
{ if (!click_field) {
if(!click_field) //.style.display=='none' .style.visibility = "hidden"
{//.style.display=='none' .style.visibility = "hidden" if (!PK) {
if(!PK) { alert(LangPleaseSelectPrimaryOrUniqueKey); return 0; }//PK alert(LangPleaseSelectPrimaryOrUniqueKey);
if(j_tabs[db+'.'+T]!='INNODB') document.getElementById('InnoDB_relation').style.display='none'; return;// 0;
}//PK
if (j_tabs[db + '.' + T] != 'INNODB') {
document.getElementById('InnoDB_relation').style.display = 'none';
}
click_field = 1; click_field = 1;
link_relation = "T1=" + T + "&F1=" + f; link_relation = "T1=" + T + "&F1=" + f;
document.getElementById('hint').innerHTML = LangSelectForeignKey; document.getElementById('hint').innerHTML = LangSelectForeignKey;
} } else {
else
{
Start_relation(); // hidden hint... Start_relation(); // hidden hint...
if(j_tabs[db+'.'+T]!='INNODB' || !PK ) document.getElementById('InnoDB_relation').style.display='none'; if (j_tabs[db + '.' + T] != 'INNODB' || !PK) {
document.getElementById('InnoDB_relation').style.display = 'none';
}
document.getElementById('layer_new_relation').style.left = Glob_X - (document.getElementById('layer_new_relation').offsetWidth>>1); document.getElementById('layer_new_relation').style.left = Glob_X - (document.getElementById('layer_new_relation').offsetWidth>>1);
document.getElementById('layer_new_relation').style.top = Glob_Y - document.getElementById('layer_new_relation').offsetHeight - 10; document.getElementById('layer_new_relation').style.top = Glob_Y - document.getElementById('layer_new_relation').offsetHeight - 10;
document.getElementById('layer_new_relation').style.visibility = "visible"; document.getElementById('layer_new_relation').style.visibility = "visible";
@@ -466,22 +497,19 @@ function Click_field(T,f,PK) // table field
} }
} }
if(ON_display_field) if (ON_display_field) {
{ // if is display field
if(display_field[T] == f) // if is display field if (display_field[T] == f) {
{ //alert(T); //alert(T);
//s = '';for(k in display_field)s += k + ' = ' + display_field[k] + ',';alert(s); //s = '';for(k in display_field)s += k + ' = ' + display_field[k] + ',';alert(s);
old_class = 'tab_field'; old_class = 'tab_field';
//display_field.splice(T, 1); //display_field.splice(T, 1);
delete display_field[T]; delete display_field[T];
//s = '';for(k in display_field)s += k + ' = ' + display_field[k] + ', ';alert(s); //s = '';for(k in display_field)s += k + ' = ' + display_field[k] + ', ';alert(s);
//n = 0;for(k in display_field)n++;alert(n); //n = 0;for(k in display_field)n++;alert(n);
} } else {
else
{
old_class = 'tab_field_3'; old_class = 'tab_field_3';
if(display_field[T]) if (display_field[T]) {
{
document.getElementById('_|_tr_' + T + '.' + display_field[T]).className = 'tab_field'; document.getElementById('_|_tr_' + T + '.' + display_field[T]).className = 'tab_field';
//display_field.splice(T, 1); //display_field.splice(T, 1);
delete display_field[T]; delete display_field[T];
@@ -507,7 +535,7 @@ function New_relation()
makeRequest('pmd_relation_new.php', link_relation); makeRequest('pmd_relation_new.php', link_relation);
} }
//----------------------------------------------------- create tables ----------------------------------------------------- //-------------------------- create tables -------------------------------------
function Start_table_new() function Start_table_new()
{ {
@@ -518,7 +546,7 @@ function Start_tab_upd(table)
{ {
window.location.href = 'tbl_structure.php?db=' + db + '&token=' + token + '&table=' + table; window.location.href = 'tbl_structure.php?db=' + db + '&token=' + token + '&table=' + table;
} }
//----------------------------------------------------- hide tables ----------------------------------------------------- //--------------------------- hide tables --------------------------------------
function Small_tab_all(id_this) // max/min all tables function Small_tab_all(id_this) // max/min all tables
{ {
@@ -526,19 +554,20 @@ function Small_tab_all(id_this) // max/min all tables
alert(LangIEnotSupport); alert(LangIEnotSupport);
return; return;
} }
if(id_this.alt=="v") if (id_this.alt == "v") {
{ for (key in j_tabs) {
for (key in j_tabs) if (document.getElementById('_|_hide_tbody_'+key).innerHTML == "v") {
if(document.getElementById('_|_hide_tbody_'+key).innerHTML=="v")
Small_tab(key, 0); Small_tab(key, 0);
}
}
id_this.alt = ">"; id_this.alt = ">";
id_this.src = "pmd/images/rightarrow1.png"; id_this.src = "pmd/images/rightarrow1.png";
} } else {
else for (key in j_tabs) {
{ if (document.getElementById('_|_hide_tbody_'+key).innerHTML != "v") {
for (key in j_tabs)
if(document.getElementById('_|_hide_tbody_'+key).innerHTML!="v")
Small_tab(key, 0); Small_tab(key, 0);
}
}
id_this.alt = "v"; id_this.alt = "v";
id_this.src = "pmd/images/downarrow1.png"; id_this.src = "pmd/images/downarrow1.png";
} }
@@ -551,20 +580,21 @@ function Small_tab_invert() // invert max/min all tables
alert(LangIEnotSupport); alert(LangIEnotSupport);
return; return;
} }
for (key in j_tabs) for (key in j_tabs) {
Small_tab(key, 0); Small_tab(key, 0);
}
Re_load(); Re_load();
} }
function Small_tab_refresh() function Small_tab_refresh()
{ {
for (key in j_tabs) for (key in j_tabs) {
if(document.getElementById('_|_hide_tbody_'+key).innerHTML!="v") if(document.getElementById('_|_hide_tbody_'+key).innerHTML != "v") {
{
Small_tab(key, 0); Small_tab(key, 0);
Small_tab(key, 0); Small_tab(key, 0);
} }
} }
}
function Small_tab(t, re_load) function Small_tab(t, re_load)
{ {
@@ -573,35 +603,37 @@ function Small_tab(t,re_load)
var id_t = document.getElementById(t); var id_t = document.getElementById(t);
id_t.style.width = id_t.offsetWidth; id_t.style.width = id_t.offsetWidth;
if(id_this.innerHTML=="v") if (id_this.innerHTML == "v") {
{
//---CROSS //---CROSS
if(isIE) return; //IE not supported if (isIE) {
return; //IE not supported
}
id.style.display = 'none'; id.style.display = 'none';
id_this.innerHTML = '>'; id_this.innerHTML = '>';
} } else {
else
{
id.style.display = ''; id.style.display = '';
id_this.innerHTML = 'v'; id_this.innerHTML = 'v';
} }
if(re_load) Re_load(); if (re_load) {
Re_load();
} }
//----------------------------------------------------------------------------------------------------------------- }
//------------------------------------------------------------------------------
function Select_tab(t) function Select_tab(t)
{ {
var id_zag = document.getElementById('_|_zag_' + t); var id_zag = document.getElementById('_|_zag_' + t);
if(id_zag.className != 'tab_zag_3') if (id_zag.className != 'tab_zag_3') {
document.getElementById('_|_zag_' + t).className = 'tab_zag_2'; document.getElementById('_|_zag_' + t).className = 'tab_zag_2';
else } else {
document.getElementById('_|_zag_' + t).className = 'tab_zag'; document.getElementById('_|_zag_' + t).className = 'tab_zag';
}
//---------- //----------
var id_t = document.getElementById(t); var id_t = document.getElementById(t);
window.scrollTo(parseInt(id_t.style.left) - 300, parseInt(id_t.style.top) - 300); window.scrollTo(parseInt(id_t.style.left) - 300, parseInt(id_t.style.top) - 300);
setTimeout(function(){document.getElementById('_|_zag_' + t).className = 'tab_zag';}, 800); setTimeout(function(){document.getElementById('_|_zag_' + t).className = 'tab_zag';}, 800);
} }
//----------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
function Canvas_click(id) function Canvas_click(id)
{ {
@@ -612,41 +644,66 @@ function Canvas_click(id)
for (K in contr) for (K in contr)
for (key in contr[K]) for (key in contr[K])
for (key2 in contr[K][key]) for (key2 in contr[K][key])
for (key3 in contr[K][key][key2]) for (key3 in contr[K][key][key2]) {
{
if (!document.getElementById("check_vis_"+key2).checked || if (!document.getElementById("check_vis_"+key2).checked ||
!document.getElementById("check_vis_"+contr[K][key][key2][key3][0]).checked) continue; // if hide !document.getElementById("check_vis_"+contr[K][key][key2][key3][0]).checked) continue; // if hide
var x1_left = document.getElementById(key2).offsetLeft + 1;//document.getElementById(key2+"."+key3).offsetLeft; var x1_left = document.getElementById(key2).offsetLeft + 1;//document.getElementById(key2+"."+key3).offsetLeft;
var x1_right = x1_left + document.getElementById(key2).offsetWidth; var x1_right = x1_left + document.getElementById(key2).offsetWidth;
var x2_left = document.getElementById(contr[K][key][key2][key3][0]).offsetLeft;//+document.getElementById(contr[K][key2][key3][0]+"."+contr[K][key2][key3][1]).offsetLeft var x2_left = document.getElementById(contr[K][key][key2][key3][0]).offsetLeft;//+document.getElementById(contr[K][key2][key3][0]+"."+contr[K][key2][key3][1]).offsetLeft
var x2_right = x2_left + document.getElementById(contr[K][key][key2][key3][0]).offsetWidth; var x2_right = x2_left + document.getElementById(contr[K][key][key2][key3][0]).offsetWidth;
a[0] = Math.abs( x1_left - x2_left ); a[1] = Math.abs(x1_left - x2_right); a[0] = Math.abs(x1_left - x2_left);
a[2] = Math.abs( x1_right - x2_left ); a[3] = Math.abs(x1_right - x2_right); a[1] = Math.abs(x1_left - x2_right);
a[2] = Math.abs(x1_right - x2_left);
a[3] = Math.abs(x1_right - x2_right);
n = s_left = s_right = 0; n = s_left = s_right = 0;
for(var i=1;i<4;i++) for (var i = 1; i < 4; i++) {
if(a[n]>a[i])n=i; if (a[n] > a[i]) {
if(n==1){ x1 = x1_left-sm_s; x2 = x2_right+sm_s; if(x1<x2)n=0;} n = i;
if(n==2){ x1 = x1_right+sm_s; x2 = x2_left-sm_s; if(x1>x2)n=0;} }
if(n==3){ x1 = x1_right+sm_s; x2 = x2_right+sm_s; s_right = 1; } }
if(n==0){ x1 = x1_left-sm_s; x2 = x2_left-sm_s; s_left = 1; } if (n == 1) {
x1 = x1_left - sm_s;
x2 = x2_right + sm_s;
if (x1 < x2) {
n = 0;
}
}
if (n == 2) {
x1 = x1_right + sm_s;
x2 = x2_left - sm_s;
if (x1 > x2) {
n = 0;
}
}
if (n == 3) {
x1 = x1_right + sm_s;
x2 = x2_right + sm_s;
s_right = 1;
}
if (n == 0) {
x1 = x1_left - sm_s;
x2 = x2_left - sm_s;
s_left = 1;
}
var y1 = document.getElementById(key2).offsetTop + document.getElementById(key2+"."+key3).offsetTop + height_field; var y1 = document.getElementById(key2).offsetTop + document.getElementById(key2+"."+key3).offsetTop + height_field;
var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop + var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop +
document.getElementById(contr[K][key][key2][key3][0]+"."+contr[K][key][key2][key3][1]).offsetTop + height_field; document.getElementById(contr[K][key][key2][key3][0]+"."+contr[K][key][key2][key3][1]).offsetTop + height_field;
if( !selected && Glob_X > x1-10 && Glob_X < x1+10 && Glob_Y > y1-7 && Glob_Y < y1+7) if (!selected && Glob_X > x1 - 10 && Glob_X < x1 + 10 && Glob_Y > y1 - 7 && Glob_Y < y1 + 7) {
{
Line0(x1 - sm_x, y1 - sm_y, x2 - sm_x, y2 - sm_y, "rgba(255,0,0,1)"); Line0(x1 - sm_x, y1 - sm_y, x2 - sm_x, y2 - sm_y, "rgba(255,0,0,1)");
selected = 1; // Rect(x1-sm_x,y1-sm_y,10,10,"rgba(0,255,0,1)"); selected = 1; // Rect(x1-sm_x,y1-sm_y,10,10,"rgba(0,255,0,1)");
relation_name = key; // relation_name = key; //
Key0=contr[K][key][key2][key3][0]; Key1=contr[K][key][key2][key3][1]; Key0 = contr[K][key][key2][key3][0];
Key1 = contr[K][key][key2][key3][1];
Key2 = key2; Key3 = key3; Key2 = key2; Key3 = key3;
Key = K; Key = K;
} } else {
else
Line0(x1 - sm_x, y1 - sm_y, x2 - sm_x, y2 - sm_y, "rgba(0,100,150,1)"); Line0(x1 - sm_x, y1 - sm_y, x2 - sm_x, y2 - sm_y, "rgba(0,100,150,1)");
} }
if( selected ) // select relations }
{ //alert(Key0+' - '+Key1+' - '+Key2+' - '+Key3); if (selected) {
// select relations
//alert(Key0+' - '+Key1+' - '+Key2+' - '+Key3);
document.getElementById('layer_upd_relation').style.left = Glob_X - (document.getElementById('layer_upd_relation').offsetWidth>>1); document.getElementById('layer_upd_relation').style.left = Glob_X - (document.getElementById('layer_upd_relation').offsetWidth>>1);
document.getElementById('layer_upd_relation').style.top = Glob_Y - document.getElementById('layer_upd_relation').offsetHeight - 10; document.getElementById('layer_upd_relation').style.top = Glob_Y - document.getElementById('layer_upd_relation').offsetHeight - 10;
document.getElementById('layer_upd_relation').style.visibility = 'visible'; document.getElementById('layer_upd_relation').style.visibility = 'visible';
@@ -664,21 +721,34 @@ function Upd_relation()
function VisibleTab(id, t_n) function VisibleTab(id, t_n)
{ {
if(id.checked)document.getElementById(t_n).style.visibility = 'visible'; if (id.checked) {
else document.getElementById(t_n).style.visibility = 'hidden'; document.getElementById(t_n).style.visibility = 'visible';
} else {
document.getElementById(t_n).style.visibility = 'hidden';
}
Re_load(); Re_load();
} }
function Hide_tab_all(id_this) // max/min all tables function Hide_tab_all(id_this) // max/min all tables
{ {
if(id_this.alt == 'v') { id_this.alt='>';id_this.src="pmd/images/rightarrow1.png"; } if (id_this.alt == 'v') {
else { id_this.alt='v';id_this.src="pmd/images/downarrow1.png"; } id_this.alt = '>';
id_this.src = "pmd/images/rightarrow1.png";
} else {
id_this.alt = 'v';
id_this.src = "pmd/images/downarrow1.png";
}
var E = document.form1; var E = document.form1;
for (i=0;i<E.elements.length;i++) for (i = 0; i < E.elements.length; i++) {
if(E.elements[i].type=="checkbox" && E.elements[i].id.substring( 0 , 10) == 'check_vis_') if (E.elements[i].type == "checkbox" && E.elements[i].id.substring(0, 10) == 'check_vis_') {
{ if (id_this.alt == 'v') {
if(id_this.alt == 'v') { E.elements[i].checked = true; document.getElementById(E.elements[i].value).style.visibility = 'visible';} E.elements[i].checked = true;
else { E.elements[i].checked = false; document.getElementById(E.elements[i].value).style.visibility = 'hidden';} document.getElementById(E.elements[i].value).style.visibility = 'visible';
} else {
E.elements[i].checked = false;
document.getElementById(E.elements[i].value).style.visibility = 'hidden';
}
}
} }
Re_load(); Re_load();
} }
@@ -686,8 +756,12 @@ function Hide_tab_all(id_this) // max/min all tables
function in_array_k(x, m) function in_array_k(x, m)
{ {
var b = 0; var b = 0;
for (u in m) for (u in m) {
if(x == u){ b=1; break; } if (x == u) {
b=1;
break;
}
}
return b; return b;
} }
@@ -701,24 +775,32 @@ function No_have_constr(id_this)
a[key2] = a[contr[K][key][key2][key3][0]] = 1; // exist constr a[key2] = a[contr[K][key][key2][key3][0]] = 1; // exist constr
if (id_this.alt == 'v') {
if(id_this.alt == 'v') { id_this.alt='>';id_this.src="pmd/images/rightarrow2.png"; } id_this.alt = '>';
else { id_this.alt='v';id_this.src="pmd/images/downarrow2.png"; } id_this.src = "pmd/images/rightarrow2.png";
} else {
id_this.alt = 'v';
id_this.src = "pmd/images/downarrow2.png";
}
var E = document.form1; var E = document.form1;
for (i=0;i<E.elements.length;i++) for (i = 0; i < E.elements.length; i++) {
if (E.elements[i].type == "checkbox" && E.elements[i].id.substring(0, 10) == 'check_vis_') if (E.elements[i].type == "checkbox" && E.elements[i].id.substring(0, 10) == 'check_vis_')
{ {
if (!in_array_k(E.elements[i].value, a)) if (!in_array_k(E.elements[i].value, a))
if(id_this.alt == 'v') if (id_this.alt == 'v') {
{ E.elements[i].checked = true; document.getElementById(E.elements[i].value).style.visibility = 'visible';} E.elements[i].checked = true;
else { E.elements[i].checked = false; document.getElementById(E.elements[i].value).style.visibility = 'hidden';} document.getElementById(E.elements[i].value).style.visibility = 'visible';
} else {
E.elements[i].checked = false;
document.getElementById(E.elements[i].value).style.visibility = 'hidden';
}
}
} }
} }
function Help() function Help()
{ {
var WinHelp = var WinHelp = window.open("pmd_help.php", "wind1", "top=200,left=400,width=300,height=200,resizable=yes,scrollbars=yes,menubar=no");
window.open("pmd_help.php","wind1", "top=200,left=400,width=300,height=200,resizable=yes,scrollbars=yes,menubar=no");
} }
function PDF_save() function PDF_save()
@@ -728,16 +810,15 @@ function PDF_save()
Save('pmd_pdf.php?token=' + token + '&db=' + db); Save('pmd_pdf.php?token=' + token + '&db=' + db);
} }
function General_scroll() function General_scroll()
{ {
/* /*
if(!document.getElementById('show_relation_olways').checked) if (!document.getElementById('show_relation_olways').checked) {
{
document.getElementById("canvas").style.visibility = 'hidden'; document.getElementById("canvas").style.visibility = 'hidden';
clearTimeout(timeoutID); clearTimeout(timeoutID);
timeoutID = setTimeout(General_scroll_end, 500); timeoutID = setTimeout(General_scroll_end, 500);
}*/ }
*/
//if (timeoutID) //if (timeoutID)
clearTimeout(timeoutID); clearTimeout(timeoutID);
timeoutID = setTimeout timeoutID = setTimeout
@@ -756,57 +837,53 @@ function General_scroll()
/* /*
function General_scroll_end() function General_scroll_end()
{ {
// document.getElementById('layer_menu').style.left = document.body.scrollLeft; document.getElementById('layer_menu').style.left = document.body.scrollLeft;
// document.getElementById('layer_menu').style.top = document.body.scrollTop + document.getElementById('top_menu').offsetHeight; document.getElementById('layer_menu').style.top = document.body.scrollTop + document.getElementById('top_menu').offsetHeight;
//if(isIE) if (isIE) {
//{ document.getElementById('layer_menu').style.left = document.body.scrollLeft;
// document.getElementById('layer_menu').style.left = document.body.scrollLeft; document.getElementById('layer_menu').style.top = document.body.scrollTop + document.getElementById('top_menu').offsetHeight;
// document.getElementById('layer_menu').style.top = document.body.scrollTop + document.getElementById('top_menu').offsetHeight; }
//}
document.getElementById("canvas").style.visibility = 'visible'; document.getElementById("canvas").style.visibility = 'visible';
} }
*/ */
function Show_left_menu(id_this) // max/min all tables function Show_left_menu(id_this) // max/min all tables
{ {
if(id_this.alt=="v") if (id_this.alt == "v") {
{
document.getElementById("layer_menu").style.top = document.getElementById('top_menu').offsetHeight; document.getElementById("layer_menu").style.top = document.getElementById('top_menu').offsetHeight;
document.getElementById("layer_menu").style.visibility = 'visible'; document.getElementById("layer_menu").style.visibility = 'visible';
id_this.alt = ">"; id_this.alt = ">";
id_this.src = "pmd/images/uparrow2_m.png"; id_this.src = "pmd/images/uparrow2_m.png";
if(isIE) General_scroll(); if (isIE) {
General_scroll();
} }
else } else {
{
document.getElementById("layer_menu").style.top = -1000; //fast scroll document.getElementById("layer_menu").style.top = -1000; //fast scroll
document.getElementById("layer_menu").style.visibility = 'hidden'; document.getElementById("layer_menu").style.visibility = 'hidden';
id_this.alt = "v"; id_this.alt = "v";
id_this.src = "pmd/images/downarrow2_m.png"; id_this.src = "pmd/images/downarrow2_m.png";
} }
} }
//---------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
function Top_menu_right(id_this) function Top_menu_right(id_this)
{ {
if(id_this.alt==">") if (id_this.alt == ">") {
{
document.getElementById('top_menu').style.marginLeft = document.getElementById('top_menu').offsetWidth; // = 350 document.getElementById('top_menu').style.marginLeft = document.getElementById('top_menu').offsetWidth; // = 350
id_this.alt = "<"; id_this.alt = "<";
id_this.src = "pmd/images/2leftarrow_m.png"; id_this.src = "pmd/images/2leftarrow_m.png";
} } else {
else
{
document.getElementById('top_menu').style.marginLeft = 0; document.getElementById('top_menu').style.marginLeft = 0;
id_this.alt = ">"; id_this.alt = ">";
id_this.src = "pmd/images/2rightarrow_m.png"; id_this.src = "pmd/images/2rightarrow_m.png";
} }
} }
//---------------------------------------------------------------------------------------- //------------------------------------------------------------------------------
function Start_display_field() function Start_display_field()
{ {
if( ON_relation ) return; if (ON_relation) {
if( !ON_display_field ) return;
{ }
if (!ON_display_field) {
ON_display_field = 1; ON_display_field = 1;
document.getElementById('hint').innerHTML = LangChangeDisplay; document.getElementById('hint').innerHTML = LangChangeDisplay;
document.getElementById('hint').style.visibility = "visible"; document.getElementById('hint').style.visibility = "visible";
@@ -815,9 +892,7 @@ function Start_display_field()
if (isIE) { // correct for IE if (isIE) { // correct for IE
document.getElementById('display_field_button').className = 'M_butt_Selected_down_IE'; document.getElementById('display_field_button').className = 'M_butt_Selected_down_IE';
} }
} } else {
else
{
document.getElementById('hint').innerHTML = ""; document.getElementById('hint').innerHTML = "";
document.getElementById('hint').style.visibility = "hidden"; document.getElementById('hint').style.visibility = "hidden";
document.getElementById('display_field_button').className = 'M_butt'; document.getElementById('display_field_button').className = 'M_butt';