Subversion Repositories DevTools

Rev

Rev 121 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 121 Rev 129
Line 1... Line 1...
1
/*
1
/*
2
 *	 COMMON JAVASCRIPTS
2
 *    COMMON JAVASCRIPTS
3
 */
3
 */
4
 
4
 
5
<!--
5
<!--
6
var clickedButton = false;
6
var clickedButton = false;
7
function check() {
7
function check() {
8
	if (clickedButton) {
8
   if (clickedButton) {
9
    	clickedButton = false;
9
       clickedButton = false;
10
        return true;
10
        return true;
11
    } else {
11
    } else {
12
    	return false;
12
       return false;
13
	}
13
   }
14
}
14
}
15
 
15
 
16
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
16
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
17
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
17
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
18
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
18
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
Line 32... Line 32...
32
 
32
 
33
function MM_findObj(n, d) { //v4.0
33
function MM_findObj(n, d) { //v4.0
34
  var p,i,x;
34
  var p,i,x;
35
  if(!d) d=document;
35
  if(!d) d=document;
36
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
36
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
37
  	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
37
     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
38
  }
38
  }
39
  if(!(x=d[n])&&d.all) x=d.all[n];
39
  if(!(x=d[n])&&d.all) x=d.all[n];
40
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
40
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
41
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
41
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
42
  if(!x && document.getElementById) x=document.getElementById(n);
42
  if(!x && document.getElementById) x=document.getElementById(n);
Line 52... Line 52...
52
  window.open(theURL,winName,features);
52
  window.open(theURL,winName,features);
53
}
53
}
54
 
54
 
55
function MM_jumpMenu(targ,selObj,restore){ //v3.1
55
function MM_jumpMenu(targ,selObj,restore){ //v3.1
56
  if (selObj.options[selObj.selectedIndex].value) {
56
  if (selObj.options[selObj.selectedIndex].value) {
57
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
57
     eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
58
	  if (restore) selObj.selectedIndex=0;
58
     if (restore) selObj.selectedIndex=0;
59
  }
59
  }
60
}
60
}
61
 
61
 
62
function Cascaded_Menu(targ,url,selObj,restore){ //v3.1
62
function Cascaded_Menu(targ,url,selObj,restore){ //v3.1
63
  if (selObj.options[selObj.selectedIndex].value) {
63
  if (selObj.options[selObj.selectedIndex].value) {
64
	  eval(targ+".location='"+url+selObj.options[selObj.selectedIndex].value+"'");
64
     eval(targ+".location='"+url+selObj.options[selObj.selectedIndex].value+"'");
65
	  if (restore) selObj.selectedIndex=0;
65
     if (restore) selObj.selectedIndex=0;
66
  }
66
  }
67
}
67
}
68
 
68
 
