--- loncom/html/res/adm/pages/menu.html 2002/07/26 12:51:11 1.64 +++ loncom/html/res/adm/pages/menu.html 2003/01/29 15:22:06 1.84 @@ -4,7 +4,7 @@ The LearningOnline Network with CAPA Remote Control // -// $Id: menu.html,v 1.64 2002/07/26 12:51:11 matthew Exp $ +// $Id: menu.html,v 1.84 2003/01/29 15:22:06 www Exp $ // // Copyright Michigan State University Board of Trustees // @@ -45,16 +45,24 @@ var statustop = ''; var statusbot = ''; var active = 0; var dislocked = 1; +var statuslocked = 0; -var imgpath='/res/adm/pages/'; - +var imgpath=':8080/res/adm/pages/'; +var fontpath=':8080/adm/lonLCDfont/'; var currentURL=''; var reloadURL=''; +var currentSymb=''; +var reloadSymb=''; var currentStale=1; var menucltim; var clockdelta=0; +var w_extdisp_flag=-1; +var extdisp; + +var autologout=1; + // not used (yet) // var w_Annotator; // var w_bmquery; @@ -74,6 +82,7 @@ var w_LONcatInfo_flag=-1; var hr = new Array; var db = new Array; var dt = new Array; +var ds = new Array; for (var i=1;i<=3;i++) { for (var j=1;j<=10;j++) { @@ -81,6 +90,7 @@ for (var i=1;i<=3;i++) { hr[index]=''; db[index]=''; dt[index]=''; + ds[index]=''; } } @@ -95,30 +105,30 @@ function syncclock(servertime) { function advanceclock() { var clock=new Date(); clock.setTime(clock.getTime()+clockdelta); + if (!statuslocked) { + var days=""+clock.getDate(); + if (days.length<2) { days="0"+days; } + var mons=""+(clock.getMonth()+1); + if (mons.length<2) { mons="0"+mons; } + var years=""+clock.getYear(); + + if (years>1000) { + years=years.substring(2,4); + } else { + years=years.substring(1,3); + } + statustop=mons+'/'+days+'/'+years; + + var secs=""+clock.getSeconds(); + if (secs.length<2) { secs="0"+secs; } + var mins=""+clock.getMinutes(); + if (mins.length<2) { mins="0"+mins; } + var hours=""+clock.getHours(); + if (hours.length<2) { hours=" "+hours; } + statusbot=hours+':'+mins+':'+secs; - var days=""+clock.getDate(); - if (days.length<2) { days="0"+days; } - var mons=""+(clock.getMonth()+1); - if (mons.length<2) { mons="0"+mons; } - var years=""+clock.getYear(); - - if (years>1000) { - years=years.substring(2,4); - } else { - years=years.substring(1,3); + if (!dislocked) { showdisplay(); } } - statustop=mons+'/'+days+'/'+years; - - var secs=""+clock.getSeconds(); - if (secs.length<2) { secs="0"+secs; } - var mins=""+clock.getMinutes(); - if (mins.length<2) { mins="0"+mins; } - var hours=""+clock.getHours(); - if (hours.length<2) { hours=" "+hours; } - statusbot=hours+':'+mins+':'+secs; - - if (!dislocked) { showdisplay(); } - setTimeout('advanceclock();',1000); } @@ -131,6 +141,7 @@ function windowcheck() { } clientwindow.name='loncapaclient'; clientwindow.menuwindow=self; + extenddispclose(); } function logout () { @@ -148,8 +159,9 @@ function logout () { if (w_LONcatInfo_flag!=-1 && loncatinfo && !loncatinfo.closed) { loncatinfo.close(); } - clientwindow.window.location.href="http://"+clienthost+"/adm/logout"; - + if (autologout) { + clientwindow.window.location.href="http://"+clienthost+"/adm/logout"; + } } function activate () { @@ -188,7 +200,7 @@ function showdisplay(utext,ltext) { if (ch==':') { ch='colon'; } if (ch=='/') { ch='slash'; } } else { ch='space'; } - this.document['i'+i].src=imgpath+ch+'.gif'; + this.document['i'+i].src="http://"+clienthost+fontpath+ch+'.gif'; } for (i=0;i<=7;i++) { if (i 1) && (Math.floor(tmp) == tmp)) { - return true; - } - return false; -} - -function cstrgo(currenturl,defaulturl) { - windowcheck(); - var url; - if ((currenturl == null) || - (currenturl == '') || - (! is_editable_resource(currenturl))) { - url = defaulturl; - } else { - url = currenturl; - var res_pattern = /^\/res\/[A-z0-p]+\//; - if (res_pattern.test(url)) { - // map /res/103/turtle to /priv/turtle - url = url.replace(/^\/res\/[A-z0-9]+\//,'/priv/'); - } else { - url = defaulturl; - } - } - this.document['led'].src="ledsend.gif"; - if (url != '') { - clientwindow.window.location.href="http://"+clienthost+url; - } } function go(url) { windowcheck(); - this.document['led'].src="ledsend.gif"; + statuslocked=0; + this.document['led'].src="http://"+clienthost+imgpath+"ledsend.gif"; if (url!='' && url!= null) { currentURL = null; + currentSymb= null; clientwindow.window.location.href="http://"+clienthost+url; } } function gopost(url,postdata) { windowcheck(); - this.document['led'].src="ledsend.gif"; + statuslocked=0; + this.document['led'].src="http://"+clienthost+imgpath+"ledsend.gif"; if (url!='') { this.document.server.action="http://"+clienthost+url; this.document.server.postdata.value=postdata; this.document.server.command.value=''; this.document.server.url.value=''; + this.document.server.symb.value=''; this.document.server.submit(); } } function gocmd(url,cmd) { windowcheck(); - this.document['led'].src="ledsend.gif"; + statuslocked=0; + this.document['led'].src="http://"+clienthost+imgpath+"ledsend.gif"; if (url!='') { this.document.server.action="http://"+clienthost+url; this.document.server.postdata.value=''; this.document.server.command.value=cmd; this.document.server.url.value=currentURL; + this.document.server.symb.value=currentSymb; this.document.server.submit(); } } @@ -334,6 +324,67 @@ function set_bookmark() { bmquery.document.close(); } +function extenddispclose() { + if (w_extdisp_flag>0) { + if (extdisp!=null && !extdisp.closed) { + extdisp.close(); + } + w_extdisp_flag=-1; + } +} + +function extenddisp() { + go(''); + w_extdisp_flag=1; + extdisp=window.open("http://"+clienthost+"/adm/rat/empty.html", + "ExtDisp", "scrollbars=1,width=400,height=450"); + extdisp.document.clear(); + extdisp.document.writeln( + ''+ + '

