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="+
87 chk = document.getElementById(
"hudCheckbox" + i);
88 Debug.log(
"ViewerRoot Hud checkboxUpdate " + i +
"=" + chk.checked);
92 ViewerRoot.autoRefreshDefault = chk.checked;
94 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&autoRefresh="+
105 ViewerRoot.hudAutoHide = chk.checked;
106 ViewerRoot.handleWindowResize();
108 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&autoHide="+
119 ViewerRoot.pauseRefresh = chk.checked;
123 if(!ViewerRoot.pauseRefresh) ViewerRoot.autoRefreshMatchArr = [];
130 this.handlerRefreshPeriodChange =
function(v) {
132 if(!v || v < 1) v = 1;
133 if(v > 9999999) v = 9999999;
134 Debug.log(
"ViewerRoot Hud handlerRefreshPeriodChange " + v);
135 document.getElementById(
"hudAutoRefreshPeriod").value = v;
136 ViewerRoot.autoRefreshPeriod = v;
137 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&autoRefreshPeriod="+
138 ViewerRoot.autoRefreshPeriod,
145 if(ViewerRoot.autoRefreshTimer) window.clearInterval(ViewerRoot.autoRefreshTimer);
146 ViewerRoot.autoRefreshTimer = window.setInterval(ViewerRoot.autoRefreshTick,
147 ViewerRoot.autoRefreshPeriod);
150 this.radioSelect =
function(i) {
151 Debug.log(
"ViewerRoot Hud radioSelect " + i);
152 ViewerRoot.nextObjectMode = i;
154 DesktopContent.XMLHttpRequest(
"Request?RequestType=setUserPreferences&radioSelect="+i);
157 this.handleDirContents =
function(req) {
158 Debug.log(
"ViewerRoot Hud handleDirContents " + req.responseText);
160 var path = DesktopContent.getXMLValue(req,
'path');
163 Debug.log(
"ViewerRoot Hud handleDirContents no path returned",Debug.HIGH_PRIORITY);
172 var baseDir = findDir(path);
175 Debug.log(
"ViewerRoot Hud handleDirContents path not found");
181 baseDir[TUPLE_CONTENT] = [];
182 baseDir[TUPLE_TYPE] |= TUPLE_TYPE_DIR_EXPANDED;
184 var dirs = req.responseXML.getElementsByTagName(
"dir");
185 var files = req.responseXML.getElementsByTagName(
"file");
187 for(var i=0;i<dirs.length;++i)
188 baseDir[TUPLE_CONTENT][baseDir[TUPLE_CONTENT].length] = [TUPLE_TYPE_DIR,dirs[i].getAttribute(
"value").replace(/[\/]+/g,
''),0,baseDir];
190 for(var i=0;i<files.length;++i)
191 baseDir[TUPLE_CONTENT][baseDir[TUPLE_CONTENT].length] = [TUPLE_TYPE_FILE,files[i].getAttribute(
"value").replace(/[\/]+/g,
''),0,baseDir];
195 redrawDirectoryDisplay();
200 var handleUserPreferences =
function(req) {
201 Debug.log(
"handleUserPreferences");
202 var radioSelect = DesktopContent.getXMLValue(req,
'radioSelect');
203 if(radioSelect && radioSelect !=
"")
205 Debug.log(
"setting radioSelect=" + (radioSelect|0));
206 ViewerRoot.nextObjectMode = radioSelect|0;
207 document.getElementById(
"newRootObjectModeRadio" + (radioSelect|0)).checked =
true;
209 var autoRefresh = DesktopContent.getXMLValue(req,
'autoRefresh');
210 if(autoRefresh && autoRefresh !=
"")
212 Debug.log(
"setting autoRefresh=" + (autoRefresh|0));
213 var chk = document.getElementById(
"hudCheckbox" + 0);
214 chk.checked = (autoRefresh|0)?
true:
false;
215 Debug.log(
"setting autoRefresh=" + chk.checked);
216 ViewerRoot.autoRefreshDefault = chk.checked;
218 var autoHide = DesktopContent.getXMLValue(req,
'autoHide');
219 if(autoHide && autoHide !=
"")
221 Debug.log(
"setting autoHide=" + (autoHide|0));
222 var chk = document.getElementById(
"hudCheckbox" + 1);
223 chk.checked = (autoHide|0)?
true:
false;
224 Debug.log(
"setting autoHide=" + chk.checked);
225 ViewerRoot.hudAutoHide = chk.checked;
226 ViewerRoot.handleWindowResize();
228 var hardRefresh = DesktopContent.getXMLValue(req,
'hardRefresh');
229 if(hardRefresh !== undefined && hardRefresh !==
"")
231 hardRefresh = hardRefresh|0;
232 Debug.log(
"setting hardRefresh=" + hardRefresh);
233 ViewerRoot.hardRefresh = hardRefresh;
235 var autoRefreshPeriod = DesktopContent.getXMLValue(req,
'autoRefreshPeriod');
236 if(autoRefreshPeriod && autoRefreshPeriod !==
"")
238 Debug.log(
"setting autoRefreshPeriod=" + autoRefreshPeriod);
239 ViewerRoot.autoRefreshPeriod = autoRefreshPeriod;
240 document.getElementById(
"hudAutoRefreshPeriod").value = ViewerRoot.autoRefreshPeriod;
248 var findDir =
function(path,currDir,currPath) {
251 currDir = dirStruct[0];
252 currPath = currDir[TUPLE_NAME] +
"/";
257 if(currDir[TUPLE_TYPE] & TUPLE_TYPE_DIR == 0)
return 0;
258 if(path == currPath)
return currDir;
259 if(!currDir[TUPLE_CONTENT])
return 0;
263 for(var i=0;i<currDir[TUPLE_CONTENT].length;++i)
265 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR == 0)
continue;
267 retVal = findDir(path,currDir[TUPLE_CONTENT][i],currPath + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"/");
268 if(retVal)
return retVal;
273 var getPath =
function(tuplePtr) {
274 if(!tuplePtr)
return "/";
275 var path = tuplePtr[TUPLE_NAME] +
"/";
276 while(tuplePtr[TUPLE_PARENT])
278 path = tuplePtr[TUPLE_PARENT][TUPLE_NAME] +
"/" + path;
279 tuplePtr = tuplePtr[TUPLE_PARENT];
288 var redrawDirectoryDisplay =
function(currDir,tabSz,path,str) {
290 var applyStr =
false;
295 hudDirBrowserDiv.innerHTML =
"";
297 currDir = currDirPtr;
299 path = getPath(currDirPtr);
303 locPath = path.length>DIR_BRW_HDR_MAX_SIZE?(
"..." + path.substr(path.length-DIR_BRW_HDR_MAX_SIZE+3)):path;
304 str +=
"<div id='ViewerRoot-hudDirBrowser-header'>";
305 str +=
"<a title='Refresh\n" + path +
"' style='float:left' href='Javascript:ViewerRoot.hud.changeDirectory(\"" +
306 path +
"\");'>" + locPath +
"</a>";
307 str +=
"<a title='Change to Parent Directory' style='float:right' href='Javascript:ViewerRoot.hud.changeDirectory(\"" +
308 getPath(currDirPtr[TUPLE_PARENT]) +
"\");'> cd .. </a>";
310 str +=
"<div style='clear:both'></div>";
313 for(var i=0;currDir[TUPLE_CONTENT] && i<currDir[TUPLE_CONTENT].length;++i)
315 locPath = path + currDir[TUPLE_CONTENT][i][TUPLE_NAME];
316 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR) locPath +=
"/";
318 str +=
"<div class='ViewerRoot-hudDirBrowser-item' style='margin-left:" + tabSz +
"px;'>";
320 dirClr = currDir[TUPLE_CONTENT][i][TUPLE_NAME].indexOf(
".root") >= 0?
"#B9E6E6":
"gray";
321 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR_EXPANDED)
323 str +=
"<a title='Collapse Directory\n" + locPath +
"' href='Javascript:ViewerRoot.hud.collapseDirectory(\"" + locPath +
"\");'> + </a> ";
325 str +=
"<a title='Change Directory\n" + locPath +
"' style='color:" + dirClr +
"' href='Javascript:ViewerRoot.hud.changeDirectory(\"" + locPath +
"\");'>" + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
327 else if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR)
329 str +=
"<a title='Expand Directory\n" + locPath +
"' style='color:gray' href='Javascript:ViewerRoot.getDirectoryContents(\"" + locPath +
"\");'> - </a> ";
331 str +=
"<a title='Change Directory\n" + locPath +
"' style='color:" + dirClr +
"' href='Javascript:ViewerRoot.hud.changeDirectory(\"" + locPath +
"\");'>" + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
333 else if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_FILE)
335 if(locPath.indexOf(
".root") > 0)
337 str +=
"<a title='Open Root File\n" + locPath +
"' href='Javascript:ViewerRoot.rootReq(\"" + locPath +
"\");'>" +
338 "<img style='margin:2px 2px -2px 0;' src='/WebPath/js/visualizers_lib/ViewerRoot_lib/img/histo.png'>";
339 str += currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
341 else if(locPath.indexOf(
".rcfg") > 0)
343 str +=
"<a title='Open Root File\n" + locPath +
"' href='Javascript:ViewerRoot.rootConfigReq(\"" + locPath +
"\");'>" +
344 "<img style='margin:2px 2px -2px 0;' src='/WebPath/js/visualizers_lib/ViewerRoot_lib/img/histo3d.png'>";
345 str += currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"</a>";
348 Debug.log(
"ViewerRoot Hud redrawDirectoryDisplay unknown file extension");
351 alert(
"Impossible DIRECTORY error!! Notify admins");
356 if(currDir[TUPLE_CONTENT][i][TUPLE_TYPE] & TUPLE_TYPE_DIR_EXPANDED)
357 str = redrawDirectoryDisplay(currDir[TUPLE_CONTENT][i],tabSz+DIR_DISP_TAB_SZ,
358 path + currDir[TUPLE_CONTENT][i][TUPLE_NAME] +
"/",str);
362 if(ViewerRoot.userPermissions >= ViewerRoot.ADMIN_PERMISSIONS_THRESHOLD &&
363 path.indexOf(PRE_MADE_ROOT_CFG_DIR) >= 0)
365 Debug.log(
"ViewerRoot Hud redrawDirectoryDisplay path " + path);
367 var iconArr = [
"folderopen",
"page",
"remove"];
368 var captionArr = [
"Make New Directory",
"Save New View",
"Delete Pre-made File/Folder!"];
369 for(var i=0;i<captionArr.length;++i)
371 str +=
"<div class='ViewerRoot-hudDirBrowser-item' style='margin-left:" + tabSz +
"px;'>";
372 str +=
"<a style='color:gray' title='Admin action: " + captionArr[i] +
373 "' href='Javascript:ViewerRoot.hud.toggleAdminControls(" + i +
",\"" + path +
"\");'>" +
374 "<img style='margin:2px 2px -2px 0;' src='/WebPath/js/visualizers_lib/ViewerRoot_lib/img/" + iconArr[i] +
".gif'>";
375 str += captionArr[i] +
"</a>";
381 hudDirBrowserDiv.innerHTML = str;
388 this.collapseDirectory =
function(dirPath) {
389 Debug.log(
"ViewerRoot Hud collapseDirectory " + dirPath);
391 var baseDir = findDir(dirPath);
393 baseDir[TUPLE_CONTENT] = 0;
394 baseDir[TUPLE_TYPE] &= ~TUPLE_TYPE_DIR_EXPANDED;
396 redrawDirectoryDisplay();
399 this.changeDirectory =
function(dirPath) {
400 Debug.log(
"ViewerRoot Hud changeDirectory " + dirPath);
401 currDirPtr = findDir(dirPath);
402 ViewerRoot.getDirectoryContents(dirPath);
407 var animateDropDown =
function() {
408 var dir = (animationTargetTop - hudMouseOverDiv.offsetTop > 0)? 1: -1;
410 var tmpTop = hudMouseOverDiv.offsetTop + dir*ViewerRoot.HUD_DROP_DOWN_SPEED;
411 if(Math.abs(tmpTop - animationTargetTop) <= ViewerRoot.HUD_DROP_DOWN_SPEED)
413 hudMouseOverDiv.style.top = animationTargetTop +
"px";
414 isDropDownAnimating =
false;
418 hudMouseOverDiv.style.top = tmpTop +
"px";
419 window.setTimeout(animateDropDown,30);
423 var mouseOverDropDown =
function() {
425 if(isDropDownAnimating)
return;
427 if(!ViewerRoot.hudAutoHide)
return;
431 isDropDownDown =
true;
432 isDropDownAnimating =
true;
433 animationTargetTop = -15;
434 window.setTimeout(animateDropDown,30);
439 var mouseOutDropDown =
function(event) {
440 if(isDropDownAnimating)
return;
444 var e =
event.toElement ||
event.relatedTarget;
447 if(e ==
this)
return;
452 if(!ViewerRoot.hudAutoHide)
return ViewerRoot.hud.handleWindowResize();
456 isDropDownDown =
false;
457 isDropDownAnimating =
true;
458 animationTargetTop = 15 - hudMouseOverDiv.offsetHeight;
459 window.setTimeout(animateDropDown,30);
464 this.toggleControls =
function() {
465 displayingControls = !displayingControls;
466 Debug.log(
"ViewerRoot Hud toggleControls " + displayingControls);
468 if(displayingControls)
470 hudDirBrowserDiv.innerHTML =
"";
472 if(ViewerRoot.hardRefresh)
473 str +=
"<input type='checkbox' id='hardRefreshCheckbox' checked ";
475 str +=
"<input type='checkbox' id='hardRefreshCheckbox' ";
476 str +=
"onchange='if(this.checked) ViewerRoot.hardRefresh = 1; else ViewerRoot.hardRefresh = 0; ViewerRoot.hud.checkboxUpdate(3);'>Hard Refresh";
478 str +=
"<br><div id='hudAdminControlStatus'></div>";
480 str +=
"<a href='javascript:ViewerRoot.hud.toggleControls();' title='Return to ROOT Browser' " +
481 "<u>Return to Browser</u></a>";
482 hudDirBrowserDiv.innerHTML = str;
485 ViewerRoot.hud.changeDirectory(getPath(currDirPtr));
492 this.toggleAdminControls =
function(type, path) {
493 displayingControls = !displayingControls;
494 Debug.log(
"ViewerRoot Hud toggleAdminControls " + displayingControls);
496 if(displayingControls)
498 Debug.log(
"ViewerRoot Hud toggleAdminControls " + type +
": " + path);
500 adminControlsPath = path;
501 hudDirBrowserDiv.innerHTML =
"";
507 str +=
"Make a new ROOT Viewer<br>Configuration Directory<br>at path:<br><br>" + path +
"<br>";
508 str +=
"<input type='text' id='hudAdminControlField' onkeyup='document.getElementById(\"hudAdminControlStatus\").innerHTML=\"\";' size='20' value=''><br>";
509 str +=
"<input type='button' onmouseup=\"ViewerRoot.hud.popUpVerification(" +
510 "'Are you sure you want to create directory with name "REPLACE"?','ViewerRoot.hud.makeConfigDir');\" value='Make New Directory'>";
514 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>";
515 str +=
"<input type='text' id='hudAdminControlField' size='20' value=''><br>";
517 str +=
"<div ><input type='checkbox' id='hudSaveFileRunWildCardCheckbox'>" +
518 "<label for='hudSaveFileRunWildCardCheckbox' >" +
"Use Wildcard Run #" +
"</label></div>";
520 str +=
"<input type='button' onmouseup=\"ViewerRoot.hud.popUpVerification(" +
521 "'Are you sure you want to save a file with name "REPLACE"?','ViewerRoot.hud.saveConfigFile');\" value='Save New File'>";
525 str +=
"Delete a ROOT Viewer<br>Configuration Directory or File<br>at path:<br><br>" + path +
"<br>";
526 str +=
"<input type='text' id='hudAdminControlField' onkeyup='document.getElementById(\"hudAdminControlStatus\").innerHTML=\"\";' size='20' value=''><br>";
527 str +=
"<input type='button' onmouseup=\"ViewerRoot.hud.popUpVerification(" +
528 "'Are you sure you want to delete file or directory with name "REPLACE"?','ViewerRoot.hud.removeConfigPath');\" value='Delete Path'><br>";
533 Debug.log(
"Unknown admin type " + type);
534 throw(
"Unknown type?");
537 str +=
"<br><div id='hudAdminControlStatus'></div>";
539 str +=
"<a href='javascript:ViewerRoot.hud.toggleAdminControls();' title='Return to ROOT Browser' " +
540 "<u>Return to Browser</u></a>";
541 hudDirBrowserDiv.innerHTML = str;
545 ViewerRoot.hud.changeDirectory(getPath(currDirPtr));
548 this.makeConfigDir =
function() {
549 var dir = document.getElementById(
'hudAdminControlField').value;
550 Debug.log(
"ViewerRoot Hud makeConfigDir " + dir);
552 DesktopContent.XMLHttpRequest(
"Request?RequestType=rootAdminControls&cmd=mkdir",
"path="+adminControlsPath+
"&name="+dir, ViewerRoot.hud.adminControlsReqHandler,
561 this.saveConfigFile =
function() {
564 if(ViewerRoot.numPositionsTiled < 1)
566 document.getElementById(
'hudAdminControlStatus').innerHTML =
"You must have at least 1 Root object in your configuration to save it.";
570 var file = document.getElementById(
'hudAdminControlField').value;
571 var wildcard = document.getElementById(
'hudSaveFileRunWildCardCheckbox').checked;
575 fileStr +=
"<ROOT><DATA>";
576 fileStr +=
"<numPositionsTiled>" + ViewerRoot.numPositionsTiled +
"</numPositionsTiled>";
577 fileStr +=
"<runNumWildcard>" + (wildcard?1:0) +
"</runNumWildcard>";
579 for(var i=0;i<ViewerRoot.rootElArr.length;++i)
581 fileStr +=
"<rootObjName>" + ViewerRoot.rootObjNameArr[i] +
"</rootObjName>";
582 fileStr +=
"<rootPos>" + ViewerRoot.rootPosArr[i] +
"</rootPos>";
583 fileStr +=
"<rootIsTransparent>" + (ViewerRoot.rootIsTransparentArr[i]?1:0) +
"</rootIsTransparent>";
584 fileStr +=
"<rootIsAutoRefresh>" + (ViewerRoot.rootIsAutoRefreshArr[i]?1:0) +
"</rootIsAutoRefresh>";
587 fileStr +=
"</DATA></ROOT>";
588 Debug.log(
"ViewerRoot Hud saveConfigFile fileStr " + fileStr);
590 DesktopContent.XMLHttpRequest(
"Request?RequestType=rootAdminControls&cmd=save",
591 "path="+adminControlsPath+
"&name="+file+
"&config="+fileStr, ViewerRoot.hud.adminControlsReqHandler);
594 this.removeConfigPath =
function() {
596 var target = document.getElementById(
'hudAdminControlField').value;
597 Debug.log(
"ViewerRoot Hud removeConfigPath " + target);
599 DesktopContent.XMLHttpRequest(
"Request?RequestType=rootAdminControls&cmd=delete",
"path="+adminControlsPath+
"&name="+target, ViewerRoot.hud.adminControlsReqHandler);
602 this.adminControlsReqHandler =
function(req) {
603 Debug.log(
"ViewerRoot Hud adminControlsReqHandler " + req.responseText);
605 var status = DesktopContent.getXMLValue(req,
'status');
608 ViewerRoot.hud.toggleAdminControls();
610 document.getElementById(
'hudAdminControlStatus').innerHTML = status;
616 this.popUpVerification =
function(prompt, func) {
618 if(hudPopUpDiv) hudPopUpDiv.parentNode.removeChild(hudPopUpDiv);
620 var path = document.getElementById(
'hudAdminControlField').value;
622 var ptrn = /^([a-zA-Z0-9_-]+)$/;
623 if(path.length < 3 || !ptrn.test(path))
625 document.getElementById(
'hudAdminControlStatus').innerHTML =
"Entry must be at least 3 characters and alpha-numeric with only underscores and dashes.";
630 prompt = prompt.replace(/REPLACE/g, path);
632 var el = this.hudDiv;
633 hudPopUpDiv = document.createElement(
"div");
634 hudPopUpDiv.setAttribute(
"class",
"hudPopUpDiv");
635 var str =
"<div id='hudPopUpText'>" + prompt +
"</div>" +
636 "<input type='submit' onmouseup='ViewerRoot.hud.clearPopUpVerification(" + func +
");' value='Yes'> " +
637 " " +
638 "<input type='submit' onmouseup='ViewerRoot.hud.clearPopUpVerification();' value='Cancel'>";
639 hudPopUpDiv.innerHTML = str;
640 el.appendChild(hudPopUpDiv);
645 this.clearPopUpVerification =
function(func) {
647 if(hudPopUpDiv) hudPopUpDiv.parentNode.removeChild(hudPopUpDiv);
651 document.getElementById(
'hudAdminControlStatus').innerHTML =
"Action was cancelled by user!";
654 hudMouseOverDiv = this.hudMouseOverDiv = document.createElement(
'div');
655 hudMouseOverDiv.setAttribute(
"id",
"ViewerRoot-hudMouseOver");
656 hudMouseOverDiv.style.position =
"absolute";
657 hudMouseOverDiv.style.zIndex = 100;
659 this.hudDiv = document.createElement(
'div');
660 this.hudDiv.setAttribute(
"id",
"ViewerRoot-hud");
667 str +=
"With new Root objects...<br>";
669 var chkLabels = [
"Auto-Refresh"];
670 var chkDefaults = [
""];
671 str +=
"<div style='float:right'>"
672 for(var i=0;i<chkLabels.length;++i)
673 str +=
"<input type='checkbox' id='hudCheckbox" + i +
"' onchange='ViewerRoot.hud.checkboxUpdate(" + i +
674 ");' " + chkDefaults[i] +
"><label for='hudCheckbox" + i +
"' >" + chkLabels[i] +
"</label>";
677 var radioLabels = [
"Tile",
"Replace",
"Superimpose"];
678 var radioDefault = ViewerRoot.nextObjectMode;
679 for(var i=0;i<radioLabels.length;++i)
680 str +=
"<input type='radio' id='newRootObjectModeRadio" + i +
"' " + (i==radioDefault?
"checked":
"") +
681 " onchange='ViewerRoot.hud.radioSelect(" + i +
");'" +
682 " name='newRootObjectModeRadio' value='0' /><label for='newRootObjectModeRadio" + i +
"'>" + radioLabels[i] +
"</label><br>";
686 str +=
"<div id='ViewerRoot-hudDirBrowser'></div>";
692 str +=
"<div id='ViewerRoot-hudControlsIcon' " +
693 "style='float:left;margin: -2px 0 -20px 20px; cursor: pointer;' onmouseup='ViewerRoot.hud.toggleControls();' " +
694 "title='Admin Controls'><img width='18px' src='/WebPath/images/dashboardImages/icon-Settings.png'></div>";
696 str +=
"<div style='float:right; margin:-3px 0 -20px 0;'>";
697 str +=
"Refresh Period: <input type='text' id='hudAutoRefreshPeriod' onchange='ViewerRoot.hud.handlerRefreshPeriodChange(this.value);' size='6' value='" +
698 ViewerRoot.autoRefreshPeriod +
"'> ms</div>";
702 str +=
"<a href='javascript:ViewerRoot.clearAll();' title='Clear ROOT objects from view'>Clear</a>";
704 str +=
"<div style='float:right;' ><input type='checkbox' id='hudCheckbox" + chkLabels.length +
"' onchange='ViewerRoot.hud.checkboxUpdate(" + chkLabels.length +
705 ");' " +
"" +
"><label for='hudCheckbox" + chkLabels.length +
"' >" +
"Auto-Hide" +
"</label></div>";
707 str +=
"<div style='float:right;margin-right:10px;' ><input type='checkbox' id='hudCheckbox" + (chkLabels.length+1) +
"' onchange='ViewerRoot.hud.checkboxUpdate(" + (chkLabels.length+1) +
708 ");' " +
"" +
"><label for='hudCheckbox" + (chkLabels.length+1) +
"' >" +
"Pause Refresh" +
"</label></div>";
710 this.hudDiv.innerHTML = str;
717 hudMouseOverDiv.appendChild(this.hudDiv);
719 hudMouseOverDiv.style.width = ViewerRoot.HUD_WIDTH +
"px";
720 hudMouseOverDiv.onmouseover = mouseOverDropDown;
721 hudMouseOverDiv.onmouseout = mouseOutDropDown;
722 ViewerRoot.omni.appendChild(hudMouseOverDiv);
724 hudDirBrowserDiv = document.getElementById(
'ViewerRoot-hudDirBrowser');
732 if(ViewerRoot.hudAutoHide)
735 hudMouseOverDiv.style.top = 15 - hudMouseOverDiv.offsetHeight +
"px";
737 isDropDownDown =
false;
738 isDropDownAnimating =
true;
739 animationTargetTop = 15 - hudMouseOverDiv.offsetHeight;
740 window.setTimeout(animateDropDown,30);
743 this.handleWindowResize();
746 DesktopContent.XMLHttpRequest(
"Request?RequestType=getUserPreferences",
"",handleUserPreferences);