1//<!-- FileName : JS_functions.js --> 2// simple browser detection 3 4var isOpera = navigator.userAgent.indexOf("Opera") > -1; 5var isIE = navigator.userAgent.indexOf("MSIE") > 1 && !isOpera; 6var isMoz = navigator.userAgent.indexOf("Mozilla/5.") == 0 && !isOpera; 7var isFF = navigator.userAgent.indexOf("Firefox") == 0 && !isOpera; 8 9// WINDOW STATUS FUNCTIONS 10window.defaultStatus = ""; 11function winStatus( msg ) 12{ 13 window.status = msg; 14} 15 16// ALERT FUNCTIONS 17function adminAlert( msg ) { 18 if( msg != null && trim(msg) != "" ) { 19 alert( msg ); 20 } 21} 22 23function addToWelcomePage( jvm, webApp, sectionName, URL, formItem ) { 24 //alert(sectionName); 25 top.adminHeader.location = "blank.html" + 26 "jrun_j=" + escape(jvm) + 27 "&jrun_wa=" + escape(webApp) + 28 "§ionName=" + escape(sectionName) + 29 "&checkOn=" + formItem.checked + 30 "&jmcLinkURL=" + escape(URL); 31} 32 33function goThere( node,loc ) { 34 //Only perform folder opening, don't close anything 35 if( parent.nav.indexOfEntries[node].isOpen == false ) 36 parent.nav.clickOnNode(node); 37 window.location = loc; 38} 39 40function popUp( loc, w, h, menubar ) { 41 if( w == null ) { w = 500; } 42 if( h == null ) { h = 350; } 43 if( menubar == null || menubar == false ) { 44 menubar = ""; 45 } else { 46 menubar = "menubar,"; 47 } 48 49 if( NS ) { w += 50; } 50 // Need the var or else IE4 blows up not recognizing editorWin 51 var editorWin = window.open(loc,'editWin', menubar + 'resizable,scrollbars,width=' + w + ',height=' + h); 52 //if( !newWin.opener ) 53 //newWin.opener = window; 54 editorWin.focus(); //causing intermittent errors 55} 56 57function popUpLarge( loc, menubar ) { 58 if( menubar == null ) { menubar = false; } 59 popUp( loc, 700, 500, menubar ); 60} 61 62function connectorWizardPrompt( jvm ) { 63 // Go to the connector wizard if the user wants to run it for the first time 64 if( confirm('You have not configured the connection between this server and an external Web server.\n\n Click OK to run the Connector Wizard.') ) { 65 self.location = "blank.html" + escape(jvm); 66 } 67} 68 69function closeMe() { 70 //self.close(); 71 parent.close(); 72} 73 74function formSubmit() { 75 parent.frames[0].document.forms[0].submit(); 76} 77 78function openerReload() { 79 if( parent.opener.name != null ) 80 parent.opener.location.reload(); 81 //alert( parent.opener.name ); 82 //parent.opener.r(); 83} 84 85function r() { 86 self.setTimeout("rl()", 2000); 87} 88function rl(){ 89 self.location.reload(); 90} 91 92function browseWindow( ele, fileExtension ) { 93 if( fileExtension == null ) { fileExtension = ""; } 94 page = "/includes/dirReader.jsp?jrun_target_element=" + ele + "&jrun_file_ext=" + fileExtension; 95 bWin = window.open(page,'browseWin','resizable,scrollbars,width=500,height=60,screenX=300,screenY=200'); 96 bWin.focus(); 97} 98 99// NAV TREE FUNCTIONS 100function navRefresh() { 101 top.nav.location.reload(); 102} 103 104// CONNECTOR FUNCTIONS 105function connectorCancel() { 106 if( confirm('You have chosen to exit the Connector Wizard. \n\nClick \'OK\' to go to the JRun Welcome Page.') ) { 107 // If the connector wizard is running solo (not within JMC /index.jsp frameset), then redirect should happen at the top level 108 if( top.location == self.location ) { 109 top.location = "/index.jsp"; 110 } else { 111 self.location = "/welcome.jsp"; 112 } 113 } 114} 115 116function connectorDone() { 117 // If the connector wizard is running solo (not within JMC /index.jsp frameset), then redirect should happen at the top level 118 if( top.location == self.location ) { 119 top.location = "/index.jsp"; 120 } else { 121 self.location = "/welcome.jsp"; 122 } 123} 124 125// EJB FUNCTIONS 126function redeployAllJarsConfirm( jvm ) { 127 if( confirm('You have chosen to redeploy all Jars. \n\nClick \'OK\' to continue.') ) { 128 self.location = "blank.html" + escape(jvm); 129 } 130} 131 132// STRING FUNCTIONS 133function trim( str ) { 134 // Immediately return if no trimming is needed 135 if( (str.charAt(0) != ' ') && (str.charAt(str.length-1) != ' ') ) { return str; } 136 // Trim leading spaces 137 while( str.charAt(0) == ' ' ) { 138 str = '' + str.substring(1,str.length); 139 }
140 // Trim trailing spaces 141 while( str.charAt(str.length-1) == ' ' ) { 142 str = '' + str.substring(0,str.length-1); 143 } 144 145 return str; 146} 147 148function strReplace( entry, bad, good ) { 149 temp = "" + entry; // temporary holder 150 while( temp.indexOf(bad) > -1 ) { 151 pos= temp.indexOf( bad ); 152 temp = "" + ( temp.substring(0, pos) + good + 153 temp.substring( (pos + bad.length), temp.length) ); 154 } 155 return temp; 156} 157 158//autodot function 159 160function forDateOfBirth(obj,e,style){ // same function like Inputmask -> additional check for Enter-Key (key code == 13) 161 var CursorPos = 0; // only for DateOfBirt Inputfield in Manualsearch 162 var txt=obj.value; 163 var objlen = txt.length; // added 164 var Key; 165 var sSelection 166 167 if(isMoz||isFF){ 168 Key = e.which; 169 sSelection = window.getSelection(); 170 if(sSelection!="") 171 window.getSelection().clear(); 172 iStart = window.getSelection().selectionStart; 173 iEnd = window.getSelection().selectionEnd;
174 CursorPos = obj.selectionStart; 175 }else if(isIE){ 176 Key = e.keyCode; 177 178 if(Key == 13) //added 179 { 180 if(objlen == 10) 181 search(); 182 } 183 sSelection = document.selection.createRange().text; 184 if(sSelection!="") 185 document.selection.clear(); 186 oRange = document.selection.createRange(); 187 oRange.moveStart('character', -obj.value.length); 188 CursorPos = oRange.text.length; 189 } 190 191 if(Key<48 || Key>57 || CursorPos >= style.length){ 192 if(Key==8||Key==0||Key==13) 193 return Key; 194 else 195 return false; 196 } 197 198 if(isMoz||isFF){ 199 if(style.charAt(CursorPos)=='#'){ 200 if(style.charAt(CursorPos+1)!='#'){ 201 obj.value = obj.value.substring(0, CursorPos)+String.fromCharCode(Key)+style.charAt(CursorPos+1); 202 return false; 203 }else{ 204 obj.value = obj.value.substring(0, CursorPos)+String.fromCharCode(Key); 205 return false; 206 } 207 }else{ 208 obj.value = obj.value.substring(0, CursorPos)+style.charAt(CursorPos)+String.fromCharCode(Key); 209 return false; 210 } 211 }else if(isIE){ 212 if(style.charAt(CursorPos)=='#'){ 213 if(style.charAt(CursorPos+1) !='#'){ 214 document.selection.createRange().moveStart('textedit',CursorPos); 215 document.selection.createRange().moveEnd('textedit',CursorPos+1); 216 document.selection.clear(); 217 document.selection.createRange().moveStart('textedit',CursorPos); 218 document.selection.createRange().moveEnd('textedit',CursorPos+1); 219 document.selection.clear(); 220 221 document.selection.createRange().text=String.fromCharCode(Key)+style.charAt(CursorPos+1); 222 return false; 223 }else{ 224 document.selection.createRange().moveStart('textedit',CursorPos); 225 document.selection.createRange().moveEnd('textedit',CursorPos+1); 226 document.selection.clear(); 227 document.selection.createRange().text=String.fromCharCode(Key); 228 return false; 229 } 230 }else{ 231 document.selection.createRange().moveStart('textedit',CursorPos); 232 document.selection.createRange().moveEnd('textedit',CursorPos+1); 233 document.selection.clear(); 234 document.selection.createRange().text=style.charAt(CursorPos)+String.fromCharCode(Key); 235 return false; 236 } 237 } 238 obj.focus(); 239} 240 241function GetDateBeforeCurrent(nTage) 242 { 243 var date = new Date(); 244 if(nTage>0) 245 { 246 var nMillis = date.getTime(); 247 date.setTime( nMillis-3600000*24*nTage); 248 } 249 var strDay = date.getDate(); 250 var strMonth = date.getMonth()+1; 251 var strYear = date.getYear(); 252 253 strDay = ""+strDay; 254 strMonth = ""+strMonth; 255 strYear = ""+strYear; 256 257 258 if (strDay < 10){ 259 strDay = "0"+strDay; 260 } 261 262 if (strMonth < 10){ 263 strMonth = "0"+strMonth; 264 } 265 266 return strDay+"."+strMonth+"."+strYear; 267 268 } 269 270function getSelectedCheckboxArray(obj) 271 { 272 list = new Array(); 273 if(obj==null) 274 { 275 list[-1]=0; 276 return list; 277 } 278 else if (obj.length==null) 279 { 280 list[-1]=1; 281 list[-2]=""; 282 if(obj.checked) 283 { 284 list[-2]="0"; 285 list[0]=obj.value; 286 } 287 return list; 288 } 289 else 290 { 291 list[-1]=obj.length; 292 list[-2]=""; 293 for(i=0;i<obj.length;i++) 294 { 295 if(obj[i].checked) 296 { 297 if(String(list[-2])=="") 298 { 299 list[-2]=i; 300 } 301 else 302 { 303 list[-2]=list[-2]+";"+i; 304 } 305 list[i]=obj[i].value; 306 } 307 } 308 } 309 return list; 310 } 311 312function IMG_Scale(obj,nMaxWidth,nMaxHeight) 313{ 314 if(!obj) 315 { 316 return; 317 } 318 319 obj.style.display="none"; 320 321 if(obj.complete) 322 { 323 obj.style.display="block"; 324 obj.style.width="auto"; 325 obj.style.height="auto"; 326 327 nWidth = getOffsetWidth(obj); 328 nHeight = getOffsetHeight(obj); 329 330 if(obj.width > nMaxWidth && nHeight>0 && nWidth>0) 331 { 332 nWidth = nMaxWidth; 333 nHeight = getOffsetHeight(obj) / (getOffsetWidth(obj)/nMaxWidth); 334 } 335 336 if(nHeight > nMaxHeight && nHeight>0 && nWidth>0) 337 { 338 nWidth = nWidth / (nHeight/nMaxHeight); 339 nHeight = nMaxHeight; 340 } 341 342 obj.style.width=nWidth+"px"; 343 obj.style.height=nHeight+"px"; 344 345 return new Array(nWidth,nHeight); 346 } 347 else 348 { 349 setTimeout("IMG_Scale(document.getElementById('"+obj.id+"'),"+nMaxWidth+","+nMaxHeight+")",1); 350 } 351} 352 353function setTitle(Variable, Default) 354{ 355 return (Variable == null ? Default : Variable); 356}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.