Annotation of loncom/publisher/publisher.html, revision 1.38

1.1       www         1: <html>
                      2: <head>
                      3: <title>LON-CAPA Publishing Frame</title>
1.38    ! albertel    4: <script type="text/javascript">
        !             5: //<!--
1.29      www         6: function frameloc() {
1.31      www         7:     if (parent.LONCAPAToBePublished.location.pathname.indexOf("/~")!=-1) {
                      8:        parent.lastknownpriv=parent.LONCAPAToBePublished.location.pathname;
1.29      www         9:     }
1.31      www        10: // alert ('We are at '+parent.lastknownpriv);
1.29      www        11:     return unescape(parent.lastknownpriv);
                     12: }
1.1       www        13: 
                     14: function getfilename() {
1.29      www        15:    document.publisher.filename.value=frameloc();
1.7       www        16:    if ((document.publisher.filename.value.charAt(
                     17:         document.publisher.filename.value.length-1)!='/') &&
                     18:        (document.publisher.filename.value.indexOf('/adm/pubdir')==-1)) {
                     19:         document.publisher.submit();
                     20:    } else {
1.35      www        21:       alert('MT{Cannot publish directory}');
1.7       www        22:    }
1.1       www        23: }
                     24: 
1.4       www        25: function getdfilename() {
1.29      www        26:   document.dpublisher.filename.value=frameloc();
1.6       www        27:   if (document.dpublisher.filename.value.indexOf('/adm/pubdir')==-1) {
                     28:       document.dpublisher.submit();
                     29:   }
1.4       www        30: }
                     31: 
1.9       www        32: function getufilename() {
1.29      www        33:   document.upublisher.filename.value=frameloc();
1.14      www        34:   if (document.upublisher.filename.value.indexOf('/adm/pubdir')!=-1) {
                     35:       document.upublisher.filename.value=document.dpublisher.filename.value;
1.9       www        36:   }
1.14      www        37:   document.upublisher.submit();
1.9       www        38: }
                     39: 
1.4       www        40: function getrfilename() {
1.29      www        41:   document.rpublisher.filename.value=frameloc();
1.8       www        42:    if ((document.rpublisher.filename.value.charAt(
                     43:         document.rpublisher.filename.value.length-1)!='/') &&
                     44:        (document.rpublisher.filename.value.indexOf('/adm/pubdir')==-1)) {
                     45:         document.rpublisher.submit();
                     46:    } else {
1.35      www        47:       alert('MT{Cannot retrieve directory}');
1.8       www        48:    }
1.4       www        49: }
                     50: 
1.24      albertel   51: function getactionfilename() {
1.29      www        52:   document.fileaction.filename.value=frameloc();
1.24      albertel   53:   var test=document.fileaction.action.selectedIndex;
1.34      albertel   54:   if (test == 8) { // trying to create a directory
1.24      albertel   55:       if (document.fileaction.filename.value.indexOf('/adm/pubdir')!=-1) {
                     56:           document.fileaction.filename.value=document.dpublisher.filename.value;
                     57:       }
                     58:       if ((document.fileaction.filename.value.charAt(
                     59:            document.fileaction.filename.value.length-1)!='/') &&
                     60:            (document.fileaction.filename.value.indexOf('/adm/pubdir')==-1)) {
1.35      www        61:           alert('MT{Must create new subdirectory inside a directory}');
1.24      albertel   62:           return;
                     63:       }
1.11      www        64:    }
1.24      albertel   65:    document.fileaction.submit();
1.11      www        66: }
1.20      www        67: 
1.25      albertel   68: function getdelfilename() {
1.29      www        69:   document.del.filename.value=frameloc();
1.25      albertel   70:   document.del.submit();
                     71: }
                     72: 
1.32      albertel   73: function getcurseed() {
                     74:   if (parent.LONCAPAToBePublished.document.lonhomework
                     75:        &&
                     76:       parent.LONCAPAToBePublished.document.lonhomework.rndseed
                     77:        &&
                     78:       parent.LONCAPAToBePublished.document.lonhomework.rndseed.value) {
                     79:     return parent.LONCAPAToBePublished.document.lonhomework.rndseed.value;
                     80:   }
                     81:   return 0;
                     82: }
                     83: 
1.37      sakharuk   84: function getproblemtype() {
                     85:   if (parent.LONCAPAToBePublished.document.lonhomework) {
                     86:      var optionelement;
                     87:      var valueIndex=0;
                     88:      for (var optionIndex=0;
                     89:           optionIndex < parent.LONCAPAToBePublished.document.lonhomework.problemtype.options.length;
                     90: 	  optionIndex++)
                     91:      {
                     92:          optionElement=parent.LONCAPAToBePublished.document.lonhomework.problemtype.options[optionIndex];
                     93: 	 if (optionElement.selected) {
                     94: 	    return optionElement.value;
                     95:          }	  
                     96:      } 	  
                     97:   }
                     98:   return 0;
                     99: }
                    100: 
1.20      www       101: function getpostdata() {
1.29      www       102:   document.printout.postdata.value=frameloc();
1.32      albertel  103:   document.printout.curseed.value=getcurseed();
1.37      sakharuk  104:   document.printout.problemtype.value=getproblemtype();
1.20      www       105:   document.printout.submit();
                    106: }
