Annotation of loncom/html/res/adm/pages/menu.html, revision 1.62
1.1 www 1: <html>
2: <!--
3: The LearningOnline Network with CAPA
4: Remote Control
1.40 www 5:
6: //
1.62 ! www 7: // $Id: menu.html,v 1.61 2002/07/16 20:30:53 www Exp $
1.40 www 8: //
9: // Copyright Michigan State University Board of Trustees
10: //
11: // This file is part of the LearningOnline Network with CAPA (LON-CAPA).
12: //
13: // LON-CAPA is free software; you can redistribute it and/or modify
14: // it under the terms of the GNU General Public License as published by
15: // the Free Software Foundation; either version 2 of the License, or
16: // (at your option) any later version.
17: //
18: // LON-CAPA is distributed in the hope that it will be useful,
19: // but WITHOUT ANY WARRANTY; without even the implied warranty of
20: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: // GNU General Public License for more details.
22: //
23: // You should have received a copy of the GNU General Public License
24: // along with LON-CAPA; if not, write to the Free Software
25: // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26: //
27: // /home/httpd/html/adm/gpl.txt
28: //
29: // http://www.lon-capa.org/
30: //
31:
1.1 www 32: -->
33: <head>
34: <title>LON-CAPA Remote</title>
35: </head>
36:
1.23 www 37: <body bgcolor="#BBBBBB"
1.46 www 38: background="remotebg.gif"
1.49 matthew 39: onUnload="logout();"
40: >
1.62 ! www 41: <font size="1">
1.19 albertel 42: <script type="text/javascript">
1.22 harris41 43: <!--
1.44 matthew 44: var statustop = '';
45: var statusbot = '';
46: var active = 0;
1.55 www 47: var dislocked = 1;
1.1 www 48:
1.44 matthew 49: var imgpath='/res/adm/pages/';
1.31 www 50:
1.27 harris41 51: var currentURL='';
1.59 www 52: var reloadURL='';
1.28 www 53: var currentStale=1;
1.33 www 54: var menucltim;
1.60 www 55:
56: var clockdelta=0;
1.55 www 57:
1.25 harris41 58: // not used (yet)
59: // var w_Annotator;
60: // var w_bmquery;
61: // var w_BookmarkPal;
62: // var w_LONcatInfo;
63:
64: //////////////////////////////////////
65: var w_Annotator_flag=-1;
66: var w_bmquery_flag=-1;
67: var w_BookmarkPal_flag=-1;
68: var w_LONcatInfo_flag=-1;
69: // 1 means currently open
70: // 0 means closed (but has been open)
71: // -1 means never yet opened/defined
72: ///////////////////////////////////////
73:
1.44 matthew 74: var hr = new Array;
75: var db = new Array;
76: var dt = new Array;
77:
78: for (var i=1;i<=3;i++) {
79: for (var j=1;j<=10;j++) {
80: var index = 10*j+i;
1.49 matthew 81: hr[index]='';
82: db[index]='';
83: dt[index]='';
1.44 matthew 84: }
85: }
1.31 www 86:
1.44 matthew 87: var clienthost=window.location.host;
88: var clientwindow=opener;
1.1 www 89:
1.60 www 90: function syncclock(servertime) {
91: var clientclock=new Date;
92: clockdelta=servertime-clientclock.getTime();
93: }
94:
1.55 www 95: function advanceclock() {
1.60 www 96: var clock=new Date();
97: clock.setTime(clock.getTime()+clockdelta);
1.58 www 98:
99: var days=""+clock.getDate();
100: if (days.length<2) { days="0"+days; }
101: var mons=""+(clock.getMonth()+1);
102: if (mons.length<2) { mons="0"+mons; }
103: var years=""+clock.getYear();
104: years=years.substring(1,3);
105: statustop=mons+'/'+days+'/'+years;
106:
1.56 www 107: var secs=""+clock.getSeconds();
108: if (secs.length<2) { secs="0"+secs; }
109: var mins=""+clock.getMinutes();
1.57 www 110: if (mins.length<2) { mins="0"+mins; }
1.56 www 111: var hours=""+clock.getHours();
112: if (hours.length<2) { hours=" "+hours; }
113: statusbot=hours+':'+mins+':'+secs;
1.58 www 114:
115: if (!dislocked) { showdisplay(); }
116:
1.55 www 117: setTimeout('advanceclock();',1000);
118: }
119:
1.1 www 120: function windowcheck() {
1.45 www 121: if (clientwindow==null || clientwindow.closed) {
122: clientwindow=window.open("http://"+clienthost+"/",'',
123: "height=400,width=440,"+
124: "scrollbars=1,toolbar=1,status=1,resizable=1,location=1,"+
125: "left=190,top=15,screenX=190,screenY=15");
1.1 www 126: }
1.7 www 127: clientwindow.name='loncapaclient';
1.45 www 128: clientwindow.menuwindow=self;
1.1 www 129: }
130:
1.5 www 131: function logout () {
1.10 www 132: windowcheck();
1.41 www 133:
1.25 harris41 134: if (w_Annotator_flag!=-1 && annotator && !annotator.closed) {
135: annotator.close();
136: }
137: if (w_bmquery_flag!=-1 && bmquery && !bmquery.closed) {
138: bmquery.close();
139: }
140: if (w_BookmarkPal_flag!=-1 && bookmarkpal && !bookmarkpal.closed) {
141: bookmarkpal.close();
142: }
143: if (w_LONcatInfo_flag!=-1 && loncatinfo && !loncatinfo.closed) {
144: loncatinfo.close();
145: }
1.9 www 146: clientwindow.window.location.href="http://"+clienthost+"/adm/logout";
1.41 www 147:
1.1 www 148: }
149:
1.23 www 150: function activate () {
1.31 www 151: opener.menuloaded=1;
1.23 www 152: setTimeout('active=1;',2000);
1.55 www 153: advanceclock();
1.23 www 154: }
155:
156: function deactivate () {
157: active=0;
158: }
159:
1.1 www 160: function display(utext,ltext) {
1.58 www 161: this.window.focus();
162: showdisplay(utext,ltext);
163: }
164:
165: function showdisplay(utext,ltext) {
1.23 www 166: var i; var ch;
1.55 www 167: dislocked=1;
1.47 matthew 168: if (utext == null) { utext = '';}
169: if (ltext == null) { ltext = '';}
1.49 matthew 170: if (typeof(utext)!="string") { utext=''; }
171: if (typeof(ltext)!="string") { ltext=''; }
1.31 www 172: if ((utext=='') && (ltext=='')) {
173: utext=statustop;
174: ltext=statusbot;
1.55 www 175: dislocked=0;
1.31 www 176: }
1.23 www 177: if (active) {
1.1 www 178: for (i=0;i<=7;i++) {
179: if (i<utext.length) {
180: ch=utext.charAt(i);
181: if (ch==' ') { ch='space'; }
182: if (ch=='-') { ch='hyphen'; }
1.55 www 183: if (ch==':') { ch='colon'; }
184: if (ch=='/') { ch='slash'; }
1.1 www 185: } else { ch='space'; }
1.31 www 186: this.document['i'+i].src=imgpath+ch+'.gif';
1.1 www 187: }
188: for (i=0;i<=7;i++) {
189: if (i<ltext.length) {
190: ch=ltext.charAt(i);
191: if (ch==' ') { ch='space'; }
192: if (ch=='-') { ch='hyphen'; }
1.55 www 193: if (ch==':') { ch='colon'; }
194: if (ch=='/') { ch='slash'; }
1.1 www 195: } else { ch='space'; }
1.31 www 196: this.document['j'+i].src=imgpath+ch+'.gif';
1.1 www 197: }
1.23 www 198: }
1.1 www 199: }
200:
201: function defdis() {
202: this.window.focus();
1.55 www 203: display();
1.1 www 204: }
205:
1.31 www 206: function switchbutton(row,col,imgsrc,texttop,textbot,action) {
207: var idx=10*row+col;
1.39 www 208: this.document['b'+idx].src="http://"+clienthost+imgpath+imgsrc;
1.31 www 209: hr[idx]=action;
210: dt[idx]=texttop;
211: db[idx]=textbot;
1.39 www 212: }
1.31 www 213:
214: function clearbut(row,col) {
215: var idx=10*row+col;
1.39 www 216: this.document['b'+idx].src="http://"+clienthost+imgpath+'empty.gif';
1.31 www 217: hr[idx]='javascript:defdis();';
218: dt[idx]='';
219: db[idx]='';
220: }
221:
1.1 www 222: function setstatus(tp,bt) {
223: this.document['led'].src="ledblink.gif";
224: statustop=tp;
225: statusbot=bt;
226: defdis();
227: endsend();
228: }
229:
1.52 matthew 230: function is_editable_resource (url) {
231: var Chunks = url.split('.');
232: var tmp = Chunks[Chunks.length-1];
233: if ((Chunks.length > 1) && (Math.floor(tmp) == tmp)) {
234: return true;
235: }
236: return false;
237: }
238:
1.47 matthew 239: function cstrgo(currenturl,defaulturl) {
240: windowcheck();
241: var url;
1.52 matthew 242: if ((currenturl == null) ||
243: (currenturl == '') ||
244: (! is_editable_resource(currenturl))) {
1.48 matthew 245: url = defaulturl;
246: } else {
1.47 matthew 247: url = currenturl;
1.48 matthew 248: var res_pattern = /^\/res\/[A-z0-p]+\//;
249: if (res_pattern.test(url)) {
250: // map /res/103/turtle to /priv/turtle
251: url = url.replace(/^\/res\/[A-z0-9]+\//,'/priv/');
252: } else {
1.47 matthew 253: url = defaulturl;
254: }
255: }
256: this.document['led'].src="ledsend.gif";
257: if (url != '') {
258: clientwindow.window.location.href="http://"+clienthost+url;
259: }
260: }
261:
1.1 www 262: function go(url) {
1.10 www 263: windowcheck();
1.1 www 264: this.document['led'].src="ledsend.gif";
1.53 matthew 265: if (url!='' && url!= null) {
1.47 matthew 266: currentURL = null;
1.7 www 267: clientwindow.window.location.href="http://"+clienthost+url;
268: }
269: }
270:
271: function gopost(url,postdata) {
1.10 www 272: windowcheck();
1.7 www 273: this.document['led'].src="ledsend.gif";
274: if (url!='') {
275: this.document.server.action="http://"+clienthost+url;
1.8 www 276: this.document.server.postdata.value=postdata;
1.34 www 277: this.document.server.command.value='';
278: this.document.server.url.value='';
279: this.document.server.submit();
280: }
281: }
282:
283: function gocmd(url,cmd) {
284: windowcheck();
285: this.document['led'].src="ledsend.gif";
286: if (url!='') {
287: this.document.server.action="http://"+clienthost+url;
288: this.document.server.postdata.value='';
289: this.document.server.command.value=cmd;
290: this.document.server.url.value=currentURL;
1.7 www 291: this.document.server.submit();
1.1 www 292: }
293: }
294:
1.2 tyszkabe 295: function annotate() {
1.25 harris41 296: w_Annotator_flag=1;
1.11 tyszkabe 297: annotator=window.open('','Annotator','width=365,height=265,scrollbars=0');
1.14 www 298: annotator.document.write(
299: "<html><body onload='Javascript:document.goannotate.submit();'>"
300: +"<form name='goannotate' target='Annotator' method='post' "
301: +"action='/adm/annotations'>"
1.36 www 302: +"<input type='hidden' name='urlnew' value='"+currentURL+"'>"
1.14 www 303: +"</form></body></html>");
304: annotator.document.close();
1.2 tyszkabe 305: }
306:
307: function set_bookmark() {
308: go('');
1.36 www 309: if (currentStale) {
310: clienttitle="Enter Title";
311: clienthref=currentURL;
312: } else {
313: clienttitle=clientwindow.document.title;
314: clienthref=clientwindow.location.pathname;
315: }
1.25 harris41 316: w_bmquery_flag=1;
1.24 tyszkabe 317: bmquery=window.open('','bmquery','width=365,height=165,scrollbars=0');
318: bmquery.document.write(
319: "<html><body bgcolor='bbbbbb'><center><form method='post'"
320: +" name='newlink' action='/adm/bookmarks' target='bmquery' "
321: +">\n <table width=340 height=150 "
322: +"bgcolor='ffffff' align=center><tr><td>Link Name:<br><input "
323: +"type='text' name='title' size=45 value='"+clienttitle+"'>"
324: +"<br>Address:<br><input type='text' name='address' size='45' "
325: +"value='"+clienthref+"'><br><center><input type='submit' "
326: +"value='Save'> <input type='button' value='Close (no save)' "
327: +"onclick='javascript:window.close();'></center></td>"
328: +"</tr></table></form></center></body></html>");
329: bmquery.document.close();
1.2 tyszkabe 330: }
331:
332: function edit_bookmarks() {
333: go('');
1.25 harris41 334: w_BookmarkPal_flag=1;
335: bookmarkpal=window.open("http://"+clienthost+"/adm/bookmarks",
1.6 www 336: "BookmarkPal", "width=400,height=505,scrollbars=0");
1.2 tyszkabe 337: }
338:
1.14 www 339: function catalog_info() {
340: go('');
1.25 harris41 341: w_LONcatInfo_flag=1;
342: loncatinfo=window.open(clientwindow.window.location.href+'.meta',"LONcatInfo");
1.14 www 343: }
1.22 harris41 344: // -->
1.1 www 345: </script>
346: <center>
1.54 matthew 347: <table hspace="0" border="0" cellspacing="0" cellpadding="0">
1.1 www 348: <tr><td>
349: <a href="javascript:defdis();"
350: onMouseOver="defdis();"
1.54 matthew 351: ><img border="0" width="80" height="50" src="title.gif"></a>
1.1 www 352: </td><td>
1.54 matthew 353: <img border="0" width="50" height="50" name="led" src="ledoff.gif">
1.1 www 354: </td></tr>
355: </table>
1.54 matthew 356: </center>
357:
358: <center>
359: <a href="javascript:defdis();"
360: onMouseOver="defdis();"
1.62 ! www 361: ><img width="103" height="3" border="0" src="spacer.gif" /></a>
1.54 matthew 362: </center>
363:
364: <center>
365: <table hspace="1" border="0" cellspacing="0" cellpadding="1">
1.1 www 366: <tr><td bgcolor="#666666">
1.54 matthew 367: <table hspace="0" border="0" cellspacing="1" cellpadding="0">
1.1 www 368: <tr>
1.62 ! www 369: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i0" width="15" height="19" src="l.gif" /></a></td>
! 370: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i1" width="15" height="19" src="o.gif" /></a></td>
! 371: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i2" width="15" height="19" src="n.gif" /></a></td>
! 372: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i3" width="15" height="19" src="hyphen.gif"></a></td>
! 373: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i4" width="15" height="19" src="c.gif" /></a></td>
! 374: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i5" width="15" height="19" src="a.gif" /></a></td>
! 375: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i6" width="15" height="19" src="p.gif" /></a></td>
! 376: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="i7" width="15" height="19" src="a.gif" /></a></td>
! 377: </tr>
! 378: <tr>
! 379: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j0" width="15" height="19" src="space.gif" /></a></td>
! 380: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j1" width="15" height="19" src="space.gif" /></a></td>
! 381: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j2" width="15" height="19" src="space.gif" /></a></td>
! 382: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j3" width="15" height="19" src="space.gif" /></a></td>
! 383: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j4" width="15" height="19" src="space.gif" /></a></td>
! 384: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j5" width="15" height="19" src="space.gif" /></a></td>
! 385: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j6" width="15" height="19" src="space.gif" /></a></td>
! 386: <td><a href="javascript:defdis();" onMouseOver="defdis();"><img border="0" name="j7" width="15" height="19" src="space.gif" /></a></td>
1.1 www 387: </tr>
388: </table>
1.54 matthew 389: </td></tr>
390: </table>
391: </center>
1.1 www 392:
1.54 matthew 393: <center>
394: <table hspace="0" border="0" cellspacing="0" cellpadding="0">
1.31 www 395:
396: <tr>
1.54 matthew 397: <td colspan="2"><a href="javascript:eval(hr[11]);" onMouseOver="display(dt[11],db[11]);"><img width="86" height="20" border="0" name="b11" src="dempty.gif" /></a></td>
398: <td><a href="javascript:eval(hr[12]);" onMouseOver="display(dt[12],db[12]);"><img width="43" height="20" border="0" name="b12" src="empty.gif" /></a></td>
1.31 www 399: </tr>
400:
401: <tr>
1.54 matthew 402: <td rowspan="2"><a href="javascript:eval(hr[21]);" onMouseOver="display(dt[21],db[21]);"><img width="43" height="40" border="0" name="b21" src="qempty.gif" /></a></td>
403: <td><a href="javascript:eval(hr[22]);" onMouseOver="display(dt[22],db[22]);"><img width="43" height="20" border="0" name="b22" src="empty.gif" /></a></td>
404: <td rowspan="2"><a href="javascript:eval(hr[23]);" onMouseOver="display(dt[23],db[23]);"><img width="43" height="40" border="0" name="b23" src="qempty.gif" /></a></td>
1.31 www 405: </tr>
406:
407: <tr>
1.54 matthew 408: <td><a href="javascript:eval(hr[31]);" onMouseOver="display(dt[31],db[31]);"><img width="43" height="20" border="0" name="b31" src="empty.gif" /></a></td>
1.31 www 409: </tr>
410:
411: <tr>
1.54 matthew 412: <td><a href="javascript:eval(hr[41]);" onMouseOver="display(dt[41],db[41]);"><img width="43" height="20" border="0" name="b41" src="empty.gif" /></a></td>
413: <td><a href="javascript:eval(hr[42]);" onMouseOver="display(dt[42],db[42]);"><img width="43" height="20" border="0" name="b42" src="empty.gif" /></a></td>
414: <td><a href="javascript:eval(hr[43]);" onMouseOver="display(dt[43],db[43]);"><img width="43" height="20" border="0" name="b43" src="empty.gif" /></a></td>
1.31 www 415: </tr>
416:
417: <tr>
1.54 matthew 418: <td><a href="javascript:eval(hr[51]);" onMouseOver="display(dt[51],db[51]);"><img width="43" height="20" border="0" name="b51" src="empty.gif" /></a></td>
419: <td><a href="javascript:eval(hr[52]);" onMouseOver="display(dt[52],db[52]);"><img width="43" height="20" border="0" name="b52" src="empty.gif" /></a></td>
420: <td><a href="javascript:eval(hr[53]);" onMouseOver="display(dt[53],db[53]);"><img width="43" height="20" border="0" name="b53" src="empty.gif" /></a></td>
1.31 www 421: </tr>
422:
423: <tr>
1.54 matthew 424: <td><a href="javascript:eval(hr[61]);" onMouseOver="display(dt[61],db[61]);"><img width="43" height="20" border="0" name="b61" src="empty.gif" /></a></td>
425: <td><a href="javascript:eval(hr[62]);" onMouseOver="display(dt[62],db[62]);"><img width="43" height="20" border="0" name="b62" src="empty.gif" /></a></td>
426: <td><a href="javascript:eval(hr[63]);" onMouseOver="display(dt[63],db[63]);"><img width="43" height="20" border="0" name="b63" src="empty.gif" /></a></td>
1.31 www 427: </tr>
428:
429: <tr>
1.54 matthew 430: <td><a href="javascript:eval(hr[71]);" onMouseOver="display(dt[71],db[71]);"><img width="43" height="20" border="0" name="b71" src="empty.gif" /></a></td>
431: <td><a href="javascript:eval(hr[72]);" onMouseOver="display(dt[72],db[72]);"><img width="43" height="20" border="0" name="b72" src="empty.gif" /></a></td>
432: <td><a href="javascript:eval(hr[73]);" onMouseOver="display(dt[73],db[73]);"><img width="43" height="20" border="0" name="b73" src="empty.gif" /></a></td>
1.31 www 433: </tr>
434:
435: <tr>
1.54 matthew 436: <td><a href="javascript:eval(hr[81]);" onMouseOver="display(dt[81],db[81]);"><img width="43" height="20" border="0" name="b81" src="empty.gif" /></a></td>
437: <td><a href="javascript:eval(hr[82]);" onMouseOver="display(dt[82],db[82]);"><img width="43" height="20" border="0" name="b82" src="empty.gif" /></a></td>
438: <td><a href="javascript:eval(hr[83]);" onMouseOver="display(dt[83],db[83]);"><img width="43" height="20" border="0" name="b83" src="empty.gif" /></a></td>
1.31 www 439: </tr>
1.1 www 440:
1.31 www 441: <tr>
1.54 matthew 442: <td><a href="javascript:eval(hr[91]);" onMouseOver="display(dt[91],db[91]);"><img width="43" height="20" border="0" name="b91" src="empty.gif" /></a></td>
443: <td><a href="javascript:eval(hr[92]);" onMouseOver="display(dt[92],db[92]);"><img width="43" height="20" border="0" name="b92" src="empty.gif" /></a></td>
444: <td><a href="javascript:eval(hr[93]);" onMouseOver="display(dt[93],db[93]);"><img width="43" height="20" border="0" name="b93" src="empty.gif" /></a></td>
1.35 www 445: </tr>
446:
447: <tr>
1.54 matthew 448: <td><a href="javascript:eval(hr[101]);" onMouseOver="display(dt[101],db[101]);"><img width="43" height="20" border="0" name="b101" src="empty.gif" /></a></td>
449: <td><a href="javascript:eval(hr[102]);" onMouseOver="display(dt[102],db[102]);"><img width="43" height="20" border="0" name="b102" src="empty.gif" /></a></td>
450: <td><a href="javascript:eval(hr[103]);" onMouseOver="display(dt[103],db[103]);"><img width="43" height="20" border="0" name="b103" src="empty.gif" /></a></td>
1.31 www 451: </tr>
1.1 www 452:
1.62 ! www 453: <tr>
! 454: <td><a href="javascript:eval(hr[111]);" onMouseOver="display(dt[111],db[111]);"><img width="43" height="20" border="0" name="b111" src="empty.gif" /></a></td>
! 455: <td><a href="javascript:eval(hr[112]);" onMouseOver="display(dt[112],db[112]);"><img width="43" height="20" border="0" name="b112" src="empty.gif" /></a></td>
! 456: <td><a href="javascript:eval(hr[113]);" onMouseOver="display(dt[113],db[113]);"><img width="43" height="20" border="0" name="b113" src="empty.gif" /></a></td>
! 457: </tr>
! 458:
1.31 www 459: </table>
1.54 matthew 460: </center>
1.1 www 461:
1.54 matthew 462: <center>
1.1 www 463: <a href="javascript:defdis();"
464: onMouseOver="defdis();"
1.54 matthew 465: ><img width="103" height="7" border="0" src="spacer.gif" /></a>
466: </center>
1.1 www 467:
1.54 matthew 468: <form name="server" action="/adm/logout" method="post" target="loncapaclient">
469: <input type="hidden" name="postdata" value="none" />
1.34 www 470: <input type="hidden" name="command" value="none" />
471: <input type="hidden" name="url" value="none" />
1.54 matthew 472: </form>
1.37 harris41 473: <script>
474: activate();
475: </script>
1.62 ! www 476: </font>
1.1 www 477: </body>
1.20 www 478: </html>
1.42 matthew 479:
480:
481:
482:
483:
484:
485:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>