16 if (typeof Debug ==
'undefined')
17 console.log(
'ERROR: Debug is undefined! Must include Debug.js before Desktop.js');
19 if (typeof Desktop ==
'undefined')
20 console.log(
'ERROR: Desktop is undefined! Must include Desktop.js before DesktopDashboard.js');
29 Desktop.createDashboard =
function(z) {
30 if(
false === (
this instanceof Desktop.createDashboard)) {
33 return new Desktop.createDashboard(z);
53 var _defaultDashboardColor =
"rgb(0,40,85)";
59 var _defaultDashboardHeight = 38;
60 var _defaultWindowDashboardWidth = 200;
61 var _defaultWindowDashboardMinWidth = 50;
63 Debug.log(
"Setup Dashboard based on window.parent.window.location.hash=" +
64 window.parent.window.location.hash,
67 var _urlHashVal = (window.parent.window.location.hash && window.parent.window.location.hash.length>1)?
68 (window.parent.window.location.hash.substr(1)|0):
70 var _windowDashboardWidth = ((_urlHashVal|0) > 1)?
71 ((_urlHashVal | 0)*_defaultWindowDashboardWidth/1000):
72 _defaultWindowDashboardWidth;
73 var _displayWindowDashboard =
74 (_urlHashVal === undefined)?1:(_urlHashVal?1:0);
76 var _windowDashboard,_topBar,_showDesktopBtn,_fullScreenBtn,_fullScreenRefreshBtn;
78 var _windowDashboardWindowCSSRule;
80 var _layoutDropDownDisplayed =
false;
81 var _layoutMenuItems = [];
82 var numOfUserLayouts = 5;
83 var numOfSystemLayouts = 5;
84 for(var i=0;i<numOfSystemLayouts;++i)
85 _layoutMenuItems.push(
"System Preset-" + (i+1));
86 _layoutMenuItems.push(
"---");
87 for(var i=0;i<numOfUserLayouts;++i)
88 _layoutMenuItems.push(
"User Preset-" + (i+1));
90 var _dashboardElement, _dashboardColorPostbox;
92 var _deepClickTimer = 0;
96 this.dashboardElement;
104 var _toggleWindowDashboard =
function(event,setValue) {
106 if(setValue !== undefined)
107 _displayWindowDashboard = setValue;
109 _displayWindowDashboard = !_displayWindowDashboard;
111 _setDashboardWidth();
124 _windowDashboard.style.display = _displayWindowDashboard?
"inline":
"none";
125 Desktop.desktop.redrawDesktop();
130 var _setDashboardWidth =
function(w)
132 console.log(
"_setDashboardWidth",w);
133 console.log(
"_setDashboardWidth _windowDashboardWidth",_windowDashboardWidth);
136 _windowDashboardWidth = w|0;
140 if(_windowDashboardWidth < _defaultWindowDashboardMinWidth)
141 _windowDashboardWidth = _defaultWindowDashboardMinWidth;
144 var newURL = window.parent.window.location.pathname +
145 window.parent.window.location.search +
147 (_displayWindowDashboard?
148 ((_windowDashboardWidth*1000/_defaultWindowDashboardWidth)|0):
152 if(!Desktop.isWizardMode())
153 window.parent.window.history.replaceState(
'ots',
'ots', newURL);
155 window.parent.window.history.replaceState(
'ots wiz',
'ots wiz', newURL);
157 Desktop.desktop.redrawDesktop();
165 var _refreshTitle =
function()
169 var hdrW = _windowDashboardWidth - 14;
170 for(var i=0;i<Desktop.desktop.getNumberOfWindows();++i) {
171 el = document.getElementById(
'DesktopDashboard-windowDashboard-win'+i);
172 winIndex = document.getElementById(
'DesktopDashboard-windowDashboard-winIndex'+i).innerHTML;
173 el.innerHTML = Desktop.desktop.getWindowNameByIndex(winIndex) +
174 (Desktop.desktop.getWindowSubNameByIndex(winIndex)==
""?
"":
" - ") +
175 Desktop.desktop.getWindowSubNameByIndex(winIndex);
176 while(el.scrollWidth > hdrW && el.innerHTML.length > 4)
177 el.innerHTML = el.innerHTML.substr(0,el.innerHTML.length-4)+
"...";
179 el.innerHTML +=
"<div class='hiddenDiv' " +
180 "id='DesktopDashboard-windowDashboard-winIndex"+i+
"'>"+ winIndex +
"</div>";
185 var _redrawDashboard =
function()
188 _topBar.style.left = Desktop.desktop.getDesktopX()+
"px";
189 _topBar.style.top = Desktop.desktop.getDesktopY()+
"px";
190 _topBar.style.width = Desktop.desktop.getDesktopWidth()+
"px";
191 _topBar.style.height = _defaultDashboardHeight+
"px";
193 _windowDashboard.style.left = Desktop.desktop.getDesktopX()+
"px";
194 _windowDashboard.style.top = Desktop.desktop.getDesktopY()+_defaultDashboardHeight+
"px";
195 _windowDashboard.style.width = _windowDashboardWidth+
"px";
196 _windowDashboardWindowCSSRule.style.width = (_windowDashboardWidth-34)+
"px";
198 _windowDashboard.style.height = Desktop.desktop.getDesktopHeight()-(Desktop.desktop.getDesktopY()+_defaultDashboardHeight)+
"px";
204 var _getDashboardWindowWidthCSSRule =
function()
208 for(i=0;i<document.styleSheets.length;++i) {
209 Debug.log(document.styleSheets[i].href);
210 if(document.styleSheets[i].href && document.styleSheets[i].href.split(
'/').pop() ==
212 for(j=0;j<document.styleSheets[i].cssRules.length;++j) {
213 if(document.styleSheets[i].cssRules[j].selectorText ==
214 "#Desktop .DesktopDashboard-windowDashboard-win")
215 return document.styleSheets[i].cssRules[j];
220 if(i == document.styleSheets.length) Debug.log(
"FAIL -- Could not locate CSS Rule for Dashboard Window.",Debug.HIGH_PRIORITY);
226 var _windowOrganizeMode = -1;
227 var _windowOrganizeModeTimeout = 0;
228 var _windowDashboardOrganize =
function() {
231 clearTimeout(_windowOrganizeModeTimeout);
232 _windowOrganizeModeTimeout = setTimeout(
function() {_windowOrganizeMode = -1; Debug.log(
"Reseting _windowOrganizeMode.");},10000);
237 var dx = Desktop.desktop.getDesktopContentX(), dy = Desktop.desktop.getDesktopContentY(),
238 dw = Desktop.desktop.getDesktopContentWidth(), dh = Desktop.desktop.getDesktopContentHeight();
241 var numOfWindows = Desktop.desktop.getNumberOfWindows();
244 if(++_windowOrganizeMode < 0 || _windowOrganizeMode > numOfWindows)
245 _windowOrganizeMode = 0;
249 if(_windowOrganizeMode && numOfWindows > 1)
255 var ww = Math.floor(dw/numOfWindows);
260 ww = Math.floor(dw/Math.ceil(numOfWindows/++rows)); wh = Math.floor(dh/rows);
264 var cols = Math.ceil(numOfWindows/rows);
265 Debug.log(
"Desktop Dashboard Organize r" + rows +
" , c" + cols,Debug.LOW_PRIORITY);
272 if(_windowOrganizeMode && numOfWindows > 1)
274 var i = _windowOrganizeMode-1;
276 win = Desktop.desktop.getWindowByIndex(
277 document.getElementById(
'DesktopDashboard-windowDashboard-winIndex'+i).innerHTML);
279 if(win.isMinimized()) win.unminimize();
280 if(win.isMaximized()) win.unmaximize();
283 win.setWindowSizeAndPosition(xx,yy,ww*2,wh);
287 if((ic)%cols==0){xx = dx; yy += wh;}
294 for(var i=0;i<Desktop.desktop.getNumberOfWindows();++i) {
296 if(_windowOrganizeMode && numOfWindows > 1 && i == _windowOrganizeMode-1)
continue;
298 win = Desktop.desktop.getWindowByIndex(
299 document.getElementById(
'DesktopDashboard-windowDashboard-winIndex'+i).innerHTML);
301 if(win.isMinimized()) win.unminimize();
302 if(win.isMaximized()) win.unmaximize();
305 if(i == Desktop.desktop.getNumberOfWindows()-1)
306 win.setWindowSizeAndPosition(xx,yy,ww*(1 + (rows*cols - numOfWindows)),wh);
308 win.setWindowSizeAndPosition(xx,yy,ww,wh);
311 if((++ic)%cols==0){xx = dx; yy += wh;}
316 Desktop.desktop.redrawDashboardWindowButtons();
319 Debug.log(
"Desktop Dashboard Organize Mode: " + _windowOrganizeMode,Debug.LOW_PRIORITY);
322 var _windowDashboardMinimizeAll =
function() {
324 for(var i=0;i<Desktop.desktop.getNumberOfWindows();++i) {
325 win = Desktop.desktop.getWindowByIndex(i);
326 win.minimize();
if(!win.isMinimized()) win.minimize();
331 var _windowDashboardRestoreAll =
function() {
333 for(var i=0;i<Desktop.desktop.getNumberOfWindows();++i) {
334 win = Desktop.desktop.getWindowByIndex(i);
336 if (win.isMaximized())
337 Desktop.desktop.setForeWindow(win);
344 var _windowDashboardToggleWindows =
function () {
353 if(_showDesktopBtn.innerHTML.indexOf(
">Show Desktop</a>") !== -1)
354 _windowDashboardMinimizeAll();
356 _windowDashboardRestoreAll();
358 Desktop.desktop.redrawDashboardWindowButtons();
365 var _windowDashboardRefresh =
function() {
367 Debug.log(
"Window refreshed.");
372 var _windowDashboardLayoutsDropDown =
function() {
373 _layoutDropDownDisplayed = !_layoutDropDownDisplayed;
374 Debug.log(
"Desktop _windowDashboardDefaultsDropDown " +
375 _layoutDropDownDisplayed,Debug.LOW_PRIORITY);
379 el = document.getElementById(
"DesktopDashboard-defaults-dropdown");
382 Debug.log(
"found DesktopDashboard-defaults-dropdown div and deleted",Debug.LOW_PRIORITY);
383 el.parentNode.removeChild(el);
385 if(!_layoutDropDownDisplayed)
return;
388 el = document.createElement(
"div");
389 el.setAttribute(
"id",
"DesktopDashboard-defaults-dropdown");
390 el.style.backgroundColor = _defaultDashboardColor;
392 for(var i=0;i<_layoutMenuItems.length;++i)
393 if(_layoutMenuItems[i] ==
"---")
394 str +=
"<center><hr width='75%' style='border:1px solid; margin-top:5px'/></center>";
396 str +=
"<a href='#' onmouseup='Desktop.desktop.dashboard.windowDashboardLayoutsDropDown(); "
397 +
"Desktop.desktop.defaultLayoutSelect("+i+
"); return false;'>"
398 + _layoutMenuItems[i] +
"</a>";
400 str +=
"<a onclick='Desktop.openNewBrowserTab(" +
401 "\"Desktop.openLayout(" + i +
")\",\"\"," +
402 "\"\",0 /*unique*/);' " +
403 "title='Click to open the layout in a new tab' " +
405 str +=
"<img style='width:11px;margin-left:10px;' " +
406 "src='/WebPath/images/dashboardImages/icon-New-Tab.png'>";
409 if(i<_layoutMenuItems.length-1)
414 _dashboardElement.appendChild(el);
420 this.getDashboardHeight =
function() {
return _defaultDashboardHeight;}
421 this.getDashboardWidth =
function() {
return _displayWindowDashboard?_windowDashboardWidth:0;}
424 this.setDashboardWidth = _setDashboardWidth;
425 this.toggleWindowDashboard = _toggleWindowDashboard;
426 this.redrawDashboard = _redrawDashboard;
427 this.windowDashboardLayoutsDropDown = _windowDashboardLayoutsDropDown;
428 this.windowDashboardOrganize = _windowDashboardOrganize;
431 this.updateWindows =
function()
434 _windowDashboard.innerHTML =
"";
436 var mySortArrId = [];
437 var mySortArrIndex = [];
438 for(var i=0;i<Desktop.desktop.getNumberOfWindows();++i) {
439 mySortArrId.push(Desktop.desktop.getWindowByIndex(i).getWindowId());
440 mySortArrIndex.push(i);
444 for(var i=0;i<mySortArrId.length-1;++i) {
446 for(var j=i+1;j<mySortArrId.length;++j)
447 if(mySortArrId[j] < mySortArrId[min])
452 tmp = mySortArrId[i];
453 mySortArrId[i] = mySortArrId[min];
454 mySortArrId[min] = tmp;
455 tmp = mySortArrIndex[i];
456 mySortArrIndex[i] = mySortArrIndex[min];
457 mySortArrIndex[min] = tmp;
461 var tmpClassStr, defClassStr =
"DesktopDashboard-windowDashboard-win";
463 for(var i=0;i<Desktop.desktop.getNumberOfWindows();++i) {
465 tmpClassStr = defClassStr +
466 ((mySortArrIndex[i] == Desktop.desktop.getNumberOfWindows()-1)?
467 " DesktopDashboard-windowDashboard-foreWin":
"");
468 _windowDashboard.innerHTML +=
470 "onmouseup='Desktop.desktop.dashboard.handleDashboardWinMouseUp(event," +
472 mySortArrId[i] +
");' " +
473 "onmousedown='Desktop.desktop.dashboard.handleDashboardWinMouseDown(event," +
475 mySortArrId[i] +
");' " +
477 "class='" + tmpClassStr +
"' " +
478 "id='DesktopDashboard-windowDashboard-win"+i+
"'>" +
479 Desktop.desktop.getWindowNameByIndex(mySortArrIndex[i]) +
" - " +
480 Desktop.desktop.getWindowSubNameByIndex(mySortArrIndex[i]) +
481 "<div class='hiddenDiv' " +
482 "id='DesktopDashboard-windowDashboard-winIndex"+i+
"'>"+ mySortArrIndex[i] +
491 this.redrawFullScreenButton =
function()
493 _fullScreenBtn.innerHTML =
"<a href='#' title='Click to toggle full screen mode for current window'>" +
494 ((Desktop.desktop.getForeWindow() &&
495 Desktop.desktop.getForeWindow().isMaximized())?
496 "Exit Full Screen":
"Full Screen") +
"</a>";
501 this.redrawRefreshButton =
function()
503 if(Debug.BROWSER_TYPE == Debug.BROWSER_TYPE_FIREFOX)
506 _fullScreenRefreshBtn.innerHTML =
507 "<div style='font-size:32px;margin-top:-12px;' title='Click to reload the desktop and all windows'>↻</div>";
508 _fullScreenRefreshBtn.style.height =
"16px";
509 _fullScreenRefreshBtn.style.padding =
"3px 10px 7px 10px";
513 _fullScreenRefreshBtn.innerHTML =
514 "<div style='font-size: 18px; margin: -1px 0 0 2px; font-weight: 300;' title='Click to reload the desktop and all windows'>↻</div>";
515 _fullScreenRefreshBtn.style.height =
"16px";
516 _fullScreenRefreshBtn.style.padding =
"3px 10px 7px 10px";
521 this.redrawShowDesktopButton =
function()
523 _showDesktopBtn.innerHTML =
"<a href='#' title='Click to toggle minimize/restore all windows'>" +
524 ((Desktop.desktop.getForeWindow() &&
525 Desktop.desktop.getForeWindow().isMinimized())?
526 "Restore Windows":
"Show Desktop") +
"</a>";
531 this.getDefaultDashboardColor =
function() {
return _defaultDashboardColor; }
534 this.setDefaultDashboardColor =
function(color) {
535 _defaultDashboardColor = color;
536 _dashboardColorPostbox.innerHTML = _defaultDashboardColor;
538 _topBar.style.backgroundColor = _defaultDashboardColor;
539 _windowDashboard.style.backgroundColor = _defaultDashboardColor;
542 var _oldUserNameWithLock =
"";
544 this.doSetUserWithLock =
function()
546 Debug.log(
"doSetUserWithLock()");
547 var user = Desktop.desktop.login.getUsername();
549 data +=
"lock=" + ((!_oldUserNameWithLock || _oldUserNameWithLock ==
"")?
"1":
"0") +
"&";
550 data +=
"username=" + user;
552 Desktop.XMLHttpRequest(
553 "Request?RequestType=setUserWithLock&accounts=1",
555 Desktop.desktop.dashboard.handleSetUserWithLock);
559 this.displayUserLock =
function(usernameWithLock, el)
562 el = document.getElementById(
"DesktopDashboard-userWithLock");
564 var user = Desktop.desktop.login.getUsername();
566 data +=
"lock=" + ((!usernameWithLock || usernameWithLock ==
"")?
"1":
"0") +
"&";
567 data +=
"username=" + user;
569 var jsReq =
"Desktop.desktop.dashboard.doSetUserWithLock();";
575 if(_oldUserNameWithLock == usernameWithLock &&
576 el.style.display ==
"block")
582 if(!usernameWithLock || usernameWithLock ==
"")
585 str +=
"<a href='javascript:" + jsReq +
"'" +
586 "title='Click to lockout the system and take the ots Lock'>";
588 "src='/WebPath/images/dashboardImages/icon-Settings-Unlock.png'>";
591 _oldUserNameWithLock =
"";
592 el.style.display =
"block";
596 if(usernameWithLock != user)
597 str =
"<img src='/WebPath/images/dashboardImages/icon-Settings-LockDisabled.png' " +
599 usernameWithLock +
" has the ots Lock'>";
602 str +=
"<a href='javascript:" + jsReq +
"' " +
603 "title='Click to unlock the system and release the ots Lock'>";
605 "src='/WebPath/images/dashboardImages/icon-Settings-Lock.png'>";
610 el.style.display =
"block";
612 _oldUserNameWithLock = usernameWithLock;
616 this.handleSetUserWithLock =
function(req)
620 var serverAlert = Desktop.getXMLValue(req,
"server_alert");
621 if(serverAlert) Debug.log(
"Message from Server: " + serverAlert, Debug.HIGH_PRIORITY);
623 Desktop.desktop.dashboard.displayUserLock(
624 Desktop.getXMLValue(req,
"username_with_lock"));
626 Desktop.desktop.resetDesktop();
632 this.displayConnectionStatus =
function(connected) {
633 var el = document.getElementById(
"DesktopDashboard-serverConnectionStatus");
637 el.style.display =
"none";
642 el.innerHTML =
"*** <a onclick='Desktop.desktop.resetDesktop();//soft reset attempt' " +
643 "style='cursor:pointer; color:rgb(255,150,0);'>Disconnected</a> ***";
644 el.style.display =
"block";
647 document.getElementById(
"DesktopDashboard-userWithLock").style.display =
"none";
652 this.handleDashboardWinMouseUp =
function(event, winId) {
655 window.clearTimeout(_deepClickTimer);
658 Desktop.desktop.clickedWindowDashboard(winId);
662 this.handleDashboardWinMouseDown =
function(event, winId) {
663 event.cancelBubble =
true;
664 event.preventDefault();
665 _deepClickTimer = window.setTimeout(
function() {
667 var targetWin = Desktop.desktop.getWindowById(winId);
668 Debug.log(
"Create Dashboard Window Menu " +
669 targetWin.isMaximized() +
"-" + targetWin.isMinimized());
672 targetWin.isMaximized()?
673 "Restore Window":
"Maximize Window",
674 targetWin.isMinimized()?
675 "Restore Window":
"Minimize Window",
678 var menuItemHandlers = [
679 "Desktop.desktop.maximizeWindowById("+ winId +
")",
680 "Desktop.desktop.minimizeWindowById("+ winId +
")",
681 "Desktop.desktop.closeWindowById("+ winId +
")",
683 Debug.log(
"createEditTableMenu()");
684 SimpleContextMenu.createMenu(
687 "DesktopIconContextMenu",
688 event.pageX-1,event.pageY-1,
689 Desktop.desktop.dashboard.getDefaultDashboardColor(),
700 this.dashboardElement = _dashboardElement = document.createElement(
"div");
701 this.dashboardElement.setAttribute(
"class",
"DesktopDashboard");
702 this.dashboardElement.setAttribute(
"id",
"DesktopDashboard");
705 _topBar = document.createElement(
"div");
706 _topBar.setAttribute(
"class",
"DesktopDashboard-topBar");
707 _topBar.style.position =
"absolute";
708 _topBar.style.zIndex = z;
709 _topBar.style.backgroundColor = _defaultDashboardColor;
711 var tmpBtn = document.createElement(
"div");
712 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button DesktopDashboard-button-left");
713 tmpBtn.innerHTML =
"<a href='#' title='Click to toggle side Window Bar'>" +
714 "<img id='dashboard_bi_arrow' src='/WebPath/images/dashboardImages/icon-Bi-arrow-gray.png'></a>";
715 tmpBtn.onmouseup = _toggleWindowDashboard;
716 _topBar.appendChild(tmpBtn);
718 tmpBtn = document.createElement(
"div");
719 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button DesktopDashboard-button-left");
720 tmpBtn.innerHTML =
"<a href='#' title='Click to open default window layouts'>Layouts</a>";
721 tmpBtn.onmouseup = _windowDashboardLayoutsDropDown;
722 _topBar.appendChild(tmpBtn);
724 tmpBtn = document.createElement(
"div");
725 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button DesktopDashboard-button-left");
726 tmpBtn.innerHTML =
"<a href='#' title='Click to automatically arrange and tile windows'>Tile</a>";
727 tmpBtn.onmouseup = _windowDashboardOrganize;
728 _topBar.appendChild(tmpBtn);
730 _showDesktopBtn = document.createElement(
"div");
731 _showDesktopBtn.setAttribute(
"class",
"DesktopDashboard-button DesktopDashboard-button-left");
732 _showDesktopBtn.innerHTML =
"<a href='#' title='Click to toggle minimize/restore all windows'>Show Desktop</a>";
733 _showDesktopBtn.onmouseup = _windowDashboardToggleWindows;
734 _topBar.appendChild(_showDesktopBtn);
736 _fullScreenBtn = document.createElement(
"div");
737 _fullScreenBtn.setAttribute(
"class",
"DesktopDashboard-button DesktopDashboard-button-left");
738 this.redrawFullScreenButton();
739 _fullScreenBtn.onmouseup = Desktop.desktop.toggleFullScreen;
740 _topBar.appendChild(_fullScreenBtn);
742 _fullScreenRefreshBtn = document.createElement(
"div");
743 _fullScreenRefreshBtn.setAttribute(
"class",
"DesktopDashboard-button DesktopDashboard-button-left");
744 this.redrawRefreshButton();
745 _fullScreenRefreshBtn.onmouseup = Desktop.handleFullScreenWindowRefresh;
746 _topBar.appendChild(_fullScreenRefreshBtn);
749 tmpBtn = document.createElement(
"div");
750 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button-right");
751 tmpBtn.setAttribute(
"id",
"DesktopDashboard-serverConnectionStatus");
752 tmpBtn.setAttribute(
"title",
"Click to attempt to reconnect the server. You could also try refreshing the page, or if the problem persists contact the ots admins.");
753 tmpBtn.style.display =
"none";
754 tmpBtn.style.color =
"rgb(255,150,0)";
755 _topBar.appendChild(tmpBtn);
758 tmpBtn = document.createElement(
"div");
759 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button-right");
760 tmpBtn.setAttribute(
"id",
"DesktopDashboard-userWithLock");
761 tmpBtn.style.display =
"none";
762 tmpBtn.style.marginTop =
"4px";
763 _topBar.appendChild(tmpBtn);
765 tmpBtn = document.createElement(
"div");
766 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button-right");
767 tmpBtn.innerHTML =
"<a target='_blank' href='" +
768 "https://cdcvs.fnal.gov/redmine/projects/otsdaq/wiki/Otsdaq_User_Manual" +
769 " 'title='Click to open ots documentation in a new tab' ><img src='/WebPath/images/dashboardImages/icon-Help.png'></a>";
770 _topBar.appendChild(tmpBtn);
772 if(Desktop.desktop.security == Desktop.SECURITY_TYPE_DIGEST_ACCESS ||
773 Desktop.desktop.security == Desktop.SECURITY_TYPE_NONE)
775 tmpBtn = document.createElement(
"div");
776 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button-right DesktopDashboard-user-account DesktopDashboard-user-logout");
777 tmpBtn.innerHTML =
"<a href='#' title='Click to sign out of your account'>Sign out</a>";
778 tmpBtn.onmouseup = Desktop.logout;
779 _topBar.appendChild(tmpBtn);
781 tmpBtn = document.createElement(
"div");
782 tmpBtn.setAttribute(
"class",
"DesktopDashboard-button-right");
783 tmpBtn.setAttribute(
"id",
"DesktopDashboard-settings-icon");
784 tmpBtn.innerHTML =
"<a href='Javascript:var win = Desktop.desktop.addWindow(\"Settings\",Desktop.desktop.login.getUsername()," +
785 "\"/WebPath/html/UserSettings.html\",true);' title='Click to open settings window'><img src='/WebPath/images/dashboardImages/icon-Settings.png'></a>";
786 _topBar.appendChild(tmpBtn);
788 tmpBtn = document.createElement(
"div");
789 tmpBtn.setAttribute(
"class",
"DesktopDashboard-user-account");
790 tmpBtn.setAttribute(
"id",
"DesktopDashboard-user-displayName");
791 tmpBtn.innerHTML =
"";
792 _topBar.appendChild(tmpBtn);
795 Debug.log(
"Desktop Dashboard is in Wizard mode",Debug.LOW_PRIORITY);
797 this.dashboardElement.appendChild(_topBar);
798 Debug.log(
"Desktop Dashboard Top Bar created",Debug.LOW_PRIORITY);
801 _windowDashboard = document.createElement(
"div");
802 _windowDashboard.setAttribute(
"id",
"DesktopDashboard-windowDashboard");
803 _windowDashboard.style.position =
"absolute";
804 _windowDashboard.style.zIndex = z;
805 _windowDashboard.style.backgroundColor = _defaultDashboardColor;
806 _toggleWindowDashboard(0,_displayWindowDashboard);
807 this.updateWindows();
808 this.dashboardElement.appendChild(_windowDashboard);
811 _dashboardColorPostbox = document.createElement(
"div");
812 _dashboardColorPostbox.setAttribute(
"id",
"DesktopContent-dashboardColorPostbox");
813 _dashboardColorPostbox.style.display =
"none";
814 _dashboardColorPostbox.innerHTML = _defaultDashboardColor;
815 this.dashboardElement.appendChild(_dashboardColorPostbox);
819 _windowDashboard.onmousemove = Desktop.handleWindowMouseMove;
820 _windowDashboard.onmousedown = Desktop.handleWindowMouseDown;
821 _windowDashboard.onmouseup = Desktop.handleWindowMouseUp;
823 _windowDashboardWindowCSSRule = _getDashboardWindowWidthCSSRule();
825 Debug.log(
"Desktop Window Dashboard created",Debug.LOW_PRIORITY);
827 Debug.log(
"Desktop Dashboard created",Debug.LOW_PRIORITY);