1.38    ! albertel  107: //-->
1.1       www       108: </script>
1.24      albertel  109:     </head>
                    110:     <body bgcolor="#ccffdd" text='#002200' link='#003333' vlink='#006666'>
                    111: 	<table border="0" align="center"><tr><th bgcolor="#004400" height="20">
1.31      www       112: 	      <table border="0" cellspacing="2" cellpadding="2"><tr valign="middle">
1.38    ! albertel  113: 		  <td bgcolor="#ccddaa" align="center">
        !           114: 		    <form name="publisher" action="/adm/publish" target="_parent" method="post">
1.24      albertel  115: 		      <input type="hidden" name="filename" value="" />
1.38    ! albertel  116: 	              <input type="button" value="MT{Publish this Resource}" onclick="getfilename();" />
        !           117: 		    </form>
        !           118: 		  </td>
        !           119: 		  <td bgcolor="#ccddaa" align="center">
        !           120: 		    <form name="dpublisher" action="/adm/pubdir" target="LONCAPAToBePublished" method="post">
1.24      albertel  121: 		      <input type="hidden" name="filename" value="" />
1.38    ! albertel  122: 		      <input type="button" value="MT{List Directory}" onclick="getdfilename();" />
        !           123: 		    </form>
        !           124: 		  </td>
        !           125: 		  <td bgcolor="#ccddaa" valign="top" align="center">
        !           126: 		    <form name="upublisher" action="/adm/upload" target="_parent"
1.24      albertel  127: 			method="post" enctype="multipart/form-data">
                    128: 		      <input type="hidden" name="filename" value="" />
                    129: 		      <input type="file" name="upfile" size="20" />
1.38    ! albertel  130: 		      <input type="button" value="MT{Upload file}"  onclick="getufilename();" />
        !           131: 		    </form>
        !           132: 		  </td>
        !           133: 		  <td rowspan="2" bgcolor="#ccddaa" align="center">
        !           134: 		    <form name="printout" target="_parent" action="/adm/printout" method="post" onsubmit="getpostdata();">
1.25      albertel  135: 		      <input type="hidden" name="postdata" value="" />
1.32      albertel  136: 		      <input type="hidden" name="curseed" value="" />
1.37      sakharuk  137: 		      <input type="hidden" name="problemtype" value="" />
1.38    ! albertel  138: 		      <input type="button" value="MT{Print}" onclick="getpostdata();" />
        !           139: 		    </form>
        !           140: 		  </td>
1.25      albertel  141: 
1.24      albertel  142: 		</tr>
                    143: 		<tr valign="middle">
1.38    ! albertel  144: 		  <td bgcolor="#ccddaa" align="center">
        !           145: 		    <form name="rpublisher" action="/adm/retrieve" target="_parent" method="post">
1.24      albertel  146: 		      <input type="hidden" name="filename" value="" />
1.38    ! albertel  147: 		      <input type="button" value="MT{Retrieve Old Version}" onclick="getrfilename();" />
        !           148: 		    </form>
        !           149: 		  </td>
        !           150: 		  <td bgcolor="#ccddaa">
        !           151: 		    <form name="del" action="/adm/cfile" target="_parent" method="post">
1.25      albertel  152: 		      <input type="hidden" name="filename" value="" />
                    153: 		      <input type="hidden" name="action" value="delete" />
1.38    ! albertel  154: 	              <input type="button" value="MT{Delete}" onclick="getdelfilename();" />
        !           155: 		    </form>
        !           156: 		  </td>
        !           157: 		  <td bgcolor="#ccddaa" align="center">
        !           158: 		    <form name="fileaction" action="/adm/cfile" target="_parent" method="post" onsubmit="getactionfilename();">
1.24      albertel  159: 		      <nobr>
                    160: 			<input type="hidden" name="filename" value="" />
                    161: 			  <select name="action">
1.35      www       162: 			    <option>MT{Select Action}</option>
                    163: 			    <option value="newfile">MT{New file}:</option>
                    164: 			    <option value="newhtmlfile">MT{New HTML file}:</option>
                    165: 			    <option value="newproblemfile">MT{New problem}:</option>
                    166:                             <option value="newpagefile">MT{New assembled page}:</option>
                    167:                             <option value="newsequencefile">MT{New assembled sequence}:</option>
                    168:                             <option value="newrightsfile">MT{New custom rights file}:</option>
                    169:                             <option value="newstyfile">MT{New style file}:</option>
                    170: 			    <option value="newdir">MT{New subdirectory}:</option>
                    171: 			    <option value="rename">MT{Rename current file to}:</option>
1.36      albertel  172: 			    <option value="move">MT{Move current file to}:</option>
1.35      www       173: 			    <option value="copy">MT{Copy current file to}:</option>
1.38    ! albertel  174: 			  </select>&nbsp;<input type="text" name="newfilename" value="MT{Type Name Here}" onfocus="if (this.value == 'MT{Type Name Here}') this.value=''" />&nbsp;<input type="button" value="MT{Go}" onclick="getactionfilename();" />
1.24      albertel  175: 		      </nobr>
1.38    ! albertel  176: 		    </form>
        !           177: 		   </td>
1.24      albertel  178: 		</tr>
                    179: 	      </table>
                    180: 	    </th>
                    181: 	  </tr>
                    182: 	</table>
                    183:     </body>
                    184:   </html>

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