LON-CAPA Extended Display Remote Control

'+ + ''+ + ''+ + ''); + for (var i=0; i<=ds.length; i++) { + if (typeof(ds[i])!='undefined') { + if (ds[i]!='') { + extdisp.document.writeln( + ''); + } + } + } + extdisp.document.writeln('
Select Functionality from BelowDescription
>>><<<
 
'+ + ''); + for (var j=0;j<=7;j++) { + if (j'); + } + extdisp.document.writeln(''); + for (var j=0;j<=7;j++) { + if (j'); + } + extdisp.document.writeln( + '
'+ds[i]+'
'); + extdisp.document.close(); +} function edit_bookmarks() { go(''); w_BookmarkPal_flag=1; @@ -344,7 +395,7 @@ function edit_bookmarks() { function catalog_info() { go(''); w_LONcatInfo_flag=1; - loncatinfo=window.open(clientwindow.window.location.href+'.meta',"LONcatInfo"); + loncatinfo=window.open(clientwindow.window.location.pathname+'.meta',"LONcatInfo"); } // --> @@ -353,17 +404,17 @@ function catalog_info() { +> - +
- +>
@@ -371,24 +422,24 @@ function catalog_info() { - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
@@ -399,81 +450,76 @@ function catalog_info() { - - + + - - - + + + - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + +
-
- -
-
+