69
function MM_validateForm() { //v5.0
69
function MM_validateForm() { //v5.0
70
	var i,p,pl,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
70
   var i,p,pl,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
71
	var REresults,HTMLchr,urlRE,pkgRE,versionRE,cleanStrRE;
71
   var REresults;
72
	var pass,passc;
72
   var pass,passc;
73
	//character range allowed
73
 
74
	cleanStrRE = /^[0-9a-z_\.\(\)\-]+$/i;
74
 
75
	pkgRE = /^[a-z][a-z0-9_-]*[a-z0-9]$/i;
75
 
76
	versionRE = /^[0-9a-z_\.\(\)\-]+$/i;
76
   // Other general validations
77
	versionNumberRE = /^\d+\.\d+\.\d+$/;
77
   var cleanStrRE = /^[0-9a-z_\.\(\)\-]+$/i;
78
	urlRE = "^https?://[a-z1-9]";
78
   var pkgRE = /^[a-z][a-z0-9_-]*[a-z0-9]$/i;
79
	//character range disallowed
79
   var versionRE = /^[0-9a-z_\.\(\)\-]+$/i;
80
	HTMLchr = /[\<\>\'\"]+/i;
80
   var versionNumberRE = /^\d+\.\d+\.\d+$/;
81
 
81
   var urlRE = "^https?://[a-z1-9]";
82
 
82
   //character range disallowed
83
	for (i=0; i<(args.length-2); i+=3) {
83
   var HTMLchr = /[\<\>\'\"]+/i;
84
		test=args[i+2];
84
 
85
		val=MM_findObj(args[i]);
85
 
86
 
86
   for (i=0; i<(args.length-2); i+=3) {
87
		if (val) {
87
      test=args[i+2];
88
			nm=args[i+1];
88
      val=MM_findObj(args[i]);
89
			val=val.value;
89
 
90
 
90
      if (val) {
91
 
91
         nm=args[i+1];
92
 
92
         val=val.value;
93
			if (val!="") {
93
 
94
				if (test.indexOf('isEmail')!=-1) {
94
 
95
					p=val.indexOf('@');
95
 
96
					if (p<1 || p==(val.length-1) || test.charAt(0) == '@') errors+='- '+nm+' must contain an e-mail address.\n';
96
         if (val!="") {
97
				}
97
            if (test.indexOf('isEmail')!=-1) {
98
 
98
               p=val.indexOf('@');
99
				if (test.indexOf('isDate') != -1) {
99
               if (p<1 || p==(val.length-1) || test.charAt(0) == '@') errors+='- '+nm+' must contain an e-mail address.\n';
100
					if (val.indexOf("/") != -1) {
100
            }
101
						tmpARR = val.split("/");
101
 
102
						if (tmpARR.length == 3) {
102
            if (test.indexOf('isDate') != -1) {
103
							if (!(tmpARR[0]>0  && tmpARR[0]<32  && tmpARR[1]>0 && tmpARR[1]<13 && tmpARR[2]>1900 && tmpARR[2]<9999)) {
103
               if (val.indexOf("/") != -1) {
104
								errors += '- '+nm+' must be in DD/MM/YYYY format.\n';
104
                  tmpARR = val.split("/");
105
							}
105
                  if (tmpARR.length == 3) {
106
						} else {
106
                     if (!(tmpARR[0]>0  && tmpARR[0]<32  && tmpARR[1]>0 && tmpARR[1]<13 && tmpARR[2]>1900 && tmpARR[2]<9999)) {
107
							errors += '- '+nm+' must be in DD/MM/YYYY format.\n';
107
                        errors += '- '+nm+' must be in DD/MM/YYYY format.\n';
108
						}
108
                     }
109
					} else {
109
                  } else {
110
						errors += '- '+nm+' must be in DD/MM/YYYY format.\n';
110
                     errors += '- '+nm+' must be in DD/MM/YYYY format.\n';
111
					}
111
                  }
112
				}
112
               } else {
113
 
113
                  errors += '- '+nm+' must be in DD/MM/YYYY format.\n';
114
				if (test.indexOf('isPackage')!=-1) {
114
               }
115
					REresults = val.search(pkgRE);
115
            }
116
					if (REresults < 0) errors += val += ' - '+nm+' is not valid. Valid characters are A-Z a-z 0-9 - _\n'
116
 
117
								+ 'Names must start with a letter and cannot contain spaces or symbols other than - and _\n';
117
            if (test.indexOf('isPackage')!=-1) {
118
				}
118
               REresults = val.search(pkgRE);
119
 
119
               if (REresults < 0) errors += val += ' - '+nm+' is not valid. Valid characters are A-Z a-z 0-9 - _\n'
120
				if (test.indexOf('isCleanStr')!=-1) {
120
                        + 'Names must start with a letter and cannot contain spaces or symbols other than - and _\n';
121
					REresults = val.search(cleanStrRE);
121
            }
122
					if (REresults < 0) errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
122
 
123
				}
123
            if (test.indexOf('isCleanStr')!=-1) {
124
 
124
               REresults = val.search(cleanStrRE);
125
				if (test.indexOf('isVersionStr')!=-1) {
125
               if (REresults < 0) errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
126
					REresults = val.search(versionRE);
126
            }
127
					if (REresults < 0) errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
127
 
128
				}
128
            if (test.indexOf('isVersionStr')!=-1) {
129
 
129
               REresults = val.search(versionRE);
130
				if (test.indexOf('isVersionNumber')!=-1) {
130
               if (REresults < 0) errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
131
					REresults = val.search(versionNumberRE);
131
            }
132
					if (REresults < 0) errors += val += ' - '+nm+' is formatted incorrectly.\nVersion number should be (major).(minor).(patch)(build)\ne.g. 1.0.2002\n';
132
 
133
				}
133
            if (test.indexOf('isCCPath')!=-1) {
134
 
134
               var CCPathRE = /^\\|\/[a-z]+[0-9a-z_\.\-\\\/ ]+$/i;
135
				if (test.indexOf('isURL')!=-1) {
135
 
136
					REresults = val.match(urlRE);
136
               REresults = val.search(CCPathRE);
137
					if (REresults == null) errors += '"'+val+'" is not a valid URL.\n';
137
               if (REresults < 0) errors += val += '- '+nm+' uses invalid character.\nAllowed characters are \\ / A-Z a-z 0-9 . - _ SPACE\nAnd the path must begin with \\ or /';
138
				}
138
            }
139
 
139
 
140
				if (test.indexOf('isChangePassword')!=-1) {
140
            if (test.indexOf('isCCLabel')!=-1) {
141
					pass=MM_findObj('FRpassword');
141
               var CCLabelRE = /^[0-9a-z_\.\-]+$/i;
142
					passc=MM_findObj('FRpasswordc');
142
 
143
					if (pass.value!=passc.value) errors+='- Password confirmation does not match.\n';
143
               REresults = val.search(CCLabelRE);
144
				}
144
               if (REresults < 0) errors += val += '- '+nm+' uses invalid character. Allowed characters are A-Z a-z 0-9 . - _\n';
145
 
145
            }
146
				if (test.indexOf('maxLength')!=-1) {
146
 
147
					p=test.indexOf(':');
147
            if (test.indexOf('isSVNTag')!=-1) {
148
					max=test.substring(p+1);
148
               // Subversion TAG validation
149
					if (val.length>max) errors+='- '+nm+' can be maximum '+max+' characters long.\n';
149
               var SVNTagValidCharsRE = /^[0-9a-z_\.\-\/\@]+$/i;
150
				}
150
               var SVNTagInValidTrunkAnywhereRE = /\/trunk\//i;
151
 
151
               var SVNTagInValidAt = /@[0-9]*[^0-9$]+/i;
152
				if (test.indexOf('notHTML')!=-1) {
152
               var SVNTagInValidSlashAtBOL = /^\/.*$/i;
153
					if (val.match(HTMLchr)) errors+='- '+nm+' has invalid characters like \'< > quotes\'\n';
153
               var SVNTagInValidTrunkRE = /\/trunk[^@$]+/i;
154
				}
154
               var SVNTagInValidSlashAt = /\/@/i;
155
 
155
               var SVNTagInValidAtSlash = /@\//i;
156
				if (test.charAt(0)=='R') {
156
               var SVNTagInValidSlash = /^.*\/\/.*$/i;
157
 
157
               var SVNTagValidTagAnywhereRE = /^.*\/tags\/.*$/i;
158
					if (test.indexOf('isNumber') != -1) {
158
               var SVNTagValidBranchAnywhereRE = /^.*\/branches\/.*$/i;
159
						if (isNaN(val)) errors+='- '+nm+' must be a number.\n';
159
               var SVNTagValidTrunkEOLRE = /^.*\/trunk$/i;
160
					}
160
               var SVNTagValidTrunkAtNumberRE = /^.*\/trunk@[0-9]+$/i;
161
 
161
 
162
					if (test.indexOf('inRange') != -1) {
162
               if (val.search(SVNTagValidCharsRE) < 0)
163
						p=test.indexOf(':');
163
                  errors += val += ' - '+nm+' uses invalid character. Allowed characters are / A-Z a-z 0-9 . - _ @\n';
164
						min=test.substring(8,p);
164
               else {
165
						max=test.substring(p+1);
165
                  if (val.search(SVNTagInValidTrunkAnywhereRE) >= 0)
166
						if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
166
                     errors += val += ' - '+nm+' contains /trunk/. This is not allowed.\n';
167
					}
167
                  else {
168
 
168
                     if (val.search(SVNTagInValidAt) >= 0)
169
					if (test.indexOf('inLength')!=-1) {
169
                        errors += val += ' - '+nm+' contains an @ symbol that is not followed by a numeric value and the end of the line.\n';
170
					    pl=test.indexOf('inLength')
170
                     else {
171
						p=test.indexOf(':');
171
                        if (val.search(SVNTagInValidSlashAtBOL) >= 0)
172
		          		min=test.substring(pl+8,p);
172
                           errors += val += ' - '+nm+' begins with a /. This is not allowed.\n';
173
		          		if (val.length<min) errors+='- '+nm+' must be at least '+min+' characters long.\n';
173
                        else {
174
			    	}
174
                           if (val.search(SVNTagInValidTrunkRE) >= 0)
175
				}
175
                              errors += val += ' - '+nm+' contains invlaid /trunk. This must be followed by an @<number>, or the end of the line.\n';
176
			} else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n';
176
                           else {
177
 
177
                              if ((val.search(SVNTagInValidSlashAt) >= 0) || (val.search(SVNTagInValidAtSlash) >= 0))
178
 
178
                                 errors += val += ' - '+nm+' contains /@ or @/. This is not allowed.\n';
179
			if (test.indexOf('isPassword')!=-1) {
179
                              else {
180
				pass=MM_findObj('FRpassword');
180
                                 if (val.search(SVNTagInValidSlash) >= 0)
181
				passc=MM_findObj('FRpasswordc');
181
                                    errors += val += ' - '+nm+' uses //. This is not allowed.\n';
182
				if (!MM_findObj('FRdomainauth').checked) {
182
                                 else {
183
					if (test.indexOf('inLength')!=-1) {
183
                                    var count_valid_forms = 0;
184
					    pl=test.indexOf('inLength')
184
 
185
						p=test.indexOf(':');
185
                                    if (val.search(SVNTagValidTrunkAtNumberRE) >= 0) count_valid_forms++;
186
		          		min=test.substring(pl+8,p);
186
 
187
		          		if (val.length<min) errors+='- '+nm+' must be at least '+min+' characters long.\n';
187
                                    if (val.search(SVNTagValidTrunkEOLRE) >= 0) count_valid_forms++;
188
			    	}
188
 
189
					if (pass.value!=passc.value) errors+='- Password confirmation does not match.\n';
189
                                    if (val.search(SVNTagValidBranchAnywhereRE) >= 0) count_valid_forms++;
190
				} else {
190
 
191
					if (MM_findObj('FRdomain_name').value=="") errors += '- Domain Name is required.\n';
191
                                    if (val.search(SVNTagValidTagAnywhereRE) >= 0) count_valid_forms++;
192
				}
192
 
193
			}
193
                                    if (count_valid_forms == 0) errors += val += ' - '+nm+' does not end in /trunk or /trunk@<number>,\nor does not contain /tags/ or /branches/\n';
194
 
194
 
195
			if (test.indexOf('isDomainName')!=-1) {
195
                                    if (count_valid_forms > 1) errors += val += ' - '+nm+' cannot combine use of trunk, /tags/, or /branches/ in one subversion tag\n';
196
				if (MM_findObj('FRdomainauth').checked) {
196
                                 }
197
					if (MM_findObj('FRdomain_name').value=="") errors += '- Domain Name is required.\n';
197
                              }
198
				}
198
                           }
199
			}
199
                        }
200
 
200
                     }
201
		}
201
                  }
202
	}
202
               }
203
 
203
            }
204
	if (errors) {
204
 
205
		alert('The following error(s) occurred:\n\n'+errors);
205
            if (test.indexOf('isVersionNumber')!=-1) {
206
		clickedButton=false;
206
               REresults = val.search(versionNumberRE);
207
	} else {
207
               if (REresults < 0) errors += val += ' - '+nm+' is formatted incorrectly.\nVersion number should be (major).(minor).(patch)(build)\ne.g. 1.0.2002\n';
208
		clickedButton=true;
208
            }
209
	}
209
 
210
	document.MM_returnValue = (errors == '');
210
            if (test.indexOf('isURL')!=-1) {
-
 
211
               REresults = val.match(urlRE);
-
 
212
               if (REresults == null) errors += '"'+val+'" is not a valid URL.\n';
-
 
213
            }
-
 
214
 
-
 
215
            if (test.indexOf('isChangePassword')!=-1) {
-
 
216
               pass=MM_findObj('FRpassword');
-
 
217
               passc=MM_findObj('FRpasswordc');
-
 
218
               if (pass.value!=passc.value) errors+='- Password confirmation does not match.\n';
-
 
219
            }
-
 
220
 
-
 
221
            if (test.indexOf('maxLength')!=-1) {
-
 
222
               p=test.indexOf(':');
-
 
223
               max=test.substring(p+1);
-
 
224
               if (val.length>max) errors+='- '+nm+' can be maximum '+max+' characters long.\n';
-
 
225
            }
-
 
226
 
-
 
227
            if (test.indexOf('notHTML')!=-1) {
-
 
228
               if (val.match(HTMLchr)) errors+='- '+nm+' has invalid characters like \'< > quotes\'\n';
-
 
229
            }
-
 
230
 
-
 
231
            if (test.charAt(0)=='R') {
-
 
232
 
-
 
233
               if (test.indexOf('isNumber') != -1) {
-
 
234
                  if (isNaN(val)) errors+='- '+nm+' must be a number.\n';
-
 
235
               }
-
 
236
 
-
 
237
               if (test.indexOf('inRange') != -1) {
-
 
238
                  p=test.indexOf(':');
-
 
239
                  min=test.substring(8,p);
-
 
240
                  max=test.substring(p+1);
-
 
241
                  if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
-
 
242
               }
-
 
243
 
-
 
244
               if (test.indexOf('inLength')!=-1) {
-
 
245
                   pl=test.indexOf('inLength')
-
 
246
                  p=test.indexOf(':');
-
 
247
                      min=test.substring(pl+8,p);
-
 
248
                      if (val.length<min) errors+='- '+nm+' must be at least '+min+' characters long.\n';
-
 
249
                }
-
 
250
            }
-
 
251
         } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n';
-
 
252
 
-
 
253
 
-
 
254
         if (test.indexOf('isPassword')!=-1) {
-
 
255
            pass=MM_findObj('FRpassword');
-
 
256
            passc=MM_findObj('FRpasswordc');
-
 
257
            if (!MM_findObj('FRdomainauth').checked) {
-
 
258
               if (test.indexOf('inLength')!=-1) {
-
 
259
                   pl=test.indexOf('inLength')
-
 
260
                  p=test.indexOf(':');
-
 
261
                      min=test.substring(pl+8,p);
-
 
262
                      if (val.length<min) errors+='- '+nm+' must be at least '+min+' characters long.\n';
-
 
263
                }
-
 
264
               if (pass.value!=passc.value) errors+='- Password confirmation does not match.\n';
-
 
265
            } else {
-
 
266
               if (MM_findObj('FRdomain_name').value=="") errors += '- Domain Name is required.\n';
-
 
267
            }
-
 
268
         }
-
 
269
 
-
 
270
         if (test.indexOf('isDomainName')!=-1) {
-
 
271
            if (MM_findObj('FRdomainauth').checked) {
-
 
272
               if (MM_findObj('FRdomain_name').value=="") errors += '- Domain Name is required.\n';
-
 
273
            }
-
 
274
         }
211
 
275
 
-
 
276
      }
-
 
277
   }
-
 
278
 
-
 
279
   if (errors) {
-
 
280
      alert('The following error(s) occurred:\n\n'+errors);
-
 
281
      clickedButton=false;
-
 
282
   } else {
-
 
283
      clickedButton=true;
-
 
284
   }
-
 
285
   document.MM_returnValue = (errors == '');
-
 
286
 
212
	if (MM_findObj('ProgressBar') && document.MM_returnValue) MM_findObj('ProgressBar').style.visibility='visible';
287
   if (MM_findObj('ProgressBar') && document.MM_returnValue) MM_findObj('ProgressBar').style.visibility='visible';
213
}
288
}
214
 
289
 
215
function isChecked(boxName, buttonId) {
290
function isChecked(boxName, buttonId) {
216
  var formButton = document.getElementById(buttonId);
291
  var formButton = document.getElementById(buttonId);
217
  var boxes = document.getElementsByName(boxName);
292
  var boxes = document.getElementsByName(boxName);
Line 234... Line 309...
234
  }
309
  }
235
}
310
}
236
 
