4 ViewerRoot.createHud =
function() {
31 var animationTargetTop, isDropDownAnimating, isDropDownDown;
34 var hudAdminSettingsDiv;
37 var displayingControls =
false;
38 var PRE_MADE_ROOT_CFG_DIR =
"Pre-made Views";
39 var adminControlsPath;
41 var DIR_BRW_HDR_MAX_SIZE = 30;
42 var DIR_DISP_TAB_SZ = 16;
43 var TUPLE_TYPE = 0, TUPLE_NAME = 1, TUPLE_CONTENT = 2, TUPLE_PARENT = 3;
44 var TUPLE_TYPE_FILE = 1, TUPLE_TYPE_DIR = 1<<1, TUPLE_TYPE_DIR_EXPANDED = 1<<2;
45 var dirStruct = [[TUPLE_TYPE_DIR,
"",0,0]];
47 var currDirPtr = dirStruct[0];
49 this.handleWindowResize =
function() {
52 if(ViewerRoot.hudAutoHide)
53 this.hudMouseOverDiv.style.left = window.innerWidth - this.hudMouseOverDiv.offsetWidth - ViewerRoot.HUD_MARGIN_RIGHT +
"px";
56 this.hudMouseOverDiv.style.left = window.innerWidth - this.hudMouseOverDiv.offsetWidth +
"px";
57 this.hudMouseOverDiv.style.top = -15 +
"px";
60 hudDirBrowserDiv.style.width = this.hudDiv.offsetWidth - 45 +
"px";
61 hudDirBrowserDiv.style.height = window.innerHeight - 190 +
"px";
63 if(ViewerRoot.userPermissions >= ViewerRoot.ADMIN_PERMISSIONS_THRESHOLD)
64 document.getElementById(
"ViewerRoot-hudControlsIcon").style.display =
"block";
66 document.getElementById(
"ViewerRoot-hudControlsIcon").style.display =
"none";
70 this.checkboxUpdate =
function(i) {
73 chk = document.getElementById(
"hardRefreshCheckbox");
74 ViewerRoot.hardRefresh = chk.checked;
75 console.log(
"checkboxUpdate: hardRefresh: " + chk.checked);
76 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&hardRefresh="+
81 chk = document.getElementById(
"hudCheckbox" + i);
82 Debug.log(
"ViewerRoot Hud checkboxUpdate " + i +
"=" + chk.checked);
86 ViewerRoot.autoRefreshDefault = chk.checked;
88 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&autoRefresh="+
93 ViewerRoot.hudAutoHide = chk.checked;
94 ViewerRoot.handleWindowResize();
96 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&autoHide="+
101 ViewerRoot.pauseRefresh = chk.checked;
105 if(!ViewerRoot.pauseRefresh) ViewerRoot.autoRefreshMatchArr = [];
112 this.handlerRefreshPeriodChange =
function(v) {
114 if(!v || v < 1) v = 1;
115 if(v > 9999999) v = 9999999;
116 Debug.log(
"ViewerRoot Hud handlerRefreshPeriodChange " + v);
117 document.getElementById(
"hudAutoRefreshPeriod").value = v;
118 ViewerRoot.autoRefreshPeriod = v;
119 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&autoRefreshPeriod="+
120 ViewerRoot.autoRefreshPeriod);
121 if(ViewerRoot.autoRefreshTimer) window.clearInterval(ViewerRoot.autoRefreshTimer);
122 ViewerRoot.autoRefreshTimer = window.setInterval(ViewerRoot.autoRefreshTick,
123 ViewerRoot.autoRefreshPeriod);
126 this.radioSelect =
function(i) {
127 Debug.log(
"ViewerRoot Hud radioSelect " + i);
128 ViewerRoot.nextObjectMode = i;
130 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&radioSelect="+i);
133 this.handleDirContents =
function(req) {
134 Debug.log(
"ViewerRoot Hud handleDirContents " + req.responseText);
136 var path = DesktopContent.getXMLValue(req,
'path');
139 Debug.log(
"ViewerRoot Hud handleDirContents no path returned",Debug.HIGH_PRIORITY);
148 var baseDir = findDir(path);
151 Debug.log(
"ViewerRoot Hud handleDirContents path not found");
157 baseDir[TUPLE_CONTENT] = [];
158 baseDir[TUPLE_TYPE] |= TUPLE_TYPE_DIR_EXPANDED;
160 var dirs = req.responseXML.getElementsByTagName(
"dir");
161 var files = req.responseXML.getElementsByTagName(
"file");
163 for(var i=0;i<dirs.length;++i)
164 baseDir[TUPLE_CONTENT][baseDir[TUPLE_CONTENT].length] = [TUPLE_TYPE_DIR,dirs[i].getAttribute(
"value").replace(/[\/]+/g,
''),0,baseDir];
166 for(var i=0;i<files.length;++i)
167 baseDir[TUPLE_CONTENT][baseDir[TUPLE_CONTENT].length] = [TUPLE_TYPE_FILE,files[i].getAttribute(
"value").replace(/[\/]+/g,
''),0,baseDir];
171 redrawDirectoryDisplay();
176 var handleUserPreferences =
function(req) {
177 Debug.log(
"handleUserPreferences");
178 var radioSelect = DesktopContent.getXMLValue(req,
'radioSelect');
179 if(radioSelect && radioSelect !=
"")
181 Debug.log(
"setting radioSelect=" + (radioSelect|0));
182 ViewerRoot.nextObjectMode = radioSelect|0;
183 document.getElementById(
"newRootObjectModeRadio" + (radioSelect|0)).checked =
true;
185 var autoRefresh = DesktopContent.getXMLValue(req,
'autoRefresh');
186 if(autoRefresh && autoRefresh !=
"")
188 Debug.log(
"setting autoRefresh=" + (autoRefresh|0));
189 var chk = document.getElementById(
"hudCheckbox" + 0);
190 chk.checked = (autoRefresh|0)?
true:
false;
191 Debug.log(
"setting autoRefresh=" + chk.checked);
192 ViewerRoot.autoRefreshDefault = chk.checked;
194 var autoHide = DesktopContent.getXMLValue(req,
'autoHide');
195 if(autoHide && autoHide !=
"")
197 Debug.log(
"setting autoHide=" + (autoHide|0));
198 var chk = document.getElementById(
"hudCheckbox" + 1);
199 chk.checked = (autoHide|0)?
true:
false;
200 Debug.log(
"setting autoHide=" + chk.checked);
201 ViewerRoot.hudAutoHide = chk.checked;
202 ViewerRoot.handleWindowResize();
204 var hardRefresh = DesktopContent.getXMLValue(req,
'hardRefresh');
205 if(hardRefresh !== undefined && hardRefresh !==
"")
207 hardRefresh = hardRefresh|0;
208 Debug.log(
"setting hardRefresh=" + hardRefresh);
209 ViewerRoot.hardRefresh = hardRefresh;
211 var autoRefreshPeriod = DesktopContent.getXMLValue(req,
'autoRefreshPeriod');
212 if(autoRefreshPeriod && autoRefreshPeriod !==
"")
214 Debug.log(
"setting autoRefreshPeriod=" + autoRefreshPeriod);
215 ViewerRoot.autoRefreshPeriod = autoRefreshPeriod;
216 document.getElementById(
"hudAutoRefreshPeriod").value = ViewerRoot.autoRefreshPeriod;
224 var findDir =
function(path,currDir,currPath) {
227 currDir = dirStruct[0];
228 currPath = currDir[TUPLE_NAME] +
"/";
233 if(currDir[TUPLE_TYPE] & TUPLE_TYPE_DIR == 0)
return 0;
234 if(path == currPath)
return currDir;
235 if(!currDir[TUPLE_CONTENT])
return 0;
239 for(var i=0;i<currDir[TUPLE_CONTENT].length;++i)
241 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR == 0)
continue;
243 retVal = findDir(path,currDir[TUPLE_CONTENT][i],currPath + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"/");
244 if(retVal)
return retVal;
249 var getPath =
function(tuplePtr) {
250 if(!tuplePtr)
return "/";
251 var path = tuplePtr[TUPLE_NAME] +
"/";
252 while(tuplePtr[TUPLE_PARENT])
254 path = tuplePtr[TUPLE_PARENT][TUPLE_NAME] +
"/" + path;
255 tuplePtr = tuplePtr[TUPLE_PARENT];
264 var redrawDirectoryDisplay =
function(currDir,tabSz,path,str) {
266 var applyStr =
false;
271 hudDirBrowserDiv.innerHTML =
"";
273 currDir = currDirPtr;
275 path = getPath(currDirPtr);
279 locPath = path.length>DIR_BRW_HDR_MAX_SIZE?(
"..." + path.substr(path.length-DIR_BRW_HDR_MAX_SIZE+3)):path;
280 str +=
"<div id='ViewerRoot-hudDirBrowser-header'>";
281 str +=
"<a title='Refresh\n" + path +
"' style='float:left' href='Javascript:ViewerRoot.hud.changeDirectory(\"" +
282 path +
"\");'>" + locPath +
"</a>";
283 str +=
"<a title='Change to Parent Directory' style='float:right' href='Javascript:ViewerRoot.hud.changeDirectory(\"" +
284 getPath(currDirPtr[TUPLE_PARENT]) +
"\");'> cd .. </a>";
286 str +=
"<div style='clear:both'></div>";
289 for(var i=0;currDir[TUPLE_CONTENT] && i<currDir[TUPLE_CONTENT].length;++i)
291 locPath = path + currDir[TUPLE_CONTENT][i][TUPLE_NAME];
292 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR) locPath +=
"/";
294 str +=
"<div class='ViewerRoot-hudDirBrowser-item' style='margin-left:" + tabSz +
"px;'>";
296 dirClr = currDir[TUPLE_CONTENT][i][TUPLE_NAME].indexOf(
".root") >= 0?
"#B9E6E6":
"gray";
297 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR_EXPANDED)
299 str +=
"<a title='Collapse Directory\n" + locPath +
"' href='Javascript:ViewerRoot.hud.collapseDirectory(\"" + locPath +
"\");'> + </a> ";
301 str +=
"<a title='Change Directory\n" + locPath +
"' style='color:" + dirClr +
"' href='Javascript:ViewerRoot.hud.changeDirectory(\"" + locPath +
"\");'>" + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
303 else if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR)
305 str +=
"<a title='Expand Directory\n" + locPath +
"' style='color:gray' href='Javascript:ViewerRoot.getDirectoryContents(\"" + locPath +
"\");'> - </a> ";
307 str +=
"<a title='Change Directory\n" + locPath +
"' style='color:" + dirClr +
"' href='Javascript:ViewerRoot.hud.changeDirectory(\"" + locPath +
"\");'>" + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
309 else if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_FILE)
311 if(locPath.indexOf(
".root") > 0)
313 str +=
"<a title='Open Root File\n" + locPath +
"' href='Javascript:ViewerRoot.rootReq(\"" + locPath +
"\");'>" +
314 "<img style='margin:2px 2px -2px 0;' src='/WebPath/js/visualizers_lib/ViewerRoot_lib/img/histo.png'>";
315 str += currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
317 else if(locPath.indexOf(
".rcfg") > 0)
319 str +=
"<a title='Open Root File\n" + locPath +
"' href='Javascript:ViewerRoot.rootConfigReq(\"" + locPath +
"\");'>" +
320 "<img style='margin:2px 2px -2px 0;' src='/WebPath/js/visualizers_lib/ViewerRoot_lib/img/histo3d.png'>";
321 str += currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
324 Debug.log(
"ViewerRoot Hud redrawDirectoryDisplay unknown file extension");
327 alert(
"Impossible DIRECTORY error!! Notify admins");
332 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR_EXPANDED)
333 str = redrawDirectoryDisplay(currDir[TUPLE_CONTENT][i],tabSz+DIR_DISP_TAB_SZ,
334 path + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"/",str);
338 if(ViewerRoot.userPermissions >= ViewerRoot.ADMIN_PERMISSIONS_THRESHOLD &&
339 path.indexOf(PRE_MADE_ROOT_CFG_DIR) >= 0)
341 Debug.log(
"ViewerRoot Hud redrawDirectoryDisplay path " + path);
343 var iconArr = [
"folderopen",
"page",
"remove"];
344 var captionArr = [
"Make New Directory",
"Save New View",
"Delete Pre-made File/Folder!"];
345 for(var i=0;i<captionArr.length;++i)
347 str +=
"<div class='ViewerRoot-hudDirBrowser-item' style='margin-left:" + tabSz +
"px;'>";
348 str +=
"<a style='color:gray' title='Admin action: " + captionArr[i] +
349 "' href='Javascript:ViewerRoot.hud.toggleAdminControls(" + i +
",\"" + path +
"\");'>" +
350 "<img style='margin:2px 2px -2px 0;' src='/WebPath/js/visualizers_lib/ViewerRoot_lib/img/" + iconArr[i] +
".gif'>";
351 str += captionArr[i] +
"</a>";
357 hudDirBrowserDiv.innerHTML = str;
364 this.collapseDirectory =
function(dirPath) {
365 Debug.log(
"ViewerRoot Hud collapseDirectory " + dirPath);
367 var baseDir = findDir(dirPath);
369 baseDir[TUPLE_CONTENT] = 0;
370 baseDir[TUPLE_TYPE] &= ~TUPLE_TYPE_DIR_EXPANDED;
372 redrawDirectoryDisplay();
375 this.changeDirectory =
function(dirPath) {
376 Debug.log(
"ViewerRoot Hud changeDirectory " + dirPath);
377 currDirPtr = findDir(dirPath);
378 ViewerRoot.getDirectoryContents(dirPath);
383 var animateDropDown =
function() {
384 var dir = (animationTargetTop - hudMouseOverDiv.offsetTop > 0)? 1: -1;
386 var tmpTop = hudMouseOverDiv.offsetTop + dir*ViewerRoot.HUD_DROP_DOWN_SPEED;
387 if(Math.abs(tmpTop - animationTargetTop) <= ViewerRoot.HUD_DROP_DOWN_SPEED)
389 hudMouseOverDiv.style.top = animationTargetTop +
"px";
390 isDropDownAnimating =
false;
394 hudMouseOverDiv.style.top = tmpTop +
"px";
395 window.setTimeout(animateDropDown,30);
399 var mouseOverDropDown =
function() {
401 if(isDropDownAnimating)
return;
403 if(!ViewerRoot.hudAutoHide)
return;
407 isDropDownDown =
true;
408 isDropDownAnimating =
true;
409 animationTargetTop = -15;
410 window.setTimeout(animateDropDown,30);
415 var mouseOutDropDown =
function(event) {
416 if(isDropDownAnimating)
return;
420 var e =
event.toElement ||
event.relatedTarget;
423 if(e ==
this)
return;
428 if(!ViewerRoot.hudAutoHide)
return ViewerRoot.hud.handleWindowResize();
432 isDropDownDown =
false;
433 isDropDownAnimating =
true;
434 animationTargetTop = 15 - hudMouseOverDiv.offsetHeight;
435 window.setTimeout(animateDropDown,30);
440 this.toggleControls =
function() {
441 displayingControls = !displayingControls;
442 Debug.log(
"ViewerRoot Hud toggleControls " + displayingControls);
444 if(displayingControls)
446 hudDirBrowserDiv.innerHTML =
"";
448 if(ViewerRoot.hardRefresh)
449 str +=
"<input type='checkbox' id='hardRefreshCheckbox' checked ";
451 str +=
"<input type='checkbox' id='hardRefreshCheckbox' ";
452 str +=
"onchange='if(this.checked) ViewerRoot.hardRefresh = 1; else ViewerRoot.hardRefresh = 0; ViewerRoot.hud.checkboxUpdate(3);'>Hard Refresh";
454 str +=
"<br><div id='hudAdminControlStatus'></div>";
456 str +=
"<a href='javascript:ViewerRoot.hud.toggleControls();' title='Return to ROOT Browser' " +
457 "<u>Return to Browser</u></a>";
458 hudDirBrowserDiv.innerHTML = str;
461 ViewerRoot.hud.changeDirectory(getPath(currDirPtr));
468 this.toggleAdminControls =
function(type, path) {
469 displayingControls = !displayingControls;
470 Debug.log(
"ViewerRoot Hud toggleAdminControls " + displayingControls);
472 if(displayingControls)
474 Debug.log(
"ViewerRoot Hud toggleAdminControls " + type +
": " + path);
476 adminControlsPath = path;
477 hudDirBrowserDiv.innerHTML =
"";
483 str +=
"Make a new ROOT Viewer<br>Configuration Directory<br>at path:<br><br>" + path +
"<br>";
484 str +=
"<input type='text' id='hudAdminControlField' onkeyup='document.getElementById(\"hudAdminControlStatus\").innerHTML=\"\";' size='20' value=''><br>";
485 str +=
"<input type='button' onmouseup=\"ViewerRoot.hud.popUpVerification(" +
486 "'Are you sure you want to create directory with name "REPLACE"?','ViewerRoot.hud.makeConfigDir');\" value='Make New Directory'>";
490 str +=
"Save a new ROOT Viewer<br>Configuration File for all users <br>based on the current view<br>at path:<br><br>" + path +
"<br>";
491 str +=
"<input type='text' id='hudAdminControlField' size='20' value=''><br>";
493 str +=
"<div ><input type='checkbox' id='hudSaveFileRunWildCardCheckbox'>" +
494 "<label for='hudSaveFileRunWildCardCheckbox' >" +
"Use Wildcard Run #" +
"</label></div>";
496 str +=
"<input type='button' onmouseup=\"ViewerRoot.hud.popUpVerification(" +
497 "'Are you sure you want to save a file with name "REPLACE"?','ViewerRoot.hud.saveConfigFile');\" value='Save New File'>";
501 str +=
"Delete a ROOT Viewer<br>Configuration Directory or File<br>at path:<br><br>" + path +
"<br>";
502 str +=
"<input type='text' id='hudAdminControlField' onkeyup='document.getElementById(\"hudAdminControlStatus\").innerHTML=\"\";' size='20' value=''><br>";
503 str +=
"<input type='button' onmouseup=\"ViewerRoot.hud.popUpVerification(" +
504 "'Are you sure you want to delete file or directory with name "REPLACE"?','ViewerRoot.hud.removeConfigPath');\" value='Delete Path'><br>";
509 Debug.log(
"Unknown admin type " + type);
510 throw(
"Unknown type?");
513 str +=
"<br><div id='hudAdminControlStatus'></div>";
515 str +=
"<a href='javascript:ViewerRoot.hud.toggleAdminControls();' title='Return to ROOT Browser' " +
516 "<u>Return to Browser</u></a>";
517 hudDirBrowserDiv.innerHTML = str;
521 ViewerRoot.hud.changeDirectory(getPath(currDirPtr));
524 this.makeConfigDir =
function() {
525 var dir = document.getElementById(
'hudAdminControlField').value;
526 Debug.log(
"ViewerRoot Hud makeConfigDir " + dir);
528 DesktopContent.XMLHttpRequest(
"Request?RequestType=rootAdminControls&cmd=mkdir",
"path="+adminControlsPath+
"&name="+dir, ViewerRoot.hud.adminControlsReqHandler);
532 this.saveConfigFile =
function() {
535 if(ViewerRoot.numPositionsTiled < 1)
537 document.getElementById(
'hudAdminControlStatus').innerHTML =
"You must have at least 1 Root object in your configuration to save it.";
541 var file = document.getElementById(
'hudAdminControlField').value;
542 var wildcard = document.getElementById(
'hudSaveFileRunWildCardCheckbox').checked;
546 fileStr +=
"<ROOT><DATA>";
547 fileStr +=
"<numPositionsTiled>" + ViewerRoot.numPositionsTiled +
"</numPositionsTiled>";
548 fileStr +=
"<runNumWildcard>" + (wildcard?1:0) +
"</runNumWildcard>";
550 for(var i=0;i<ViewerRoot.rootElArr.length;++i)
552 fileStr +=
"<rootObjName>" + ViewerRoot.rootObjNameArr[i] +
"</rootObjName>";
553 fileStr +=
"<rootPos>" + ViewerRoot.rootPosArr[i] +
"</rootPos>";
554 fileStr +=
"<rootIsTransparent>" + (ViewerRoot.rootIsTransparentArr[i]?1:0) +
"</rootIsTransparent>";
555 fileStr +=
"<rootIsAutoRefresh>" + (ViewerRoot.rootIsAutoRefreshArr[i]?1:0) +
"</rootIsAutoRefresh>";
558 fileStr +=
"</DATA></ROOT>";
559 Debug.log(
"ViewerRoot Hud saveConfigFile fileStr " + fileStr);
561 DesktopContent.XMLHttpRequest(
"Request?RequestType=rootAdminControls&cmd=save",
562 "path="+adminControlsPath+
"&name="+file+
"&config="+fileStr, ViewerRoot.hud.adminControlsReqHandler);
565 this.removeConfigPath =
function() {
567 var target = document.getElementById(
'hudAdminControlField').value;
568 Debug.log(
"ViewerRoot Hud removeConfigPath " + target);
570 DesktopContent.XMLHttpRequest(
"Request?RequestType=rootAdminControls&cmd=delete",
"path="+adminControlsPath+
"&name="+target, ViewerRoot.hud.adminControlsReqHandler);
573 this.adminControlsReqHandler =
function(req) {
574 Debug.log(
"ViewerRoot Hud adminControlsReqHandler " + req.responseText);
576 var status = DesktopContent.getXMLValue(req,
'status');
579 ViewerRoot.hud.toggleAdminControls();
581 document.getElementById(
'hudAdminControlStatus').innerHTML = status;
587 this.popUpVerification =
function(prompt, func) {
589 if(hudPopUpDiv) hudPopUpDiv.parentNode.removeChild(hudPopUpDiv);
591 var path = document.getElementById(
'hudAdminControlField').value;
593 var ptrn = /^([a-zA-Z0-9_-]+)$/;
594 if(path.length < 3 || !ptrn.test(path))
596 document.getElementById(
'hudAdminControlStatus').innerHTML =
"Entry must be at least 3 characters and alpha-numeric with only underscores and dashes.";
601 prompt = prompt.replace(/REPLACE/g, path);
603 var el = this.hudDiv;
604 hudPopUpDiv = document.createElement(
"div");
605 hudPopUpDiv.setAttribute(
"class",
"hudPopUpDiv");
606 var str =
"<div id='hudPopUpText'>" + prompt +
"</div>" +
607 "<input type='submit' onmouseup='ViewerRoot.hud.clearPopUpVerification(" + func +
");' value='Yes'> " +
608 " " +
609 "<input type='submit' onmouseup='ViewerRoot.hud.clearPopUpVerification();' value='Cancel'>";
610 hudPopUpDiv.innerHTML = str;
611 el.appendChild(hudPopUpDiv);
616 this.clearPopUpVerification =
function(func) {
618 if(hudPopUpDiv) hudPopUpDiv.parentNode.removeChild(hudPopUpDiv);
622 document.getElementById(
'hudAdminControlStatus').innerHTML =
"Action was cancelled by user!";
625 hudMouseOverDiv = this.hudMouseOverDiv = document.createElement(
'div');
626 hudMouseOverDiv.setAttribute(
"id",
"ViewerRoot-hudMouseOver");
627 hudMouseOverDiv.style.position =
"absolute";
628 hudMouseOverDiv.style.zIndex = 100;
630 this.hudDiv = document.createElement(
'div');
631 this.hudDiv.setAttribute(
"id",
"ViewerRoot-hud");
638 str +=
"With new Root objects...<br>";
640 var chkLabels = [
"Auto-Refresh"];
641 var chkDefaults = [
""];
642 str +=
"<div style='float:right'>"
643 for(var i=0;i<chkLabels.length;++i)
644 str +=
"<input type='checkbox' id='hudCheckbox" + i +
"' onchange='ViewerRoot.hud.checkboxUpdate(" + i +
645 ");' " + chkDefaults[i] +
"><label for='hudCheckbox" + i +
"' >" + chkLabels[i] +
"</label>";
648 var radioLabels = [
"Tile",
"Replace",
"Superimpose"];
649 var radioDefault = ViewerRoot.nextObjectMode;
650 for(var i=0;i<radioLabels.length;++i)
651 str +=
"<input type='radio' id='newRootObjectModeRadio" + i +
"' " + (i==radioDefault?
"checked":
"") +
652 " onchange='ViewerRoot.hud.radioSelect(" + i +
");'" +
653 " name='newRootObjectModeRadio' value='0' /><label for='newRootObjectModeRadio" + i +
"'>" + radioLabels[i] +
"</label><br>";
657 str +=
"<div id='ViewerRoot-hudDirBrowser'></div>";
663 str +=
"<div id='ViewerRoot-hudControlsIcon' " +
664 "style='float:left;margin: -2px 0 -20px 20px; cursor: pointer;' onmouseup='ViewerRoot.hud.toggleControls();' " +
665 "title='Admin Controls'><img width='18px' src='/WebPath/images/dashboardImages/icon-Settings.png'></div>";
667 str +=
"<div style='float:right; margin:-3px 0 -20px 0;'>";
668 str +=
"Refresh Period: <input type='text' id='hudAutoRefreshPeriod' onchange='ViewerRoot.hud.handlerRefreshPeriodChange(this.value);' size='6' value='" +
669 ViewerRoot.autoRefreshPeriod +
"'> ms</div>";
673 str +=
"<a href='javascript:ViewerRoot.clearAll();' title='Clear ROOT objects from view'>Clear</a>";
675 str +=
"<div style='float:right;' ><input type='checkbox' id='hudCheckbox" + chkLabels.length +
"' onchange='ViewerRoot.hud.checkboxUpdate(" + chkLabels.length +
676 ");' " +
"" +
"><label for='hudCheckbox" + chkLabels.length +
"' >" +
"Auto-Hide" +
"</label></div>";
678 str +=
"<div style='float:right;margin-right:10px;' ><input type='checkbox' id='hudCheckbox" + (chkLabels.length+1) +
"' onchange='ViewerRoot.hud.checkboxUpdate(" + (chkLabels.length+1) +
679 ");' " +
"" +
"><label for='hudCheckbox" + (chkLabels.length+1) +
"' >" +
"Pause Refresh" +
"</label></div>";
681 this.hudDiv.innerHTML = str;
688 hudMouseOverDiv.appendChild(this.hudDiv);
690 hudMouseOverDiv.style.width = ViewerRoot.HUD_WIDTH +
"px";
691 hudMouseOverDiv.onmouseover = mouseOverDropDown;
692 hudMouseOverDiv.onmouseout = mouseOutDropDown;
693 ViewerRoot.omni.appendChild(hudMouseOverDiv);
695 hudDirBrowserDiv = document.getElementById(
'ViewerRoot-hudDirBrowser');
703 if(ViewerRoot.hudAutoHide)
706 hudMouseOverDiv.style.top = 15 - hudMouseOverDiv.offsetHeight +
"px";
708 isDropDownDown =
false;
709 isDropDownAnimating =
true;
710 animationTargetTop = 15 - hudMouseOverDiv.offsetHeight;
711 window.setTimeout(animateDropDown,30);
714 this.handleWindowResize();
717 DesktopContent.XMLHttpRequest(
"Request?RequestType=getUserPreferences",
"",handleUserPreferences);