File:  [LON-CAPA] / loncom / publisher / publisher.html
Revision 1.29: download - view: text, annotated - select for diffs
Sun Jun 15 18:02:57 2003 UTC (20 years, 10 months ago) by www
Branches: MAIN
CVS tags: version_0_99_3, HEAD
Bug #1265: upper construction space menu bar would not work if lower frame
shows /adm/ or /res/ resources.

    1: <html>
    2: <head>
    3: <title>LON-CAPA Publishing Frame</title>
    4: <script language="JavaScript">
    5: 
    6: function frameloc() {
    7:     if (parent.LONCAPAToBePublished.location.href.indexOf("/~")!=-1) {
    8:        parent.lastknownpriv=parent.LONCAPAToBePublished.location.href;
    9:     }
   10:     return unescape(parent.lastknownpriv);
   11: }
   12: 
   13: function getfilename() {
   14:    document.publisher.filename.value=frameloc();
   15:    if ((document.publisher.filename.value.charAt(
   16:         document.publisher.filename.value.length-1)!='/') &&
   17:        (document.publisher.filename.value.indexOf('/adm/pubdir')==-1)) {
   18:         document.publisher.submit();
   19:    } else {
   20:       alert('Cannot publish directory');
   21:    }
   22: }
   23: 
   24: function getdfilename() {
   25:   document.dpublisher.filename.value=frameloc();
   26:   if (document.dpublisher.filename.value.indexOf('/adm/pubdir')==-1) {
   27:       document.dpublisher.submit();
   28:   }
   29: }
   30: 
   31: function getufilename() {
   32:   document.upublisher.filename.value=frameloc();
   33:   if (document.upublisher.filename.value.indexOf('/adm/pubdir')!=-1) {
   34:       document.upublisher.filename.value=document.dpublisher.filename.value;
   35:   }
   36:   document.upublisher.submit();
   37: }
   38: 
   39: function getrfilename() {
   40:   document.rpublisher.filename.value=frameloc();
   41:    if ((document.rpublisher.filename.value.charAt(
   42:         document.rpublisher.filename.value.length-1)!='/') &&
   43:        (document.rpublisher.filename.value.indexOf('/adm/pubdir')==-1)) {
   44:         document.rpublisher.submit();
   45:    } else {
   46:       alert('Cannot retrieve directory');
   47:    }
   48: }
   49: 
   50: function getactionfilename() {
   51:   document.fileaction.filename.value=frameloc();
   52:   var test=document.fileaction.action.selectedIndex;
   53:   if (test == 4) { // trying to create a directory
   54:       if (document.fileaction.filename.value.indexOf('/adm/pubdir')!=-1) {
   55:           document.fileaction.filename.value=document.dpublisher.filename.value;
   56:       }
   57:       if ((document.fileaction.filename.value.charAt(
   58:            document.fileaction.filename.value.length-1)!='/') &&
   59:            (document.fileaction.filename.value.indexOf('/adm/pubdir')==-1)) {
   60:           alert('Must create new subdirectory inside a directory');
   61:           return;
   62:       }
   63:    }
   64:    document.fileaction.submit();
   65: }
   66: 
   67: function getdelfilename() {
   68:   document.del.filename.value=frameloc();
   69:   document.del.submit();
   70: }
   71: 
   72: function getpostdata() {
   73:   document.printout.postdata.value=frameloc();
   74:   document.printout.submit();
   75: }
   76: </script>
   77:     </head>
   78:     <body bgcolor="#ccffdd" text='#002200' link='#003333' vlink='#006666'>
   79:       <font size="-2">
   80: 	<table border="0" align="center"><tr><th bgcolor="#004400" height="20">
   81: 	      <table border="0" cellspacing="4"><tr valign="middle">
   82: 		  <form name="publisher" action="/adm/publish" target="_parent" method="post">
   83: 		    <td bgcolor="#ccddaa" align="center">
   84: 		      <input type="hidden" name="filename" value="" />
   85: 	              <input type="button" value="Publish this Resource" onClick="getfilename();" />
   86: 		    </td>
   87: 		  </form>
   88: 		  <form name="dpublisher" action="/adm/pubdir" target="LONCAPAToBePublished" method="post">
   89: 		    <td bgcolor="#ccddaa" align="center">
   90: 		      <input type="hidden" name="filename" value="" />
   91: 		      <input type="button" value="List Directory" onClick="getdfilename();" />
   92: 		    </td>
   93: 		  </form>
   94: 		  <form name="upublisher" action="/adm/upload" target="_parent"
   95: 			method="post" enctype="multipart/form-data">
   96: 		    <td bgcolor="#ccddaa" valign="top" align="center">
   97: 		      <input type="hidden" name="filename" value="" />
   98: 		      <input type="file" name="upfile" size="20" />
   99: 		      <input type="button" value="Upload file"  onClick="getufilename();" />
  100: 		    </td>
  101: 		  </form>
  102: 		  <form name="printout" target="_parent" action="/adm/printout" target="LONCAPAToBePublished" method="post" onSubmit="getpostdata();">
  103: 		    <td rowspan="2" bgcolor="#ccddaa" align="center">
  104: 		      <input type="hidden" name="postdata" value="" />
  105: 		      <input type="button" value="Print" onClick="getpostdata();" />
  106: 		    </td>
  107: 		  </form>
  108: 
  109: 		</tr>
  110: 		<tr valign="middle">
  111: 		  <form name="rpublisher" action="/adm/retrieve" target="_parent" method="post">
  112: 		    <td bgcolor="#ccddaa" align="center">
  113: 		      <input type="hidden" name="filename" value="" />
  114: 		      <input type="button" value="Retrieve Old Version" onClick="getrfilename();" />
  115: 		    </td>
  116: 		  </form>
  117: 		  <form name="del" action="/adm/cfile" target="_parent" method="post">
  118: 		    <td bgcolor="#ccddaa">
  119: 		      <input type="hidden" name="filename" value="" />
  120: 		      <input type="hidden" name="action" value="delete" />
  121: 	              <input type="button" value="Delete" onClick="getdelfilename();" />
  122: 		    </td>
  123: 		  </form>
  124: 		  <form name="fileaction" action="/adm/cfile" target="_parent" method="post" onSubmit="getactionfilename();">
  125: 		    <td bgcolor="#ccddaa" align="center">
  126: 		      <nobr>
  127: 			<input type="hidden" name="filename" value="" />
  128: 			  <select name="action">
  129: 			    <option>Select Action</option>
  130: 			    <option value="newfile">New file:</option>
  131: 			    <option value="newhtmlfile">New HTML file:</option>
  132: 			    <option value="newproblemfile">New problem:</option>
  133:                             <option value="newpagefile">New assembled page:</option>
  134:                             <option value="newsequencefile">New assembled sequence:</option>
  135: 			    <option value="newdir">New subdirectory:</option>
  136: 			    <option value="rename">Rename current file to:</option>
  137: 			    <option value="copy">Copy current file to:</option>
  138: 			  </select>&nbsp;<input type="text" name="newfilename" value="Type Name Here" onFocus="if (this.value == 'Type Name Here') this.value=''" />&nbsp;<input type="button" value="Go" onClick="getactionfilename();" />
  139: 		      </nobr>
  140: 		    </td>
  141: 		  </form>
  142: 		</td>
  143: 		</form>
  144: 		</tr>
  145: 	      </table>
  146: 	    </th>
  147: 	  </tr>
  148: 	</table>
  149:       </font>
  150:     </body>
  151:   </html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>