311
 
237
function confirmDelete(m)
312
function confirmDelete(m)
238
{
313
{
239
	var agree=confirm('Are you sure you want to delete '+m+'?');
314
   var agree=confirm('Are you sure you want to delete '+m+'?');
240
	if (agree) {
315
   if (agree) {
241
		if (MM_findObj('ProgressBar')) MM_findObj('ProgressBar').style.visibility='visible';
316
      if (MM_findObj('ProgressBar')) MM_findObj('ProgressBar').style.visibility='visible';
242
		return true;
317
      return true;
243
	} else {
318
   } else {
244
		return false;
319
      return false;
245
	}
320
   }
246
}
321
}
247
 
322
 
248
function confirmAction(m)
323
function confirmAction(m)
249
{
324
{
250
	var agree=confirm(m);
325
   var agree=confirm(m);
251
	if (agree) {
326
   if (agree) {
252
		if (MM_findObj('ProgressBar')) MM_findObj('ProgressBar').style.visibility='visible';
327
      if (MM_findObj('ProgressBar')) MM_findObj('ProgressBar').style.visibility='visible';
253
		return true;
328
      return true;
254
	} else {
329
   } else {
255
		return false;
330
      return false;
256
	}
331
   }
257
}
332
}
258
 
333
 
259
function DisplaySPAN(show) {
334
function DisplaySPAN(show) {
260
	if (show) {
335
   if (show) {
261
		MM_findObj("spanHideDetails").style.display = "block";
336
      MM_findObj("spanHideDetails").style.display = "block";
262
		MM_findObj("spanPkgInfo").style.display = "block";
337
      MM_findObj("spanPkgInfo").style.display = "block";
263
		MM_findObj("spanShowDetails").style.display = "none";
338
      MM_findObj("spanShowDetails").style.display = "none";
264
	} else {
339
   } else {
265
		MM_findObj("spanHideDetails").style.display = "none";
340
      MM_findObj("spanHideDetails").style.display = "none";
266
		MM_findObj("spanPkgInfo").style.display = "none";
341
      MM_findObj("spanPkgInfo").style.display = "none";
267
		MM_findObj("spanShowDetails").style.display = "block";
342
      MM_findObj("spanShowDetails").style.display = "block";
268
	}
343
   }
269
}
344
}
270
 
