Subversion Repositories DevTools

Rev

Rev 5506 | Rev 6616 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5506 Rev 6613
Line 6... Line 6...
6
var is_opera = ((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0;
6
var is_opera = ((navigator.userAgent.indexOf("Opera6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0;
7
//netscape, safari, mozilla behave the same???
7
//netscape, safari, mozilla behave the same???
8
var is_netscape = (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0;
8
var is_netscape = (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0;
9
var ajaxdivname;
9
var ajaxdivname;
10
 
10
 
-
 
11
//
-
 
12
//	Load/Hide/Show an Ajax expander
-
 
13
//	BaseId - Base for IDs to process
-
 
14
//			 IMG_BaseId - image to to toggle
-
 
15
//             TGL_BaseId - element to show/hide if found else use BaseId
-
 
16
//             BaseId - Div to load Ajax into
-
 
17
//	url - Url used to load subcontrol
-
 
18
function ToggleLoadControl(baseId, url)
-
 
19
{
-
 
20
  var img, dmode;
-
 
21
  var imgel = MM_findObj("IMG_" + baseId);
-
 
22
  var shel =  MM_findObj("TGL_" + baseId);
-
 
23
  var divel = MM_findObj(baseId);
-
 
24
  if ( !shel ) {
-
 
25
      shel = divel;
-
 
26
  }
-
 
27
  var showing = imgel.getAttribute("data-show");
-
 
28
  if(showing == 1) {
-
 
29
      img = "images/bt_minus.gif";
-
 
30
      dmode = '';
-
 
31
      showing = 2
-
 
32
  } else if(showing == 2) {
-
 
33
      img = "images/bt_plus.gif";
-
 
34
      dmode = 'none';
-
 
35
      showing = 1;
-
 
36
  } else {
-
 
37
      img = "images/bt_minus.gif";
-
 
38
      dmode = '';
-
 
39
      showing = 2;
-
 
40
 
-
 
41
      // Set div name for ajax loading
-
 
42
      ajaxdivname = baseId;
-
 
43
 
-
 
44
      //Create the xmlHttp object to use in the request
-
 
45
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
-
 
46
      // This is non-blocking (asynchronous)
-
 
47
      xmlHttp = GetXmlHttpObject(stateChangeHandler);
11
 
48
 
-
 
49
      //Send the xmlHttp get to the specified url
-
 
50
      xmlHttp_Get(xmlHttp, url);
-
 
51
  }
-
 
52
  // Update image and attributes
-
 
53
  imgel.src = img;
-
 
54
  shel.style.display = dmode;
-
 
55
  imgel.setAttribute("data-show", showing);
-
 
56
}
12
 
57
 
13
//stateChangeHandler will fire when the state has changed, i.e. data is received back
58
//stateChangeHandler will fire when the state has changed, i.e. data is received back
14
// This is non-blocking (asynchronous)
59
// This is non-blocking (asynchronous)
15
function stateChangeHandler()
60
function stateChangeHandler()
16
{
61
{
Line 21... Line 66...
21
        var str = xmlHttp.responseText;
66
        var str = xmlHttp.responseText;
22
 
67
 
23
        //Populate the innerHTML of the div with the results
68
        //Populate the innerHTML of the div with the results
24
		MM_findObj( ajaxdivname ).innerHTML = str;
69
		MM_findObj( ajaxdivname ).innerHTML = str;
25
    }
70
    }
26
	
-
 
27
}
71
}
28
 
72
 
29
 
73
 
30
//stateComboChangeHandler will fire when the state has changed, i.e. data is received back
74
//stateComboChangeHandler will fire when the state has changed, i.e. data is received back
31
// This is non-blocking (asynchronous)
75
// This is non-blocking (asynchronous)
Line 39... Line 83...
39
        var str = xmlHttp.responseText;
83
        var str = xmlHttp.responseText;
40
		var combo = ajaxdivname ;
84
		var combo = ajaxdivname ;
41
		var lastOption = combo.options.length
85
		var lastOption = combo.options.length
42
		
86
		
43
        //Remove current Combo options
87
        //Remove current Combo options
44
		for (i=0; i<lastOption; i++)
88
		for (i=0; i<lastOption; i++) {
45
		{
-
 
46
			combo.options[0] = null;//The combo box re-organizes itself therefore remove the first element
89
			combo.options[0] = null;//The combo box re-organizes itself therefore remove the first element
47
		}
90
		}
48
		
91
		
49
		//Populate combowith new items
92
		//Populate combowith new items
50
		var optionArray = str.split('|+|');
93
		var optionArray = str.split('|+|');
51
		
94
		
52
		for (i in optionArray)
95
		for (i in optionArray) {
53
		{
-
 
54
			//alert(optionArray[i]);
96
			//alert(optionArray[i]);
55
			var opt = optionArray[i].split('|-|');
97
			var opt = optionArray[i].split('|-|');
56
			combo.options[i] = new Option( opt[0], opt[1], opt[2] );
98
			combo.options[i] = new Option( opt[0], opt[1], opt[2] );
57
		}
99
		}
58
		
-
 
59
		
-
 
60
    }
100
    }
61
	
-
 
62
}
101
}
63
 
102
 
64
// XMLHttp send GET request
103
// XMLHttp send GET request
65
function xmlHttp_Get(xmlhttp, url) {
104
function xmlHttp_Get(xmlhttp, url) {
66
    xmlhttp.open('GET', url, true);
105
    xmlhttp.open('GET', url, true);