345
 
271
function ToggleDisplay () {
346
function ToggleDisplay () {
272
	var i, args, div_name, visibility
347
   var i, args, div_name, visibility
273
	args=ToggleDisplay.arguments;
348
   args=ToggleDisplay.arguments;
274
	for (i=0; i<(args.length); i+=1) {
349
   for (i=0; i<(args.length); i+=1) {
275
		div_name=args[i];
350
      div_name=args[i];
276
		if ( MM_findObj(div_name).style.display == 'block' ) {
351
      if ( MM_findObj(div_name).style.display == 'block' ) {
277
			MM_findObj(div_name).style.display = 'none';
352
         MM_findObj(div_name).style.display = 'none';
278
		} else {
353
      } else {
279
			MM_findObj(div_name).style.display = 'block';
354
         MM_findObj(div_name).style.display = 'block';
280
		}
355
      }
281
 
356
 
282
	}
357
   }
283
}
358
}
284
 
359
 
285
function Visible () {
360
function Visible () {
286
 
361
 
287
	var i, args, div_name, visibility
362
   var i, args, div_name, visibility
288
	args=Visible.arguments;
363
   args=Visible.arguments;
289
	for (i=0; i<(args.length); i+=2) {
364
   for (i=0; i<(args.length); i+=2) {
290
		div_name=args[i];
365
      div_name=args[i];
291
		visibility=args[i+1]
366
      visibility=args[i+1]
292
		MM_findObj(div_name).style.display = visibility;
367
      MM_findObj(div_name).style.display = visibility;
293
 
368
 
294
	}
369
   }
295
}
370
}
296
 
371
 
297
function DisplayObjects () {
372
function DisplayObjects () {
298
	var i, args, div_name
373
   var i, args, div_name
299
	args=DisplayObjects.arguments;
374
   args=DisplayObjects.arguments;
300
	for (i=0; i<(args.length); i+=1) {
375
   for (i=0; i<(args.length); i+=1) {
301
		div_name=args[i];
376
      div_name=args[i];
302
		MM_findObj(div_name).style.display = 'block';
377
      MM_findObj(div_name).style.display = 'block';
303
	}
378
   }
304
}
379
}
305
 
380
 
306
function GetCookieVal (offset) {
381
function GetCookieVal (offset) {
307
	var endstr = document.cookie.indexOf (";", offset);
382
   var endstr = document.cookie.indexOf (";", offset);
308
	if (endstr == -1) { endstr = document.cookie.length; }
383
   if (endstr == -1) { endstr = document.cookie.length; }
309
	return unescape(document.cookie.substring(offset, endstr));
384
   return unescape(document.cookie.substring(offset, endstr));
310
}
385
}
311
 
386
 
312
 
387
 
313
function GetCookie (name) {
388
function GetCookie (name) {
314
	var arg = name + "=";
389
   var arg = name + "=";
315
	var alen = arg.length;
390
   var alen = arg.length;
316
	var clen = document.cookie.length;
391
   var clen = document.cookie.length;
317
	var i = 0;
392
   var i = 0;
318
 
393
 
319
	while (i < clen) {
394
   while (i < clen) {
320
		var j = i + alen;
395
      var j = i + alen;
321
		if (document.cookie.substring(i, j) == arg) return GetCookieVal (j);
396
      if (document.cookie.substring(i, j) == arg) return GetCookieVal (j);
322
		i = document.cookie.indexOf(" ", i) + 1;
397
      i = document.cookie.indexOf(" ", i) + 1;
323
		if (i == 0) break;
398
      if (i == 0) break;
324
	}
399
   }
325
 
400
 
326
	return null;
401
   return null;
327
}
402
}
328
 
403
 
329
function go_submit( formname, actionname )
404
function go_submit( formname, actionname )
330
{
405
{
331
	formname.action.value = actionname;
406
   formname.action.value = actionname;
332
	formname.submit();
407
   formname.submit();
333
}
408
}
334
 
409
 
335
function ExpandAll()
410
function ExpandAll()
336
{
411
{
337
	var elem
412
   var elem
338
 
413
 
339
	if (document.all)
414
   if (document.all)
340
	{
415
   {
341
		// Run this for IE
416
      // Run this for IE
342
		elem = document.all;
417
      elem = document.all;
343
	} else {
418
   } else {
344
		// Run this for other browsers
419
      // Run this for other browsers
345
		elem = document.getElementsByTagName('div');
420
      elem = document.getElementsByTagName('div');
346
	}
421
   }
347
 
422
 
348
	for (i in elem)
423
   for (i in elem)
349
	{
424
   {
350
		if (elem[i].id)
425
      if (elem[i].id)
351
		{
426
      {
352
			if (elem[i].id.indexOf('SHORT_') == 0) elem[i].style.display = 'none';
427
         if (elem[i].id.indexOf('SHORT_') == 0) elem[i].style.display = 'none';
353
			if (elem[i].id.indexOf('FULL_') == 0) elem[i].style.display = 'block';
428
         if (elem[i].id.indexOf('FULL_') == 0) elem[i].style.display = 'block';
354
		}
429
      }
355
	}
430
   }
356
 
431
 
357
}
432
}
358
 
433
 
359
function CollapseAll()
434
function CollapseAll()
360
{
435
{
361
	var elem
436
   var elem
362
 
437
 
363
	if (document.all)
438
   if (document.all)
364
	{
439
   {
365
		// Run this for IE
440
      // Run this for IE
366
		elem = document.all;
441
      elem = document.all;
367
	} else {
442
   } else {
368
		// Run this for other browsers
443
      // Run this for other browsers
369
		elem = document.getElementsByTagName('div');
444
      elem = document.getElementsByTagName('div');
370
	}
445
   }
371
 
446
 
372
	for (i in elem)
447
   for (i in elem)
373
	{
448
   {
374
		if (elem[i].id)
449
      if (elem[i].id)
375
		{
450
      {
376
			if (elem[i].id.indexOf('SHORT_') == 0) elem[i].style.display = 'block';
451
         if (elem[i].id.indexOf('SHORT_') == 0) elem[i].style.display = 'block';
377
			if (elem[i].id.indexOf('FULL_') == 0) elem[i].style.display = 'none';
452
         if (elem[i].id.indexOf('FULL_') == 0) elem[i].style.display = 'none';
378
		}
453
      }
379
	}
454
   }
380
 
455
 
381
}
456
}
382
 
457
 
383
 
458
 
384
function height()
459
function height()
385
{
460
{
386
	if( typeof( window.innerWidth ) == 'number' )
461
   if( typeof( window.innerWidth ) == 'number' )
387
	{
462
   {
388
		h = window.innerHeight;
463
      h = window.innerHeight;
389
	}
464
   }
390
	else if(document.documentElement&&(document.documentElement.clientHeight ))
465
   else if(document.documentElement&&(document.documentElement.clientHeight ))
391
	{
466
   {
392
		h = document.documentElement.clientHeight;
467
      h = document.documentElement.clientHeight;
393
	}
468
   }
394
	else if( document.body &&	( document.body.clientWidth || document.body.clientHeight ) )
469
   else if( document.body &&   ( document.body.clientWidth || document.body.clientHeight ) )
395
	{
470
   {
396
		h = document.body.clientHeight;
471
      h = document.body.clientHeight;
397
	}
472
   }
398
 
473
 
399
	var e = document.getElementById("LayerDescription");
474
   var e = document.getElementById("LayerDescription");
400
 
475
 
401
	if (navigator.userAgent.indexOf('Internet Explorer'))
476
   if (navigator.userAgent.indexOf('Internet Explorer'))
402
	{
477
   {
403
		e.style.height = h - 350 + "px";
478
      e.style.height = h - 350 + "px";
404
		e.style.overflow = "auto";
479
      e.style.overflow = "auto";
405
	}
480
   }
406
	else
481
   else
407
	{
482
   {
408
		// This line shouldn't be run by IE; it doesn't seem to work. It gets run in Firefox, etc.
483
      // This line shouldn't be run by IE; it doesn't seem to work. It gets run in Firefox, etc.
409
		e.style.minHeight= h - 350 + "px";
484
      e.style.minHeight= h - 350 + "px";
410
		e.style.overflow = "auto";
485
      e.style.overflow = "auto";
411
	}
486
   }
412
}
487
}
413
 
488
 
414
//////////////////////////////////////////////////////////////////////////////////////////////////
489
//////////////////////////////////////////////////////////////////////////////////////////////////
415
//
490
//
416
// MM_ValidateVersion(pkgName, versionBase, versionExt, isAutobuild)
491
// MM_ValidateVersion(pkgName, versionBase, versionExt, isAutobuild)
417
//
492
//
418
//    pkgName       eg EA_DocGen
493
//    pkgName       eg EA_DocGen
419
//    versionBase   eg 1.2.3
494
//    versionBase   eg 1.2.3
420
//    versionExt	eg .cr
495
//    versionExt   eg .cr
421
//    isAutobuild   true or false
496
//    isAutobuild   true or false
422
//
497
//
423
// Returns true if version is valid, else false
498
// Returns true if version is valid, else false
424
//
499
//
425
// This function can and should be used instead of MM_validateForm to validate
500
// This function can and should be used instead of MM_validateForm to validate
Line 430... Line 505...
430
//    2) Reversion existing version (_wform_rename_version.asp)
505
//    2) Reversion existing version (_wform_rename_version.asp)
431
//    3) Add package to release (Form_add_pkg_versions.asp)
506
//    3) Add package to release (Form_add_pkg_versions.asp)
432
//////////////////////////////////////////////////////////////////////////////////////////////////
507
//////////////////////////////////////////////////////////////////////////////////////////////////
433
function MM_ValidateVersion(pkgName, versionBase, versionExt, isAutobuild)
508
function MM_ValidateVersion(pkgName, versionBase, versionExt, isAutobuild)
434
{
509
{
435
	var errString = MM_ValidateVersionReturningErrString(pkgName, versionBase, versionExt, isAutobuild);
510
   var errString = MM_ValidateVersionReturningErrString(pkgName, versionBase, versionExt, isAutobuild);
436
	if (errString.length > 0)
511
   if (errString.length > 0)
437
	{
512
   {
438
		alert(errString);
513
      alert(errString);
439
		return false;
514
      return false;
440
	}
515
   }
441
	return true;
516
   return true;
442
}
517
}
443
 
518
 
444
//////////////////////////////////////////////////////////////////////////////////////////////////
519
//////////////////////////////////////////////////////////////////////////////////////////////////
445
//
520
//
446
// MM_ValidateVersionReturningErrString(pkgName, versionBase, versionExt, isAutobuild)
521
// MM_ValidateVersionReturningErrString(pkgName, versionBase, versionExt, isAutobuild)
447
//
522
//
448
//    pkgName       eg buildtool
523
//    pkgName       eg buildtool
449
//    versionBase   eg 1.2.3
524
//    versionBase   eg 1.2.3
450
//    versionExt	eg .cr
525
//    versionExt   eg .cr
451
//    isAutobuild   true or false
526
//    isAutobuild   true or false
452
//
527
//
453
// Returns a non-zero-length error string if version is NOT valid, else returns a zero-length string
528
// Returns a non-zero-length error string if version is NOT valid, else returns a zero-length string
454
//
529
//
455
// The MM_validateForm function should be modified to use this if possible, although I currently
530
// The MM_validateForm function should be modified to use this if possible, although I currently
456
// do not believe it has access to all the necessary parameter values needed.
531
// do not believe it has access to all the necessary parameter values needed.
457
//
532
//
458
//////////////////////////////////////////////////////////////////////////////////////////////////
533
//////////////////////////////////////////////////////////////////////////////////////////////////
459
function MM_ValidateVersionReturningErrString(pkgName, versionBase, versionExt, isAutobuild)
534
function MM_ValidateVersionReturningErrString(pkgName, versionBase, versionExt, isAutobuild)
460
{
535
{
461
	var re_std_ver_format = /^\d+\.\d+\.\d+$/;
536
   var re_std_ver_format = /^\d+\.\d+\.\d+$/;
462
	var re_cots_ver_format = /^[\w]+[\w\.\-]*$/;    // starts with letter or digit or underscore, subsequent chars can be letters or digits or _ or . or -
537
   var re_cots_ver_format = /^[\w]+[\w\.\-]*$/;    // starts with letter or digit or underscore, subsequent chars can be letters or digits or _ or . or -
463
	var re_cots_ver_format_exc1 = /[-_.]+[-_.]+/;	// look for any two adjacent special characters
538
   var re_cots_ver_format_exc1 = /[-_.]+[-_.]+/;   // look for any two adjacent special characters
464
	var re_cots_ver_format_exc2 = /[0-9A-Za-z]+/;	// look for any alphanumeric char
539
   var re_cots_ver_format_exc2 = /[0-9A-Za-z]+/;   // look for any alphanumeric char
465
 
540
 
466
	var forPkgName = "";
541
   var forPkgName = "";
467
	if (pkgName != null && pkgName.length > 0)
542
   if (pkgName != null && pkgName.length > 0)
468
	{
543
   {
469
		forPkgName = ", for package " + pkgName;
544
      forPkgName = ", for package " + pkgName;
470
	}
545
   }
471
 
546
 
472
	if(!isAutobuild)
547
   if(!isAutobuild)
473
	{
548
   {
474
		if( versionBase.length == 0 )
549
      if( versionBase.length == 0 )
475
		{
550
      {
476
			return "Action failed: version number is of zero length" + forPkgName;
551
         return "Action failed: version number is of zero length" + forPkgName;
477
		}
552
      }
478
		else if( versionExt != ".cots" && !re_std_ver_format.test(versionBase) )
553
      else if( versionExt != ".cots" && !re_std_ver_format.test(versionBase) )
479
		{
554
      {
480
			return "Action failed: version is not of form (integer).(integer).(integer).(extension)" + forPkgName;
555
         return "Action failed: version is not of form (integer).(integer).(integer).(extension)" + forPkgName;
481
		}
556
      }
482
		else if( versionExt == ".cots")
557
      else if( versionExt == ".cots")
483
		{
558
      {
484
			if( !re_cots_ver_format.test(versionBase) )
559
         if( !re_cots_ver_format.test(versionBase) )
485
			{
560
         {
486
				return "Action failed: COTS version must begin with letter/digit/underscore, cannot contain any whitespace, and only special characters underscore/dash/dot are allowed" + forPkgName;
561
            return "Action failed: COTS version must begin with letter/digit/underscore, cannot contain any whitespace, and only special characters underscore/dash/dot are allowed" + forPkgName;
487
			}
562
         }
488
 
563
 
489
			if( re_cots_ver_format_exc1.test(versionBase) )
564
         if( re_cots_ver_format_exc1.test(versionBase) )
490
			{
565
         {
491
				return "Action failed: COTS version cannot contain two adjacent special characters (underscore/dash/dot)" + forPkgName;
566
            return "Action failed: COTS version cannot contain two adjacent special characters (underscore/dash/dot)" + forPkgName;
492
			}
567
         }
493
 
568
 
494
			if( !re_cots_ver_format_exc2.test(versionBase) )
569
         if( !re_cots_ver_format_exc2.test(versionBase) )
495
			{
570
         {
496
				return "Action failed: COTS version must contain one or more alphanumeric characters" + forPkgName;
571
            return "Action failed: COTS version must contain one or more alphanumeric characters" + forPkgName;
497
			}
572
         }
498
		}
573
      }
499
	}
574
   }
500
 
575
 
501
	// everything ok - no error
576
   // everything ok - no error
502
	return "";
577
   return "";
503
}
578
}
504
 
579
 
505
 
580
 
506
 
581
 
507
//-->
582
//-->